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

Commit 109f1fd8 authored by Jim Miller's avatar Jim Miller
Browse files

Update keyguard selector view to match UX design spec

- Use new Roboto-Thin font
- Add new keyguard-specific date format
- Layout tweaks to keyguard selector screen.
- Add smart EmergencyButton class
- Add selective upper-casing of components on the display to enable later UX decision
- Work around SIM state bug

Bug: 7094419
Change-Id: Ic7e0f30697c14d4946372509d98ad81bf6a23c92
parent 6704a48b
Loading
Loading
Loading
Loading
+25 −4
Original line number Diff line number Diff line
@@ -1112,8 +1112,13 @@ public class LockPatternUtils {
     *  {@link TelephonyManager#CALL_STATE_RINGING}
     *  {@link TelephonyManager#CALL_STATE_OFFHOOK}
     * @param shown indicates whether the given screen wants the emergency button to show at all
     * @param button
     * @param phoneState
     * @param shown shown if true; hidden if false
     * @param upperCase if true, converts button label string to upper case
     */
    public void updateEmergencyCallButtonState(Button button, int  phoneState, boolean shown) {
    public void updateEmergencyCallButtonState(Button button, int  phoneState, boolean shown,
            boolean upperCase, boolean showIcon) {
        if (isEmergencyCallCapable() && shown) {
            button.setVisibility(View.VISIBLE);
        } else {
@@ -1125,15 +1130,31 @@ public class LockPatternUtils {
        if (phoneState == TelephonyManager.CALL_STATE_OFFHOOK) {
            // show "return to call" text and show phone icon
            textId = R.string.lockscreen_return_to_call;
            int phoneCallIcon = R.drawable.stat_sys_phone_call;
            int phoneCallIcon = showIcon ? R.drawable.stat_sys_phone_call : 0;
            button.setCompoundDrawablesWithIntrinsicBounds(phoneCallIcon, 0, 0, 0);
        } else {
            textId = R.string.lockscreen_emergency_call;
            int emergencyIcon = R.drawable.ic_emergency;
            int emergencyIcon = showIcon ? R.drawable.ic_emergency : 0;
            button.setCompoundDrawablesWithIntrinsicBounds(emergencyIcon, 0, 0, 0);
        }
        if (upperCase) {
            CharSequence original = mContext.getResources().getText(textId);
            String upper = original != null ? original.toString().toUpperCase() : null;
            button.setText(upper);
        } else {
            button.setText(textId);
        }
    }

    /**
     * @deprecated
     * @param button
     * @param phoneState
     * @param shown
     */
    public void updateEmergencyCallButtonState(Button button, int  phoneState, boolean shown) {
        updateEmergencyCallButtonState(button, phoneState, shown, false, true);
    }

    /**
     * Resumes a call in progress. Typically launched from the EmergencyCall button
+2 −1
Original line number Diff line number Diff line
@@ -13,7 +13,8 @@
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<alpha xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@interpolator/accelerate_quad"
<alpha xmlns:android="http://schemas.android.com/apk/res/android" 
    android:interpolator="@interpolator/accelerate_quad"
    android:fromAlpha="1.0"
    android:toAlpha="0.0"
    android:duration="@integer/kg_security_fade_duration"
+28 −21
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@
        android:id="@+id/app_widget_container"
        android:layout_width="match_parent"
        android:layout_height="0dip"
        android:layout_weight="1"
        android:layout_weight="0.45"
        android:visibility="gone">
            <!-- TODO: Remove this when supported as a widget -->
            <include layout="@layout/keyguard_status_view"/>
@@ -40,7 +40,7 @@
    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="0dip"
        android:layout_weight="1"
        android:layout_weight="0.55"
        android:layout_gravity="center"
        android:gravity="center">

@@ -64,28 +64,35 @@
            prvandroid:glowRadius="@*android:dimen/glowpadview_glow_radius"
            prvandroid:pointDrawable="@*android:drawable/ic_lockscreen_glowdot"/>

        <Button
            android:id="@+id/emergency_call_button"
            android:layout_width="wrap_content"
        <LinearLayout
            android:id="@+id/keyguard_selector_fade_container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:drawableLeft="@drawable/lockscreen_emergency_button"
            android:text="@string/kg_emergency_call_label"
            style="?android:attr/buttonBarButtonStyle"
            android:drawablePadding="8dip"
            android:layout_alignParentBottom="true"
            />
            android:orientation="vertical"
            android:gravity="center_horizontal"
            android:layout_alignParentBottom="true">

            <com.android.internal.policy.impl.keyguard.CarrierText
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
            android:layout_above="@id/emergency_call_button"
                android:singleLine="true"
                android:ellipsize="marquee"
                android:textAppearance="?android:attr/textAppearanceMedium"
            android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
                android:textSize="@*android:dimen/keyguard_lockscreen_status_line_font_size"
                android:textColor="?android:attr/textColorSecondary"
                />

            <com.android.internal.policy.impl.keyguard.EmergencyButton
                android:id="@+id/emergency_call_button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:drawableLeft="@*android:drawable/lockscreen_emergency_button"
                android:text="@string/kg_emergency_call_label"
                style="?android:attr/buttonBarButtonStyle"
                android:drawablePadding="8dip" />

        </LinearLayout>

    </RelativeLayout>

</com.android.internal.policy.impl.keyguard.KeyguardSelectorView>
+31 −63
Original line number Diff line number Diff line
@@ -31,101 +31,69 @@
        android:layout_height="match_parent"
        android:gravity="center_horizontal">

        <com.android.internal.widget.DigitalClock android:id="@+id/time"
            android:layout_marginTop="@*android:dimen/keyguard_lockscreen_status_line_clockfont_top_margin"
            android:layout_marginBottom="12dip"
            android:layout_marginEnd="@*android:dimen/keyguard_lockscreen_status_line_font_right_margin"
            android:layout_gravity="end">

            <!-- Because we can't have multi-tone fonts, we render two TextViews, one on
            top of the other. Hence the redundant layout... -->
            <TextView android:id="@*android:id/timeDisplayBackground"
        <com.android.internal.policy.impl.keyguard.ClockView
            android:id="@+id/clock_view"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
                android:singleLine="true"
                android:ellipsize="none"
                android:textSize="@*android:dimen/keyguard_lockscreen_clock_font_size"
                android:textAppearance="?android:attr/textAppearanceMedium"
                android:layout_marginBottom="6dip"
                android:textColor="@*android:color/lockscreen_clock_background"
                />
            android:layout_marginEnd="@dimen/kg_status_line_font_right_margin"
            android:layout_gravity="end">

            <TextView android:id="@*android:id/timeDisplayForeground"
            <TextView android:id="@+id/clock_text"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:singleLine="true"
                android:ellipsize="none"
                android:textSize="@*android:dimen/keyguard_lockscreen_clock_font_size"
                android:textSize="@dimen/kg_status_clock_font_size"
                android:textAppearance="?android:attr/textAppearanceMedium"
                android:layout_marginBottom="6dip"
                android:textColor="@*android:color/lockscreen_clock_foreground"
                android:layout_alignStart="@*android:id/timeDisplayBackground"
                android:layout_alignTop="@*android:id/timeDisplayBackground"
                android:textColor="#ffffffff"
                />

        </com.android.internal.widget.DigitalClock>

        <LinearLayout
            android:orientation="horizontal"
            android:layout_gravity="end"
            android:layout_marginEnd="@*android:dimen/keyguard_lockscreen_status_line_font_right_margin">

            <TextView
                android:id="@*android:id/date"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:singleLine="true"
                android:ellipsize="marquee"
                android:textAppearance="?android:attr/textAppearanceMedium"
                android:textSize="@*android:dimen/keyguard_lockscreen_status_line_font_size"
                />
        </com.android.internal.policy.impl.keyguard.ClockView>

        <TextView
                android:id="@*android:id/alarm_status"
            android:id="@+id/date"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
                android:layout_marginStart="16dip"
            android:layout_gravity="end"
            android:layout_marginTop="-16dp"
            android:layout_marginEnd="@dimen/kg_status_line_font_right_margin"
            android:singleLine="true"
            android:ellipsize="marquee"
            android:textAppearance="?android:attr/textAppearanceMedium"
                android:textSize="@*android:dimen/keyguard_lockscreen_status_line_font_size"
                android:drawablePadding="4dip"
            android:textSize="@dimen/kg_status_date_font_size"
            />

        </LinearLayout>

        <TextView
            android:id="@+id/status1"
            android:id="@+id/owner_info"
            android:layout_gravity="end"
            android:layout_marginEnd="@*android:dimen/keyguard_lockscreen_status_line_font_right_margin"
            android:layout_marginTop="16dp"
            android:layout_marginEnd="@dimen/kg_status_line_font_right_margin"
            android:singleLine="true"
            android:ellipsize="marquee"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:textSize="@*android:dimen/keyguard_lockscreen_status_line_font_size"
            android:drawablePadding="4dip"
            android:textSize="@dimen/kg_status_line_font_size"
            />

        <TextView
            android:id="@+id/owner_info"
            android:id="@+id/alarm_status"
            android:layout_gravity="end"
            android:layout_marginEnd="@*android:dimen/keyguard_lockscreen_status_line_font_right_margin"
            android:layout_marginEnd="@dimen/kg_status_line_font_right_margin"
            android:singleLine="true"
            android:ellipsize="marquee"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:textSize="@*android:dimen/keyguard_lockscreen_status_line_font_size"
            android:drawablePadding="4dip"
            android:textSize="@dimen/kg_status_line_font_size"
            />

        <TextView
            android:id="@+id/carrier"
            android:id="@+id/status1"
            android:layout_gravity="end"
            android:layout_marginEnd="@*android:dimen/keyguard_lockscreen_status_line_font_right_margin"
            android:layout_marginEnd="@dimen/kg_status_line_font_right_margin"
            android:singleLine="true"
            android:ellipsize="marquee"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:textSize="@*android:dimen/keyguard_lockscreen_status_line_font_size"
            android:textColor="?android:attr/textColorSecondary"
            android:textSize="@dimen/kg_status_line_font_size"
            />

    </com.android.internal.policy.impl.keyguard.KeyguardStatusView>

</com.android.internal.policy.impl.keyguard.KeyguardWidgetFrame>
 No newline at end of file
+13 −0
Original line number Diff line number Diff line
@@ -256,4 +256,17 @@

    <!-- Padding surrounding each widget page -->
    <dimen name="kg_widget_page_padding">10dp</dimen>

    <!-- Size of the clock font in keyguard's status view -->
    <dimen name="kg_status_clock_font_size">94dp</dimen>

    <!-- Size of the date font in keyguard's status view  -->
    <dimen name="kg_status_date_font_size">24dp</dimen>

    <!-- Size of the generic status lines keyguard's status view  -->
    <dimen name="kg_status_line_font_size">12sp</dimen>

    <!-- Size of margin on the right of keyguard's status view -->
    <dimen name="kg_status_line_font_right_margin">32dp</dimen>

</resources>
Loading