Skip to content

Commit

Permalink
Menu Update More Native feeling.
Browse files Browse the repository at this point in the history
  • Loading branch information
w9jds committed Jan 3, 2014
1 parent 8dd49ca commit a18fcdc
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 70 deletions.
86 changes: 52 additions & 34 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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<Pair<String,String>> parameters = new ArrayList<Pair<String, String>>();
parameters.add(new Pair<String, String>("containerName", containerName));
parameters.add(new Pair<String, String>("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<Pair<String,String>> parameters = new ArrayList<Pair<String, String>>();
// parameters.add(new Pair<String, String>("containerName", containerName));
// parameters.add(new Pair<String, String>("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
Expand Down
28 changes: 22 additions & 6 deletions GlassShare/src/main/java/com/w9jds/glassshare/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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:
//
Expand Down Expand Up @@ -415,7 +432,6 @@ public void run()
}
}


private void saveFileToDrive(String sPath)
{
final String msPath = sPath;
Expand Down

0 comments on commit a18fcdc

Please sign in to comment.