Update Settings redlines per UX request

See bug: #15384992 Setting Dashboard - padding updates

Change-Id: Ie95b6cee701847d7f76f2e2a72aaf8fc64bc4dd9
This commit is contained in:
Fabrice Di Meglio
2014-06-10 17:12:51 -07:00
parent 65b145e6d5
commit da8babaedf
7 changed files with 57 additions and 22 deletions

View File

@@ -23,7 +23,7 @@
<TextView android:id="@+id/category_title"
android:layout_width="match_parent"
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:ellipsize="marquee"
android:gravity="center_vertical"

View File

@@ -23,7 +23,7 @@
android:layout_height="wrap_content"
android:layout_width="0dp"
android:layout_weight="1"
android:paddingStart="@dimen/switchbar_padding_start"
android:layout_marginStart="?attr/switchBarMarginStart"
android:layout_gravity="center_vertical"
android:textAppearance="@style/TextAppearance.Switch"
android:textAlignment="viewStart" />
@@ -32,6 +32,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingEnd="@dimen/switchbar_padding_end" />
android:layout_marginEnd="?attr/switchBarMarginEnd" />
</merge>

View File

@@ -41,18 +41,22 @@
<!-- ActionBar contentInsetStart -->
<dimen name="actionbar_contentInsetStart">24dp</dimen>
<dimen name="actionbar_subsettings_contentInsetStart">80dp</dimen>
<!-- Dashboard category title padding start -->
<dimen name="dashboard_category_title_padding_start">24dp</dimen>
<!-- Dashboard category title margin start -->
<dimen name="dashboard_category_title_margin_start">23dp</dimen>
<!-- Dashboard tile image padding start / end -->
<dimen name="dashboard_tile_image_margin_start">24dp</dimen>
<dimen name="dashboard_tile_image_margin_end">32dp</dimen>
<!-- SwitchBar padding start -->
<dimen name="switchbar_padding_start">24dp</dimen>
<!-- SwitchBar padding end -->
<dimen name="switchbar_padding_end">24dp</dimen>
<!-- SwitchBar margin start / end -->
<dimen name="switchbar_margin_start">24dp</dimen>
<dimen name="switchbar_margin_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 -->
<dimen name="search_title_padding_start">24dp</dimen>

View File

@@ -96,4 +96,8 @@
<declare-styleable name="Preference">
<attr name="keywords" format="string" />
</declare-styleable>
<attr name="switchBarMarginStart" format="dimension" />
<attr name="switchBarMarginEnd" format="dimension" />
</resources>

View File

@@ -92,6 +92,7 @@
<!-- ActionBar contentInsetStart -->
<dimen name="actionbar_contentInsetStart">16dp</dimen>
<dimen name="actionbar_subsettings_contentInsetStart">72dp</dimen>
<!-- Dashboard padding between each tiles within the layout -->
<dimen name="dashboard_cell_gap">1dp</dimen>
@@ -104,8 +105,8 @@
<!-- Dashboard category title layout height -->
<dimen name="dashboard_category_title_height">48dp</dimen>
<!-- Dashboard category title padding start -->
<dimen name="dashboard_category_title_padding_start">16dp</dimen>
<!-- Dashboard category title margin start -->
<dimen name="dashboard_category_title_margin_start">15dp</dimen>
<!-- Dashboard tile minimum height -->
<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_end">32dp</dimen>
<!-- SwitchBar padding start -->
<dimen name="switchbar_padding_start">16dp</dimen>
<!-- SwitchBar padding end. Should be n x @*android:dimen/preference_fragment_padding_side -->
<dimen name="switchbar_padding_end">16dp</dimen>
<!-- SwitchBar margin start / end -->
<dimen name="switchbar_margin_start">16dp</dimen>
<dimen name="switchbar_margin_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 -->
<dimen name="search_results_padding_start">1dp</dimen>

View File

@@ -84,6 +84,9 @@
<item name="ic_wps">@drawable/ic_wps_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 -->
<item name="android:actionBarStyle">@style/Theme.ActionBar</item>
@@ -100,6 +103,18 @@
<item name="android:contentInsetStart">@dimen/actionbar_contentInsetStart</item>
</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">
<!-- Used by the ActionBar -->
<item name="android:colorPrimary">@color/theme_primary</item>

View File

@@ -456,6 +456,20 @@ public class SettingsActivity extends Activity
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);
mContent = (ViewGroup) findViewById(R.id.prefs);
@@ -465,11 +479,6 @@ public class SettingsActivity extends Activity
mDisplayHomeAsUpEnabled = 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) {
Index.getInstance(getApplicationContext()).update();
}
@@ -494,9 +503,8 @@ public class SettingsActivity extends Activity
mDisplaySearch = savedState.getBoolean(SAVE_KEY_SHOW_SEARCH);
} else {
if (!mIsShowingDashboard) {
final ComponentName cn = getIntent().getComponent();
// No UP nor Search is shown we are launched thru a Settings "shortcut"
if (!cn.getClassName().equals(SubSettings.class.getName())) {
if (isShortcut) {
mDisplayHomeAsUpEnabled = false;
mDisplaySearch = false;
}