Skip to content

Commit d57de9d

Browse files
committed
Apply bottom insets to about and settings screens
1 parent e4348a2 commit d57de9d

File tree

3 files changed

+90
-41
lines changed

3 files changed

+90
-41
lines changed

uhabits-android/src/main/java/org/isoron/uhabits/activities/about/AboutView.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import org.isoron.uhabits.BuildConfig
2626
import org.isoron.uhabits.R
2727
import org.isoron.uhabits.core.models.PaletteColor
2828
import org.isoron.uhabits.databinding.AboutBinding
29+
import org.isoron.uhabits.utils.applyBottomInset
2930
import org.isoron.uhabits.utils.applyRootViewInsets
3031
import org.isoron.uhabits.utils.currentTheme
3132
import org.isoron.uhabits.utils.setupToolbar
@@ -55,6 +56,7 @@ class AboutView(
5556
binding.tvTranslate.setOnClickListener { screen.showTranslationWebsite() }
5657
binding.tvVersion.setOnClickListener { screen.onPressDeveloperCountdown() }
5758
binding.tvVersion.text = String.format(version, BuildConfig.VERSION_NAME)
59+
binding.outerLinearLayout.applyBottomInset()
5860
applyRootViewInsets()
5961
}
6062
}

uhabits-android/src/main/java/org/isoron/uhabits/activities/settings/SettingsActivity.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import org.isoron.uhabits.R
2626
import org.isoron.uhabits.activities.AndroidThemeSwitcher
2727
import org.isoron.uhabits.core.models.PaletteColor
2828
import org.isoron.uhabits.databinding.SettingsActivityBinding
29+
import org.isoron.uhabits.utils.applyBottomInset
2930
import org.isoron.uhabits.utils.applyRootViewInsets
3031
import org.isoron.uhabits.utils.setupToolbar
3132

@@ -44,6 +45,7 @@ class SettingsActivity : AppCompatActivity() {
4445
theme = themeSwitcher.currentTheme
4546
)
4647
binding.root.applyRootViewInsets()
48+
binding.root.applyBottomInset()
4749
setContentView(binding.root)
4850
}
4951
}

uhabits-android/src/main/res/layout/about.xml

Lines changed: 86 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<!--
1+
<?xml version="1.0" encoding="utf-8"?><!--
32
~ Copyright (C) 2016-2021 Álinson Santos Xavier <[email protected]>
43
~
54
~ This file is part of Loop Habit Tracker.
@@ -19,16 +18,16 @@
1918
-->
2019

2120
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
22-
android:layout_width="fill_parent"
23-
android:layout_height="fill_parent"
24-
xmlns:app="http://schemas.android.com/apk/res-auto"
25-
android:background="?windowBackgroundColor"
26-
android:fillViewport="true">
21+
android:layout_width="fill_parent"
22+
android:layout_height="fill_parent"
23+
xmlns:app="http://schemas.android.com/apk/res-auto"
24+
android:background="?windowBackgroundColor"
25+
android:fillViewport="true">
2726

2827
<androidx.appcompat.widget.Toolbar
2928
android:id="@+id/toolbar"
3029
app:popupTheme="?toolbarPopupTheme"
31-
style="@style/Toolbar"/>
30+
style="@style/Toolbar" />
3231

3332
<ScrollView
3433
android:id="@+id/scrollView"
@@ -37,6 +36,7 @@
3736
android:layout_below="@id/toolbar">
3837

3938
<LinearLayout
39+
android:id="@+id/outerLinearLayout"
4040
style="@style/CardList">
4141

4242
<LinearLayout
@@ -47,7 +47,7 @@
4747
android:layout_width="100dp"
4848
android:layout_height="100dp"
4949
android:layout_margin="6dp"
50-
android:src="@drawable/intro_icon_1"/>
50+
android:src="@drawable/intro_icon_1" />
5151

5252
<TextView
5353
android:layout_width="wrap_content"
@@ -57,14 +57,14 @@
5757
android:textSize="16sp"
5858
android:layout_margin="6dp"
5959
android:textColor="?aboutScreenColor"
60-
android:text="@string/app_name"/>
60+
android:text="@string/app_name" />
6161

6262
<TextView
6363
android:id="@+id/tvVersion"
6464
android:layout_width="wrap_content"
6565
android:layout_height="wrap_content"
6666
android:gravity="center"
67-
android:text=""/>
67+
android:text="" />
6868

6969
</LinearLayout>
7070

@@ -75,32 +75,32 @@
7575
<TextView
7676
style="@style/CardHeader"
7777
android:text="@string/links"
78-
android:textColor="?aboutScreenColor"/>
78+
android:textColor="?aboutScreenColor" />
7979

8080
<TextView
8181
android:id="@+id/tvRate"
8282
style="@style/About.Item.Clickable"
83-
android:text="@string/pref_rate_this_app"/>
83+
android:text="@string/pref_rate_this_app" />
8484

8585
<TextView
8686
android:id="@+id/tvFeedback"
8787
style="@style/About.Item.Clickable"
88-
android:text="@string/pref_send_feedback"/>
88+
android:text="@string/pref_send_feedback" />
8989

9090
<TextView
9191
android:id="@+id/tvTranslate"
9292
style="@style/About.Item.Clickable"
93-
android:text="@string/help_translate"/>
93+
android:text="@string/help_translate" />
9494

9595
<TextView
9696
android:id="@+id/tvSource"
9797
style="@style/About.Item.Clickable"
98-
android:text="@string/pref_view_source_code"/>
98+
android:text="@string/pref_view_source_code" />
9999

100100
<TextView
101-
android:id="@+id/tvPrivacy"
102-
style="@style/About.Item.Clickable"
103-
android:text="@string/pref_view_privacy"/>
101+
android:id="@+id/tvPrivacy"
102+
style="@style/About.Item.Clickable"
103+
android:text="@string/pref_view_privacy" />
104104

105105
</LinearLayout>
106106

@@ -111,7 +111,7 @@
111111
<TextView
112112
style="@style/CardHeader"
113113
android:text="@string/developers"
114-
android:textColor="?aboutScreenColor"/>
114+
android:textColor="?aboutScreenColor" />
115115

116116
<!--
117117
This file lists developers who contributed with at least 100 lines
@@ -120,31 +120,76 @@
120120
linked at the bottom of the list. If you qualify, please feel free to
121121
submit a pull request adding yourself here.
122122
-->
123-
<TextView style="@style/About.Item" android:text="Álinson S. Xavier (@iSoron)"/>
124-
<TextView style="@style/About.Item" android:text="Quentin Hibon (@hiqua)"/>
125-
<TextView style="@style/About.Item" android:text="Oleg Ivashchenko (@olegivo)"/>
126-
<TextView style="@style/About.Item" android:text="Kristian Tashkov (@KristianTashkov)"/>
127-
<TextView style="@style/About.Item" android:text="Jakub Kalinowski (@kalina559)"/>
128-
<TextView style="@style/About.Item" android:text="Rechee Jozil (@recheej)"/>
129-
<TextView style="@style/About.Item" android:text="Sebastian Gallese (@sgallese)"/>
130-
<TextView style="@style/About.Item" android:text="Luboš Luňák (@llunak)"/>
131-
<TextView style="@style/About.Item" android:text="Bindu (@vbh)"/>
132-
<TextView style="@style/About.Item" android:text="Victor Yu (@vyu1)"/>
133-
<TextView style="@style/About.Item" android:text="Christoph Hennemann (@chennemann)"/>
134-
<TextView style="@style/About.Item" android:text="Денис (@sciamano)"/>
135-
<TextView style="@style/About.Item" android:text="Joseph Tran (@JotraN)"/>
136-
<TextView style="@style/About.Item" android:text="Nikhil (@regularcoder)"/>
137-
<TextView style="@style/About.Item" android:text="JanetQC"/>
138-
<TextView
139-
android:id="@+id/tvContributors"
140-
style="@style/About.Item.Clickable"
141-
android:text="@string/view_all_contributors"/>
123+
<TextView
124+
style="@style/About.Item"
125+
android:text="Álinson S. Xavier (@iSoron)" />
126+
127+
<TextView
128+
style="@style/About.Item"
129+
android:text="Quentin Hibon (@hiqua)" />
130+
131+
<TextView
132+
style="@style/About.Item"
133+
android:text="Oleg Ivashchenko (@olegivo)" />
134+
135+
<TextView
136+
style="@style/About.Item"
137+
android:text="Kristian Tashkov (@KristianTashkov)" />
138+
139+
<TextView
140+
style="@style/About.Item"
141+
android:text="Jakub Kalinowski (@kalina559)" />
142+
143+
<TextView
144+
style="@style/About.Item"
145+
android:text="Rechee Jozil (@recheej)" />
146+
147+
<TextView
148+
style="@style/About.Item"
149+
android:text="Sebastian Gallese (@sgallese)" />
150+
151+
<TextView
152+
style="@style/About.Item"
153+
android:text="Luboš Luňák (@llunak)" />
154+
155+
<TextView
156+
style="@style/About.Item"
157+
android:text="Bindu (@vbh)" />
158+
159+
<TextView
160+
style="@style/About.Item"
161+
android:text="Victor Yu (@vyu1)" />
162+
163+
<TextView
164+
style="@style/About.Item"
165+
android:text="Christoph Hennemann (@chennemann)" />
166+
167+
<TextView
168+
style="@style/About.Item"
169+
android:text="Денис (@sciamano)" />
170+
171+
<TextView
172+
style="@style/About.Item"
173+
android:text="Joseph Tran (@JotraN)" />
174+
175+
<TextView
176+
style="@style/About.Item"
177+
android:text="Nikhil (@regularcoder)" />
178+
179+
<TextView
180+
style="@style/About.Item"
181+
android:text="JanetQC" />
182+
183+
<TextView
184+
android:id="@+id/tvContributors"
185+
style="@style/About.Item.Clickable"
186+
android:text="@string/view_all_contributors" />
142187

143188
</LinearLayout>
144189

145-
<include layout="@layout/about_translators"/>
190+
<include layout="@layout/about_translators" />
146191

147-
>
192+
>
148193
</LinearLayout>
149194
</ScrollView>
150195

0 commit comments

Comments
 (0)