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

@ -156,7 +156,7 @@ public class FileDisplayActivity extends HookActivity
SendShareDialog.SendShareDialogDownloader {
public static final String RESTART = "RESTART";
private SyncBroadcastReceiver mSyncBroadcastReceiver;
private UploadFinishReceiver mUploadFinishReceiver;
private DownloadFinishReceiver mDownloadFinishReceiver;
@ -368,7 +368,7 @@ public class FileDisplayActivity extends HookActivity
if (MainApp.getVersionCode() > lastSeenVersion) {
OwnCloudVersion serverVersion = AccountUtils.getServerVersionForAccount(account, this);
if (serverVersion == null) {
OCCapability capability = getCapabilities();
serverVersion = new OwnCloudVersion(capability.getVersionMayor() + VERSION_DOT +
@ -736,7 +736,7 @@ public class FileDisplayActivity extends HookActivity
if (success) {
// update the file from database, for the local storage path
mWaitingToPreview = getStorageManager().getFileById(mWaitingToPreview.getFileId());
if (PreviewMediaFragment.canBePreviewed(mWaitingToPreview)) {
boolean streaming = AccountUtils.getServerVersionForAccount(getAccount(), this)
.isMediaStreamingSupported();
@ -1261,7 +1261,7 @@ public class FileDisplayActivity extends HookActivity
} else {
setDrawerMenuItemChecked(menuItemId);
}
Log_OC.v(TAG, "onResume() end");
}
@ -2301,7 +2301,7 @@ public class FileDisplayActivity extends HookActivity
} else {
Log_OC.e(TAG, "Trying to send a NULL OCFile");
}
mWaitingToSend = null;
}
@ -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();
}