Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 713762ef authored by cretin45's avatar cretin45 Committed by Ed Carrigan
Browse files

CMFM: Fix landscape/rotation issues in file system info dialog

Issue-id: FEIJ-356

Change-Id: I918f62e42ecca8c7c51ff8edefdfcd3f78245b45
(cherry picked from commit c25f3b99)
parent 29ab48ea
Loading
Loading
Loading
Loading
+280 −268
Original line number Diff line number Diff line
@@ -257,13 +257,23 @@
  </ScrollView>

  <!-- Disk Usage -->
  <LinearLayout
  <ScrollView
          android:id="@+id/filesystem_tab_diskusage"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_below="@id/filesystem_tabs"
          android:scrollbars="vertical"
          android:visibility="gone">

    <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"
@@ -350,7 +360,6 @@
          </TableRow>
        </TableLayout>
      </LinearLayout>

      <GridLayout
              android:id="@+id/ll_legend"
              android:gravity="center"
@@ -365,5 +374,8 @@
              android:padding="@dimen/legend_padding"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"/>
    </LinearLayout>

  </ScrollView>

</RelativeLayout>
+11 −0
Original line number Diff line number Diff line
@@ -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();
    }

+30 −0
Original line number Diff line number Diff line
@@ -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.
     *