mirror of
https://github.com/nextcloud/android.git
synced 2024-11-23 13:45:35 +03:00
Navigation drawer updated when account is removed in settings, opening this from uploads view
This commit is contained in:
parent
9b85e57c8c
commit
f1bd697d7f
3 changed files with 16 additions and 3 deletions
|
@ -455,7 +455,7 @@ public class FileActivity extends AppCompatActivity
|
|||
* @param navigationDrawerLayout the drawer layout to be used
|
||||
* @param account the account to be set in the drawer
|
||||
*/
|
||||
protected void setUsernameInDrawer(RelativeLayout navigationDrawerLayout, Account account) {
|
||||
protected void setUsernameInDrawer(View navigationDrawerLayout, Account account) {
|
||||
if (navigationDrawerLayout != null && account != null) {
|
||||
TextView username = (TextView) navigationDrawerLayout.findViewById(R.id.drawer_username);
|
||||
int lastAtPos = account.name.lastIndexOf("@");
|
||||
|
|
|
@ -56,7 +56,6 @@ import android.view.MenuInflater;
|
|||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.owncloud.android.MainApp;
|
||||
|
@ -310,7 +309,7 @@ public class FileDisplayActivity extends HookActivity implements
|
|||
setFile(file);
|
||||
|
||||
if (mAccountWasSet) {
|
||||
setUsernameInDrawer((RelativeLayout) findViewById(R.id.left_drawer), getAccount());
|
||||
setUsernameInDrawer(findViewById(R.id.left_drawer), getAccount());
|
||||
}
|
||||
|
||||
if (!stateWasRecovered) {
|
||||
|
|
|
@ -344,4 +344,18 @@ public class UploadListActivity extends FileActivity implements UploadListFragme
|
|||
protected String getDefaultTitle() {
|
||||
return getString(R.string.uploads_view_title);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called when the ownCloud {@link Account} associated to the Activity was just updated.
|
||||
*/
|
||||
@Override
|
||||
protected void onAccountSet(boolean stateWasRecovered) {
|
||||
super.onAccountSet(stateWasRecovered);
|
||||
updateActionBarTitleAndHomeButton(null);
|
||||
if (mAccountWasSet) {
|
||||
setUsernameInDrawer(findViewById(R.id.left_drawer), getAccount());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue