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

Commit 517577ea authored by Daichi Hirono's avatar Daichi Hirono
Browse files

DocumentsUI: Stop to override fixed size of dialog in CreateDirectoryDialog.

Previously CreateDirectoryDialog overrides fixed size defined in the application
theme. As a result, the dialog is shown as vertically long.

The CL specifies explicitly specifies the default theme for dialog when creating
the dialog to stop override the application theme.

BUG=20239384
Change-Id: I7227bd91705c32f5196b666bbe94ff32b5cb4af8
parent c1d54873
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -18,11 +18,9 @@
    <bool name="show_as_dialog">true</bool>

    <item type="dimen" name="dialog_width">85%</item>
    <item type="dimen" name="dialog_height">90%</item>

    <dimen name="grid_padding_horiz">24dp</dimen>
    <dimen name="grid_padding_vert">16dp</dimen>

    <dimen name="grid_item_padding">8dp</dimen>

</resources>
+6 −1
Original line number Diff line number Diff line
@@ -16,6 +16,11 @@

<resources xmlns:android="http://schemas.android.com/apk/res/android">

    <style name="DialogWhenReallyLarge" parent="@*android:style/Theme.Material.DayNight.Dialog.FixedSize" />
    <style name="DialogWhenReallyLarge" parent="@*android:style/Theme.Material.DayNight.Dialog">
        <!-- We do not specify width of window here because the max size of
             floating window specified by windowFixedWidthis is limited. -->
        <item name="*android:windowFixedHeightMajor">80%</item>
        <item name="*android:windowFixedHeightMinor">90%</item>
    </style>

</resources>
+0 −7
Original line number Diff line number Diff line
@@ -33,13 +33,6 @@
        <item name="android:windowActionModeOverlay">true</item>
        <item name="android:windowNoTitle">true</item>

        <item name="*android:windowFixedWidthMajor">@null</item>
        <item name="*android:windowFixedWidthMinor">@null</item>
        <item name="*android:windowMinWidthMajor">@null</item>
        <item name="*android:windowMinWidthMinor">@null</item>
        <item name="*android:windowFixedHeightMajor">80%</item>
        <item name="*android:windowFixedHeightMinor">90%</item>

        <item name="android:windowSoftInputMode">stateUnspecified|adjustUnspecified</item>
    </style>

+5 −1
Original line number Diff line number Diff line
@@ -56,7 +56,11 @@ public class CreateDirectoryFragment extends DialogFragment {
        final Context context = getActivity();
        final ContentResolver resolver = context.getContentResolver();

        final AlertDialog.Builder builder = new AlertDialog.Builder(context);
        // We need to specify android.R.style.Theme_DeviceDefault_Dialog explicitly,
        // because the application theme 'DialogWhenReallyLarge' has
        // fixed window size properties for large screen devices.
        final AlertDialog.Builder builder = new AlertDialog.Builder(
                context, AlertDialog.THEME_DEVICE_DEFAULT_LIGHT);
        final LayoutInflater dialogInflater = LayoutInflater.from(builder.getContext());

        final View view = dialogInflater.inflate(R.layout.dialog_create_dir, null, false);
+0 −9
Original line number Diff line number Diff line
@@ -80,15 +80,6 @@ public class StandaloneActivity extends BaseActivity {

        final Context context = this;

        // Strongly define our horizontal dimension; we leave vertical as
        final WindowManager.LayoutParams a = getWindow().getAttributes();

        final Point size = new Point();
        getWindowManager().getDefaultDisplay().getSize(size);
        // a.width = (int) res.getFraction(R.dimen.dialog_width, size.x, size.x);

        getWindow().setAttributes(a);

        mDirectoryContainer = (DirectoryContainerView) findViewById(R.id.container_directory);

        mState = (icicle != null)