diff options
author | Jorim Jaggi <jjaggi@google.com> | 2014-08-12 23:44:59 +0200 |
---|---|---|
committer | Jorim Jaggi <jjaggi@google.com> | 2014-08-14 12:30:14 +0000 |
commit | e210cc8e9463508381048a2af8b4c30a94239c32 (patch) | |
tree | 22be95419650d844dea22b898177cf788e79d184 | |
parent | 84a3e7aacf6dbeccf4afb36a29f2f069dca7d486 (diff) | |
download | frameworks_base-e210cc8e9463508381048a2af8b4c30a94239c32.zip frameworks_base-e210cc8e9463508381048a2af8b4c30a94239c32.tar.gz frameworks_base-e210cc8e9463508381048a2af8b4c30a94239c32.tar.bz2 |
Make clock larger on tablets
Also fixes "Large text" option on lockscreen and fixes Keyguard
layout on smaller devies. In addition, make sure that landscape
layout for phones isn't terrible broken (it's not pretty but
it works).
Bug: 14994495
Bug: 15589636
Bug: 16799035
Change-Id: I9ab76af41cbecd1a727d019e422765efbbd3276d
20 files changed, 118 insertions, 12 deletions
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 64226fd..220f5ab 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -1978,4 +1978,5 @@ <java-symbol type="bool" name="config_sms_decode_gsm_8bit_data" /> <java-symbol type="string" name="time_picker_am_label" /> <java-symbol type="string" name="time_picker_pm_label" /> + <java-symbol type="dimen" name="text_size_small_material" /> </resources> diff --git a/packages/Keyguard/res/values-sw600dp-land/dimens.xml b/packages/Keyguard/res/values-sw600dp-land/dimens.xml index 13a6f62..89252cf 100644 --- a/packages/Keyguard/res/values-sw600dp-land/dimens.xml +++ b/packages/Keyguard/res/values-sw600dp-land/dimens.xml @@ -25,5 +25,5 @@ <dimen name="kg_status_line_font_right_margin">16dp</dimen> <!-- Overload default clock widget parameters --> - <dimen name="widget_big_font_size">88dp</dimen> + <dimen name="widget_big_font_size">100dp</dimen> </resources>
\ No newline at end of file diff --git a/packages/Keyguard/res/values-sw600dp/dimens.xml b/packages/Keyguard/res/values-sw600dp/dimens.xml index 69bf44f..74be1ff 100644 --- a/packages/Keyguard/res/values-sw600dp/dimens.xml +++ b/packages/Keyguard/res/values-sw600dp/dimens.xml @@ -63,7 +63,7 @@ <dimen name="keyguard_muliuser_selector_margin">12dp</dimen> <!-- Overload default clock widget parameters --> - <dimen name="widget_big_font_size">120dp</dimen> + <dimen name="widget_big_font_size">140dp</dimen> <dimen name="widget_label_font_size">16sp</dimen> <dimen name="bottom_text_spacing_digital">-16dp</dimen> diff --git a/packages/Keyguard/res/values-sw720dp-land/dimens.xml b/packages/Keyguard/res/values-sw720dp-land/dimens.xml index 14726ab..731bb64 100644 --- a/packages/Keyguard/res/values-sw720dp-land/dimens.xml +++ b/packages/Keyguard/res/values-sw720dp-land/dimens.xml @@ -26,4 +26,6 @@ <!-- Horizontal padding for the widget pager --> <dimen name="kg_widget_pager_horizontal_padding">32dp</dimen> + + <dimen name="widget_big_font_size">150dp</dimen> </resources> diff --git a/packages/Keyguard/res/values-sw720dp/dimens.xml b/packages/Keyguard/res/values-sw720dp/dimens.xml index c487072..3e89a84 100644 --- a/packages/Keyguard/res/values-sw720dp/dimens.xml +++ b/packages/Keyguard/res/values-sw720dp/dimens.xml @@ -61,4 +61,5 @@ <!-- Height of the sliding KeyguardSecurityContainer (includes 2x keyguard_security_view_margin) --> <dimen name="keyguard_security_height">420dp</dimen> + <dimen name="widget_big_font_size">150dp</dimen> </resources> diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java index 451db2b..51a276e 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java @@ -19,6 +19,7 @@ package com.android.keyguard; import android.app.AlarmManager; import android.content.ContentResolver; import android.content.Context; +import android.content.res.Configuration; import android.content.res.Resources; import android.provider.AlarmClock; import android.text.TextUtils; @@ -26,6 +27,7 @@ import android.text.format.DateFormat; import android.util.AttributeSet; import android.util.Log; import android.util.Slog; +import android.util.TypedValue; import android.view.View; import android.widget.GridLayout; import android.widget.TextClock; @@ -115,6 +117,17 @@ public class KeyguardStatusView extends GridLayout { mClockView.setElegantTextHeight(false); } + @Override + protected void onConfigurationChanged(Configuration newConfig) { + super.onConfigurationChanged(newConfig); + mClockView.setTextSize(TypedValue.COMPLEX_UNIT_PX, + getResources().getDimensionPixelSize(R.dimen.widget_big_font_size)); + mDateView.setTextSize(TypedValue.COMPLEX_UNIT_PX, + getResources().getDimensionPixelSize(R.dimen.widget_label_font_size)); + mOwnerInfo.setTextSize(TypedValue.COMPLEX_UNIT_PX, + getResources().getDimensionPixelSize(R.dimen.widget_label_font_size)); + } + protected void refresh() { AlarmManager.AlarmClockInfo nextAlarm = mLockPatternUtils.getNextAlarm(); Patterns.update(mContext, nextAlarm != null); diff --git a/packages/SystemUI/res/drawable/trust_circle.xml b/packages/SystemUI/res/drawable/trust_circle.xml index 89f4a0b..56fc62e 100644 --- a/packages/SystemUI/res/drawable/trust_circle.xml +++ b/packages/SystemUI/res/drawable/trust_circle.xml @@ -17,6 +17,6 @@ --> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="ring" - android:innerRadius="24dp" android:thickness="1dp"> - <solid android:color="#66ffffff" /> + android:innerRadius="22dp" android:thickness="2dp"> + <solid android:color="#4cffffff" /> </shape>
\ No newline at end of file diff --git a/packages/SystemUI/res/layout/keyguard_bottom_area.xml b/packages/SystemUI/res/layout/keyguard_bottom_area.xml index fc6e9ae..8e9b501 100644 --- a/packages/SystemUI/res/layout/keyguard_bottom_area.xml +++ b/packages/SystemUI/res/layout/keyguard_bottom_area.xml @@ -27,7 +27,7 @@ android:id="@+id/keyguard_indication_text" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginBottom="70dp" + android:layout_marginBottom="@dimen/keyguard_indication_margin_bottom" android:layout_gravity="bottom|center_horizontal" android:textStyle="italic" android:textColor="#ffffff" diff --git a/packages/SystemUI/res/layout/keyguard_status_bar.xml b/packages/SystemUI/res/layout/keyguard_status_bar.xml index d4b1214..fcc0f4a 100644 --- a/packages/SystemUI/res/layout/keyguard_status_bar.xml +++ b/packages/SystemUI/res/layout/keyguard_status_bar.xml @@ -60,7 +60,7 @@ android:paddingEnd="@dimen/battery_level_padding_end" android:textColor="#ffffff" android:visibility="gone" - android:textSize="12sp"/> + android:textSize="@dimen/battery_level_text_size"/> </LinearLayout> <com.android.keyguard.CarrierText diff --git a/packages/SystemUI/res/layout/status_bar_expanded_header.xml b/packages/SystemUI/res/layout/status_bar_expanded_header.xml index d852d72..1226fc5 100644 --- a/packages/SystemUI/res/layout/status_bar_expanded_header.xml +++ b/packages/SystemUI/res/layout/status_bar_expanded_header.xml @@ -72,7 +72,7 @@ android:layout_marginStart="@dimen/header_battery_margin_expanded" android:paddingEnd="@dimen/battery_level_padding_end" android:textColor="#ffffff" - android:textSize="12sp"/> + android:textSize="@dimen/battery_level_text_size"/> </LinearLayout> <TextView diff --git a/packages/SystemUI/res/values-h560dp/config.xml b/packages/SystemUI/res/values-h560dp/config.xml new file mode 100644 index 0000000..b2231a6 --- /dev/null +++ b/packages/SystemUI/res/values-h560dp/config.xml @@ -0,0 +1,22 @@ +<?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> + <!-- The maximum count of notifications on Keyguard. The rest will be collapsed in an overflow + card. --> + <integer name="keyguard_max_notification_count">4</integer> +</resources> + diff --git a/packages/SystemUI/res/values-land/config.xml b/packages/SystemUI/res/values-land/config.xml index 2b1a4dc..d608e25 100644 --- a/packages/SystemUI/res/values-land/config.xml +++ b/packages/SystemUI/res/values-land/config.xml @@ -29,5 +29,7 @@ <!-- The number of columns that the top level tiles span in the QuickSettings --> <integer name="quick_settings_user_time_settings_tile_span">2</integer> -</resources> + <!-- We have only space for one notification on phone landscape layouts. --> + <integer name="keyguard_max_notification_count">1</integer> +</resources> diff --git a/packages/SystemUI/res/values-sw600dp-land/dimens.xml b/packages/SystemUI/res/values-sw600dp-land/dimens.xml index 5367fbc..2c22cef 100644 --- a/packages/SystemUI/res/values-sw600dp-land/dimens.xml +++ b/packages/SystemUI/res/values-sw600dp-land/dimens.xml @@ -27,4 +27,6 @@ <dimen name="keyguard_clock_notifications_margin_min">36dp</dimen> <dimen name="keyguard_clock_notifications_margin_max">36dp</dimen> + + <dimen name="keyguard_indication_margin_bottom">80dp</dimen> </resources> diff --git a/packages/SystemUI/res/values-sw600dp/dimens.xml b/packages/SystemUI/res/values-sw600dp/dimens.xml index 7cdc078..9901e44 100644 --- a/packages/SystemUI/res/values-sw600dp/dimens.xml +++ b/packages/SystemUI/res/values-sw600dp/dimens.xml @@ -79,4 +79,6 @@ <!-- The width of the region on the left/right edge of the screen for performing the camera/ phone hints. --> <dimen name="edge_tap_area_width">80dp</dimen> + + <dimen name="keyguard_indication_margin_bottom">90dp</dimen> </resources> diff --git a/packages/SystemUI/res/values-sw720dp-land/config.xml b/packages/SystemUI/res/values-sw720dp-land/config.xml new file mode 100644 index 0000000..1b50288 --- /dev/null +++ b/packages/SystemUI/res/values-sw720dp-land/config.xml @@ -0,0 +1,20 @@ +<?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> + <integer name="keyguard_max_notification_count">4</integer> +</resources> + diff --git a/packages/SystemUI/res/values-sw720dp-land/dimens.xml b/packages/SystemUI/res/values-sw720dp-land/dimens.xml index 2532dd6..511d45f 100644 --- a/packages/SystemUI/res/values-sw720dp-land/dimens.xml +++ b/packages/SystemUI/res/values-sw720dp-land/dimens.xml @@ -19,5 +19,5 @@ min value is used when no notifications are displaying, and the max value is when the highest possible number of notifications are showing. --> <fraction name="keyguard_clock_y_fraction_max">35%</fraction> - <fraction name="keyguard_clock_y_fraction_min">20%</fraction> + <fraction name="keyguard_clock_y_fraction_min">24%</fraction> </resources> diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml index 28d7e29..f628039 100644 --- a/packages/SystemUI/res/values/config.xml +++ b/packages/SystemUI/res/values/config.xml @@ -157,7 +157,7 @@ <!-- The maximum count of notifications on Keyguard. The rest will be collapsed in an overflow card. --> - <integer name="keyguard_max_notification_count">4</integer> + <integer name="keyguard_max_notification_count">3</integer> <!-- Defines the implementation of the velocity tracker to be used for the panel expansion. Can be 'platform' or 'noisy' (i.e. for noisy touch screens). --> diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index bf80d84..a09dfe1 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -425,4 +425,9 @@ <!-- The width/height of the phone/camera/unlock icon on keyguard. --> <dimen name="keyguard_affordance_height">56dp</dimen> <dimen name="keyguard_affordance_width">56dp</dimen> + + <dimen name="keyguard_indication_margin_bottom">65dp</dimen> + + <!-- The text size for battery level --> + <dimen name="battery_level_text_size">12sp</dimen> </resources> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java index 6a800fd..b8ac3e7 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java @@ -24,15 +24,18 @@ import android.content.Intent; import android.content.IntentFilter; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; +import android.content.res.Configuration; import android.os.RemoteException; import android.os.UserHandle; import android.provider.MediaStore; import android.util.AttributeSet; import android.util.Log; +import android.util.TypedValue; import android.view.View; import android.view.ViewGroup; import android.view.accessibility.AccessibilityManager; import android.widget.FrameLayout; +import android.widget.TextView; import com.android.internal.widget.LockPatternUtils; import com.android.keyguard.KeyguardUpdateMonitor; @@ -62,7 +65,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL private KeyguardAffordanceView mCameraImageView; private KeyguardAffordanceView mPhoneImageView; private KeyguardAffordanceView mLockIcon; - private View mIndicationText; + private TextView mIndicationText; private ViewGroup mPreviewContainer; private View mPhonePreview; @@ -101,7 +104,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL mCameraImageView = (KeyguardAffordanceView) findViewById(R.id.camera_button); mPhoneImageView = (KeyguardAffordanceView) findViewById(R.id.phone_button); mLockIcon = (KeyguardAffordanceView) findViewById(R.id.lock_icon); - mIndicationText = findViewById(R.id.keyguard_indication_text); + mIndicationText = (TextView) findViewById(R.id.keyguard_indication_text); watchForCameraPolicyChanges(); watchForAccessibilityChanges(); updateCameraVisibility(); @@ -116,6 +119,23 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL mLockIcon.setOnClickListener(this); } + @Override + protected void onConfigurationChanged(Configuration newConfig) { + super.onConfigurationChanged(newConfig); + int indicationBottomMargin = getResources().getDimensionPixelSize( + R.dimen.keyguard_indication_margin_bottom); + MarginLayoutParams mlp = (MarginLayoutParams) mIndicationText.getLayoutParams(); + if (mlp.bottomMargin != indicationBottomMargin) { + mlp.bottomMargin = indicationBottomMargin; + mIndicationText.setLayoutParams(mlp); + } + + // Respect font size setting. + mIndicationText.setTextSize(TypedValue.COMPLEX_UNIT_PX, + getResources().getDimensionPixelSize( + com.android.internal.R.dimen.text_size_small_material)); + } + public void setActivityStarter(ActivityStarter activityStarter) { mActivityStarter = activityStarter; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java index b66c310..5e5c3aa 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java @@ -18,8 +18,10 @@ package com.android.systemui.statusbar.phone; import android.animation.LayoutTransition; import android.content.Context; +import android.content.res.Configuration; import android.graphics.drawable.Drawable; import android.util.AttributeSet; +import android.util.TypedValue; import android.view.View; import android.view.ViewTreeObserver; import android.view.animation.AnimationUtils; @@ -43,6 +45,7 @@ public class KeyguardStatusBarView extends RelativeLayout private boolean mKeyguardUserSwitcherShowing; private boolean mBatteryListening; + private TextView mCarrierLabel; private View mSystemIconsSuperContainer; private MultiUserSwitch mMultiUserSwitch; private ImageView mMultiUserAvatar; @@ -65,12 +68,25 @@ public class KeyguardStatusBarView extends RelativeLayout mMultiUserSwitch = (MultiUserSwitch) findViewById(R.id.multi_user_switch); mMultiUserAvatar = (ImageView) findViewById(R.id.multi_user_avatar); mBatteryLevel = (TextView) findViewById(R.id.battery_level); + mCarrierLabel = (TextView) findViewById(R.id.keyguard_carrier_text); loadDimens(); mFastOutSlowInInterpolator = AnimationUtils.loadInterpolator(getContext(), android.R.interpolator.fast_out_slow_in); updateUserSwitcher(); } + @Override + protected void onConfigurationChanged(Configuration newConfig) { + super.onConfigurationChanged(newConfig); + + // Respect font size setting. + mCarrierLabel.setTextSize(TypedValue.COMPLEX_UNIT_PX, + getResources().getDimensionPixelSize( + com.android.internal.R.dimen.text_size_small_material)); + mBatteryLevel.setTextSize(TypedValue.COMPLEX_UNIT_PX, + getResources().getDimensionPixelSize(R.dimen.battery_level_text_size)); + } + private void loadDimens() { mSystemIconsSwitcherHiddenExpandedMargin = getResources().getDimensionPixelSize( R.dimen.system_icons_switcher_hidden_expanded_margin); |