瀏覽代碼

fix, in a tablet, the title is not correct when menu is shown and rotating

masensio 10 年之前
父節點
當前提交
5f47524864
共有 1 個文件被更改,包括 7 次插入2 次删除
  1. 7 2
      src/com/owncloud/android/ui/activity/FileActivity.java

+ 7 - 2
src/com/owncloud/android/ui/activity/FileActivity.java

@@ -393,13 +393,18 @@ public class FileActivity extends ActionBarActivity
     }
     }
 
 
     protected void updateActionBarTitleAndHomeButton(){
     protected void updateActionBarTitleAndHomeButton(){
-        if (mFile.getParentId() == 0) {
+        if (mFile.getParentId() == 0 ||
+                (!mFile.isFolder() && mFile.getParentId() == 1)) {
             getSupportActionBar().setTitle(getString(
             getSupportActionBar().setTitle(getString(
                     R.string.default_display_name_for_root_folder));
                     R.string.default_display_name_for_root_folder));
             mDrawerToggle.setDrawerIndicatorEnabled(true);
             mDrawerToggle.setDrawerIndicatorEnabled(true);
-        } else {
+        } else if (mFile.isFolder()) {
             getSupportActionBar().setTitle(mFile.getFileName().toString());
             getSupportActionBar().setTitle(mFile.getFileName().toString());
             mDrawerToggle.setDrawerIndicatorEnabled(false);
             mDrawerToggle.setDrawerIndicatorEnabled(false);
+        } else {
+            getSupportActionBar().setTitle(getStorageManager().getFileById(mFile.getParentId())
+                    .getFileName().toString());
+            mDrawerToggle.setDrawerIndicatorEnabled(false);
         }
         }
     }
     }
     /**
     /**