X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/1363f6686d23f0bd9f0817aa1b9e8d8b12374edc..bad83f956d15f5fbeb97bca2b9a8e6a123189c63:/src/com/owncloud/android/ui/activity/FileActivity.java diff --git a/src/com/owncloud/android/ui/activity/FileActivity.java b/src/com/owncloud/android/ui/activity/FileActivity.java index d3efb01b..382019f8 100644 --- a/src/com/owncloud/android/ui/activity/FileActivity.java +++ b/src/com/owncloud/android/ui/activity/FileActivity.java @@ -39,6 +39,7 @@ import android.support.v4.app.ActionBarDrawerToggle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; +import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBar; import android.support.v7.app.ActionBarActivity; @@ -286,6 +287,10 @@ public class FileActivity extends ActionBarActivity // Sync the toggle state after onRestoreInstanceState has occurred. if (mDrawerToggle != null) { mDrawerToggle.syncState(); + if (mDrawerLayout.isDrawerOpen(GravityCompat.START)) { + getSupportActionBar().setTitle(R.string.app_name); + mDrawerToggle.setDrawerIndicatorEnabled(true); + } } } @@ -357,13 +362,13 @@ public class FileActivity extends ActionBarActivity this, mDrawerLayout, R.drawable.ic_drawer, - R.string.drawer_open, + R.string.app_name, R.string.drawer_close) { /** Called when a drawer has settled in a completely closed state. */ public void onDrawerClosed(View view) { super.onDrawerClosed(view); - updateActionBarTitle(); + updateActionBarTitleAndHomeButton(); getSupportActionBar().setDisplayShowTitleEnabled(true); getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); invalidateOptionsMenu(); @@ -372,7 +377,7 @@ public class FileActivity extends ActionBarActivity /** Called when a drawer has settled in a completely open state. */ public void onDrawerOpened(View drawerView) { super.onDrawerOpened(drawerView); - getSupportActionBar().setTitle(R.string.drawer_open); + getSupportActionBar().setTitle(R.string.app_name); getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); mDrawerToggle.setDrawerIndicatorEnabled(true); invalidateOptionsMenu(); @@ -387,7 +392,7 @@ public class FileActivity extends ActionBarActivity mDrawerLayout.setDrawerListener(mDrawerToggle); } - protected void updateActionBarTitle(){ + protected void updateActionBarTitleAndHomeButton(){ if (mFile.getParentId() == 0) { getSupportActionBar().setTitle(getString( R.string.default_display_name_for_root_folder)); @@ -861,12 +866,14 @@ public class FileActivity extends ActionBarActivity Intent settingsIntent = new Intent(getApplicationContext(), Preferences.class); startActivity(settingsIntent); + mDrawerLayout.closeDrawers(); break; case 2: // Logs Intent loggerIntent = new Intent(getApplicationContext(), LogHistoryActivity.class); startActivity(loggerIntent); + mDrawerLayout.closeDrawers(); break; } }