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

Commit 22e4b34c authored by Robyn Coultas's avatar Robyn Coultas
Browse files

Change alarm/timer setup font from bold to light

Moved units to bottom
Moved common setup layout into timer_h_mm_ss_view.xml
Removed references to ZeroTopPaddingTextView from alarm/timer setup.

Change-Id: Iefa9fa06be6098c9e7bd55ad943b84ac8cd760a7
parent fd116ef2
Loading
Loading
Loading
Loading
+7 −69
Original line number Diff line number Diff line
@@ -17,10 +17,12 @@
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <LinearLayout
        android:layoutDirection="ltr"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <com.android.deskclock.timer.TimerView
            android:id="@+id/timer_time_text"
            android:layout_width="0dip"
@@ -32,78 +34,12 @@
            android:paddingStart="@dimen/timer_padding_left"
            android:layout_gravity="center"
            android:gravity="top"
            android:baselineAligned="false">
            <com.android.deskclock.ZeroTopPaddingTextView
                android:id="@+id/hours_ones"
                android:singleLine="true"
                android:ellipsize="none"
                style="@style/medium_bold"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:textColor="@color/clock_white"/>

            <com.android.deskclock.ZeroTopPaddingTextView
                android:id="@+id/hours_label"
                android:singleLine="true"
                android:ellipsize="none"
                style="@style/label"
                android:layout_gravity="top"
                android:contentDescription="@string/hours_label_description"
                android:text="@string/hours_label"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:textColor="@color/clock_white"/>

            <com.android.deskclock.ZeroTopPaddingTextView
                android:id="@+id/minutes_tens"
                android:singleLine="true"
                android:ellipsize="none"
                style="@style/medium_bold"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:textColor="@color/clock_white"/>

            <com.android.deskclock.ZeroTopPaddingTextView
                android:id="@+id/minutes_ones"
                android:singleLine="true"
                android:ellipsize="none"
                style="@style/medium_bold"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:textColor="@color/clock_white"/>
            <com.android.deskclock.ZeroTopPaddingTextView
                android:id="@+id/minutes_label"
                android:singleLine="true"
                android:ellipsize="none"
                style="@style/label"
                android:contentDescription="@string/minutes_label_description"
                android:text="@string/minutes_label"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:textColor="@color/clock_white"/>

            <com.android.deskclock.ZeroTopPaddingTextView
                android:id="@+id/seconds"
                android:singleLine="true"
                android:ellipsize="none"
                style="@style/medium_light"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:textColor="@color/clock_white"/>
            >

            <com.android.deskclock.ZeroTopPaddingTextView
                android:id="@+id/seconds_label"
                android:singleLine="true"
                android:ellipsize="none"
                style="@style/label"
                android:layout_gravity="top"
                android:contentDescription="@string/seconds_label_description"
                android:text="@string/seconds_label"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:textColor="@color/clock_white"/>
            <include layout="@layout/timer_h_mm_ss_view"/>

        </com.android.deskclock.timer.TimerView>

        <ImageButton
            android:id="@+id/delete"
            android:layout_width="0dip"
@@ -115,7 +51,9 @@
            android:background="@drawable/item_background"
            android:contentDescription="@string/timer_delete"
            android:layout_height="match_parent" />

    </LinearLayout>

    <View
        android:layout_width="match_parent"
        android:layout_height="1dip"
+16 −11
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
        android:layout_height="wrap_content"
        android:layoutDirection="ltr"
        android:gravity="center">

        <com.android.deskclock.timer.TimerView
            android:id="@+id/timer_time_text"
            android:layout_width="0dip"
@@ -32,26 +33,27 @@
            android:paddingLeft="@dimen/timer_padding_left"
            android:paddingStart="@dimen/timer_padding_left"
            android:layout_gravity="center"
            android:baselineAligned="false"
            android:baselineAligned="true"
            android:gravity="top">
            <com.android.deskclock.ZeroTopPaddingTextView

            <TextView
                android:id="@+id/hours_tens"
                android:singleLine="true"
                android:ellipsize="none"
                style="@style/medium_bold"
                style="@style/medium_light"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:textColor="@color/clock_white"/>
            <com.android.deskclock.ZeroTopPaddingTextView
            <TextView
                android:id="@+id/hours_ones"
                android:singleLine="true"
                android:ellipsize="none"
                style="@style/medium_bold"
                style="@style/medium_light"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:textColor="@color/clock_white"/>

            <com.android.deskclock.ZeroTopPaddingTextView
            <TextView
                android:id="@+id/hours_seperator"
                android:singleLine="true"
                android:ellipsize="none"
@@ -61,24 +63,24 @@
                android:layout_width="wrap_content"
                android:textColor="@color/clock_white"/>

            <com.android.deskclock.ZeroTopPaddingTextView
            <TextView
                android:id="@+id/minutes_tens"
                android:singleLine="true"
                android:ellipsize="none"
                style="@style/medium_bold"
                style="@style/medium_light"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:textColor="@color/clock_white"/>
            <com.android.deskclock.ZeroTopPaddingTextView
            <TextView
                android:id="@+id/minutes_ones"
                android:singleLine="true"
                android:ellipsize="none"
                style="@style/medium_bold"
                style="@style/medium_light"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:textColor="@color/clock_white"/>

            <com.android.deskclock.ZeroTopPaddingTextView
            <TextView
                android:id="@+id/ampm_label"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
@@ -90,6 +92,7 @@
                android:textColor="@color/clock_white"/>

        </com.android.deskclock.timer.TimerView>

        <ImageButton
            android:id="@+id/delete"
            android:layout_width="0dip"
@@ -100,7 +103,9 @@
            android:background="@drawable/item_background"
            android:contentDescription="@string/timer_delete"
            android:layout_height="match_parent" />

    </LinearLayout>

    <View
        android:layout_width="match_parent"
        android:layout_height="1dip"
+7 −69
Original line number Diff line number Diff line
@@ -17,10 +17,12 @@
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <LinearLayout
        android:layoutDirection="ltr"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <com.android.deskclock.timer.TimerView
            android:id="@+id/timer_time_text"
            android:layout_width="0dip"
@@ -29,78 +31,12 @@
            android:paddingTop="@dimen/medium_font_padding"
            android:paddingBottom="@dimen/medium_font_padding"
            android:gravity="top|center_horizontal"
            android:baselineAligned="false">
            <com.android.deskclock.ZeroTopPaddingTextView
                android:id="@+id/hours_ones"
                android:singleLine="true"
                android:ellipsize="none"
                style="@style/medium_bold"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:textColor="@color/clock_white"/>

            <com.android.deskclock.ZeroTopPaddingTextView
                android:id="@+id/hours_label"
                android:singleLine="true"
                android:ellipsize="none"
                style="@style/label"
                android:layout_gravity="top"
                android:contentDescription="@string/hours_label_description"
                android:text="@string/hours_label"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:textColor="@color/clock_white"/>

            <com.android.deskclock.ZeroTopPaddingTextView
                android:id="@+id/minutes_tens"
                android:singleLine="true"
                android:ellipsize="none"
                style="@style/medium_bold"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:textColor="@color/clock_white"/>

            <com.android.deskclock.ZeroTopPaddingTextView
                android:id="@+id/minutes_ones"
                android:singleLine="true"
                android:ellipsize="none"
                style="@style/medium_bold"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:textColor="@color/clock_white"/>
            <com.android.deskclock.ZeroTopPaddingTextView
                android:id="@+id/minutes_label"
                android:singleLine="true"
                android:ellipsize="none"
                style="@style/label"
                android:contentDescription="@string/minutes_label_description"
                android:text="@string/minutes_label"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:textColor="@color/clock_white"/>

            <com.android.deskclock.ZeroTopPaddingTextView
                android:id="@+id/seconds"
                android:singleLine="true"
                android:ellipsize="none"
                style="@style/medium_light"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:textColor="@color/clock_white"/>
            >

            <com.android.deskclock.ZeroTopPaddingTextView
                android:id="@+id/seconds_label"
                android:singleLine="true"
                android:ellipsize="none"
                style="@style/label"
                android:layout_gravity="top"
                android:contentDescription="@string/seconds_label_description"
                android:text="@string/seconds_label"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:textColor="@color/clock_white"/>
            <include layout="@layout/timer_h_mm_ss_view"/>

        </com.android.deskclock.timer.TimerView>

        <ImageButton
            android:id="@+id/delete"
            android:layout_width="0dip"
@@ -112,7 +48,9 @@
            android:background="@drawable/item_background"
            android:contentDescription="@string/timer_delete"
            android:layout_height="match_parent" />

    </LinearLayout>

    <View
        android:layout_width="match_parent"
        android:layout_height="1dip"
+94 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2013 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.
-->

<merge xmlns:android="http://schemas.android.com/apk/res/android"
       android:layout_width="match_parent"
       android:layout_height="match_parent">

    <TextView
            android:id="@+id/hours_ones"
            android:singleLine="true"
            android:ellipsize="none"
            style="@style/medium_light"
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:textColor="@color/clock_white"/>

    <TextView
            android:id="@+id/hours_label"
            android:singleLine="true"
            android:ellipsize="none"
            style="@style/label"
            android:layout_gravity="bottom"
            android:contentDescription="@string/hours_label_description"
            android:text="@string/hours_label"
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:textColor="@color/clock_white"/>

    <TextView
            android:id="@+id/minutes_tens"
            android:singleLine="true"
            android:ellipsize="none"
            style="@style/medium_light"
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:textColor="@color/clock_white"/>

    <TextView
            android:id="@+id/minutes_ones"
            android:singleLine="true"
            android:ellipsize="none"
            style="@style/medium_light"
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:textColor="@color/clock_white"/>

    <TextView
            android:id="@+id/minutes_label"
            android:singleLine="true"
            android:ellipsize="none"
            style="@style/label"
            android:layout_gravity="bottom"
            android:contentDescription="@string/minutes_label_description"
            android:text="@string/minutes_label"
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:textColor="@color/clock_white"/>

    <TextView
            android:id="@+id/seconds"
            android:singleLine="true"
            android:ellipsize="none"
            style="@style/medium_light"
            android:layout_gravity="bottom"
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:textColor="@color/clock_white"/>

    <TextView
            android:id="@+id/seconds_label"
            android:singleLine="true"
            android:ellipsize="none"
            style="@style/label"
            android:layout_gravity="bottom"
            android:contentDescription="@string/seconds_label_description"
            android:text="@string/seconds_label"
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:textColor="@color/clock_white"/>

</merge>
+25 −30
Original line number Diff line number Diff line
@@ -17,25 +17,27 @@
package com.android.deskclock.timer;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.Typeface;
import android.util.AttributeSet;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.view.View;

import com.android.deskclock.R;
import com.android.deskclock.ZeroTopPaddingTextView;


public class TimerView extends LinearLayout {

    private ZeroTopPaddingTextView mHoursOnes, mMinutesOnes;
    private ZeroTopPaddingTextView mHoursTens, mMinutesTens;
    private TextView mHoursOnes, mMinutesOnes;
    private TextView mHoursTens, mMinutesTens;
    private TextView mSeconds;
    private final Typeface mAndroidClockMonoThin;
    private Typeface mOriginalHoursTypeface;
    private Typeface mOriginalMinutesTypeface;
    private final int mWhiteColor, mGrayColor;

    @SuppressWarnings("unused")
    public TimerView(Context context) {
        this(context, null);
    }
@@ -45,34 +47,26 @@ public class TimerView extends LinearLayout {

        mAndroidClockMonoThin =
                Typeface.createFromAsset(context.getAssets(), "fonts/AndroidClockMono-Thin.ttf");
        mWhiteColor = context.getResources().getColor(R.color.clock_white);
        mGrayColor = context.getResources().getColor(R.color.clock_gray);

        Resources resources = context.getResources();
        mWhiteColor = resources.getColor(R.color.clock_white);
        mGrayColor = resources.getColor(R.color.clock_gray);
    }

    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();

        mHoursTens = (ZeroTopPaddingTextView)findViewById(R.id.hours_tens);
        mMinutesTens = (ZeroTopPaddingTextView)findViewById(R.id.minutes_tens);
        mHoursOnes = (ZeroTopPaddingTextView)findViewById(R.id.hours_ones);
        mMinutesOnes = (ZeroTopPaddingTextView)findViewById(R.id.minutes_ones);
        mHoursTens = (TextView)findViewById(R.id.hours_tens);
        mMinutesTens = (TextView)findViewById(R.id.minutes_tens);
        mHoursOnes = (TextView)findViewById(R.id.hours_ones);
        mMinutesOnes = (TextView)findViewById(R.id.minutes_ones);
        mSeconds = (TextView)findViewById(R.id.seconds);
        if (mHoursOnes != null) {
            mOriginalHoursTypeface = mHoursOnes.getTypeface();
        }
        // Set the lowest time unit with thin font (excluding hundredths)
        if (mSeconds != null) {
            mSeconds.setTypeface(mAndroidClockMonoThin);
        } else  {
            if (mMinutesTens != null) {
                mMinutesTens.setTypeface(mAndroidClockMonoThin);
                mMinutesTens.updatePadding();
            }
        if (mMinutesOnes != null) {
                mMinutesOnes.setTypeface(mAndroidClockMonoThin);
                mMinutesOnes.updatePadding();
            }
            mOriginalMinutesTypeface = mMinutesOnes.getTypeface();
        }
    }

@@ -87,13 +81,11 @@ public class TimerView extends LinearLayout {
                mHoursTens.setText("-");
                mHoursTens.setTypeface(mAndroidClockMonoThin);
                mHoursTens.setTextColor(mGrayColor);
                mHoursTens.updatePadding();
                mHoursTens.setVisibility(View.VISIBLE);
            } else {
                mHoursTens.setText(String.format("%d",hoursTensDigit));
                mHoursTens.setTypeface(mOriginalHoursTypeface);
                mHoursTens.setTextColor(mWhiteColor);
                mHoursTens.updatePadding();
                mHoursTens.setVisibility(View.VISIBLE);
            }
        }
@@ -102,29 +94,32 @@ public class TimerView extends LinearLayout {
                mHoursOnes.setText("-");
                mHoursOnes.setTypeface(mAndroidClockMonoThin);
                mHoursOnes.setTextColor(mGrayColor);
                mHoursOnes.updatePadding();
            } else {
                mHoursOnes.setText(String.format("%d", hoursOnesDigit));
                mHoursOnes.setTypeface(mOriginalHoursTypeface);
                mHoursOnes.setTextColor(mWhiteColor);
                mHoursOnes.updatePadding();
            }
        }

        if (mMinutesTens != null) {
            if (minutesTensDigit == -1) {
                mMinutesTens.setText("-");
                mMinutesTens.setTypeface(mAndroidClockMonoThin);
                mMinutesTens.setTextColor(mGrayColor);
            } else {
                mMinutesTens.setTextColor(mWhiteColor);
                mMinutesTens.setText(String.format("%d", minutesTensDigit));
                mMinutesTens.setTypeface(mOriginalMinutesTypeface);
                mMinutesTens.setTextColor(mWhiteColor);
            }
        }
        if (mMinutesOnes != null) {
            if (minutesOnesDigit == -1) {
                mMinutesOnes.setText("-");
                mMinutesOnes.setTypeface(mAndroidClockMonoThin);
                mMinutesOnes.setTextColor(mGrayColor);
            } else {
                mMinutesOnes.setText(String.format("%d", minutesOnesDigit));
                mMinutesOnes.setTypeface(mOriginalMinutesTypeface);
                mMinutesOnes.setTextColor(mWhiteColor);
            }
        }