slightly optimize layouts

This commit is contained in:
Phillip Thelen 2022-07-07 10:52:12 +02:00
parent a8d533e570
commit 0e99d17812
9 changed files with 90 additions and 124 deletions

View file

@ -1,32 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/chip"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="52dp"
style="@style/Chip">
<FrameLayout
android:id="@+id/checkbox_wrapper"
android:layout_width="34dp"
android:layout_height="34dp"
android:background="@drawable/circle"
android:layout_marginEnd="6dp"
android:foreground="@drawable/task_score_feedback">
<ImageView
android:id="@+id/checkbox"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/daily_square"
android:scaleType="center"
android:layout_gravity="center"/>
</FrameLayout>
<LinearLayout
android:id="@+id/chip"
android:layout_width="match_parent"
android:layout_height="52dp"
style="@style/Chip">
<FrameLayout
android:id="@+id/checkbox_wrapper"
android:layout_width="34dp"
android:layout_height="34dp"
android:background="@drawable/circle"
android:layout_marginEnd="6dp"
android:foreground="@drawable/task_score_feedback">
<ImageView
android:id="@+id/checkbox"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/daily_square"
android:scaleType="center"
android:layout_gravity="center"/>
</FrameLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.habitrpg.wearos.habitica.ui.views.TaskTextView
android:id="@+id/title"
android:layout_width="wrap_content"
@ -36,6 +33,5 @@
tools:text="Task Title that is long and wraps and"
android:textColor="@color/watch_white"
style="@style/Text.Body1"/>
</LinearLayout>
</LinearLayout>
</FrameLayout>
</LinearLayout>

View file

@ -1,14 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="45dp">
android:layout_height="45dp"
android:orientation="vertical"
android:gravity="center">
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_above="@id/text_view"
android:layout_centerHorizontal="true"
android:layout_marginBottom="2dp"
android:importantForAccessibility="no"
android:src="@mipmap/ic_launcher" />
@ -17,11 +16,9 @@
android:id="@+id/text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:fontFamily="sans-serif"
android:textColor="@color/watch_purple_200"
android:textSize="12sp"
tools:text="Footer Text" />
</RelativeLayout>
</LinearLayout>

View file

@ -1,39 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="52dp"
style="@style/Chip">
<FrameLayout
android:id="@+id/habit_button"
android:layout_width="34dp"
android:layout_height="34dp"
android:background="@drawable/circle"
android:layout_marginEnd="@dimen/spacing_medium"
android:foreground="@drawable/task_score_feedback">
<ImageView
android:id="@+id/habit_button_icon"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="center" />
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="52dp"
style="@style/Chip">
<FrameLayout
android:id="@+id/habit_button"
android:layout_width="34dp"
android:layout_height="34dp"
android:background="@drawable/circle"
android:layout_marginEnd="@dimen/spacing_medium"
android:foreground="@drawable/task_score_feedback"
>
<ImageView
android:id="@+id/habit_button_icon"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="center"/>
</FrameLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.habitrpg.wearos.habitica.ui.views.TaskTextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.habitrpg.wearos.habitica.ui.views.TaskTextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="2"
android:ellipsize="end"
tools:text="Task Title"
android:textColor="@color/watch_white"
style="@style/Text.Body1"/>
</LinearLayout>
android:maxLines="2"
android:ellipsize="end"
tools:text="Task Title"
android:textColor="@color/watch_white"
style="@style/Text.Body1" />
</LinearLayout>
</FrameLayout>
</LinearLayout>

View file

@ -1,16 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:id="@+id/text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="6dp">
<TextView
android:id="@+id/text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textColor="@color/watch_purple_200"
tools:text="Header Text"
style="@style/Text.SubHeader1"/>
</FrameLayout>
android:layout_gravity="center"
android:gravity="center"
android:textColor="@color/watch_purple_200"
tools:text="Header Text"
style="@style/Text.SubHeader1"
android:padding="6dp"/>

View file

@ -1,13 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/row_container"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/row_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
style="@style/Chip">
android:layout_height="wrap_content"
android:orientation="horizontal"
style="@style/Chip">
<ImageView
android:id="@+id/icon_view"
android:layout_width="36dp"
@ -23,12 +20,11 @@
android:layout_height="wrap_content"
android:textColor="@color/watch_white"
style="@style/Text.SubHeader1"/>
<TextView
android:id="@+id/detail_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/Text.Body1"
android:textColor="@color/watch_purple_200"
android:layout_marginEnd="@dimen/spacing_medium"/>
</LinearLayout>
</FrameLayout>
<TextView
android:id="@+id/detail_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/Text.Body1"
android:textColor="@color/watch_purple_200"
android:layout_marginEnd="@dimen/spacing_medium"/>
</LinearLayout>

View file

@ -1,9 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="52dp"
style="@style/Chip">
@ -17,4 +14,3 @@
android:textColor="@color/watch_white"
style="@style/Text.Body1"/>
</LinearLayout>
</FrameLayout>

View file

@ -1,16 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="6dp">
<TextView
android:id="@+id/text_view"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:textColor="@color/watch_purple_200"
tools:text="Header Text"
style="@style/Text.Body1"/>
</FrameLayout>
style="@style/Text.Body1"
android:layout_margin="6dp"/>

View file

@ -1,11 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center">
<LinearLayout
android:id="@+id/row"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -23,5 +18,4 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
</FrameLayout>
</LinearLayout>

View file

@ -1,9 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="52dp"
style="@style/Chip">
@ -36,5 +33,4 @@
android:textColor="@color/watch_white"
style="@style/Text.Body1"/>
</LinearLayout>
</LinearLayout>
</FrameLayout>
</LinearLayout>