Skip to content

Commit

Permalink
Merge pull request #2785 from nextcloud/backport-2773
Browse files Browse the repository at this point in the history
Backport of #2773: correct menu highlighting
  • Loading branch information
AndyScherzinger authored Jul 4, 2018
2 parents 6aafcb5 + c2307b1 commit be546d0
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ public boolean onOptionsItemSelected(MenuItem item) {
protected void onResume() {
super.onResume();

setDrawerMenuItemChecked(R.id.nav_activity);

setupContent();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,8 @@ public void onLoadFailed(Exception e, Drawable errorDrawable) {

DisplayUtils.downloadIcon(this, link.iconUrl, target, R.drawable.ic_link_grey, size, size);
}

setDrawerMenuItemChecked(mCheckedMenuItem);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ protected void onCreate(Bundle savedInstanceState) {
setupDrawer(R.id.nav_all_files);
}


mDualPane = getResources().getBoolean(R.bool.large_land_layout);
mLeftFragmentContainer = findViewById(R.id.left_fragment_container);
mRightFragmentContainer = findViewById(R.id.right_fragment_container);
Expand Down Expand Up @@ -1166,8 +1165,8 @@ protected void onResume() {
}

revertBottomNavigationBarToAllFiles();
// refresh list of files

// refresh list of files
if (searchView != null && !TextUtils.isEmpty(searchQuery)) {
searchView.setQuery(searchQuery, true);
} else if (getListOfFilesFragment() != null && !getListOfFilesFragment().getIsSearchFragment()
Expand Down Expand Up @@ -1203,8 +1202,14 @@ protected void onResume() {
mDownloadFinishReceiver = new DownloadFinishReceiver();
registerReceiver(mDownloadFinishReceiver, downloadIntentFilter);

// setup drawer
if (MainApp.isOnlyOnDevice()) {
setDrawerMenuItemChecked(R.id.nav_on_device);
} else {
setDrawerMenuItemChecked(R.id.nav_all_files);
}

Log_OC.v(TAG, "onResume() end");

}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,4 +356,11 @@ private void setEmptyContent(String headline, String message) {
emptyContentIcon.setVisibility(View.VISIBLE);
}
}

@Override
protected void onResume() {
super.onResume();

setDrawerMenuItemChecked(R.id.nav_notifications);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,11 @@ public void showFiles(boolean onDeviceOnly) {
fileDisplayActivity.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(fileDisplayActivity);
}

@Override
protected void onResume() {
super.onResume();

setDrawerMenuItemChecked(R.id.nav_participate);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -665,4 +665,11 @@ public void onAddCustomFolderClick(View view) {
FileUploader.LOCAL_BEHAVIOUR_FORGET, false, null, MediaFolderType.CUSTOM);
onSyncFolderSettingsClick(0, emptyCustomFolder);
}

@Override
protected void onResume() {
super.onResume();

setDrawerMenuItemChecked(R.id.nav_synced_folders);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ protected void onResume() {
Log_OC.v(TAG, "onResume() start");
super.onResume();

setDrawerMenuItemChecked(R.id.nav_uploads);

// Listen for upload messages
mUploadMessagesReceiver = new UploadMessagesReceiver();
IntentFilter uploadIntentFilter = new IntentFilter();
Expand Down

0 comments on commit be546d0

Please sign in to comment.