From 8b563da25d4bf1d66c29de236f35fbf87896d505 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Tue, 28 Oct 2014 13:32:05 +0200 Subject: [PATCH] Fix create/pick folder being shown when folder roots are shown (fixes #173). --- .../syncthingandroid/activities/FolderPickerActivity.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/nutomic/syncthingandroid/activities/FolderPickerActivity.java b/src/main/java/com/nutomic/syncthingandroid/activities/FolderPickerActivity.java index 8eababcf..5507349e 100644 --- a/src/main/java/com/nutomic/syncthingandroid/activities/FolderPickerActivity.java +++ b/src/main/java/com/nutomic/syncthingandroid/activities/FolderPickerActivity.java @@ -91,6 +91,9 @@ public class FolderPickerActivity extends SyncthingActivity @Override public boolean onCreateOptionsMenu(Menu menu) { + if (mListView.getAdapter() == mRootsAdapter) + return true; + // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.folder_picker, menu); return true; @@ -169,6 +172,7 @@ public class FolderPickerActivity extends SyncthingActivity public void onItemClick(AdapterView adapterView, View view, int i, long l) { ArrayAdapter adapter = (ArrayAdapter) mListView.getAdapter(); displayFolder(adapter.getItem(i)); + invalidateOptionsMenu(); } private class FileAdapter extends ArrayAdapter { @@ -240,6 +244,7 @@ public class FolderPickerActivity extends SyncthingActivity mListView.setAdapter(mRootsAdapter); mLocation = null; } + invalidateOptionsMenu(); } }