set action bar title to show "On device"

This commit is contained in:
Joe Apicella 2017-10-24 19:51:07 -07:00 committed by tobiasKaminsky
parent 36bed52eae
commit 6e98e25184
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7

View file

@ -2492,9 +2492,23 @@ public class FileDisplayActivity extends HookActivity
browseToRoot();
}
public void setActionBarTitle(@StringRes final int title) {
runOnUiThread(new Runnable() {
@Override
public void run() {
if (getSupportActionBar() != null) {
ThemeUtils.setColoredTitle(getSupportActionBar(), title, getBaseContext());
}
}
});
}
@Override
public void showFiles(boolean onDeviceOnly) {
super.showFiles(onDeviceOnly);
if (onDeviceOnly) {
setActionBarTitle(R.string.drawer_item_on_device);
}
getListOfFilesFragment().refreshDirectory();
}