Skip to content

Commit

Permalink
layout
Browse files Browse the repository at this point in the history
enlarges the alarm screen back button (from mini to normal size); realigns the dismiss button to avoid overlap (#777)
  • Loading branch information
forrestguice committed Feb 24, 2024
1 parent 4d8ce34 commit fda7630
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
21 changes: 13 additions & 8 deletions app/src/main/res/layout/layout_activity_dismissalarm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<android.support.constraint.ConstraintLayout
android:layout_width="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:padding="16dp" android:animateLayoutChanges="true">
android:orientation="vertical" android:animateLayoutChanges="true">

<TextView
style="@style/TextAppearance.AppCompat.Large" android:textSize="?attr/text_size_huge"
Expand All @@ -32,6 +32,7 @@
app:layout_constraintVertical_chainStyle="spread"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="@dimen/alarmdismiss_margin" android:layout_marginStart="@dimen/alarmdismiss_margin" android:layout_marginEnd="@dimen/alarmdismiss_margin"
tools:text="Alarm" />

<LinearLayout android:id="@+id/layout_alarm_label2"
Expand All @@ -46,6 +47,7 @@
style="@style/TextAppearance.AppCompat.Small"
android:id="@+id/txt_alarm_offset" android:textSize="?attr/text_size_small"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/alarmdismiss_margin" android:layout_marginEnd="@dimen/alarmdismiss_margin"
android:gravity="bottom|center_horizontal" tools:text="30m before" />

<TextView
Expand All @@ -58,6 +60,7 @@
style="@style/TextAppearance.AppCompat.Medium"
android:id="@+id/txt_alarm_label2"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/alarmdismiss_margin" android:layout_marginEnd="@dimen/alarmdismiss_margin"
android:gravity="top|center_horizontal"
tools:text="Sunrise" />

Expand Down Expand Up @@ -103,13 +106,15 @@
<TextView android:id="@+id/txt_alarm_note"
style="@style/TextAppearance.AppCompat.Small" android:textSize="?attr/text_size_large"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_marginStart="16dp" android:layout_marginEnd="16dp"
android:gravity="bottom|center_horizontal" tools:text="a note that might be more\nthan one line long\neven several\nlines" />

</LinearLayout>

<TextView android:id="@+id/txt_clock_time"
style="@style/SunsetTimeTextView" android:textSize="?attr/text_size_enormous" android:textStyle="bold"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/alarmdismiss_margin" android:layout_marginEnd="@dimen/alarmdismiss_margin"
android:gravity="center"
app:layout_constraintVertical_bias="0.65"
app:layout_constraintEnd_toEndOf="parent"
Expand All @@ -127,7 +132,7 @@

app:layout_constraintEnd_toStartOf="@+id/btn_dismiss"
app:layout_constraintHorizontal_chainStyle="spread"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintStart_toEndOf="@+id/layout_back"
app:layout_constraintTop_toTopOf="@+id/btn_dismiss"
app:layout_constraintBottom_toBottomOf="@+id/btn_dismiss" />

Expand All @@ -144,27 +149,27 @@

<TextView android:id="@+id/txt_snooze" android:visibility="visible"
style="@style/TextAppearance.AppCompat.Small"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_width="0dp" android:layout_height="wrap_content"
android:gravity="center"

app:layout_constraintStart_toStartOf="parent"
app:layout_constraintStart_toEndOf="@+id/layout_back" android:layout_marginBottom="@dimen/alarmdismiss_margin"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
tools:text="Snoozing for 10m" />

<FrameLayout android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom|start"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintBottom_toBottomOf="parent"
android:animateLayoutChanges="true">
android:animateLayoutChanges="true"
android:id="@+id/layout_back">

<android.support.design.widget.FloatingActionButton
android:id="@+id/btn_back" android:visibility="visible"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_width="match_parent" android:layout_height="match_parent"
android:layout_gravity="bottom|start" android:layout_margin="8dp"
android:src="?attr/icActionBack" android:scaleType="center"
android:contentDescription="@android:string/cancel"
app:backgroundTint="?attr/fab_rippleColor" app:rippleColor="?attr/fab_backgroundColor"
app:fabSize="mini"
app:fabSize="normal" app:useCompatPadding="true"
app:layout_dodgeInsetEdges="bottom" />

</FrameLayout>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/alarm_res.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
<integer name="anim_alarmitem_timeout0_duration">1750</integer>
<integer name="anim_alarmitem_timeout1_duration">1000</integer>

<dimen name="alarmdismiss_margin">16dp</dimen>

<dimen name="alarmcard_corners_controls">8dp</dimen>
<dimen name="alarmcard_corners_pressed">8dp</dimen>
<dimen name="alarmcard_corners_enabled">8dp</dimen>
Expand Down

0 comments on commit fda7630

Please sign in to comment.