From a18fcdccf2bcf1e9550e53c1cf6cd5c48e5f8b49 Mon Sep 17 00:00:00 2001 From: Jeremy Shore Date: Thu, 2 Jan 2014 22:26:48 -0600 Subject: [PATCH] Menu Update More Native feeling. --- .idea/workspace.xml | 86 +++++++++++-------- .../glassshare/Classes/StorageService.java | 60 ++++++------- .../com/w9jds/glassshare/MainActivity.java | 28 ++++-- 3 files changed, 104 insertions(+), 70 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index ca40f54..644c5e8 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -96,8 +96,17 @@ - - + + + + + + + + + + + @@ -105,7 +114,7 @@ - + @@ -543,10 +552,10 @@ @@ -845,19 +854,6 @@ - + - + - + - + - + - + @@ -1218,26 +1227,26 @@ - + - + - + - + - + - + @@ -1350,14 +1359,23 @@ - - + + + + + + + + + + + - + diff --git a/GlassShare/src/main/java/com/w9jds/glassshare/Classes/StorageService.java b/GlassShare/src/main/java/com/w9jds/glassshare/Classes/StorageService.java index 900468a..41287ae 100644 --- a/GlassShare/src/main/java/com/w9jds/glassshare/Classes/StorageService.java +++ b/GlassShare/src/main/java/com/w9jds/glassshare/Classes/StorageService.java @@ -132,36 +132,36 @@ public void onCompleted(JsonObject jsonObject, Exception exception, ServiceFilte * NOTE THIS IS DONE AS A SEPARATE METHOD FROM getSasForNewBlob BECAUSE IT * BROADCASTS A DIFFERENT ACTION */ - public void getBlobSas(String containerName, String blobName) - { - //Create the json Object we'll send over and fill it with the required - //id property - otherwise we'll get kicked back - JsonObject blob = new JsonObject(); - blob.addProperty("id", 0); - //Create parameters to pass in the blob details. We do this with params - //because it would be stripped out if we put it on the blob object - List> parameters = new ArrayList>(); - parameters.add(new Pair("containerName", containerName)); - parameters.add(new Pair("blobName", blobName)); - mTableBlobs.insert(blob, parameters, new TableJsonOperationCallback() - { - @Override - public void onCompleted(JsonObject jsonObject, Exception exception, ServiceFilterResponse response) - { - if (exception != null) - { - Log.e(TAG, exception.getCause().getMessage()); - return; - } - //Set the loaded blob - mLoadedBlob = jsonObject; - //Broadcast that the blob is loaded - Intent broadcast = new Intent(); - broadcast.setAction("blob.loaded"); - mContext.sendBroadcast(broadcast); - } - }); - } +// public void getBlobSas(String containerName, String blobName) +// { +// //Create the json Object we'll send over and fill it with the required +// //id property - otherwise we'll get kicked back +// JsonObject blob = new JsonObject(); +// blob.addProperty("id", 0); +// //Create parameters to pass in the blob details. We do this with params +// //because it would be stripped out if we put it on the blob object +// List> parameters = new ArrayList>(); +// parameters.add(new Pair("containerName", containerName)); +// parameters.add(new Pair("blobName", blobName)); +// mTableBlobs.insert(blob, parameters, new TableJsonOperationCallback() +// { +// @Override +// public void onCompleted(JsonObject jsonObject, Exception exception, ServiceFilterResponse response) +// { +// if (exception != null) +// { +// Log.e(TAG, exception.getCause().getMessage()); +// return; +// } +// //Set the loaded blob +// mLoadedBlob = jsonObject; +// //Broadcast that the blob is loaded +// Intent broadcast = new Intent(); +// broadcast.setAction("blob.loaded"); +// mContext.sendBroadcast(broadcast); +// } +// }); +// } /*** * Gets a SAS URL for a new blob so we can upload it to the server diff --git a/GlassShare/src/main/java/com/w9jds/glassshare/MainActivity.java b/GlassShare/src/main/java/com/w9jds/glassshare/MainActivity.java index 31e0f00..e09895f 100644 --- a/GlassShare/src/main/java/com/w9jds/glassshare/MainActivity.java +++ b/GlassShare/src/main/java/com/w9jds/glassshare/MainActivity.java @@ -227,14 +227,16 @@ public boolean onOptionsItemSelected(android.view.MenuItem iItem) setContentView(R.layout.menu_layout); ((ImageView)findViewById(R.id.icon)).setImageResource(R.drawable.ic_delete_50); ((TextView)findViewById(R.id.label)).setText("Deleting"); - ProgressBar pbProgress = (ProgressBar)findViewById(R.id.progress); + ProgressBar pbProgress = (ProgressBar)findViewById(R.id.progress); pbProgress.setIndeterminate(false); - for (int i = 0; i <= 100; i++) - { - pbProgress.setProgress(i); - } +// for (int i = 0; i <= 100; i++) +// { +// +// pbProgress.setProgress(i); +// +// } //pull the file from the path of the selected item java.io.File fPic = new java.io.File(mlsPaths.get(miPosition)); @@ -248,7 +250,22 @@ public boolean onOptionsItemSelected(android.view.MenuItem iItem) mcvAdapter.notifyDataSetChanged(); //handled + + setContentView(R.layout.menu_layout); + ((ImageView)findViewById(R.id.icon)).setImageResource(R.drawable.ic_done_50); + ((TextView)findViewById(R.id.label)).setText("Deleted"); + findViewById(R.id.progress).setVisibility(View.GONE); + maManager.playSoundEffect(Sounds.SUCCESS); + + new Handler().postDelayed(new Runnable() + { + public void run() + { + CreatePictureView(); + } + }, 1000); + return true; // case R.id.upload_menu_item: // @@ -415,7 +432,6 @@ public void run() } } - private void saveFileToDrive(String sPath) { final String msPath = sPath;