diff options
-rw-r--r-- | packages/DocumentsUI/AndroidManifest.xml | 4 | ||||
-rw-r--r-- | packages/DocumentsUI/res/values-sw720dp/dimens.xml | 4 | ||||
-rw-r--r-- | packages/DocumentsUI/res/values-sw720dp/layouts.xml | 19 | ||||
-rw-r--r-- | packages/DocumentsUI/res/values-sw720dp/styles.xml | 26 | ||||
-rw-r--r-- | packages/DocumentsUI/res/values/attrs.xml | 2 | ||||
-rw-r--r-- | packages/DocumentsUI/res/values/dimens.xml | 1 | ||||
-rw-r--r-- | packages/DocumentsUI/res/values/styles.xml | 23 | ||||
-rw-r--r-- | packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java | 47 |
8 files changed, 14 insertions, 112 deletions
diff --git a/packages/DocumentsUI/AndroidManifest.xml b/packages/DocumentsUI/AndroidManifest.xml index 8cc79a4c5584..5e634a4df3d3 100644 --- a/packages/DocumentsUI/AndroidManifest.xml +++ b/packages/DocumentsUI/AndroidManifest.xml @@ -40,7 +40,7 @@ <activity android:name=".DownloadsActivity" - android:theme="@style/DocumentsFullScreenTheme" + android:theme="@style/DocumentsTheme" android:label="@string/downloads_label" android:icon="@drawable/ic_doc_text"> <intent-filter> @@ -64,7 +64,7 @@ <activity android:name=".FilesActivity" - android:theme="@style/DocumentsFullScreenTheme" + android:theme="@style/DocumentsTheme" android:icon="@drawable/ic_files_app" android:label="@string/files_label" android:documentLaunchMode="intoExisting"> diff --git a/packages/DocumentsUI/res/values-sw720dp/dimens.xml b/packages/DocumentsUI/res/values-sw720dp/dimens.xml index f393d88a82cd..83ceb556499f 100644 --- a/packages/DocumentsUI/res/values-sw720dp/dimens.xml +++ b/packages/DocumentsUI/res/values-sw720dp/dimens.xml @@ -15,10 +15,6 @@ --> <resources> - <bool name="show_as_dialog">true</bool> - - <item type="dimen" name="dialog_width">85%</item> - <dimen name="grid_padding_horiz">16dp</dimen> <dimen name="grid_padding_vert">16dp</dimen> diff --git a/packages/DocumentsUI/res/values-sw720dp/layouts.xml b/packages/DocumentsUI/res/values-sw720dp/layouts.xml deleted file mode 100644 index 7d28f9cbc2ac..000000000000 --- a/packages/DocumentsUI/res/values-sw720dp/layouts.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2015 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> - -<resources> - <item name="docs_activity" type="layout">@layout/fixed_layout</item> -</resources> diff --git a/packages/DocumentsUI/res/values-sw720dp/styles.xml b/packages/DocumentsUI/res/values-sw720dp/styles.xml deleted file mode 100644 index a8dcbb0bbd8a..000000000000 --- a/packages/DocumentsUI/res/values-sw720dp/styles.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2014 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> - -<resources xmlns:android="http://schemas.android.com/apk/res/android"> - - <style name="DocumentsBaseTheme" parent="@style/Theme.AppCompat.Light.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> diff --git a/packages/DocumentsUI/res/values/attrs.xml b/packages/DocumentsUI/res/values/attrs.xml index 0afc3a2e4d8b..9e130011496b 100644 --- a/packages/DocumentsUI/res/values/attrs.xml +++ b/packages/DocumentsUI/res/values/attrs.xml @@ -14,7 +14,7 @@ limitations under the License. --> <resources> - <declare-styleable name="DocumentsBaseTheme"> + <declare-styleable name="DocumentsTheme"> <attr name="colorActionMode" format="color"/> </declare-styleable> </resources> diff --git a/packages/DocumentsUI/res/values/dimens.xml b/packages/DocumentsUI/res/values/dimens.xml index f94a00ed74d0..060871d526d0 100644 --- a/packages/DocumentsUI/res/values/dimens.xml +++ b/packages/DocumentsUI/res/values/dimens.xml @@ -35,7 +35,6 @@ <dimen name="list_divider_inset">72dp</dimen> <bool name="list_divider_inset_left">true</bool> - <bool name="show_as_dialog">false</bool> <bool name="always_show_summary">false</bool> <dimen name="dir_elevation">8dp</dimen> diff --git a/packages/DocumentsUI/res/values/styles.xml b/packages/DocumentsUI/res/values/styles.xml index 6712e2dd4537..d14631dbbc1a 100644 --- a/packages/DocumentsUI/res/values/styles.xml +++ b/packages/DocumentsUI/res/values/styles.xml @@ -16,31 +16,10 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android"> - <style name="DocumentsBaseTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar" /> <style name="ActionBarTheme" parent="@*android:style/ThemeOverlay.Material.Dark.ActionBar" /> <style name="ActionBarPopupTheme" parent="@*android:style/ThemeOverlay.Material.Light" /> - <style name="DocumentsTheme" parent="@style/DocumentsBaseTheme"> - <item name="actionBarWidgetTheme">@null</item> - <item name="actionBarTheme">@style/ActionBarTheme</item> - <item name="actionBarPopupTheme">@style/ActionBarPopupTheme</item> - - <item name="android:windowBackground">@color/window_background</item> - <item name="android:colorPrimaryDark">@color/primary_dark</item> - <item name="android:colorPrimary">@color/primary</item> - <item name="android:colorAccent">@color/accent</item> - <item name="colorActionMode">@color/action_mode</item> - - <item name="android:listDivider">@*android:drawable/list_divider_material</item> - - <item name="android:windowActionBar">false</item> - <item name="android:windowActionModeOverlay">true</item> - <item name="android:windowNoTitle">true</item> - - <item name="android:windowSoftInputMode">stateUnspecified|adjustUnspecified</item> - </style> - - <style name="DocumentsFullScreenTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar"> + <style name="DocumentsTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar"> <item name="actionBarWidgetTheme">@null</item> <item name="actionBarTheme">@style/ActionBarTheme</item> <item name="actionBarPopupTheme">@style/ActionBarPopupTheme</item> diff --git a/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java b/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java index 313d303e785d..8ca2cfb93bac 100644 --- a/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java +++ b/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java @@ -34,7 +34,6 @@ import android.content.ContentValues; import android.content.Intent; import android.content.pm.ResolveInfo; import android.content.res.Resources; -import android.graphics.Point; import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; @@ -45,7 +44,6 @@ import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.View; -import android.view.WindowManager; import android.widget.BaseAdapter; import android.widget.Spinner; import android.widget.Toolbar; @@ -64,8 +62,6 @@ public class DocumentsActivity extends BaseActivity { private static final int CODE_FORWARD = 42; private static final String TAG = "DocumentsActivity"; - private boolean mShowAsDialog; - private Toolbar mToolbar; private Spinner mToolbarStack; @@ -83,29 +79,8 @@ public class DocumentsActivity extends BaseActivity { super.onCreate(icicle); final Resources res = getResources(); - mShowAsDialog = res.getBoolean(R.bool.show_as_dialog); - - if (!mShowAsDialog) { - setTheme(R.style.DocumentsFullScreenTheme); - } - - if (mShowAsDialog) { - mDrawer = DrawerController.createDummy(); - - // Strongly define our horizontal dimension; we leave vertical as - // WRAP_CONTENT so that system resizes us when IME is showing. - 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); - - } else { - mDrawer = DrawerController.create(this); - } + mDrawer = DrawerController.create(this); mToolbar = (Toolbar) findViewById(R.id.toolbar); mStackAdapter = new StackAdapter(); @@ -267,15 +242,16 @@ public class DocumentsActivity extends BaseActivity { } } - if (!mShowAsDialog && mDrawer.isUnlocked()) { + if (mDrawer.isUnlocked()) { mToolbar.setNavigationIcon(R.drawable.ic_hamburger); mToolbar.setNavigationContentDescription(R.string.drawer_open); - mToolbar.setNavigationOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - setRootsDrawerOpen(true); - } - }); + mToolbar.setNavigationOnClickListener( + new View.OnClickListener() { + @Override + public void onClick(View v) { + setRootsDrawerOpen(true); + } + }); } else { mToolbar.setNavigationIcon(null); mToolbar.setNavigationContentDescription(R.string.drawer_open); @@ -306,10 +282,7 @@ public class DocumentsActivity extends BaseActivity { public boolean onCreateOptionsMenu(Menu menu) { boolean showMenu = super.onCreateOptionsMenu(menu); - // Most actions are visible when showing as dialog - if (mShowAsDialog) { - expandMenus(menu); - } + expandMenus(menu); return showMenu; } |