diff options
| author | cretin45 <cretin45@gmail.com> | 2016-05-05 14:19:25 -0700 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-05-05 15:10:14 -0700 |
| commit | c25f3b995f410883856929972096c8e375cd5377 (patch) | |
| tree | 550a44ea0bd7aada2e398bfc3df7b133cda94845 | |
| parent | fb5b91434a10910ce29395293f8430b0eb9a10c6 (diff) | |
| download | android_packages_apps_CMFileManager-c25f3b995f410883856929972096c8e375cd5377.tar.gz android_packages_apps_CMFileManager-c25f3b995f410883856929972096c8e375cd5377.tar.bz2 android_packages_apps_CMFileManager-c25f3b995f410883856929972096c8e375cd5377.zip | |
CMFM: Fix landscape/rotation issues in file system info dialog
Issue-id: FEIJ-356
Change-Id: I918f62e42ecca8c7c51ff8edefdfcd3f78245b45
3 files changed, 321 insertions, 268 deletions
diff --git a/res/layout/filesystem_info_dialog.xml b/res/layout/filesystem_info_dialog.xml index 596a0266..9f83578b 100644 --- a/res/layout/filesystem_info_dialog.xml +++ b/res/layout/filesystem_info_dialog.xml @@ -15,355 +15,367 @@ --> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="wrap_content" - android:layout_height="wrap_content" > + android:layout_width="wrap_content" + android:layout_height="wrap_content" > <!-- Tabs --> <LinearLayout - android:id="@+id/filesystem_tabs" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="vertical" > + android:id="@+id/filesystem_tabs" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" > <LinearLayout - android:id="@+id/filesystem_info_dialog_tabhost" - android:layout_width="match_parent" - android:layout_height="@dimen/default_row_height" - android:orientation="horizontal" > + android:id="@+id/filesystem_info_dialog_tabhost" + android:layout_width="match_parent" + android:layout_height="@dimen/default_row_height" + android:orientation="horizontal" > <TextView - android:id="@+id/filesystem_info_dialog_tab_info" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_weight="1" - android:background="@drawable/material_selector" - android:clickable="true" - android:gravity="center_horizontal|center_vertical" - android:text="@string/filesystem_info_dialog_tab_info" - android:textAllCaps="true" - android:textAppearance="@style/primary_text_appearance" /> + android:id="@+id/filesystem_info_dialog_tab_info" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_weight="1" + android:background="@drawable/material_selector" + android:clickable="true" + android:gravity="center_horizontal|center_vertical" + android:text="@string/filesystem_info_dialog_tab_info" + android:textAllCaps="true" + android:textAppearance="@style/primary_text_appearance" /> <include - android:id="@+id/filesystem_info_dialog_tab_divider1" - layout="@layout/horizontal_divider" /> + android:id="@+id/filesystem_info_dialog_tab_divider1" + layout="@layout/horizontal_divider" /> <TextView - android:id="@+id/filesystem_info_dialog_tab_disk_usage" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_weight="1" - android:background="@drawable/material_selector" - android:clickable="true" - android:gravity="center_horizontal|center_vertical" - android:text="@string/filesystem_info_dialog_tab_disk_usage" - android:textAllCaps="true" - android:textAppearance="@style/primary_text_appearance" /> + android:id="@+id/filesystem_info_dialog_tab_disk_usage" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_weight="1" + android:background="@drawable/material_selector" + android:clickable="true" + android:gravity="center_horizontal|center_vertical" + android:text="@string/filesystem_info_dialog_tab_disk_usage" + android:textAllCaps="true" + android:textAppearance="@style/primary_text_appearance" /> </LinearLayout> <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" > + android:layout_width="match_parent" + android:layout_height="wrap_content" > <include - android:id="@+id/filesystem_info_dialog_tab_divider2" - layout="@layout/vertical_divider" /> + android:id="@+id/filesystem_info_dialog_tab_divider2" + layout="@layout/vertical_divider" /> </LinearLayout> </LinearLayout> <!-- Info --> <ScrollView - android:id="@+id/filesystem_tab_info" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_below="@id/filesystem_tabs" - android:paddingBottom="@dimen/extra_large_margin" - android:paddingTop="@dimen/default_margin" - android:scrollbars="vertical"> + android:id="@+id/filesystem_tab_info" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_below="@id/filesystem_tabs" + android:paddingBottom="@dimen/extra_large_margin" + android:paddingTop="@dimen/default_margin" + android:scrollbars="vertical"> <TableLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:shrinkColumns="1" > + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:shrinkColumns="1" > <!-- Status --> <TableRow - android:layout_marginStart="@dimen/extra_large_margin" - android:layout_marginEnd="@dimen/extra_large_margin" > + android:layout_marginStart="@dimen/extra_large_margin" + android:layout_marginEnd="@dimen/extra_large_margin" > <TextView - android:id="@+id/filesystem_info_status_label" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_margin="@dimen/default_margin" - android:gravity="start|center_vertical" - android:text="@string/filesystem_info_dialog_status" - android:textAppearance="@style/primary_text_appearance" /> + android:id="@+id/filesystem_info_status_label" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_margin="@dimen/default_margin" + android:gravity="start|center_vertical" + android:text="@string/filesystem_info_dialog_status" + android:textAppearance="@style/primary_text_appearance" /> <Switch - android:id="@+id/filesystem_info_status" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_gravity="start" - android:layout_margin="@dimen/default_margin" - android:textOff="@string/mount_point_readonly" - android:textOn="@string/mount_point_readwrite" /> + android:id="@+id/filesystem_info_status" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="start" + android:layout_margin="@dimen/default_margin" + android:textOff="@string/mount_point_readonly" + android:textOn="@string/mount_point_readwrite" /> </TableRow> <!-- Mount Point --> <TableRow - android:layout_marginStart="@dimen/extra_large_margin" - android:layout_marginEnd="@dimen/extra_large_margin" > + android:layout_marginStart="@dimen/extra_large_margin" + android:layout_marginEnd="@dimen/extra_large_margin" > <TextView - android:id="@+id/filesystem_info_mount_point_label" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_margin="@dimen/default_margin" - android:gravity="start|center_vertical" - android:text="@string/filesystem_info_dialog_mount_point" - android:textAppearance="@style/primary_text_appearance" /> + android:id="@+id/filesystem_info_mount_point_label" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_margin="@dimen/default_margin" + android:gravity="start|center_vertical" + android:text="@string/filesystem_info_dialog_mount_point" + android:textAppearance="@style/primary_text_appearance" /> <TextView - android:id="@+id/filesystem_info_mount_point" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_margin="@dimen/default_margin" - android:paddingEnd="@dimen/double_margin" - android:gravity="start|center_vertical" - android:singleLine="false" - android:textAppearance="@style/secondary_text_appearance" /> + android:id="@+id/filesystem_info_mount_point" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_margin="@dimen/default_margin" + android:paddingEnd="@dimen/double_margin" + android:gravity="start|center_vertical" + android:singleLine="false" + android:textAppearance="@style/secondary_text_appearance" /> </TableRow> <!-- Device --> <TableRow - android:layout_marginStart="@dimen/extra_large_margin" - android:layout_marginEnd="@dimen/extra_large_margin" > + android:layout_marginStart="@dimen/extra_large_margin" + android:layout_marginEnd="@dimen/extra_large_margin" > <TextView - android:id="@+id/filesystem_info_device_label" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_margin="@dimen/default_margin" - android:gravity="start|center_vertical" - android:text="@string/filesystem_info_dialog_device" - android:textAppearance="@style/primary_text_appearance" /> + android:id="@+id/filesystem_info_device_label" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_margin="@dimen/default_margin" + android:gravity="start|center_vertical" + android:text="@string/filesystem_info_dialog_device" + android:textAppearance="@style/primary_text_appearance" /> <TextView - android:id="@+id/filesystem_info_device" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_margin="@dimen/default_margin" - android:paddingEnd="@dimen/double_margin" - android:gravity="start|center_vertical" - android:singleLine="false" - android:textAppearance="@style/secondary_text_appearance" /> + android:id="@+id/filesystem_info_device" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_margin="@dimen/default_margin" + android:paddingEnd="@dimen/double_margin" + android:gravity="start|center_vertical" + android:singleLine="false" + android:textAppearance="@style/secondary_text_appearance" /> </TableRow> <!-- Type --> <TableRow - android:layout_marginStart="@dimen/extra_large_margin" - android:layout_marginEnd="@dimen/extra_large_margin" > + android:layout_marginStart="@dimen/extra_large_margin" + android:layout_marginEnd="@dimen/extra_large_margin" > <TextView - android:id="@+id/filesystem_info_type_label" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_margin="@dimen/default_margin" - android:gravity="start|top" - android:text="@string/filesystem_info_dialog_type" - android:textAppearance="@style/primary_text_appearance" /> + android:id="@+id/filesystem_info_type_label" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_margin="@dimen/default_margin" + android:gravity="start|top" + android:text="@string/filesystem_info_dialog_type" + android:textAppearance="@style/primary_text_appearance" /> <TextView - android:id="@+id/filesystem_info_type" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_margin="@dimen/default_margin" - android:paddingEnd="@dimen/double_margin" - android:gravity="start|center_vertical" - android:singleLine="false" - android:textAppearance="@style/secondary_text_appearance" /> + android:id="@+id/filesystem_info_type" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_margin="@dimen/default_margin" + android:paddingEnd="@dimen/double_margin" + android:gravity="start|center_vertical" + android:singleLine="false" + android:textAppearance="@style/secondary_text_appearance" /> </TableRow> <!-- Options --> <TableRow - android:layout_marginStart="@dimen/extra_large_margin" - android:layout_marginEnd="@dimen/extra_large_margin" > + android:layout_marginStart="@dimen/extra_large_margin" + android:layout_marginEnd="@dimen/extra_large_margin" > <TextView - android:id="@+id/filesystem_info_options_label" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_margin="@dimen/default_margin" - android:gravity="start|center_vertical" - android:text="@string/filesystem_info_dialog_options" - android:textAppearance="@style/primary_text_appearance" /> + android:id="@+id/filesystem_info_options_label" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_margin="@dimen/default_margin" + android:gravity="start|center_vertical" + android:text="@string/filesystem_info_dialog_options" + android:textAppearance="@style/primary_text_appearance" /> <TextView - android:id="@+id/filesystem_info_options" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_margin="@dimen/default_margin" - android:paddingEnd="@dimen/double_margin" - android:gravity="start|center_vertical" - android:singleLine="false" - android:maxLines="5" - android:textAppearance="@style/secondary_text_appearance" /> + android:id="@+id/filesystem_info_options" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_margin="@dimen/default_margin" + android:paddingEnd="@dimen/double_margin" + android:gravity="start|center_vertical" + android:singleLine="false" + android:maxLines="5" + android:textAppearance="@style/secondary_text_appearance" /> </TableRow> <!-- Dump/Pass --> <TableRow - android:layout_marginStart="@dimen/extra_large_margin" - android:layout_marginEnd="@dimen/extra_large_margin" > + android:layout_marginStart="@dimen/extra_large_margin" + android:layout_marginEnd="@dimen/extra_large_margin" > <TextView - android:id="@+id/filesystem_info_dump_pass_label" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_margin="@dimen/default_margin" - android:gravity="start|center_vertical" - android:text="@string/filesystem_info_dialog_dump_pass" - android:textAppearance="@style/primary_text_appearance" /> + android:id="@+id/filesystem_info_dump_pass_label" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_margin="@dimen/default_margin" + android:gravity="start|center_vertical" + android:text="@string/filesystem_info_dialog_dump_pass" + android:textAppearance="@style/primary_text_appearance" /> <TextView - android:id="@+id/filesystem_info_dump_pass" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_margin="@dimen/default_margin" - android:paddingEnd="@dimen/double_margin" - android:gravity="start|center_vertical" - android:singleLine="false" - android:textAppearance="@style/secondary_text_appearance" /> + android:id="@+id/filesystem_info_dump_pass" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_margin="@dimen/default_margin" + android:paddingEnd="@dimen/double_margin" + android:gravity="start|center_vertical" + android:singleLine="false" + android:textAppearance="@style/secondary_text_appearance" /> </TableRow> <!-- Info message --> <TextView - android:id="@+id/filesystem_info_msg" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_gravity="center_vertical" - android:layout_marginStart="@dimen/extra_large_margin" - android:layout_marginEnd="@dimen/extra_large_margin" - android:contentDescription="@null" - android:drawableStart="@drawable/ic_material_light_fs_warning" - android:drawablePadding="@dimen/default_margin" - android:gravity="start|center_vertical" - android:singleLine="false" - android:background="@drawable/material_selector" - android:text="@string/filesystem_info_mount_not_allowed_msg" - android:textAppearance="@style/secondary_text_appearance" - android:textSize="@dimen/note_text_size" - android:visibility="gone" /> + android:id="@+id/filesystem_info_msg" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:layout_marginStart="@dimen/extra_large_margin" + android:layout_marginEnd="@dimen/extra_large_margin" + android:contentDescription="@null" + android:drawableStart="@drawable/ic_material_light_fs_warning" + android:drawablePadding="@dimen/default_margin" + android:gravity="start|center_vertical" + android:singleLine="false" + android:background="@drawable/material_selector" + android:text="@string/filesystem_info_mount_not_allowed_msg" + android:textAppearance="@style/secondary_text_appearance" + android:textSize="@dimen/note_text_size" + android:visibility="gone" /> </TableLayout> </ScrollView> <!-- Disk Usage --> - <LinearLayout - android:id="@+id/filesystem_tab_diskusage" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_below="@id/filesystem_tabs" - android:visibility="gone" > - - <com.cyanogenmod.filemanager.ui.widgets.DiskUsageGraph - android:id="@+id/filesystem_disk_usage_graph" - android:layout_width="0dip" - android:layout_height="wrap_content" - android:layout_weight=".30" - android:layout_margin="@dimen/extra_large_margin" /> - - <TableLayout - android:layout_width="0dip" - android:layout_height="wrap_content" - android:layout_weight=".70" - android:layout_gravity="start|center_vertical" - android:paddingBottom="@dimen/extra_large_margin" - android:paddingTop="@dimen/default_margin" - android:shrinkColumns="1" > - - <!-- Total --> - <TableRow - android:layout_marginStart="@dimen/extra_large_margin" - android:layout_marginEnd="@dimen/extra_large_margin" > - - <TextView - android:id="@+id/filesystem_info_total_disk_usage_label" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_margin="@dimen/default_margin" - android:gravity="start|center_vertical" - android:text="@string/filesystem_info_dialog_total_disk_usage" - android:textAppearance="@style/primary_text_appearance" /> - - <TextView - android:id="@+id/filesystem_info_total_disk_usage" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_margin="@dimen/default_margin" - android:gravity="start|center_vertical" - android:textAppearance="@style/secondary_text_appearance" /> - </TableRow> - - <!-- Used --> - <TableRow - android:layout_marginStart="@dimen/extra_large_margin" - android:layout_marginEnd="@dimen/extra_large_margin" > - - <TextView - android:id="@+id/filesystem_info_used_disk_usage_label" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_margin="@dimen/default_margin" - android:gravity="start|center_vertical" - android:text="@string/filesystem_info_dialog_used_disk_usage" - android:textAppearance="@style/primary_text_appearance" /> - - <TextView - android:id="@+id/filesystem_info_used_disk_usage" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_margin="@dimen/default_margin" - android:gravity="start|center_vertical" - android:textAppearance="@style/secondary_text_appearance" /> - </TableRow> - - <!-- Free --> - <TableRow - android:layout_marginStart="@dimen/extra_large_margin" - android:layout_marginEnd="@dimen/extra_large_margin" > - - <TextView - android:id="@+id/filesystem_info_free_disk_usage_label" + <ScrollView + android:id="@+id/filesystem_tab_diskusage" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_margin="@dimen/default_margin" - android:gravity="start|center_vertical" - android:text="@string/filesystem_info_dialog_free_disk_usage" - android:textAppearance="@style/primary_text_appearance" /> + android:layout_below="@id/filesystem_tabs" + android:scrollbars="vertical" + android:visibility="gone"> - <TextView - android:id="@+id/filesystem_info_free_disk_usage" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_margin="@dimen/default_margin" - android:gravity="start|center_vertical" - android:textAppearance="@style/secondary_text_appearance" /> - </TableRow> - </TableLayout> - </LinearLayout> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <com.cyanogenmod.filemanager.ui.widgets.DiskUsageGraph + android:id="@+id/filesystem_disk_usage_graph" + android:layout_width="0dip" + android:layout_height="wrap_content" + android:layout_weight=".30" + android:layout_margin="@dimen/extra_large_margin" /> + + <TableLayout + android:layout_width="0dip" + android:layout_height="wrap_content" + android:layout_weight=".70" + android:layout_gravity="start|center_vertical" + android:paddingBottom="@dimen/extra_large_margin" + android:paddingTop="@dimen/default_margin" + android:shrinkColumns="1" > + + <!-- Total --> + <TableRow + android:layout_marginStart="@dimen/extra_large_margin" + android:layout_marginEnd="@dimen/extra_large_margin" > + + <TextView + android:id="@+id/filesystem_info_total_disk_usage_label" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_margin="@dimen/default_margin" + android:gravity="start|center_vertical" + android:text="@string/filesystem_info_dialog_total_disk_usage" + android:textAppearance="@style/primary_text_appearance" /> + + <TextView + android:id="@+id/filesystem_info_total_disk_usage" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_margin="@dimen/default_margin" + android:gravity="start|center_vertical" + android:textAppearance="@style/secondary_text_appearance" /> + </TableRow> + + <!-- Used --> + <TableRow + android:layout_marginStart="@dimen/extra_large_margin" + android:layout_marginEnd="@dimen/extra_large_margin" > + + <TextView + android:id="@+id/filesystem_info_used_disk_usage_label" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_margin="@dimen/default_margin" + android:gravity="start|center_vertical" + android:text="@string/filesystem_info_dialog_used_disk_usage" + android:textAppearance="@style/primary_text_appearance" /> + + <TextView + android:id="@+id/filesystem_info_used_disk_usage" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_margin="@dimen/default_margin" + android:gravity="start|center_vertical" + android:textAppearance="@style/secondary_text_appearance" /> + </TableRow> + + <!-- Free --> + <TableRow + android:layout_marginStart="@dimen/extra_large_margin" + android:layout_marginEnd="@dimen/extra_large_margin" > + + <TextView + android:id="@+id/filesystem_info_free_disk_usage_label" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_margin="@dimen/default_margin" + android:gravity="start|center_vertical" + android:text="@string/filesystem_info_dialog_free_disk_usage" + android:textAppearance="@style/primary_text_appearance" /> + + <TextView + android:id="@+id/filesystem_info_free_disk_usage" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_margin="@dimen/default_margin" + android:gravity="start|center_vertical" + android:textAppearance="@style/secondary_text_appearance" /> + </TableRow> + </TableLayout> + </LinearLayout> + <GridLayout + android:id="@+id/ll_legend" + android:gravity="center" + android:layout_centerHorizontal="true" + android:visibility="invisible" + android:layout_below="@id/filesystem_tab_diskusage" + android:orientation="horizontal" + android:columnCount="4" + android:columnOrderPreserved="true" + android:rowOrderPreserved="true" + android:useDefaultMargins="true" + android:padding="@dimen/legend_padding" + android:layout_width="wrap_content" + android:layout_height="wrap_content"/> + </LinearLayout> - <GridLayout - android:id="@+id/ll_legend" - android:gravity="center" - android:layout_centerHorizontal="true" - android:visibility="invisible" - android:layout_below="@id/filesystem_tab_diskusage" - android:orientation="horizontal" - android:columnCount="4" - android:columnOrderPreserved="true" - android:rowOrderPreserved="true" - android:useDefaultMargins="true" - android:padding="@dimen/legend_padding" - android:layout_width="wrap_content" - android:layout_height="wrap_content"/> + </ScrollView> </RelativeLayout> diff --git a/src/com/cyanogenmod/filemanager/activities/NavigationActivity.java b/src/com/cyanogenmod/filemanager/activities/NavigationActivity.java index 2b051c4e..2e474786 100755 --- a/src/com/cyanogenmod/filemanager/activities/NavigationActivity.java +++ b/src/com/cyanogenmod/filemanager/activities/NavigationActivity.java @@ -205,6 +205,7 @@ public class NavigationActivity extends Activity private SearchView mSearchView; private NavigationCustomTitleView mCustomTitleView; private InputMethodManager mImm; + private FilesystemInfoDialog.OnConfigChangeListener mOnConfigChangeListener; private final BroadcastReceiver mNotificationReceiver = new BroadcastReceiver() { @Override @@ -798,6 +799,9 @@ public class NavigationActivity extends Activity mDrawerToggle.onConfigurationChanged(newConfig); } } + if (mActiveDialog != null && mOnConfigChangeListener != null) { + mOnConfigChangeListener.onConfigurationChanged(newConfig); + } } /** @@ -2285,6 +2289,13 @@ public class NavigationActivity extends Activity } } }); + mOnConfigChangeListener = dialog.getOnConfigChangeListener(); + dialog.setOnDismissListener(new DialogInterface.OnDismissListener() { + @Override + public void onDismiss(DialogInterface dialog) { + mOnConfigChangeListener = null; + } + }); dialog.show(); } diff --git a/src/com/cyanogenmod/filemanager/ui/dialogs/FilesystemInfoDialog.java b/src/com/cyanogenmod/filemanager/ui/dialogs/FilesystemInfoDialog.java index 318f69e7..235ae45c 100644 --- a/src/com/cyanogenmod/filemanager/ui/dialogs/FilesystemInfoDialog.java +++ b/src/com/cyanogenmod/filemanager/ui/dialogs/FilesystemInfoDialog.java @@ -19,6 +19,7 @@ package com.cyanogenmod.filemanager.ui.dialogs; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; +import android.content.res.Configuration; import android.database.Cursor; import android.util.Log; import android.view.LayoutInflater; @@ -157,6 +158,11 @@ public class FilesystemInfoDialog implements OnClickListener, OnCheckedChangeLis } + public interface OnConfigChangeListener { + void onConfigurationChanged(Configuration newConfig); + } + + private static final String TAG = "FilesystemInfoDialog"; //$NON-NLS-1$ @@ -187,6 +193,22 @@ public class FilesystemInfoDialog implements OnClickListener, OnCheckedChangeLis private final boolean mIsAdvancedMode; private boolean mIsInUsageTab = false; + private final OnConfigChangeListener mOnConfigChangeListener = new OnConfigChangeListener() { + @Override + public void onConfigurationChanged(Configuration newConfig) { + if (mDiskUsageGraph != null) { + populateLegend(); + mDiskUsageGraph.post(new Runnable() { + @Override + public void run() { + //Animate disk usage graph + FilesystemInfoDialog.this.mDiskUsageGraph.drawDiskUsage(mDiskUsage); + } + }); + } + } + }; + /** * Constructor of <code>FilesystemInfoDialog</code>. * @@ -248,6 +270,14 @@ public class FilesystemInfoDialog implements OnClickListener, OnCheckedChangeLis this.mOnMountListener = onMountListener; } + public OnConfigChangeListener getOnConfigChangeListener() { + return mOnConfigChangeListener; + } + + public void setOnDismissListener(final DialogInterface.OnDismissListener listener) { + mDialog.setOnDismissListener(listener); + } + /** * Method that fill the dialog with the data of the mount point. * |
