Update Settings redlines per UX request
See bug: #15384992 Setting Dashboard - padding updates Change-Id: Ie95b6cee701847d7f76f2e2a72aaf8fc64bc4dd9
This commit is contained in:
@@ -23,7 +23,7 @@
|
|||||||
<TextView android:id="@+id/category_title"
|
<TextView android:id="@+id/category_title"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/dashboard_category_title_height"
|
android:layout_height="@dimen/dashboard_category_title_height"
|
||||||
android:paddingStart="@dimen/dashboard_category_title_padding_start"
|
android:layout_marginStart="@dimen/dashboard_category_title_margin_start"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:ellipsize="marquee"
|
android:ellipsize="marquee"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:paddingStart="@dimen/switchbar_padding_start"
|
android:layout_marginStart="?attr/switchBarMarginStart"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:textAppearance="@style/TextAppearance.Switch"
|
android:textAppearance="@style/TextAppearance.Switch"
|
||||||
android:textAlignment="viewStart" />
|
android:textAlignment="viewStart" />
|
||||||
@@ -32,6 +32,6 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:paddingEnd="@dimen/switchbar_padding_end" />
|
android:layout_marginEnd="?attr/switchBarMarginEnd" />
|
||||||
</merge>
|
</merge>
|
||||||
|
|
||||||
|
@@ -41,18 +41,22 @@
|
|||||||
|
|
||||||
<!-- ActionBar contentInsetStart -->
|
<!-- ActionBar contentInsetStart -->
|
||||||
<dimen name="actionbar_contentInsetStart">24dp</dimen>
|
<dimen name="actionbar_contentInsetStart">24dp</dimen>
|
||||||
|
<dimen name="actionbar_subsettings_contentInsetStart">80dp</dimen>
|
||||||
|
|
||||||
<!-- Dashboard category title padding start -->
|
<!-- Dashboard category title margin start -->
|
||||||
<dimen name="dashboard_category_title_padding_start">24dp</dimen>
|
<dimen name="dashboard_category_title_margin_start">23dp</dimen>
|
||||||
|
|
||||||
<!-- Dashboard tile image padding start / end -->
|
<!-- Dashboard tile image padding start / end -->
|
||||||
<dimen name="dashboard_tile_image_margin_start">24dp</dimen>
|
<dimen name="dashboard_tile_image_margin_start">24dp</dimen>
|
||||||
<dimen name="dashboard_tile_image_margin_end">32dp</dimen>
|
<dimen name="dashboard_tile_image_margin_end">32dp</dimen>
|
||||||
|
|
||||||
<!-- SwitchBar padding start -->
|
<!-- SwitchBar margin start / end -->
|
||||||
<dimen name="switchbar_padding_start">24dp</dimen>
|
<dimen name="switchbar_margin_start">24dp</dimen>
|
||||||
<!-- SwitchBar padding end -->
|
<dimen name="switchbar_margin_end">24dp</dimen>
|
||||||
<dimen name="switchbar_padding_end">24dp</dimen>
|
|
||||||
|
<!-- SwitchBar sub settings margin start / end -->
|
||||||
|
<dimen name="switchbar_subsettings_margin_start">80dp</dimen>
|
||||||
|
<dimen name="switchbar_subsettings_margin_end">24dp</dimen>
|
||||||
|
|
||||||
<!-- Search title (recent / results) padding start -->
|
<!-- Search title (recent / results) padding start -->
|
||||||
<dimen name="search_title_padding_start">24dp</dimen>
|
<dimen name="search_title_padding_start">24dp</dimen>
|
||||||
|
@@ -96,4 +96,8 @@
|
|||||||
<declare-styleable name="Preference">
|
<declare-styleable name="Preference">
|
||||||
<attr name="keywords" format="string" />
|
<attr name="keywords" format="string" />
|
||||||
</declare-styleable>
|
</declare-styleable>
|
||||||
|
|
||||||
|
<attr name="switchBarMarginStart" format="dimension" />
|
||||||
|
<attr name="switchBarMarginEnd" format="dimension" />
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -92,6 +92,7 @@
|
|||||||
|
|
||||||
<!-- ActionBar contentInsetStart -->
|
<!-- ActionBar contentInsetStart -->
|
||||||
<dimen name="actionbar_contentInsetStart">16dp</dimen>
|
<dimen name="actionbar_contentInsetStart">16dp</dimen>
|
||||||
|
<dimen name="actionbar_subsettings_contentInsetStart">72dp</dimen>
|
||||||
|
|
||||||
<!-- Dashboard padding between each tiles within the layout -->
|
<!-- Dashboard padding between each tiles within the layout -->
|
||||||
<dimen name="dashboard_cell_gap">1dp</dimen>
|
<dimen name="dashboard_cell_gap">1dp</dimen>
|
||||||
@@ -104,8 +105,8 @@
|
|||||||
<!-- Dashboard category title layout height -->
|
<!-- Dashboard category title layout height -->
|
||||||
<dimen name="dashboard_category_title_height">48dp</dimen>
|
<dimen name="dashboard_category_title_height">48dp</dimen>
|
||||||
|
|
||||||
<!-- Dashboard category title padding start -->
|
<!-- Dashboard category title margin start -->
|
||||||
<dimen name="dashboard_category_title_padding_start">16dp</dimen>
|
<dimen name="dashboard_category_title_margin_start">15dp</dimen>
|
||||||
|
|
||||||
<!-- Dashboard tile minimum height -->
|
<!-- Dashboard tile minimum height -->
|
||||||
<dimen name="dashboard_tile_minimum_height">72dp</dimen>
|
<dimen name="dashboard_tile_minimum_height">72dp</dimen>
|
||||||
@@ -117,10 +118,13 @@
|
|||||||
<dimen name="dashboard_tile_image_margin_start">16dp</dimen>
|
<dimen name="dashboard_tile_image_margin_start">16dp</dimen>
|
||||||
<dimen name="dashboard_tile_image_margin_end">32dp</dimen>
|
<dimen name="dashboard_tile_image_margin_end">32dp</dimen>
|
||||||
|
|
||||||
<!-- SwitchBar padding start -->
|
<!-- SwitchBar margin start / end -->
|
||||||
<dimen name="switchbar_padding_start">16dp</dimen>
|
<dimen name="switchbar_margin_start">16dp</dimen>
|
||||||
<!-- SwitchBar padding end. Should be n x @*android:dimen/preference_fragment_padding_side -->
|
<dimen name="switchbar_margin_end">16dp</dimen>
|
||||||
<dimen name="switchbar_padding_end">16dp</dimen>
|
|
||||||
|
<!-- SwitchBar sub settings margin start / end -->
|
||||||
|
<dimen name="switchbar_subsettings_margin_start">72dp</dimen>
|
||||||
|
<dimen name="switchbar_subsettings_margin_end">16dp</dimen>
|
||||||
|
|
||||||
<!-- Search Results padding in its container -->
|
<!-- Search Results padding in its container -->
|
||||||
<dimen name="search_results_padding_start">1dp</dimen>
|
<dimen name="search_results_padding_start">1dp</dimen>
|
||||||
|
@@ -84,6 +84,9 @@
|
|||||||
<item name="ic_wps">@drawable/ic_wps_dark</item>
|
<item name="ic_wps">@drawable/ic_wps_dark</item>
|
||||||
<item name="wifi_signal">@drawable/wifi_signal_dark</item>
|
<item name="wifi_signal">@drawable/wifi_signal_dark</item>
|
||||||
|
|
||||||
|
<item name="switchBarMarginStart">@dimen/switchbar_margin_start</item>
|
||||||
|
<item name="switchBarMarginEnd">@dimen/switchbar_margin_end</item>
|
||||||
|
|
||||||
<!-- Redefine the ActionBar style for contentInsetStart -->
|
<!-- Redefine the ActionBar style for contentInsetStart -->
|
||||||
<item name="android:actionBarStyle">@style/Theme.ActionBar</item>
|
<item name="android:actionBarStyle">@style/Theme.ActionBar</item>
|
||||||
|
|
||||||
@@ -100,6 +103,18 @@
|
|||||||
<item name="android:contentInsetStart">@dimen/actionbar_contentInsetStart</item>
|
<item name="android:contentInsetStart">@dimen/actionbar_contentInsetStart</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="Theme.SubSettings" parent="Theme.Settings">
|
||||||
|
<!-- Redefine the ActionBar style for contentInsetStart -->
|
||||||
|
<item name="android:actionBarStyle">@style/Theme.SubSettingsActionBar</item>
|
||||||
|
|
||||||
|
<item name="switchBarMarginStart">@dimen/switchbar_subsettings_margin_start</item>
|
||||||
|
<item name="switchBarMarginEnd">@dimen/switchbar_subsettings_margin_end</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="Theme.SubSettingsActionBar" parent="Theme.ActionBar">
|
||||||
|
<item name="android:contentInsetStart">@dimen/actionbar_subsettings_contentInsetStart</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
<style name="Theme.DialogWhenLarge" parent="android:style/Theme.Material.Light.DialogWhenLarge">
|
<style name="Theme.DialogWhenLarge" parent="android:style/Theme.Material.Light.DialogWhenLarge">
|
||||||
<!-- Used by the ActionBar -->
|
<!-- Used by the ActionBar -->
|
||||||
<item name="android:colorPrimary">@color/theme_primary</item>
|
<item name="android:colorPrimary">@color/theme_primary</item>
|
||||||
|
@@ -456,6 +456,20 @@ public class SettingsActivity extends Activity
|
|||||||
|
|
||||||
super.onCreate(savedState);
|
super.onCreate(savedState);
|
||||||
|
|
||||||
|
// Getting Intent properties can only be done after the super.onCreate(...)
|
||||||
|
final String initialFragmentName = getIntent().getStringExtra(EXTRA_SHOW_FRAGMENT);
|
||||||
|
|
||||||
|
mIsShowingDashboard = (initialFragmentName == null);
|
||||||
|
|
||||||
|
final ComponentName cn = getIntent().getComponent();
|
||||||
|
final boolean isShortcut = !cn.getClassName().equals(SubSettings.class.getName());
|
||||||
|
|
||||||
|
// If this is a subsettings (but not a Shortcut) then apply the correct theme for
|
||||||
|
// the ActionBar content inset
|
||||||
|
if (!mIsShowingDashboard && !isShortcut) {
|
||||||
|
setTheme(R.style.Theme_SubSettings);
|
||||||
|
}
|
||||||
|
|
||||||
setContentView(R.layout.settings_main);
|
setContentView(R.layout.settings_main);
|
||||||
|
|
||||||
mContent = (ViewGroup) findViewById(R.id.prefs);
|
mContent = (ViewGroup) findViewById(R.id.prefs);
|
||||||
@@ -465,11 +479,6 @@ public class SettingsActivity extends Activity
|
|||||||
mDisplayHomeAsUpEnabled = true;
|
mDisplayHomeAsUpEnabled = true;
|
||||||
mDisplaySearch = true;
|
mDisplaySearch = true;
|
||||||
|
|
||||||
// Getting Intent properties can only be done after the super.onCreate(...)
|
|
||||||
final String initialFragmentName = getIntent().getStringExtra(EXTRA_SHOW_FRAGMENT);
|
|
||||||
|
|
||||||
mIsShowingDashboard = (initialFragmentName == null);
|
|
||||||
|
|
||||||
if (mIsShowingDashboard) {
|
if (mIsShowingDashboard) {
|
||||||
Index.getInstance(getApplicationContext()).update();
|
Index.getInstance(getApplicationContext()).update();
|
||||||
}
|
}
|
||||||
@@ -494,9 +503,8 @@ public class SettingsActivity extends Activity
|
|||||||
mDisplaySearch = savedState.getBoolean(SAVE_KEY_SHOW_SEARCH);
|
mDisplaySearch = savedState.getBoolean(SAVE_KEY_SHOW_SEARCH);
|
||||||
} else {
|
} else {
|
||||||
if (!mIsShowingDashboard) {
|
if (!mIsShowingDashboard) {
|
||||||
final ComponentName cn = getIntent().getComponent();
|
|
||||||
// No UP nor Search is shown we are launched thru a Settings "shortcut"
|
// No UP nor Search is shown we are launched thru a Settings "shortcut"
|
||||||
if (!cn.getClassName().equals(SubSettings.class.getName())) {
|
if (isShortcut) {
|
||||||
mDisplayHomeAsUpEnabled = false;
|
mDisplayHomeAsUpEnabled = false;
|
||||||
mDisplaySearch = false;
|
mDisplaySearch = false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user