lots of edge to edge ui fixes
BIN
Habitica/res/drawable-hdpi/footer_hills.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
Habitica/res/drawable-hdpi/footer_hills_g1g1.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
Habitica/res/drawable-hdpi/footer_stars_left.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
Habitica/res/drawable-hdpi/footer_stars_right.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
Habitica/res/drawable-mdpi/footer_hills.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
Habitica/res/drawable-mdpi/footer_hills_g1g1.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
Habitica/res/drawable-mdpi/footer_stars_left.png
Normal file
|
After Width: | Height: | Size: 647 B |
BIN
Habitica/res/drawable-mdpi/footer_stars_right.png
Normal file
|
After Width: | Height: | Size: 641 B |
BIN
Habitica/res/drawable-xhdpi/footer_hills.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
Habitica/res/drawable-xhdpi/footer_hills_g1g1.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
Habitica/res/drawable-xhdpi/footer_stars_left.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
Habitica/res/drawable-xhdpi/footer_stars_right.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
Habitica/res/drawable-xxhdpi/footer_hills.png
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
BIN
Habitica/res/drawable-xxhdpi/footer_hills_g1g1.png
Normal file
|
After Width: | Height: | Size: 74 KiB |
BIN
Habitica/res/drawable-xxhdpi/footer_stars_left.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
Habitica/res/drawable-xxhdpi/footer_stars_right.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
<androidx.core.widget.NestedScrollView
|
<com.habitrpg.android.habitica.ui.views.HabiticaScrollView
|
||||||
android:id="@+id/nested_scroll_view"
|
android:id="@+id/nested_scroll_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
|
@ -109,5 +109,5 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical" />
|
android:orientation="vertical" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</com.habitrpg.android.habitica.ui.views.HabiticaScrollView>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>
|
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>
|
||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
<androidx.core.widget.NestedScrollView
|
<com.habitrpg.android.habitica.ui.views.HabiticaScrollView
|
||||||
android:id="@+id/nested_scroll_view"
|
android:id="@+id/nested_scroll_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
|
@ -228,5 +228,5 @@
|
||||||
|
|
||||||
</com.habitrpg.android.habitica.ui.helpers.RecyclerViewEmptySupport>
|
</com.habitrpg.android.habitica.ui.helpers.RecyclerViewEmptySupport>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</com.habitrpg.android.habitica.ui.views.HabiticaScrollView>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,12 @@
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical">
|
||||||
tools:context="com.habitrpg.android.habitica.ui.activities.FixCharacterValuesActivity">
|
|
||||||
<com.google.android.material.appbar.AppBarLayout
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
android:id="@+id/appbar"
|
android:id="@+id/appbar"
|
||||||
android:background="?attr/headerBackgroundColor"
|
android:background="?attr/headerBackgroundColor"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<androidx.appcompat.widget.Toolbar
|
<androidx.appcompat.widget.Toolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
@ -21,18 +19,15 @@
|
||||||
style="@style/ToolbarTitleStyle"
|
style="@style/ToolbarTitleStyle"
|
||||||
app:layout_scrollFlags="scroll|enterAlways"
|
app:layout_scrollFlags="scroll|enterAlways"
|
||||||
app:popupTheme="@style/PopupTheme"/>
|
app:popupTheme="@style/PopupTheme"/>
|
||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
<androidx.core.widget.NestedScrollView
|
<com.habitrpg.android.habitica.ui.views.HabiticaScrollView
|
||||||
android:id="@+id/nested_scroll_view"
|
android:id="@+id/nested_scroll_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/blocked_disclaimer_view"
|
android:id="@+id/blocked_disclaimer_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
@ -63,12 +58,10 @@
|
||||||
android:layout_gravity="center" />
|
android:layout_gravity="center" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
style="@style/FlatCardView"
|
style="@style/FlatCardView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
style="@style/CardContent"
|
style="@style/CardContent"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
@ -310,22 +303,26 @@
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:text="STR" />
|
android:text="@string/str_abbrv"
|
||||||
|
android:textAllCaps="true"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:text="INT" />
|
android:text="@string/int_abbrv"
|
||||||
|
android:textAllCaps="true" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:text="CON" />
|
android:text="@string/con_abbrv"
|
||||||
|
android:textAllCaps="true" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:text="PER" />
|
android:text="@string/per_abbrv"
|
||||||
|
android:textAllCaps="true" />
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
||||||
</TableLayout>
|
</TableLayout>
|
||||||
|
|
@ -430,5 +427,5 @@
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</com.habitrpg.android.habitica.ui.views.HabiticaScrollView>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@
|
||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
<androidx.core.widget.NestedScrollView
|
<com.habitrpg.android.habitica.ui.views.HabiticaScrollView
|
||||||
android:id="@+id/nested_scroll_view"
|
android:id="@+id/nested_scroll_view"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
@ -234,5 +234,5 @@
|
||||||
android:textSize="14sp" />
|
android:textSize="14sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</com.habitrpg.android.habitica.ui.views.HabiticaScrollView>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
app:popupTheme="@style/PopupTheme"/>
|
app:popupTheme="@style/PopupTheme"/>
|
||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
<androidx.core.widget.NestedScrollView
|
<com.habitrpg.android.habitica.ui.views.HabiticaScrollView
|
||||||
android:id="@+id/nested_scroll_view"
|
android:id="@+id/nested_scroll_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
|
@ -33,5 +33,5 @@
|
||||||
android:id="@+id/text_view"
|
android:id="@+id/text_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
</androidx.core.widget.NestedScrollView>
|
</com.habitrpg.android.habitica.ui.views.HabiticaScrollView>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,6 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:titleEnabled="false"
|
app:titleEnabled="false"
|
||||||
app:contentScrim="?attr/headerBackgroundColor"
|
app:contentScrim="?attr/headerBackgroundColor"
|
||||||
android:background="?attr/headerBackgroundColor"
|
|
||||||
app:expandedTitleMarginEnd="?attr/actionBarSize"
|
app:expandedTitleMarginEnd="?attr/actionBarSize"
|
||||||
app:expandedTitleMarginStart="0dp"
|
app:expandedTitleMarginStart="0dp"
|
||||||
app:layout_scrollFlags="scroll|exitUntilCollapsed"
|
app:layout_scrollFlags="scroll|exitUntilCollapsed"
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
|
|
||||||
<androidx.core.widget.NestedScrollView
|
<com.habitrpg.android.habitica.ui.views.HabiticaScrollView
|
||||||
android:id="@+id/nested_scroll_view"
|
android:id="@+id/nested_scroll_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
@ -109,7 +109,7 @@
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:showDividers="middle" />
|
android:showDividers="middle" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</com.habitrpg.android.habitica.ui.views.HabiticaScrollView>
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@
|
||||||
</androidx.appcompat.widget.Toolbar>
|
</androidx.appcompat.widget.Toolbar>
|
||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
<androidx.core.widget.NestedScrollView
|
<com.habitrpg.android.habitica.ui.views.HabiticaScrollView
|
||||||
android:id="@+id/nested_scroll_view"
|
android:id="@+id/nested_scroll_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
|
@ -129,6 +129,6 @@
|
||||||
android:textColorLink="?colorAccent"
|
android:textColorLink="?colorAccent"
|
||||||
/>
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</com.habitrpg.android.habitica.ui.views.HabiticaScrollView>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
<androidx.core.widget.NestedScrollView
|
<com.habitrpg.android.habitica.ui.views.HabiticaScrollView
|
||||||
android:id="@+id/nested_scroll_view"
|
android:id="@+id/nested_scroll_view"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
@ -319,5 +319,5 @@
|
||||||
android:divider="@drawable/tag_divider" />
|
android:divider="@drawable/tag_divider" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</com.habitrpg.android.habitica.ui.views.HabiticaScrollView>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
android:layout_marginBottom="@dimen/spacing_large"
|
android:layout_marginBottom="@dimen/spacing_large"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
/>
|
/>
|
||||||
<androidx.core.widget.NestedScrollView
|
<com.habitrpg.android.habitica.ui.views.HabiticaScrollView
|
||||||
android:id="@+id/nested_scroll_view"
|
android:id="@+id/nested_scroll_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
@ -21,5 +21,5 @@
|
||||||
android:id="@+id/container"
|
android:id="@+id/container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
</androidx.core.widget.NestedScrollView>
|
</com.habitrpg.android.habitica.ui.views.HabiticaScrollView>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@
|
||||||
android:paddingEnd="@dimen/spacing_medium"
|
android:paddingEnd="@dimen/spacing_medium"
|
||||||
android:paddingTop="4dp"
|
android:paddingTop="4dp"
|
||||||
android:paddingBottom="4dp"
|
android:paddingBottom="4dp"
|
||||||
|
android:imeOptions="actionSend"
|
||||||
tools:height="200dp"/>
|
tools:height="200dp"/>
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.core.widget.NestedScrollView
|
<com.habitrpg.android.habitica.ui.views.HabiticaScrollView
|
||||||
android:id="@+id/nested_scroll_view" xmlns:android="http://schemas.android.com/apk/res/android"
|
android:id="@+id/nested_scroll_view" xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
|
@ -157,4 +157,4 @@
|
||||||
android:textAllCaps="false"
|
android:textAllCaps="false"
|
||||||
android:textSize="@dimen/card_medium_text" />
|
android:textSize="@dimen/card_medium_text" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</com.habitrpg.android.habitica.ui.views.HabiticaScrollView>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.core.widget.NestedScrollView
|
<com.habitrpg.android.habitica.ui.views.HabiticaScrollView
|
||||||
android:id="@+id/nested_scroll_view" xmlns:android="http://schemas.android.com/apk/res/android"
|
android:id="@+id/nested_scroll_view" xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
|
@ -210,4 +210,4 @@
|
||||||
style="@style/HabiticaButton.Red"/>
|
style="@style/HabiticaButton.Red"/>
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</com.habitrpg.android.habitica.ui.views.HabiticaScrollView>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.core.widget.NestedScrollView
|
<com.habitrpg.android.habitica.ui.views.HabiticaScrollView
|
||||||
android:id="@+id/nested_scroll_view"
|
android:id="@+id/nested_scroll_view"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
@ -8,4 +8,4 @@
|
||||||
android:id="@+id/compose_view"
|
android:id="@+id/compose_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
</androidx.core.widget.NestedScrollView>
|
</com.habitrpg.android.habitica.ui.views.HabiticaScrollView>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.core.widget.NestedScrollView
|
<com.habitrpg.android.habitica.ui.views.HabiticaScrollView
|
||||||
android:id="@+id/nested_scroll_view"
|
android:id="@+id/nested_scroll_view"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
@ -36,4 +36,4 @@
|
||||||
style="@style/Subheader3"
|
style="@style/Subheader3"
|
||||||
/>
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</com.habitrpg.android.habitica.ui.views.HabiticaScrollView>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.core.widget.NestedScrollView
|
<com.habitrpg.android.habitica.ui.views.HabiticaScrollView
|
||||||
android:id="@+id/nested_scroll_view"
|
android:id="@+id/nested_scroll_view"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
|
@ -152,4 +152,4 @@
|
||||||
android:gravity="center"/>
|
android:gravity="center"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</com.habitrpg.android.habitica.ui.views.HabiticaScrollView>
|
||||||
|
|
|
||||||
|
|
@ -1,306 +1,333 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.core.widget.NestedScrollView
|
<com.habitrpg.android.habitica.ui.views.HabiticaScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/nested_scroll_view" xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/nested_scroll_view"
|
||||||
android:layout_height="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:scrollbarSize="3dp"
|
android:layout_height="match_parent"
|
||||||
android:scrollbarThumbVertical="@color/scrollbarThumb"
|
android:scrollbarSize="3dp"
|
||||||
android:scrollbars="vertical">
|
android:scrollbarThumbVertical="@color/scrollbarThumb"
|
||||||
|
app:skipDirectchild="true"
|
||||||
|
android:scrollbars="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<androidx.compose.ui.platform.ComposeView
|
<androidx.compose.ui.platform.ComposeView
|
||||||
android:id="@+id/promo_compose_view"
|
android:id="@+id/promo_compose_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/promo_banner"
|
android:id="@+id/promo_banner"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="96dp"
|
android:layout_height="96dp"
|
||||||
android:background="@drawable/g1g1_box"
|
android:background="@drawable/g1g1_box"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
android:layout_marginEnd="10dp"
|
||||||
android:layout_marginBottom="@dimen/spacing_large"
|
android:layout_marginBottom="@dimen/spacing_large"
|
||||||
android:clipChildren="true"
|
android:clipChildren="true"
|
||||||
android:clipToPadding="true"
|
android:clipToPadding="true"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
tools:visibility="visible">
|
tools:visibility="visible">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/promo_banner_left_image"
|
android:id="@+id/promo_banner_left_image"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:scaleType="center"
|
android:scaleType="center"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:layout_alignParentStart="true"
|
android:layout_alignParentStart="true"
|
||||||
android:layout_alignParentBottom="false"
|
android:layout_alignParentBottom="false"
|
||||||
android:importantForAccessibility="no" />
|
android:importantForAccessibility="no" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/promo_banner_right_image"
|
android:id="@+id/promo_banner_right_image"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:scaleType="center"
|
android:scaleType="center"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:importantForAccessibility="no" />
|
android:importantForAccessibility="no" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_centerInParent="true"
|
android:layout_centerInParent="true"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/promo_banner_title_image"
|
android:id="@+id/promo_banner_title_image"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="6dp" />
|
android:layout_marginBottom="6dp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/promo_banner_title_text"
|
android:id="@+id/promo_banner_title_text"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
android:textSize="22sp"
|
android:textSize="22sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:layout_marginStart="84dp"
|
android:layout_marginStart="84dp"
|
||||||
android:layout_marginEnd="84dp"
|
android:layout_marginEnd="84dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:layout_marginBottom="4dp" />
|
android:layout_marginBottom="4dp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/promo_banner_subtitle_text"
|
android:id="@+id/promo_banner_subtitle_text"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:fontFamily="@string/font_family_medium"
|
android:fontFamily="@string/font_family_medium"
|
||||||
android:layout_marginStart="84dp"
|
android:layout_marginStart="84dp"
|
||||||
android:layout_marginEnd="84dp"
|
android:layout_marginEnd="84dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:layout_marginBottom="6dp" />
|
android:layout_marginBottom="6dp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/promo_banner_duration_view"
|
android:id="@+id/promo_banner_duration_view"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
style="@style/Overline" />
|
style="@style/Overline" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="60dp"
|
android:layout_marginStart="60dp"
|
||||||
android:layout_marginEnd="60dp"
|
android:layout_marginEnd="60dp"
|
||||||
android:gravity="center_horizontal"
|
android:gravity="center_horizontal"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:fontFamily="@string/font_family_medium"
|
android:fontFamily="@string/font_family_medium"
|
||||||
android:layout_marginBottom="12dp"
|
android:layout_marginBottom="12dp"
|
||||||
android:layout_centerInParent="true" />
|
android:layout_centerInParent="true" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
<LinearLayout
|
||||||
<FrameLayout
|
android:layout_width="match_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content">
|
android:orientation="vertical"
|
||||||
|
android:paddingHorizontal="20dp">
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/header_image_view"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:src="@drawable/gem_footer"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="bottom"
|
android:src="@drawable/gem_purchase_header"
|
||||||
android:scaleType="fitXY"
|
android:layout_gravity="center_horizontal"
|
||||||
tools:ignore="ContentDescription" />
|
android:layout_marginBottom="20dp" />
|
||||||
|
|
||||||
<LinearLayout xmlns:app="http://schemas.android.com/apk/res-auto"
|
<TextView
|
||||||
android:orientation="vertical"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:text="@string/gem_purchase_subtitle"
|
||||||
android:paddingHorizontal="20dp">
|
android:gravity="center"
|
||||||
|
android:textStyle="normal|bold"
|
||||||
|
android:textColor="?colorPrimaryText"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:lineSpacingExtra="4dp"
|
||||||
|
android:layout_marginTop="23dp"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:layout_marginStart="@dimen/spacing_xlarge"
|
||||||
|
android:layout_marginEnd="@dimen/spacing_xlarge" />
|
||||||
|
|
||||||
<ImageView
|
<com.habitrpg.android.habitica.ui.views.DayNightTextView
|
||||||
android:id="@+id/header_image_view"
|
android:text="@string/gem_purchase_listitem1"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:src="@drawable/gem_purchase_header"
|
style="@style/GemPurchaseListItem" />
|
||||||
android:layout_gravity="center_horizontal"
|
|
||||||
android:layout_marginBottom="20dp" />
|
|
||||||
|
|
||||||
<TextView
|
<com.habitrpg.android.habitica.ui.views.DayNightTextView
|
||||||
android:layout_width="match_parent"
|
android:text="@string/gem_purchase_listitem2"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:text="@string/gem_purchase_subtitle"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"
|
style="@style/GemPurchaseListItem" />
|
||||||
android:textStyle="normal|bold"
|
|
||||||
android:textColor="?colorPrimaryText"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:lineSpacingExtra="4dp"
|
|
||||||
android:layout_marginTop="23dp"
|
|
||||||
android:layout_marginBottom="12dp"
|
|
||||||
android:layout_marginStart="@dimen/spacing_xlarge"
|
|
||||||
android:layout_marginEnd="@dimen/spacing_xlarge" />
|
|
||||||
|
|
||||||
<com.habitrpg.android.habitica.ui.views.DayNightTextView
|
<com.habitrpg.android.habitica.ui.views.DayNightTextView
|
||||||
android:text="@string/gem_purchase_listitem1"
|
android:text="@string/gem_purchase_listitem3"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
style="@style/GemPurchaseListItem" />
|
style="@style/GemPurchaseListItem" />
|
||||||
|
|
||||||
<com.habitrpg.android.habitica.ui.views.DayNightTextView
|
<com.habitrpg.android.habitica.ui.views.DayNightTextView
|
||||||
android:text="@string/gem_purchase_listitem2"
|
android:text="@string/gem_purchase_listitem4"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
style="@style/GemPurchaseListItem" />
|
style="@style/GemPurchaseListItem" />
|
||||||
|
|
||||||
<com.habitrpg.android.habitica.ui.views.DayNightTextView
|
<com.habitrpg.android.habitica.ui.views.DayNightTextView
|
||||||
android:text="@string/gem_purchase_listitem3"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:text="@string/no_billing_gems"
|
||||||
style="@style/GemPurchaseListItem" />
|
android:paddingTop="50dp"
|
||||||
|
android:paddingBottom="10dp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
<com.habitrpg.android.habitica.ui.views.DayNightTextView
|
<Button
|
||||||
android:text="@string/gem_purchase_listitem4"
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_gravity="center"
|
||||||
style="@style/GemPurchaseListItem" />
|
android:text="@string/visit_habitica_website"
|
||||||
|
android:layout_marginBottom="50dp"
|
||||||
|
style="@style/HabiticaButton.Purple"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
<com.habitrpg.android.habitica.ui.views.DayNightTextView
|
<androidx.compose.ui.platform.ComposeView
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/loading_indicator"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="70dp"
|
||||||
android:text="@string/no_billing_gems"
|
android:layout_height="70dp"
|
||||||
android:paddingTop="50dp"
|
android:layout_gravity="center"
|
||||||
android:paddingBottom="10dp"
|
android:layout_marginVertical="60dp" />
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
<Button
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_marginTop="@dimen/spacing_large">
|
||||||
android:text="@string/visit_habitica_website"
|
|
||||||
android:layout_marginBottom="50dp"
|
|
||||||
style="@style/HabiticaButton.Purple"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
<androidx.compose.ui.platform.ComposeView
|
|
||||||
android:id="@+id/loading_indicator"
|
|
||||||
android:layout_width="70dp"
|
|
||||||
android:layout_height="70dp"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:layout_marginVertical="60dp" />
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/gem_purchase_options"
|
android:id="@+id/gem_purchase_options"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_marginTop="@dimen/spacing_large"
|
||||||
|
app:layout_constraintHeight_default="wrap"
|
||||||
|
app:layout_constraintWidth_default="spread"
|
||||||
|
app:layout_constraintWidth_max="500dp"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="horizontal"
|
||||||
android:visibility="gone"
|
android:layout_marginBottom="16dp">
|
||||||
android:layout_marginTop="@dimen/spacing_large">
|
|
||||||
<LinearLayout
|
<com.habitrpg.android.habitica.ui.GemPurchaseOptionsView
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/gems_4_view"
|
||||||
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:layout_weight="1"
|
||||||
android:layout_marginBottom="16dp">
|
app:gemAmount="4"
|
||||||
|
app:gemDrawable="@drawable/gems_4"
|
||||||
|
android:layout_marginEnd="@dimen/spacing_large" />
|
||||||
|
|
||||||
<com.habitrpg.android.habitica.ui.GemPurchaseOptionsView
|
<com.habitrpg.android.habitica.ui.GemPurchaseOptionsView
|
||||||
android:id="@+id/gems_4_view"
|
android:id="@+id/gems_21_view"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
app:gemAmount="4"
|
app:gemAmount="21"
|
||||||
app:gemDrawable="@drawable/gems_4"
|
app:gemDrawable="@drawable/gems_21" />
|
||||||
android:layout_marginEnd="@dimen/spacing_large" />
|
|
||||||
<com.habitrpg.android.habitica.ui.GemPurchaseOptionsView
|
|
||||||
android:id="@+id/gems_21_view"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
app:gemAmount="21"
|
|
||||||
app:gemDrawable="@drawable/gems_21" />
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:maxWidth="100dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:dividerPadding="16dp"
|
||||||
|
android:showDividers="middle"
|
||||||
|
android:divider="@android:color/white">
|
||||||
|
|
||||||
|
<com.habitrpg.android.habitica.ui.GemPurchaseOptionsView
|
||||||
|
android:id="@+id/gems_42_view"
|
||||||
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:layout_weight="1"
|
||||||
android:dividerPadding="16dp"
|
app:gemAmount="42"
|
||||||
android:showDividers="middle"
|
app:gemDrawable="@drawable/gems_42"
|
||||||
android:divider="@android:color/white">
|
android:layout_marginEnd="@dimen/spacing_large" />
|
||||||
|
|
||||||
<com.habitrpg.android.habitica.ui.GemPurchaseOptionsView
|
<com.habitrpg.android.habitica.ui.GemPurchaseOptionsView
|
||||||
android:id="@+id/gems_42_view"
|
android:id="@+id/gems_84_view"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
app:gemAmount="42"
|
app:gemAmount="84"
|
||||||
app:gemDrawable="@drawable/gems_42"
|
app:gemDrawable="@drawable/gems_84" />
|
||||||
android:layout_marginEnd="@dimen/spacing_large" />
|
|
||||||
|
|
||||||
<com.habitrpg.android.habitica.ui.GemPurchaseOptionsView
|
|
||||||
android:id="@+id/gems_84_view"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
app:gemAmount="84"
|
|
||||||
app:gemDrawable="@drawable/gems_84" />
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:src="@drawable/gift_sub_gift"
|
||||||
|
android:layout_marginTop="30dp"
|
||||||
|
android:layout_marginBottom="6dp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@color/text_quad"
|
||||||
|
android:text="@string/gems_gift_description"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:layout_marginStart="@dimen/spacing_xlarge"
|
||||||
|
android:layout_marginEnd="@dimen/spacing_xlarge" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/gift_gems_button"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/gift_gems"
|
||||||
|
android:background="@color/transparent"
|
||||||
|
android:textColor="?colorPrimaryText"
|
||||||
|
android:textAllCaps="false" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/footer_hills"
|
||||||
|
android:layout_gravity="bottom">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:src="@drawable/footer_stars_right"
|
||||||
android:src="@drawable/gift_sub_gift"
|
android:layout_gravity="center_horizontal"
|
||||||
android:layout_marginTop="30dp"
|
android:scaleType="fitCenter" />
|
||||||
android:layout_marginBottom="6dp" />
|
|
||||||
|
|
||||||
<TextView
|
<ImageView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="@color/text_quad"
|
android:src="@drawable/footer_stars_left"
|
||||||
android:text="@string/gems_gift_description"
|
android:layout_gravity="center_horizontal"
|
||||||
android:gravity="center_horizontal"
|
android:scaleType="fitCenter" />
|
||||||
android:layout_marginStart="@dimen/spacing_xlarge"
|
</FrameLayout>
|
||||||
android:layout_marginEnd="@dimen/spacing_xlarge" />
|
|
||||||
|
|
||||||
<Button
|
<TextView
|
||||||
android:id="@+id/gift_gems_button"
|
android:id="@+id/supportTextView"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/gift_gems"
|
|
||||||
android:background="@color/transparent"
|
|
||||||
android:textColor="?colorPrimaryText"
|
|
||||||
android:textAllCaps="false" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/supportTextView"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:paddingStart="41dp"
|
|
||||||
android:paddingEnd="41dp"
|
|
||||||
android:paddingTop="70dp"
|
|
||||||
android:text="@string/gem_purchase_title"
|
|
||||||
android:layout_gravity="center_horizontal"
|
|
||||||
android:gravity="center"
|
|
||||||
android:lineSpacingExtra="3dp"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
style="@style/Caption2"
|
|
||||||
android:drawablePadding="@dimen/spacing_medium" />
|
|
||||||
</LinearLayout>
|
|
||||||
</FrameLayout>
|
|
||||||
<View
|
|
||||||
android:id="@+id/bottom_spacing"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp"
|
android:paddingStart="41dp"
|
||||||
android:background="@color/brand_400"/>
|
android:paddingEnd="41dp"
|
||||||
|
android:text="@string/gem_purchase_title"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:gravity="center"
|
||||||
|
android:lineSpacingExtra="3dp"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
style="@style/Caption2"
|
||||||
|
android:background="@color/brand_400"
|
||||||
|
android:drawablePadding="@dimen/spacing_medium" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/bottom_spacing"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:background="@color/brand_400" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</com.habitrpg.android.habitica.ui.views.HabiticaScrollView>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.core.widget.NestedScrollView
|
<com.habitrpg.android.habitica.ui.views.HabiticaScrollView
|
||||||
android:id="@+id/nested_scroll_view" android:orientation="vertical"
|
android:id="@+id/nested_scroll_view" android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
|
@ -83,4 +83,4 @@
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</com.habitrpg.android.habitica.ui.views.HabiticaScrollView>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.core.widget.NestedScrollView
|
<com.habitrpg.android.habitica.ui.views.HabiticaScrollView
|
||||||
android:id="@+id/nested_scroll_view" android:orientation="vertical"
|
android:id="@+id/nested_scroll_view" android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
|
@ -105,4 +105,4 @@
|
||||||
android:layout_marginBottom="@dimen/spacing_xlarge"
|
android:layout_marginBottom="@dimen/spacing_xlarge"
|
||||||
style="@style/Caption2"/>
|
style="@style/Caption2"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</com.habitrpg.android.habitica.ui.views.HabiticaScrollView>
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/refreshLayout">
|
android:id="@+id/refreshLayout">
|
||||||
<androidx.core.widget.NestedScrollView
|
<com.habitrpg.android.habitica.ui.views.HabiticaScrollView
|
||||||
android:id="@+id/nested_scroll_view"
|
android:id="@+id/nested_scroll_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
@ -196,5 +196,5 @@
|
||||||
style="@style/HabiticaButton.Red"
|
style="@style/HabiticaButton.Red"
|
||||||
android:text="@string/leave_guild"/>
|
android:text="@string/leave_guild"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</com.habitrpg.android.habitica.ui.views.HabiticaScrollView>
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
|
|
||||||
<androidx.core.widget.NestedScrollView
|
<com.habitrpg.android.habitica.ui.views.HabiticaScrollView
|
||||||
android:id="@+id/nested_scroll_view"
|
android:id="@+id/nested_scroll_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
@ -44,5 +44,5 @@
|
||||||
android:divider="?android:listDivider"
|
android:divider="?android:listDivider"
|
||||||
android:showDividers="middle" />
|
android:showDividers="middle" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</com.habitrpg.android.habitica.ui.views.HabiticaScrollView>
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<androidx.core.widget.NestedScrollView
|
<com.habitrpg.android.habitica.ui.views.HabiticaScrollView
|
||||||
android:id="@+id/nested_scroll_view"
|
android:id="@+id/nested_scroll_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
|
@ -200,5 +200,5 @@
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</com.habitrpg.android.habitica.ui.views.HabiticaScrollView>
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
android:id="@+id/refreshLayout"
|
android:id="@+id/refreshLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
<androidx.core.widget.NestedScrollView
|
<com.habitrpg.android.habitica.ui.views.HabiticaScrollView
|
||||||
android:id="@+id/nested_scroll_view"
|
android:id="@+id/nested_scroll_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
@ -268,5 +268,5 @@
|
||||||
android:text="@string/leave_party"
|
android:text="@string/leave_party"
|
||||||
android:textSize="16sp" />
|
android:textSize="16sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</com.habitrpg.android.habitica.ui.views.HabiticaScrollView>
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.core.widget.NestedScrollView
|
<com.habitrpg.android.habitica.ui.views.HabiticaScrollView
|
||||||
android:id="@+id/nested_scroll_view"
|
android:id="@+id/nested_scroll_view"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:orientation="vertical" android:layout_width="match_parent"
|
android:orientation="vertical" android:layout_width="match_parent"
|
||||||
|
|
@ -32,4 +32,4 @@
|
||||||
android:text="@string/add_invites"
|
android:text="@string/add_invites"
|
||||||
android:layout_margin="@dimen/row_padding" />
|
android:layout_margin="@dimen/row_padding" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</com.habitrpg.android.habitica.ui.views.HabiticaScrollView>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.core.widget.NestedScrollView
|
<com.habitrpg.android.habitica.ui.views.HabiticaScrollView
|
||||||
android:id="@+id/nested_scroll_view" xmlns:android="http://schemas.android.com/apk/res/android"
|
android:id="@+id/nested_scroll_view" xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
|
@ -139,4 +139,4 @@
|
||||||
tools:text="This is some text"
|
tools:text="This is some text"
|
||||||
android:lineSpacingExtra="3dp"/>
|
android:lineSpacingExtra="3dp"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</com.habitrpg.android.habitica.ui.views.HabiticaScrollView>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.core.widget.NestedScrollView
|
<com.habitrpg.android.habitica.ui.views.HabiticaScrollView
|
||||||
android:id="@+id/nested_scroll_view"
|
android:id="@+id/nested_scroll_view"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
|
@ -136,4 +136,4 @@
|
||||||
style="@style/HabiticaButton.Red" />
|
style="@style/HabiticaButton.Red" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</com.habitrpg.android.habitica.ui.views.HabiticaScrollView>
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@
|
||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
<androidx.core.widget.NestedScrollView
|
<com.habitrpg.android.habitica.ui.views.HabiticaScrollView
|
||||||
android:id="@+id/nested_scroll_view"
|
android:id="@+id/nested_scroll_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
|
@ -167,5 +167,5 @@
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
tools:text="@string/report_message_explanation" />
|
tools:text="@string/report_message_explanation" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</com.habitrpg.android.habitica.ui.views.HabiticaScrollView>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.core.widget.NestedScrollView
|
<com.habitrpg.android.habitica.ui.views.HabiticaScrollView
|
||||||
android:id="@+id/nested_scroll_view"
|
android:id="@+id/nested_scroll_view"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
@ -234,4 +234,4 @@
|
||||||
android:layout_marginBottom="28dp"/>
|
android:layout_marginBottom="28dp"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</com.habitrpg.android.habitica.ui.views.HabiticaScrollView>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.core.widget.NestedScrollView
|
<com.habitrpg.android.habitica.ui.views.HabiticaScrollView
|
||||||
android:id="@+id/nested_scroll_view"
|
android:id="@+id/nested_scroll_view"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
|
@ -9,7 +9,8 @@
|
||||||
android:scrollbarSize="3dp"
|
android:scrollbarSize="3dp"
|
||||||
android:scrollbarThumbVertical="@color/scrollbarThumb"
|
android:scrollbarThumbVertical="@color/scrollbarThumb"
|
||||||
android:background="@color/brand_300"
|
android:background="@color/brand_300"
|
||||||
android:scrollbars="vertical">
|
android:scrollbars="vertical"
|
||||||
|
app:skipDirectchild="true">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
@ -388,12 +389,23 @@
|
||||||
layout="@layout/gift_segment" />
|
layout="@layout/gift_segment" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<ImageView
|
<FrameLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/footer_hills">
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:src="@drawable/subscription_bg"
|
android:src="@drawable/footer_stars_right"
|
||||||
android:scaleType="centerCrop" />
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:scaleType="fitCenter" />
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@drawable/footer_stars_left"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:scaleType="fitCenter" />
|
||||||
|
</FrameLayout>
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|
@ -428,4 +440,4 @@
|
||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
android:background="@color/brand_400"/>
|
android:background="@color/brand_400"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</com.habitrpg.android.habitica.ui.views.HabiticaScrollView>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.core.widget.NestedScrollView
|
<com.habitrpg.android.habitica.ui.views.HabiticaScrollView
|
||||||
android:id="@+id/nested_scroll_view" xmlns:android="http://schemas.android.com/apk/res/android"
|
android:id="@+id/nested_scroll_view" xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
|
@ -137,4 +137,4 @@
|
||||||
android:layout_marginStart="@dimen/spacing_large"
|
android:layout_marginStart="@dimen/spacing_large"
|
||||||
android:layout_marginEnd="@dimen/spacing_large" />
|
android:layout_marginEnd="@dimen/spacing_large" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</com.habitrpg.android.habitica.ui.views.HabiticaScrollView>
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,15 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.core.widget.NestedScrollView
|
<com.habitrpg.android.habitica.ui.views.HabiticaScrollView android:id="@+id/nested_scroll_view"
|
||||||
android:id="@+id/nested_scroll_view" xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent"
|
||||||
|
app:skipDirectchild="true"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/scroll_content"
|
android:id="@+id/scroll_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
android:background="@drawable/layout_rounded_bg_window">
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|
@ -165,11 +166,11 @@
|
||||||
/>
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<View
|
<FrameLayout
|
||||||
android:id="@+id/reset_tutorial_button_wrapper"
|
android:id="@+id/reset_tutorial_button_wrapper"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp"
|
android:layout_height="wrap_content"
|
||||||
android:background="?attr/colorContentBackgroundOffset"/>
|
android:background="?attr/colorWindowBackground">
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/reset_tutorial_button"
|
android:id="@+id/reset_tutorial_button"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
@ -178,5 +179,6 @@
|
||||||
android:textColor="@color/text_primary"
|
android:textColor="@color/text_primary"
|
||||||
android:text="@string/reset_walkthrough"
|
android:text="@string/reset_walkthrough"
|
||||||
android:layout_margin="@dimen/spacing_large"/>
|
android:layout_margin="@dimen/spacing_large"/>
|
||||||
|
</FrameLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</com.habitrpg.android.habitica.ui.views.HabiticaScrollView>
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@
|
||||||
<attr name="widgetBackgroundRadius" format="dimension" />
|
<attr name="widgetBackgroundRadius" format="dimension" />
|
||||||
<attr name="currency" format="string" />
|
<attr name="currency" format="string" />
|
||||||
<attr name="color" format="color" />
|
<attr name="color" format="color" />
|
||||||
|
<attr name="ignoreScrollViewWindowInsets" format="boolean" />
|
||||||
|
|
||||||
<declare-styleable name="GemPurchaseOptionsView">
|
<declare-styleable name="GemPurchaseOptionsView">
|
||||||
<attr name="gemAmount" format="integer" />
|
<attr name="gemAmount" format="integer" />
|
||||||
|
|
@ -146,4 +147,7 @@
|
||||||
<attr name="maxSpacing" format="dimension" />
|
<attr name="maxSpacing" format="dimension" />
|
||||||
<attr name="duration" format="integer" />
|
<attr name="duration" format="integer" />
|
||||||
</declare-styleable>
|
</declare-styleable>
|
||||||
|
<declare-styleable name="HabiticaScrollView">
|
||||||
|
<attr name="skipDirectchild" format="boolean" />
|
||||||
|
</declare-styleable>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
||||||
|
|
@ -22,11 +22,16 @@ fun applyScrollContentWindowInsets(view: View,
|
||||||
val bottomPadding = view.paddingBottom
|
val bottomPadding = view.paddingBottom
|
||||||
ViewCompat.setOnApplyWindowInsetsListener(view) { v, windowInsets ->
|
ViewCompat.setOnApplyWindowInsetsListener(view) { v, windowInsets ->
|
||||||
val insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars() + WindowInsetsCompat.Type.displayCutout())
|
val insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars() + WindowInsetsCompat.Type.displayCutout())
|
||||||
|
val top = (if (applyTop) insets.top else 0) + topPadding
|
||||||
|
val bottom = (if (applyBottom) insets.bottom else 0) + bottomPadding
|
||||||
|
if (v.layoutParams.height > 0 && v.layoutParams.height < top + bottom) {
|
||||||
|
v.layoutParams.height += top + bottom
|
||||||
|
}
|
||||||
v.updatePadding(
|
v.updatePadding(
|
||||||
top = (if (applyTop) insets.top else 0) + topPadding,
|
top = top,
|
||||||
left = (if (applyLeft) insets.left else 0) + leftPadding,
|
left = (if (applyLeft) insets.left else 0) + leftPadding,
|
||||||
right = (if (applyRight) insets.right else 0) + rightPadding,
|
right = (if (applyRight) insets.right else 0) + rightPadding,
|
||||||
bottom = (if (applyBottom) insets.bottom else 0) + bottomPadding)
|
bottom = bottom)
|
||||||
consumeWindowInsetsAbove30(windowInsets)
|
consumeWindowInsetsAbove30(windowInsets)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,14 +8,9 @@ import android.view.View
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import androidx.core.app.NavUtils
|
import androidx.core.app.NavUtils
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.core.view.ViewCompat
|
|
||||||
import androidx.core.view.WindowInsetsCompat
|
|
||||||
import androidx.core.view.updatePadding
|
|
||||||
import com.habitrpg.android.habitica.R
|
import com.habitrpg.android.habitica.R
|
||||||
import com.habitrpg.android.habitica.databinding.ActivityAdventureGuideBinding
|
import com.habitrpg.android.habitica.databinding.ActivityAdventureGuideBinding
|
||||||
import com.habitrpg.android.habitica.databinding.AdventureGuideItemBinding
|
import com.habitrpg.android.habitica.databinding.AdventureGuideItemBinding
|
||||||
import com.habitrpg.android.habitica.extensions.applyScrollContentWindowInsets
|
|
||||||
import com.habitrpg.android.habitica.extensions.consumeWindowInsetsAbove30
|
|
||||||
import com.habitrpg.android.habitica.helpers.Analytics
|
import com.habitrpg.android.habitica.helpers.Analytics
|
||||||
import com.habitrpg.android.habitica.models.user.User
|
import com.habitrpg.android.habitica.models.user.User
|
||||||
import com.habitrpg.android.habitica.ui.viewmodels.MainUserViewModel
|
import com.habitrpg.android.habitica.ui.viewmodels.MainUserViewModel
|
||||||
|
|
@ -77,11 +72,6 @@ class AdventureGuideActivity : BaseActivity() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onAttachedToWindow() {
|
|
||||||
super.onAttachedToWindow()
|
|
||||||
applyScrollContentWindowInsets(binding.scrollContent)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
return if (item.itemId == android.R.id.home) {
|
return if (item.itemId == android.R.id.home) {
|
||||||
NavUtils.navigateUpFromSameTask(this)
|
NavUtils.navigateUpFromSameTask(this)
|
||||||
|
|
|
||||||
|
|
@ -25,9 +25,12 @@ import androidx.core.net.toUri
|
||||||
import androidx.core.view.ViewCompat
|
import androidx.core.view.ViewCompat
|
||||||
import androidx.core.view.WindowCompat
|
import androidx.core.view.WindowCompat
|
||||||
import androidx.core.view.WindowInsetsCompat
|
import androidx.core.view.WindowInsetsCompat
|
||||||
|
import androidx.core.view.children
|
||||||
import androidx.core.view.updatePadding
|
import androidx.core.view.updatePadding
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import androidx.preference.PreferenceManager
|
import androidx.preference.PreferenceManager
|
||||||
|
import com.google.android.material.appbar.AppBarLayout
|
||||||
|
import com.google.android.material.tabs.TabLayout
|
||||||
import com.habitrpg.android.habitica.HabiticaApplication
|
import com.habitrpg.android.habitica.HabiticaApplication
|
||||||
import com.habitrpg.android.habitica.R
|
import com.habitrpg.android.habitica.R
|
||||||
import com.habitrpg.android.habitica.data.UserRepository
|
import com.habitrpg.android.habitica.data.UserRepository
|
||||||
|
|
@ -143,9 +146,12 @@ abstract class BaseActivity : AppCompatActivity() {
|
||||||
WindowInsetsCompat.Type.systemBars()
|
WindowInsetsCompat.Type.systemBars()
|
||||||
+ WindowInsetsCompat.Type.displayCutout()
|
+ WindowInsetsCompat.Type.displayCutout()
|
||||||
)
|
)
|
||||||
v.updatePadding(top = insets.top + paddingTop,
|
v.updatePadding(top = insets.top + paddingTop)
|
||||||
left = insets.left,
|
(v as AppBarLayout).children.forEach {
|
||||||
right = insets.right)
|
if (it !is TabLayout) {
|
||||||
|
it.updatePadding(left = insets.left, right = insets.right)
|
||||||
|
}
|
||||||
|
}
|
||||||
consumeWindowInsetsAbove30(windowInsets)
|
consumeWindowInsetsAbove30(windowInsets)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -253,7 +253,7 @@ class FullProfileActivity : BaseActivity() {
|
||||||
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.S_V2) {
|
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.S_V2) {
|
||||||
HabiticaSnackbar.showSnackbar(
|
HabiticaSnackbar.showSnackbar(
|
||||||
this@FullProfileActivity.binding.nestedScrollView.getChildAt(0) as ViewGroup,
|
this@FullProfileActivity.binding.nestedScrollView.getChildAt(0) as ViewGroup,
|
||||||
String.format(getString(R.string.username_copied), userDisplayName),
|
getString(R.string.username_copied),
|
||||||
SnackbarDisplayType.NORMAL
|
SnackbarDisplayType.NORMAL
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
@ -268,7 +268,7 @@ class FullProfileActivity : BaseActivity() {
|
||||||
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.S_V2) {
|
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.S_V2) {
|
||||||
HabiticaSnackbar.showSnackbar(
|
HabiticaSnackbar.showSnackbar(
|
||||||
this@FullProfileActivity.binding.nestedScrollView.getChildAt(0) as ViewGroup,
|
this@FullProfileActivity.binding.nestedScrollView.getChildAt(0) as ViewGroup,
|
||||||
String.format(getString(R.string.id_copied), userDisplayName),
|
getString(R.string.id_copied),
|
||||||
SnackbarDisplayType.NORMAL
|
SnackbarDisplayType.NORMAL
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,6 @@ import android.view.ViewGroup
|
||||||
import android.view.WindowManager
|
import android.view.WindowManager
|
||||||
import android.widget.CheckBox
|
import android.widget.CheckBox
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import androidx.activity.SystemBarStyle
|
|
||||||
import androidx.activity.result.contract.ActivityResultContracts
|
import androidx.activity.result.contract.ActivityResultContracts
|
||||||
import androidx.activity.viewModels
|
import androidx.activity.viewModels
|
||||||
import androidx.appcompat.widget.AppCompatCheckBox
|
import androidx.appcompat.widget.AppCompatCheckBox
|
||||||
|
|
@ -32,13 +31,10 @@ import androidx.compose.runtime.mutableStateListOf
|
||||||
import androidx.compose.runtime.mutableStateMapOf
|
import androidx.compose.runtime.mutableStateMapOf
|
||||||
import androidx.compose.runtime.toMutableStateList
|
import androidx.compose.runtime.toMutableStateList
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.core.view.ViewCompat
|
|
||||||
import androidx.core.view.WindowInsetsCompat
|
|
||||||
import androidx.core.view.children
|
import androidx.core.view.children
|
||||||
import androidx.core.view.forEachIndexed
|
import androidx.core.view.forEachIndexed
|
||||||
import androidx.core.view.isVisible
|
import androidx.core.view.isVisible
|
||||||
import androidx.core.view.iterator
|
import androidx.core.view.iterator
|
||||||
import androidx.core.view.updatePadding
|
|
||||||
import androidx.core.widget.NestedScrollView
|
import androidx.core.widget.NestedScrollView
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import com.habitrpg.android.habitica.R
|
import com.habitrpg.android.habitica.R
|
||||||
|
|
@ -49,8 +45,6 @@ import com.habitrpg.android.habitica.data.TaskRepository
|
||||||
import com.habitrpg.android.habitica.databinding.ActivityTaskFormBinding
|
import com.habitrpg.android.habitica.databinding.ActivityTaskFormBinding
|
||||||
import com.habitrpg.android.habitica.extensions.OnChangeTextWatcher
|
import com.habitrpg.android.habitica.extensions.OnChangeTextWatcher
|
||||||
import com.habitrpg.android.habitica.extensions.addCancelButton
|
import com.habitrpg.android.habitica.extensions.addCancelButton
|
||||||
import com.habitrpg.android.habitica.extensions.applyScrollContentWindowInsets
|
|
||||||
import com.habitrpg.android.habitica.extensions.consumeWindowInsetsAbove30
|
|
||||||
import com.habitrpg.android.habitica.helpers.AppConfigManager
|
import com.habitrpg.android.habitica.helpers.AppConfigManager
|
||||||
import com.habitrpg.android.habitica.helpers.TaskAlarmManager
|
import com.habitrpg.android.habitica.helpers.TaskAlarmManager
|
||||||
import com.habitrpg.android.habitica.helpers.notifications.PushNotificationManager
|
import com.habitrpg.android.habitica.helpers.notifications.PushNotificationManager
|
||||||
|
|
@ -432,12 +426,7 @@ class TaskFormActivity : BaseActivity() {
|
||||||
}
|
}
|
||||||
|
|
||||||
configureForm()
|
configureForm()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onAttachedToWindow() {
|
|
||||||
super.onAttachedToWindow()
|
|
||||||
applyScrollContentWindowInsets(binding.mainFormContent)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
checkIfShowNotifLayout()
|
checkIfShowNotifLayout()
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import android.view.MenuInflater
|
||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.view.WindowInsetsController
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.core.os.bundleOf
|
import androidx.core.os.bundleOf
|
||||||
import androidx.core.view.WindowCompat
|
import androidx.core.view.WindowCompat
|
||||||
import androidx.viewbinding.ViewBinding
|
import androidx.viewbinding.ViewBinding
|
||||||
|
|
@ -87,6 +87,7 @@ abstract class BaseMainFragment<VB : ViewBinding> : BaseFragment<VB>() {
|
||||||
binding = null
|
binding = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var navigationBarColor: Int? = null
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
mainActivity?.showBackButton = showsBackButton
|
mainActivity?.showBackButton = showsBackButton
|
||||||
|
|
@ -108,6 +109,7 @@ abstract class BaseMainFragment<VB : ViewBinding> : BaseFragment<VB>() {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||||
window.isNavigationBarContrastEnforced = true
|
window.isNavigationBarContrastEnforced = true
|
||||||
}
|
}
|
||||||
|
activity?.window?.navigationBarColor = navigationBarColor ?: ContextCompat.getColor(requireContext(), R.color.content_background)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -118,7 +120,8 @@ abstract class BaseMainFragment<VB : ViewBinding> : BaseFragment<VB>() {
|
||||||
inflater: MenuInflater
|
inflater: MenuInflater
|
||||||
) {
|
) {
|
||||||
super.onCreateOptionsMenu(menu, inflater)
|
super.onCreateOptionsMenu(menu, inflater)
|
||||||
mainActivity?.toolbar?.let { ToolbarColorHelper.colorizeToolbar(it, mainActivity) }
|
mainActivity?.toolbar?.let { ToolbarColorHelper.colorizeToolbar(it, mainActivity,
|
||||||
|
appbar = mainActivity?.findViewById(R.id.appbar)) }
|
||||||
updateToolbarInteractivity()
|
updateToolbarInteractivity()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.habitrpg.android.habitica.ui.fragments.inventory.customization
|
package com.habitrpg.android.habitica.ui.fragments.inventory.customization
|
||||||
|
|
||||||
|
import android.content.res.Configuration
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.Menu
|
import android.view.Menu
|
||||||
|
|
@ -9,21 +10,22 @@ import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.AdapterView
|
import android.widget.AdapterView
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.gestures.Orientation
|
|
||||||
import androidx.compose.foundation.gestures.rememberScrollableState
|
|
||||||
import androidx.compose.foundation.gestures.scrollable
|
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.ExperimentalLayoutApi
|
import androidx.compose.foundation.layout.ExperimentalLayoutApi
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.foundation.layout.Spacer
|
import androidx.compose.foundation.layout.Spacer
|
||||||
import androidx.compose.foundation.layout.WindowInsets
|
import androidx.compose.foundation.layout.WindowInsets
|
||||||
|
import androidx.compose.foundation.layout.add
|
||||||
|
import androidx.compose.foundation.layout.asPaddingValues
|
||||||
|
import androidx.compose.foundation.layout.calculateEndPadding
|
||||||
|
import androidx.compose.foundation.layout.calculateStartPadding
|
||||||
|
import androidx.compose.foundation.layout.displayCutout
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.height
|
|
||||||
import androidx.compose.foundation.layout.navigationBarsIgnoringVisibility
|
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.size
|
import androidx.compose.foundation.layout.size
|
||||||
import androidx.compose.foundation.layout.windowInsetsBottomHeight
|
import androidx.compose.foundation.layout.systemBars
|
||||||
|
import androidx.compose.foundation.layout.widthIn
|
||||||
import androidx.compose.foundation.rememberScrollState
|
import androidx.compose.foundation.rememberScrollState
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.foundation.verticalScroll
|
import androidx.compose.foundation.verticalScroll
|
||||||
|
|
@ -37,19 +39,18 @@ import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.draw.alpha
|
import androidx.compose.ui.draw.alpha
|
||||||
import androidx.compose.ui.draw.clip
|
import androidx.compose.ui.draw.clip
|
||||||
import androidx.compose.ui.draw.clipToBounds
|
import androidx.compose.ui.platform.LocalConfiguration
|
||||||
|
import androidx.compose.ui.platform.LocalLayoutDirection
|
||||||
import androidx.compose.ui.platform.ViewCompositionStrategy
|
import androidx.compose.ui.platform.ViewCompositionStrategy
|
||||||
import androidx.compose.ui.res.colorResource
|
import androidx.compose.ui.res.colorResource
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.core.view.WindowInsetsCompat
|
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import androidx.lifecycle.map
|
import androidx.lifecycle.map
|
||||||
import com.habitrpg.android.habitica.R
|
import com.habitrpg.android.habitica.R
|
||||||
import com.habitrpg.android.habitica.data.InventoryRepository
|
import com.habitrpg.android.habitica.data.InventoryRepository
|
||||||
import com.habitrpg.android.habitica.databinding.FragmentComposeBinding
|
import com.habitrpg.android.habitica.databinding.FragmentComposeBinding
|
||||||
import com.habitrpg.android.habitica.databinding.FragmentComposeScrollingBinding
|
|
||||||
import com.habitrpg.android.habitica.helpers.AppConfigManager
|
import com.habitrpg.android.habitica.helpers.AppConfigManager
|
||||||
import com.habitrpg.android.habitica.interactors.ShareAvatarUseCase
|
import com.habitrpg.android.habitica.interactors.ShareAvatarUseCase
|
||||||
import com.habitrpg.android.habitica.models.inventory.Equipment
|
import com.habitrpg.android.habitica.models.inventory.Equipment
|
||||||
|
|
@ -108,24 +109,33 @@ open class AvatarOverviewFragment :
|
||||||
setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed)
|
setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed)
|
||||||
setContent {
|
setContent {
|
||||||
HabiticaTheme {
|
HabiticaTheme {
|
||||||
|
val configuration = LocalConfiguration.current
|
||||||
|
val isWidthGreaterHeight = configuration.screenWidthDp > configuration.screenHeightDp
|
||||||
|
|
||||||
val avatar by userViewModel.user.observeAsState()
|
val avatar by userViewModel.user.observeAsState()
|
||||||
Column {
|
Column {
|
||||||
Column(horizontalAlignment = Alignment.CenterHorizontally, modifier = Modifier.fillMaxWidth().background(colorResource(R.color.window_background))) {
|
Column(horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.background(colorResource(R.color.window_background))) {
|
||||||
ComposableAvatarView(
|
ComposableAvatarView(
|
||||||
avatar = avatar,
|
avatar = avatar,
|
||||||
configManager = appConfigManager,
|
configManager = appConfigManager,
|
||||||
modifier =
|
modifier =
|
||||||
Modifier
|
Modifier
|
||||||
.padding(bottom = 24.dp)
|
.padding(bottom = if (isWidthGreaterHeight) 8.dp else 24.dp)
|
||||||
.size(140.dp, 147.dp)
|
.size(140.dp, 147.dp)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
val insets = WindowInsets.systemBars.add(WindowInsets.displayCutout).asPaddingValues()
|
||||||
|
val ld = LocalLayoutDirection.current
|
||||||
Column(modifier = Modifier
|
Column(modifier = Modifier
|
||||||
|
.padding(bottom = insets.calculateBottomPadding())
|
||||||
.background(colorResource(R.color.window_background))
|
.background(colorResource(R.color.window_background))
|
||||||
|
.padding(start = insets.calculateStartPadding(ld), end = insets.calculateEndPadding(ld))
|
||||||
.clip(RoundedCornerShape(topStart = 22.dp, topEnd = 22.dp))
|
.clip(RoundedCornerShape(topStart = 22.dp, topEnd = 22.dp))
|
||||||
.background(colorResource(R.color.content_background))
|
.background(colorResource(R.color.content_background))
|
||||||
.verticalScroll(rememberScrollState())
|
.verticalScroll(rememberScrollState())
|
||||||
.padding(top = 12.dp)
|
|
||||||
) {
|
) {
|
||||||
AvatarOverviewView(
|
AvatarOverviewView(
|
||||||
userViewModel,
|
userViewModel,
|
||||||
|
|
@ -143,7 +153,6 @@ open class AvatarOverviewFragment :
|
||||||
displayEquipmentFragment(type, equipped, isCostume)
|
displayEquipmentFragment(type, equipped, isCostume)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.windowInsetsBottomHeight(WindowInsets.navigationBarsIgnoringVisibility))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -204,13 +213,20 @@ open class AvatarOverviewFragment :
|
||||||
super.onCreateOptionsMenu(menu, inflater)
|
super.onCreateOptionsMenu(menu, inflater)
|
||||||
inflater.inflate(R.menu.menu_share_avatar, menu)
|
inflater.inflate(R.menu.menu_share_avatar, menu)
|
||||||
|
|
||||||
|
val color = ContextCompat.getColor(requireContext(), R.color.window_background)
|
||||||
mainActivity?.toolbar?.let {
|
mainActivity?.toolbar?.let {
|
||||||
val color = ContextCompat.getColor(requireContext(), R.color.window_background)
|
ToolbarColorHelper.colorizeToolbar(it, mainActivity, backgroundColor = color,
|
||||||
ToolbarColorHelper.colorizeToolbar(it, mainActivity, backgroundColor = color)
|
appbar = mainActivity?.findViewById(R.id.appbar))
|
||||||
requireActivity().window.statusBarColor = color
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
if (requireActivity().resources.configuration.orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||||
|
navigationBarColor = ContextCompat.getColor(requireContext(), R.color.window_background)
|
||||||
|
}
|
||||||
|
super.onResume()
|
||||||
|
}
|
||||||
|
|
||||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
if (item.itemId == R.id.share_avatar) {
|
if (item.itemId == R.id.share_avatar) {
|
||||||
userViewModel.user.value?.let {
|
userViewModel.user.value?.let {
|
||||||
|
|
@ -259,92 +275,97 @@ fun AvatarOverviewView(
|
||||||
onEquipmentTap: (String, String?, Boolean) -> Unit
|
onEquipmentTap: (String, String?, Boolean) -> Unit
|
||||||
) {
|
) {
|
||||||
val user by userViewModel.user.observeAsState()
|
val user by userViewModel.user.observeAsState()
|
||||||
Column(
|
Box(contentAlignment = Alignment.TopCenter,
|
||||||
Modifier
|
modifier = Modifier.fillMaxWidth()) {
|
||||||
.padding(horizontal = 8.dp)
|
Column(
|
||||||
.padding(bottom = 16.dp)
|
horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
) {
|
modifier = Modifier
|
||||||
if (showCustomization) {
|
.padding(horizontal = 8.dp)
|
||||||
Row(
|
.padding(bottom = 16.dp)
|
||||||
Modifier.padding(horizontal = 12.dp, vertical = 15.dp),
|
.widthIn(max = 500.dp)
|
||||||
verticalAlignment = Alignment.CenterVertically
|
) {
|
||||||
) {
|
if (showCustomization) {
|
||||||
Text(
|
Row(
|
||||||
stringResource(R.string.avatar_size),
|
Modifier.padding(horizontal = 12.dp, vertical = 15.dp),
|
||||||
style = HabiticaTheme.typography.titleMedium,
|
verticalAlignment = Alignment.CenterVertically
|
||||||
color = HabiticaTheme.colors.textSecondary
|
) {
|
||||||
)
|
Text(
|
||||||
Spacer(modifier = Modifier.weight(1f))
|
stringResource(R.string.avatar_size),
|
||||||
SegmentedControl(
|
style = HabiticaTheme.typography.titleMedium,
|
||||||
items =
|
color = HabiticaTheme.colors.textSecondary
|
||||||
listOf(
|
)
|
||||||
stringResource(R.string.avatar_size_slim),
|
Spacer(modifier = Modifier.weight(1f))
|
||||||
stringResource(
|
SegmentedControl(
|
||||||
R.string.avatar_size_broad
|
items =
|
||||||
)
|
listOf(
|
||||||
),
|
stringResource(R.string.avatar_size_slim),
|
||||||
defaultSelectedItemIndex = if (user?.preferences?.size == "slim") 0 else 1,
|
stringResource(
|
||||||
onItemSelection = {
|
R.string.avatar_size_broad
|
||||||
userViewModel.updateUser(
|
)
|
||||||
"preferences.size",
|
),
|
||||||
if (it == 0) "slim" else "broad"
|
defaultSelectedItemIndex = if (user?.preferences?.size == "slim") 0 else 1,
|
||||||
)
|
onItemSelection = {
|
||||||
}
|
userViewModel.updateUser(
|
||||||
)
|
"preferences.size",
|
||||||
|
if (it == 0) "slim" else "broad"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
AvatarCustomizationOverviewView(user?.preferences, user?.items?.gear?.equipped, onCustomizationTap, onAvatarEquipmentTap)
|
||||||
}
|
}
|
||||||
AvatarCustomizationOverviewView(user?.preferences, user?.items?.gear?.equipped, onCustomizationTap, onAvatarEquipmentTap)
|
if (showEquipment) {
|
||||||
}
|
Row(
|
||||||
if (showEquipment) {
|
Modifier
|
||||||
Row(
|
.padding(horizontal = 12.dp)
|
||||||
Modifier
|
.padding(top = 15.dp),
|
||||||
.padding(horizontal = 12.dp)
|
verticalAlignment = Alignment.CenterVertically
|
||||||
.padding(top = 15.dp),
|
) {
|
||||||
verticalAlignment = Alignment.CenterVertically
|
Text(
|
||||||
) {
|
stringResource(R.string.equipped).uppercase(),
|
||||||
Text(
|
style = HabiticaTheme.typography.titleSmall,
|
||||||
stringResource(R.string.equipped).uppercase(),
|
color = HabiticaTheme.colors.textSecondary
|
||||||
style = HabiticaTheme.typography.titleSmall,
|
)
|
||||||
color = HabiticaTheme.colors.textSecondary
|
Spacer(modifier = Modifier.weight(1f))
|
||||||
)
|
Text(
|
||||||
Spacer(modifier = Modifier.weight(1f))
|
stringResource(R.string.equip_automatically),
|
||||||
Text(
|
style = HabiticaTheme.typography.bodyMedium,
|
||||||
stringResource(R.string.equip_automatically),
|
color = HabiticaTheme.colors.textPrimary,
|
||||||
style = HabiticaTheme.typography.bodyMedium,
|
modifier = Modifier.padding(end = 6.dp)
|
||||||
color = HabiticaTheme.colors.textPrimary,
|
)
|
||||||
modifier = Modifier.padding(end = 6.dp)
|
Switch(checked = user?.preferences?.autoEquip == true, onCheckedChange = {
|
||||||
)
|
userViewModel.updateUser("preferences.autoEquip", it)
|
||||||
Switch(checked = user?.preferences?.autoEquip == true, onCheckedChange = {
|
})
|
||||||
userViewModel.updateUser("preferences.autoEquip", it)
|
}
|
||||||
|
EquipmentOverviewView(user?.items?.gear?.equipped, battleGearTwoHanded, { type, equipped ->
|
||||||
|
onEquipmentTap(type, equipped, false)
|
||||||
})
|
})
|
||||||
|
Row(
|
||||||
|
Modifier
|
||||||
|
.padding(horizontal = 12.dp)
|
||||||
|
.padding(top = 15.dp),
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
|
) {
|
||||||
|
Text(
|
||||||
|
stringResource(R.string.costume).uppercase(),
|
||||||
|
style = HabiticaTheme.typography.titleSmall,
|
||||||
|
color = HabiticaTheme.colors.textSecondary
|
||||||
|
)
|
||||||
|
Spacer(modifier = Modifier.weight(1f))
|
||||||
|
Text(
|
||||||
|
stringResource(R.string.wear_costume),
|
||||||
|
style = HabiticaTheme.typography.bodyMedium,
|
||||||
|
color = HabiticaTheme.colors.textPrimary,
|
||||||
|
modifier = Modifier.padding(end = 6.dp)
|
||||||
|
)
|
||||||
|
Switch(checked = user?.preferences?.costume == true, onCheckedChange = {
|
||||||
|
userViewModel.updateUser("preferences.costume", it)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
EquipmentOverviewView(user?.items?.gear?.costume, costumeTwoHanded, { type, equipped ->
|
||||||
|
onEquipmentTap(type, equipped, true)
|
||||||
|
}, modifier = Modifier.alpha(if (user?.preferences?.costume == true) 1.0f else 0.5f))
|
||||||
}
|
}
|
||||||
EquipmentOverviewView(user?.items?.gear?.equipped, battleGearTwoHanded, { type, equipped ->
|
|
||||||
onEquipmentTap(type, equipped, false)
|
|
||||||
})
|
|
||||||
Row(
|
|
||||||
Modifier
|
|
||||||
.padding(horizontal = 12.dp)
|
|
||||||
.padding(top = 15.dp),
|
|
||||||
verticalAlignment = Alignment.CenterVertically
|
|
||||||
) {
|
|
||||||
Text(
|
|
||||||
stringResource(R.string.costume).uppercase(),
|
|
||||||
style = HabiticaTheme.typography.titleSmall,
|
|
||||||
color = HabiticaTheme.colors.textSecondary
|
|
||||||
)
|
|
||||||
Spacer(modifier = Modifier.weight(1f))
|
|
||||||
Text(
|
|
||||||
stringResource(R.string.wear_costume),
|
|
||||||
style = HabiticaTheme.typography.bodyMedium,
|
|
||||||
color = HabiticaTheme.colors.textPrimary,
|
|
||||||
modifier = Modifier.padding(end = 6.dp)
|
|
||||||
)
|
|
||||||
Switch(checked = user?.preferences?.costume == true, onCheckedChange = {
|
|
||||||
userViewModel.updateUser("preferences.costume", it)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
EquipmentOverviewView(user?.items?.gear?.costume, costumeTwoHanded, { type, equipped ->
|
|
||||||
onEquipmentTap(type, equipped, true)
|
|
||||||
}, modifier = Modifier.alpha(if (user?.preferences?.costume == true) 1.0f else 0.5f))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.habitrpg.android.habitica.ui.fragments.inventory.customization
|
package com.habitrpg.android.habitica.ui.fragments.inventory.customization
|
||||||
|
|
||||||
|
import android.content.res.Configuration
|
||||||
import android.graphics.PorterDuff
|
import android.graphics.PorterDuff
|
||||||
import android.graphics.Typeface
|
import android.graphics.Typeface
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
|
@ -19,10 +20,16 @@ import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.PaddingValues
|
import androidx.compose.foundation.layout.PaddingValues
|
||||||
|
import androidx.compose.foundation.layout.WindowInsets
|
||||||
|
import androidx.compose.foundation.layout.add
|
||||||
|
import androidx.compose.foundation.layout.asPaddingValues
|
||||||
|
import androidx.compose.foundation.layout.calculateEndPadding
|
||||||
|
import androidx.compose.foundation.layout.calculateStartPadding
|
||||||
|
import androidx.compose.foundation.layout.displayCutout
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.height
|
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.size
|
import androidx.compose.foundation.layout.size
|
||||||
|
import androidx.compose.foundation.layout.systemBars
|
||||||
import androidx.compose.foundation.lazy.grid.GridCells
|
import androidx.compose.foundation.lazy.grid.GridCells
|
||||||
import androidx.compose.foundation.lazy.grid.GridItemSpan
|
import androidx.compose.foundation.lazy.grid.GridItemSpan
|
||||||
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
|
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
|
||||||
|
|
@ -44,6 +51,7 @@ import androidx.compose.ui.layout.ContentScale
|
||||||
import androidx.compose.ui.layout.onGloballyPositioned
|
import androidx.compose.ui.layout.onGloballyPositioned
|
||||||
import androidx.compose.ui.platform.LocalConfiguration
|
import androidx.compose.ui.platform.LocalConfiguration
|
||||||
import androidx.compose.ui.platform.LocalDensity
|
import androidx.compose.ui.platform.LocalDensity
|
||||||
|
import androidx.compose.ui.platform.LocalLayoutDirection
|
||||||
import androidx.compose.ui.platform.ViewCompositionStrategy
|
import androidx.compose.ui.platform.ViewCompositionStrategy
|
||||||
import androidx.compose.ui.platform.rememberNestedScrollInteropConnection
|
import androidx.compose.ui.platform.rememberNestedScrollInteropConnection
|
||||||
import androidx.compose.ui.res.colorResource
|
import androidx.compose.ui.res.colorResource
|
||||||
|
|
@ -248,11 +256,18 @@ class ComposeAvatarCustomizationFragment :
|
||||||
|
|
||||||
mainActivity?.toolbar?.let {
|
mainActivity?.toolbar?.let {
|
||||||
val color = ContextCompat.getColor(requireContext(), R.color.window_background)
|
val color = ContextCompat.getColor(requireContext(), R.color.window_background)
|
||||||
ToolbarColorHelper.colorizeToolbar(it, mainActivity, backgroundColor = color)
|
ToolbarColorHelper.colorizeToolbar(it, mainActivity, backgroundColor = color,
|
||||||
requireActivity().window.statusBarColor = color
|
appbar = mainActivity?.findViewById(R.id.appbar))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
if (requireActivity().resources.configuration.orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||||
|
navigationBarColor = ContextCompat.getColor(requireContext(), R.color.window_background)
|
||||||
|
}
|
||||||
|
super.onResume()
|
||||||
|
}
|
||||||
|
|
||||||
private fun updateFilterIcon() {
|
private fun updateFilterIcon() {
|
||||||
if (!currentFilter.value.isFiltering) {
|
if (!currentFilter.value.isFiltering) {
|
||||||
filterMenuItem?.setIcon(R.drawable.ic_action_filter_list)
|
filterMenuItem?.setIcon(R.drawable.ic_action_filter_list)
|
||||||
|
|
@ -469,41 +484,46 @@ private fun AvatarCustomizationView(
|
||||||
activeCustomization: String?,
|
activeCustomization: String?,
|
||||||
onSelect: (Customization) -> Unit
|
onSelect: (Customization) -> Unit
|
||||||
) {
|
) {
|
||||||
|
val configuration = LocalConfiguration.current
|
||||||
|
val isWidthGreaterHeight = configuration.screenWidthDp > configuration.screenHeightDp
|
||||||
Column(horizontalAlignment = Alignment.CenterHorizontally) {
|
Column(horizontalAlignment = Alignment.CenterHorizontally) {
|
||||||
Column(horizontalAlignment = Alignment.CenterHorizontally, modifier = Modifier.background(colorResource(R.color.window_background))) {
|
Column(horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.background(colorResource(R.color.window_background))) {
|
||||||
ComposableAvatarView(
|
ComposableAvatarView(
|
||||||
avatar = avatar,
|
avatar = avatar,
|
||||||
configManager = configManager,
|
configManager = configManager,
|
||||||
modifier =
|
modifier =
|
||||||
Modifier
|
Modifier
|
||||||
.padding(top = 6.dp, bottom = 24.dp)
|
.padding(bottom = if (isWidthGreaterHeight) 8.dp else 24.dp)
|
||||||
.size(140.dp, 147.dp)
|
.size(140.dp, 147.dp)
|
||||||
)
|
)
|
||||||
Box(
|
|
||||||
Modifier
|
|
||||||
.background(colorResource(R.color.content_background), RoundedCornerShape(topStart = 22.dp, topEnd = 22.dp))
|
|
||||||
.fillMaxWidth()
|
|
||||||
.height(22.dp)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
val nestedScrollInterop = rememberNestedScrollInteropConnection()
|
val nestedScrollInterop = rememberNestedScrollInteropConnection()
|
||||||
val screenWidth = LocalConfiguration.current.screenWidthDp.dp
|
val screenWidth = LocalConfiguration.current.screenWidthDp.dp
|
||||||
var gridWidth by remember { mutableStateOf(screenWidth) }
|
var gridWidth by remember { mutableStateOf(screenWidth) }
|
||||||
val horizontalPadding = (gridWidth - (84.dp * 3)) / 2
|
val horizontalPadding = (gridWidth - (84.dp * 3)) / 2
|
||||||
val density = LocalDensity.current
|
val density = LocalDensity.current
|
||||||
|
val insets = WindowInsets.systemBars.add(WindowInsets.displayCutout).asPaddingValues()
|
||||||
|
val ld = LocalLayoutDirection.current
|
||||||
LazyVerticalGrid(
|
LazyVerticalGrid(
|
||||||
columns = GridCells.Adaptive(76.dp),
|
columns = GridCells.Adaptive(76.dp),
|
||||||
horizontalArrangement = Arrangement.Center,
|
horizontalArrangement = Arrangement.Center,
|
||||||
contentPadding = PaddingValues(horizontal = horizontalPadding),
|
contentPadding = PaddingValues(horizontal = horizontalPadding),
|
||||||
modifier =
|
modifier =
|
||||||
Modifier
|
Modifier
|
||||||
|
.padding(bottom = insets.calculateBottomPadding())
|
||||||
|
.background(colorResource(R.color.window_background))
|
||||||
|
.padding(start = insets.calculateStartPadding(ld), end = insets.calculateEndPadding(ld))
|
||||||
|
.clip(RoundedCornerShape(topStart = 22.dp, topEnd = 22.dp))
|
||||||
|
.background(colorResource(R.color.content_background))
|
||||||
.onGloballyPositioned {
|
.onGloballyPositioned {
|
||||||
gridWidth = with(density) {
|
gridWidth = with(density) {
|
||||||
it.size.width.toDp()
|
it.size.width.toDp()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.nestedScroll(nestedScrollInterop)
|
.nestedScroll(nestedScrollInterop)
|
||||||
.background(colorResource(R.color.content_background))
|
|
||||||
) {
|
) {
|
||||||
item(span = { GridItemSpan(3) }) {
|
item(span = { GridItemSpan(3) }) {
|
||||||
Text(
|
Text(
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,10 @@
|
||||||
package com.habitrpg.android.habitica.ui.fragments.inventory.customization
|
package com.habitrpg.android.habitica.ui.fragments.inventory.customization
|
||||||
|
|
||||||
|
import android.content.res.Configuration
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
|
import android.view.Menu
|
||||||
|
import android.view.MenuInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.compose.foundation.Image
|
import androidx.compose.foundation.Image
|
||||||
|
|
@ -12,10 +15,16 @@ import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.PaddingValues
|
import androidx.compose.foundation.layout.PaddingValues
|
||||||
|
import androidx.compose.foundation.layout.WindowInsets
|
||||||
|
import androidx.compose.foundation.layout.add
|
||||||
|
import androidx.compose.foundation.layout.asPaddingValues
|
||||||
|
import androidx.compose.foundation.layout.calculateEndPadding
|
||||||
|
import androidx.compose.foundation.layout.calculateStartPadding
|
||||||
|
import androidx.compose.foundation.layout.displayCutout
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.height
|
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.size
|
import androidx.compose.foundation.layout.size
|
||||||
|
import androidx.compose.foundation.layout.systemBars
|
||||||
import androidx.compose.foundation.lazy.grid.GridCells
|
import androidx.compose.foundation.lazy.grid.GridCells
|
||||||
import androidx.compose.foundation.lazy.grid.GridItemSpan
|
import androidx.compose.foundation.lazy.grid.GridItemSpan
|
||||||
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
|
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
|
||||||
|
|
@ -37,6 +46,7 @@ import androidx.compose.ui.layout.ContentScale
|
||||||
import androidx.compose.ui.layout.onGloballyPositioned
|
import androidx.compose.ui.layout.onGloballyPositioned
|
||||||
import androidx.compose.ui.platform.LocalConfiguration
|
import androidx.compose.ui.platform.LocalConfiguration
|
||||||
import androidx.compose.ui.platform.LocalDensity
|
import androidx.compose.ui.platform.LocalDensity
|
||||||
|
import androidx.compose.ui.platform.LocalLayoutDirection
|
||||||
import androidx.compose.ui.platform.ViewCompositionStrategy
|
import androidx.compose.ui.platform.ViewCompositionStrategy
|
||||||
import androidx.compose.ui.platform.rememberNestedScrollInteropConnection
|
import androidx.compose.ui.platform.rememberNestedScrollInteropConnection
|
||||||
import androidx.compose.ui.res.colorResource
|
import androidx.compose.ui.res.colorResource
|
||||||
|
|
@ -49,6 +59,7 @@ import androidx.compose.ui.text.style.TextAlign
|
||||||
import androidx.compose.ui.text.withStyle
|
import androidx.compose.ui.text.withStyle
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.fragment.app.viewModels
|
import androidx.fragment.app.viewModels
|
||||||
import androidx.lifecycle.ViewModel
|
import androidx.lifecycle.ViewModel
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
|
|
@ -60,6 +71,7 @@ import com.habitrpg.android.habitica.helpers.AppConfigManager
|
||||||
import com.habitrpg.android.habitica.models.inventory.Equipment
|
import com.habitrpg.android.habitica.models.inventory.Equipment
|
||||||
import com.habitrpg.android.habitica.models.user.User
|
import com.habitrpg.android.habitica.models.user.User
|
||||||
import com.habitrpg.android.habitica.ui.fragments.BaseMainFragment
|
import com.habitrpg.android.habitica.ui.fragments.BaseMainFragment
|
||||||
|
import com.habitrpg.android.habitica.ui.helpers.ToolbarColorHelper
|
||||||
import com.habitrpg.android.habitica.ui.theme.colors
|
import com.habitrpg.android.habitica.ui.theme.colors
|
||||||
import com.habitrpg.android.habitica.ui.viewmodels.MainUserViewModel
|
import com.habitrpg.android.habitica.ui.viewmodels.MainUserViewModel
|
||||||
import com.habitrpg.android.habitica.ui.views.PixelArtView
|
import com.habitrpg.android.habitica.ui.views.PixelArtView
|
||||||
|
|
@ -167,6 +179,26 @@ class ComposeAvatarEquipmentFragment :
|
||||||
Analytics.sendNavigationEvent("${viewModel.type} screen")
|
Analytics.sendNavigationEvent("${viewModel.type} screen")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onCreateOptionsMenu(
|
||||||
|
menu: Menu,
|
||||||
|
inflater: MenuInflater
|
||||||
|
) {
|
||||||
|
super.onCreateOptionsMenu(menu, inflater)
|
||||||
|
|
||||||
|
mainActivity?.toolbar?.let {
|
||||||
|
val color = ContextCompat.getColor(requireContext(), R.color.window_background)
|
||||||
|
ToolbarColorHelper.colorizeToolbar(it, mainActivity, backgroundColor = color,
|
||||||
|
appbar = mainActivity?.findViewById(R.id.appbar))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
if (requireActivity().resources.configuration.orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||||
|
navigationBarColor = ContextCompat.getColor(requireContext(), R.color.window_background)
|
||||||
|
}
|
||||||
|
super.onResume()
|
||||||
|
}
|
||||||
|
|
||||||
private fun loadEquipment() {
|
private fun loadEquipment() {
|
||||||
val type = viewModel.type ?: return
|
val type = viewModel.type ?: return
|
||||||
lifecycleScope.launchCatching {
|
lifecycleScope.launchCatching {
|
||||||
|
|
@ -219,41 +251,47 @@ private fun AvatarEquipmentView(
|
||||||
activeCustomization: String?,
|
activeCustomization: String?,
|
||||||
onSelect: (Equipment) -> Unit
|
onSelect: (Equipment) -> Unit
|
||||||
) {
|
) {
|
||||||
|
val configuration = LocalConfiguration.current
|
||||||
|
val isWidthGreaterHeight = configuration.screenWidthDp > configuration.screenHeightDp
|
||||||
|
|
||||||
Column(horizontalAlignment = Alignment.CenterHorizontally) {
|
Column(horizontalAlignment = Alignment.CenterHorizontally) {
|
||||||
Column(horizontalAlignment = Alignment.CenterHorizontally, modifier = Modifier.background(colorResource(R.color.window_background))) {
|
Column(horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.background(colorResource(R.color.window_background))) {
|
||||||
ComposableAvatarView(
|
ComposableAvatarView(
|
||||||
avatar = avatar,
|
avatar = avatar,
|
||||||
configManager = configManager,
|
configManager = configManager,
|
||||||
modifier =
|
modifier =
|
||||||
Modifier
|
Modifier
|
||||||
.padding(top = 6.dp, bottom = 24.dp)
|
.padding(bottom = if (isWidthGreaterHeight) 8.dp else 24.dp)
|
||||||
.size(140.dp, 147.dp)
|
.size(140.dp, 147.dp)
|
||||||
)
|
)
|
||||||
Box(
|
|
||||||
Modifier
|
|
||||||
.background(colorResource(R.color.content_background), RoundedCornerShape(topStart = 22.dp, topEnd = 22.dp))
|
|
||||||
.fillMaxWidth()
|
|
||||||
.height(22.dp)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
val nestedScrollInterop = rememberNestedScrollInteropConnection()
|
val nestedScrollInterop = rememberNestedScrollInteropConnection()
|
||||||
val screenWidth = LocalConfiguration.current.screenWidthDp.dp
|
val screenWidth = LocalConfiguration.current.screenWidthDp.dp
|
||||||
var gridWidth by remember { mutableStateOf(screenWidth) }
|
var gridWidth by remember { mutableStateOf(screenWidth) }
|
||||||
val horizontalPadding = (gridWidth - (84.dp * 3)) / 2
|
val horizontalPadding = (gridWidth - (84.dp * 3)) / 2
|
||||||
val density = LocalDensity.current
|
val density = LocalDensity.current
|
||||||
|
val insets = WindowInsets.systemBars.add(WindowInsets.displayCutout).asPaddingValues()
|
||||||
|
val ld = LocalLayoutDirection.current
|
||||||
LazyVerticalGrid(
|
LazyVerticalGrid(
|
||||||
columns = GridCells.Adaptive(76.dp),
|
columns = GridCells.Adaptive(76.dp),
|
||||||
horizontalArrangement = Arrangement.Center,
|
horizontalArrangement = Arrangement.Center,
|
||||||
contentPadding = PaddingValues(horizontal = horizontalPadding),
|
contentPadding = PaddingValues(horizontal = horizontalPadding),
|
||||||
modifier =
|
modifier =
|
||||||
Modifier
|
Modifier
|
||||||
|
.padding(bottom = insets.calculateBottomPadding())
|
||||||
|
.background(colorResource(R.color.window_background))
|
||||||
|
.padding(start = insets.calculateStartPadding(ld), end = insets.calculateEndPadding(ld))
|
||||||
|
.clip(RoundedCornerShape(topStart = 22.dp, topEnd = 22.dp))
|
||||||
|
.background(colorResource(R.color.content_background))
|
||||||
.onGloballyPositioned {
|
.onGloballyPositioned {
|
||||||
gridWidth = with(density) {
|
gridWidth = with(density) {
|
||||||
it.size.width.toDp()
|
it.size.width.toDp()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.nestedScroll(nestedScrollInterop)
|
.nestedScroll(nestedScrollInterop)
|
||||||
.background(colorResource(R.color.content_background))
|
|
||||||
) {
|
) {
|
||||||
item(span = { GridItemSpan(3) }) {
|
item(span = { GridItemSpan(3) }) {
|
||||||
Text(
|
Text(
|
||||||
|
|
|
||||||
|
|
@ -280,8 +280,11 @@ class EquipmentDetailFragment :
|
||||||
|
|
||||||
mainActivity?.toolbar?.let {
|
mainActivity?.toolbar?.let {
|
||||||
val color = ContextCompat.getColor(requireContext(), R.color.window_background)
|
val color = ContextCompat.getColor(requireContext(), R.color.window_background)
|
||||||
ToolbarColorHelper.colorizeToolbar(it, mainActivity, backgroundColor = color)
|
|
||||||
requireActivity().window.statusBarColor = color
|
ToolbarColorHelper.colorizeToolbar(it,
|
||||||
|
mainActivity,
|
||||||
|
backgroundColor = color,
|
||||||
|
appbar = mainActivity?.findViewById(R.id.appbar))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -125,6 +125,15 @@ class MountDetailRecyclerFragment :
|
||||||
outState.putString(ANIMAL_TYPE_KEY, this.animalType)
|
outState.putString(ANIMAL_TYPE_KEY, this.animalType)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
|
binding?.recyclerView?.let {
|
||||||
|
it.post {
|
||||||
|
setGridSpanCount(it.width - it.paddingStart - it.paddingEnd)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun setGridSpanCount(width: Int) {
|
private fun setGridSpanCount(width: Int) {
|
||||||
var spanCount = 0
|
var spanCount = 0
|
||||||
context?.resources?.let {
|
context?.resources?.let {
|
||||||
|
|
|
||||||
|
|
@ -156,6 +156,11 @@ class PetDetailRecyclerFragment :
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
mainActivity?.title = animalType
|
mainActivity?.title = animalType
|
||||||
|
binding?.recyclerView?.let {
|
||||||
|
it.post {
|
||||||
|
setGridSpanCount(it.width - it.paddingStart - it.paddingEnd)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onSaveInstanceState(outState: Bundle) {
|
override fun onSaveInstanceState(outState: Bundle) {
|
||||||
|
|
|
||||||
|
|
@ -10,11 +10,7 @@ import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.draw.clip
|
import androidx.compose.ui.draw.clip
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.core.view.ViewCompat
|
|
||||||
import androidx.core.view.WindowInsetsCompat
|
|
||||||
import androidx.core.view.isVisible
|
import androidx.core.view.isVisible
|
||||||
import androidx.core.view.updateLayoutParams
|
|
||||||
import androidx.core.view.updatePadding
|
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import com.android.billingclient.api.ProductDetails
|
import com.android.billingclient.api.ProductDetails
|
||||||
|
|
@ -23,7 +19,6 @@ import com.habitrpg.android.habitica.data.UserRepository
|
||||||
import com.habitrpg.android.habitica.databinding.FragmentGemPurchaseBinding
|
import com.habitrpg.android.habitica.databinding.FragmentGemPurchaseBinding
|
||||||
import com.habitrpg.android.habitica.extensions.addCancelButton
|
import com.habitrpg.android.habitica.extensions.addCancelButton
|
||||||
import com.habitrpg.android.habitica.extensions.addCloseButton
|
import com.habitrpg.android.habitica.extensions.addCloseButton
|
||||||
import com.habitrpg.android.habitica.extensions.consumeWindowInsetsAbove30
|
|
||||||
import com.habitrpg.android.habitica.helpers.Analytics
|
import com.habitrpg.android.habitica.helpers.Analytics
|
||||||
import com.habitrpg.android.habitica.helpers.AppConfigManager
|
import com.habitrpg.android.habitica.helpers.AppConfigManager
|
||||||
import com.habitrpg.android.habitica.helpers.PurchaseHandler
|
import com.habitrpg.android.habitica.helpers.PurchaseHandler
|
||||||
|
|
@ -36,7 +31,6 @@ import com.habitrpg.android.habitica.ui.fragments.PromoInfoFragment
|
||||||
import com.habitrpg.android.habitica.ui.helpers.dismissKeyboard
|
import com.habitrpg.android.habitica.ui.helpers.dismissKeyboard
|
||||||
import com.habitrpg.android.habitica.ui.views.dialogs.HabiticaAlertDialog
|
import com.habitrpg.android.habitica.ui.views.dialogs.HabiticaAlertDialog
|
||||||
import com.habitrpg.android.habitica.ui.views.promo.BirthdayBanner
|
import com.habitrpg.android.habitica.ui.views.promo.BirthdayBanner
|
||||||
import com.habitrpg.common.habitica.extensions.dpToPx
|
|
||||||
import com.habitrpg.common.habitica.extensions.isUsingNightModeResources
|
import com.habitrpg.common.habitica.extensions.isUsingNightModeResources
|
||||||
import com.habitrpg.common.habitica.helpers.ExceptionHandler
|
import com.habitrpg.common.habitica.helpers.ExceptionHandler
|
||||||
import com.habitrpg.common.habitica.helpers.launchCatching
|
import com.habitrpg.common.habitica.helpers.launchCatching
|
||||||
|
|
@ -129,19 +123,6 @@ class GemsPurchaseFragment : BaseFragment<FragmentGemPurchaseBinding>() {
|
||||||
}
|
}
|
||||||
loadInventory()
|
loadInventory()
|
||||||
|
|
||||||
binding?.bottomSpacing?.let {
|
|
||||||
ViewCompat.setOnApplyWindowInsetsListener(it) { v, insets ->
|
|
||||||
val bars = insets.getInsets(
|
|
||||||
WindowInsetsCompat.Type.systemBars()
|
|
||||||
or WindowInsetsCompat.Type.displayCutout()
|
|
||||||
)
|
|
||||||
v.updateLayoutParams {
|
|
||||||
height = bars.bottom + 30.dpToPx(requireContext())
|
|
||||||
}
|
|
||||||
consumeWindowInsetsAbove30(insets)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Analytics.sendNavigationEvent("gem screen")
|
Analytics.sendNavigationEvent("gem screen")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ import com.habitrpg.android.habitica.R
|
||||||
import com.habitrpg.android.habitica.data.InventoryRepository
|
import com.habitrpg.android.habitica.data.InventoryRepository
|
||||||
import com.habitrpg.android.habitica.data.SocialRepository
|
import com.habitrpg.android.habitica.data.SocialRepository
|
||||||
import com.habitrpg.android.habitica.databinding.FragmentQuestDetailBinding
|
import com.habitrpg.android.habitica.databinding.FragmentQuestDetailBinding
|
||||||
import com.habitrpg.android.habitica.extensions.applyScrollContentWindowInsets
|
|
||||||
import com.habitrpg.android.habitica.helpers.HapticFeedbackManager
|
import com.habitrpg.android.habitica.helpers.HapticFeedbackManager
|
||||||
import com.habitrpg.android.habitica.models.inventory.Quest
|
import com.habitrpg.android.habitica.models.inventory.Quest
|
||||||
import com.habitrpg.android.habitica.models.inventory.QuestContent
|
import com.habitrpg.android.habitica.models.inventory.QuestContent
|
||||||
|
|
@ -101,7 +100,6 @@ class QuestDetailFragment : BaseMainFragment<FragmentQuestDetailBinding>() {
|
||||||
updateQuestContent(it)
|
updateQuestContent(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
binding?.scrollContent?.let { applyScrollContentWindowInsets(it) }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateParty(group: Group?) {
|
private fun updateParty(group: Group?) {
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@ import com.habitrpg.android.habitica.data.SocialRepository
|
||||||
import com.habitrpg.android.habitica.databinding.DialogChallengeDetailTaskGroupBinding
|
import com.habitrpg.android.habitica.databinding.DialogChallengeDetailTaskGroupBinding
|
||||||
import com.habitrpg.android.habitica.databinding.FragmentChallengeDetailBinding
|
import com.habitrpg.android.habitica.databinding.FragmentChallengeDetailBinding
|
||||||
import com.habitrpg.android.habitica.extensions.addCloseButton
|
import com.habitrpg.android.habitica.extensions.addCloseButton
|
||||||
import com.habitrpg.android.habitica.extensions.applyScrollContentWindowInsets
|
|
||||||
import com.habitrpg.android.habitica.models.members.Member
|
import com.habitrpg.android.habitica.models.members.Member
|
||||||
import com.habitrpg.android.habitica.models.social.Challenge
|
import com.habitrpg.android.habitica.models.social.Challenge
|
||||||
import com.habitrpg.android.habitica.models.tasks.Task
|
import com.habitrpg.android.habitica.models.tasks.Task
|
||||||
|
|
@ -166,7 +165,6 @@ class ChallengeDetailFragment : BaseMainFragment<FragmentChallengeDetailBinding>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
binding?.leaveButton?.setOnClickListener { showChallengeLeaveDialog() }
|
binding?.leaveButton?.setOnClickListener { showChallengeLeaveDialog() }
|
||||||
binding?.scrollContent?.let { applyScrollContentWindowInsets(it) }
|
|
||||||
refresh()
|
refresh()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,6 @@ import com.habitrpg.android.habitica.R
|
||||||
import com.habitrpg.android.habitica.data.ChallengeRepository
|
import com.habitrpg.android.habitica.data.ChallengeRepository
|
||||||
import com.habitrpg.android.habitica.data.UserRepository
|
import com.habitrpg.android.habitica.data.UserRepository
|
||||||
import com.habitrpg.android.habitica.databinding.FragmentGuildDetailBinding
|
import com.habitrpg.android.habitica.databinding.FragmentGuildDetailBinding
|
||||||
import com.habitrpg.android.habitica.extensions.applyScrollContentWindowInsets
|
|
||||||
import com.habitrpg.android.habitica.extensions.consumeWindowInsetsAbove30
|
|
||||||
import com.habitrpg.android.habitica.helpers.AppConfigManager
|
import com.habitrpg.android.habitica.helpers.AppConfigManager
|
||||||
import com.habitrpg.android.habitica.models.members.Member
|
import com.habitrpg.android.habitica.models.members.Member
|
||||||
import com.habitrpg.android.habitica.models.social.Challenge
|
import com.habitrpg.android.habitica.models.social.Challenge
|
||||||
|
|
@ -94,8 +92,6 @@ class GuildDetailFragment : BaseFragment<FragmentGuildDetailBinding>() {
|
||||||
MainNavigationController.navigate(profileDirections)
|
MainNavigationController.navigate(profileDirections)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
binding?.scrollContent?.let { applyScrollContentWindowInsets(it) }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setLeader(leader: Member?) {
|
private fun setLeader(leader: Member?) {
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@ import androidx.lifecycle.lifecycleScope
|
||||||
import com.habitrpg.android.habitica.R
|
import com.habitrpg.android.habitica.R
|
||||||
import com.habitrpg.android.habitica.data.SocialRepository
|
import com.habitrpg.android.habitica.data.SocialRepository
|
||||||
import com.habitrpg.android.habitica.databinding.FragmentNoPartyBinding
|
import com.habitrpg.android.habitica.databinding.FragmentNoPartyBinding
|
||||||
import com.habitrpg.android.habitica.extensions.applyScrollContentWindowInsets
|
|
||||||
import com.habitrpg.android.habitica.helpers.AppConfigManager
|
import com.habitrpg.android.habitica.helpers.AppConfigManager
|
||||||
import com.habitrpg.android.habitica.ui.activities.GroupFormActivity
|
import com.habitrpg.android.habitica.ui.activities.GroupFormActivity
|
||||||
import com.habitrpg.android.habitica.ui.fragments.BaseMainFragment
|
import com.habitrpg.android.habitica.ui.fragments.BaseMainFragment
|
||||||
|
|
@ -145,8 +144,6 @@ class NoPartyFragmentFragment : BaseMainFragment<FragmentNoPartyBinding>() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
binding?.scrollContent?.let { applyScrollContentWindowInsets(it) }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private val groupFormResult =
|
private val groupFormResult =
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ import com.habitrpg.android.habitica.data.InventoryRepository
|
||||||
import com.habitrpg.android.habitica.data.SocialRepository
|
import com.habitrpg.android.habitica.data.SocialRepository
|
||||||
import com.habitrpg.android.habitica.data.UserRepository
|
import com.habitrpg.android.habitica.data.UserRepository
|
||||||
import com.habitrpg.android.habitica.databinding.FragmentPartyDetailBinding
|
import com.habitrpg.android.habitica.databinding.FragmentPartyDetailBinding
|
||||||
import com.habitrpg.android.habitica.extensions.applyScrollContentWindowInsets
|
|
||||||
import com.habitrpg.android.habitica.helpers.AppConfigManager
|
import com.habitrpg.android.habitica.helpers.AppConfigManager
|
||||||
import com.habitrpg.android.habitica.helpers.HapticFeedbackManager
|
import com.habitrpg.android.habitica.helpers.HapticFeedbackManager
|
||||||
import com.habitrpg.android.habitica.models.inventory.QuestContent
|
import com.habitrpg.android.habitica.models.inventory.QuestContent
|
||||||
|
|
@ -162,8 +161,6 @@ class PartyDetailFragment : BaseFragment<FragmentPartyDetailBinding>() {
|
||||||
binding?.questMechanicsButton?.setOnClickListener {
|
binding?.questMechanicsButton?.setOnClickListener {
|
||||||
showQuestMechanicsDialog()
|
showQuestMechanicsDialog()
|
||||||
}
|
}
|
||||||
|
|
||||||
binding?.scrollContent?.let { applyScrollContentWindowInsets(it) }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun refreshParty() {
|
private fun refreshParty() {
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ import androidx.compose.animation.core.Spring
|
||||||
import androidx.compose.animation.core.animateFloat
|
import androidx.compose.animation.core.animateFloat
|
||||||
import androidx.compose.animation.core.spring
|
import androidx.compose.animation.core.spring
|
||||||
import androidx.compose.animation.core.updateTransition
|
import androidx.compose.animation.core.updateTransition
|
||||||
import androidx.compose.foundation.ExperimentalFoundationApi
|
|
||||||
import androidx.compose.foundation.Image
|
import androidx.compose.foundation.Image
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.gestures.Orientation
|
import androidx.compose.foundation.gestures.Orientation
|
||||||
|
|
@ -16,16 +15,20 @@ import androidx.compose.foundation.gestures.scrollable
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.PaddingValues
|
import androidx.compose.foundation.layout.PaddingValues
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
|
import androidx.compose.foundation.layout.WindowInsets
|
||||||
|
import androidx.compose.foundation.layout.asPaddingValues
|
||||||
|
import androidx.compose.foundation.layout.calculateEndPadding
|
||||||
|
import androidx.compose.foundation.layout.calculateStartPadding
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.foundation.layout.safeContent
|
||||||
import androidx.compose.foundation.layout.size
|
import androidx.compose.foundation.layout.size
|
||||||
import androidx.compose.foundation.lazy.LazyColumn
|
import androidx.compose.foundation.lazy.LazyColumn
|
||||||
import androidx.compose.foundation.lazy.items
|
import androidx.compose.foundation.lazy.items
|
||||||
import androidx.compose.foundation.rememberScrollState
|
import androidx.compose.foundation.rememberScrollState
|
||||||
import androidx.compose.material3.Button
|
import androidx.compose.material3.Button
|
||||||
import androidx.compose.material3.ButtonDefaults
|
import androidx.compose.material3.ButtonDefaults
|
||||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.material3.TextField
|
import androidx.compose.material3.TextField
|
||||||
import androidx.compose.material3.TextFieldDefaults
|
import androidx.compose.material3.TextFieldDefaults
|
||||||
|
|
@ -42,6 +45,7 @@ import androidx.compose.ui.draw.rotate
|
||||||
import androidx.compose.ui.focus.onFocusChanged
|
import androidx.compose.ui.focus.onFocusChanged
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.graphics.ColorFilter
|
import androidx.compose.ui.graphics.ColorFilter
|
||||||
|
import androidx.compose.ui.platform.LocalLayoutDirection
|
||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.TextStyle
|
import androidx.compose.ui.text.TextStyle
|
||||||
|
|
@ -144,7 +148,6 @@ class PartyInviteFragment : BaseFragment<FragmentComposeBinding>() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalFoundationApi::class, ExperimentalMaterial3Api::class)
|
|
||||||
@Composable
|
@Composable
|
||||||
fun PartyInviteView(
|
fun PartyInviteView(
|
||||||
viewModel: PartyInviteViewModel,
|
viewModel: PartyInviteViewModel,
|
||||||
|
|
@ -154,10 +157,14 @@ fun PartyInviteView(
|
||||||
val scope = rememberCoroutineScope()
|
val scope = rememberCoroutineScope()
|
||||||
val scrollableState = rememberScrollState()
|
val scrollableState = rememberScrollState()
|
||||||
|
|
||||||
|
val padding = WindowInsets.safeContent.asPaddingValues()
|
||||||
|
val ld = LocalLayoutDirection.current
|
||||||
|
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
Modifier
|
Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.padding(14.dp)
|
.padding(14.dp)
|
||||||
|
.padding(start = padding.calculateStartPadding(ld), end = padding.calculateEndPadding(ld))
|
||||||
.scrollable(scrollableState, Orientation.Vertical)
|
.scrollable(scrollableState, Orientation.Vertical)
|
||||||
) {
|
) {
|
||||||
item {
|
item {
|
||||||
|
|
@ -201,7 +208,7 @@ fun PartyInviteView(
|
||||||
.padding(0.dp, 4.dp)
|
.padding(0.dp, 4.dp)
|
||||||
.background(HabiticaTheme.colors.windowBackground, HabiticaTheme.shapes.medium)
|
.background(HabiticaTheme.colors.windowBackground, HabiticaTheme.shapes.medium)
|
||||||
.padding(4.dp, 4.dp)
|
.padding(4.dp, 4.dp)
|
||||||
.animateItemPlacement()
|
.animateItem()
|
||||||
) {
|
) {
|
||||||
Button(
|
Button(
|
||||||
onClick = {
|
onClick = {
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ import androidx.lifecycle.lifecycleScope
|
||||||
import com.habitrpg.android.habitica.R
|
import com.habitrpg.android.habitica.R
|
||||||
import com.habitrpg.android.habitica.databinding.FragmentSupportBugFixBinding
|
import com.habitrpg.android.habitica.databinding.FragmentSupportBugFixBinding
|
||||||
import com.habitrpg.android.habitica.databinding.KnownIssueBinding
|
import com.habitrpg.android.habitica.databinding.KnownIssueBinding
|
||||||
import com.habitrpg.android.habitica.extensions.applyScrollContentWindowInsets
|
|
||||||
import com.habitrpg.android.habitica.helpers.AppConfigManager
|
import com.habitrpg.android.habitica.helpers.AppConfigManager
|
||||||
import com.habitrpg.android.habitica.ui.fragments.BaseMainFragment
|
import com.habitrpg.android.habitica.ui.fragments.BaseMainFragment
|
||||||
import com.habitrpg.android.habitica.ui.viewmodels.MainUserViewModel
|
import com.habitrpg.android.habitica.ui.viewmodels.MainUserViewModel
|
||||||
|
|
@ -81,7 +80,6 @@ class BugFixFragment : BaseMainFragment<FragmentSupportBugFixBinding>() {
|
||||||
}
|
}
|
||||||
binding?.knownIssuesLayout?.addView(issueBinding.root)
|
binding?.knownIssuesLayout?.addView(issueBinding.root)
|
||||||
}
|
}
|
||||||
binding?.scrollContent?.let { applyScrollContentWindowInsets(it) }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private val versionName: String by lazy {
|
private val versionName: String by lazy {
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ import android.view.ViewGroup
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import com.habitrpg.android.habitica.data.FAQRepository
|
import com.habitrpg.android.habitica.data.FAQRepository
|
||||||
import com.habitrpg.android.habitica.databinding.FragmentFaqDetailBinding
|
import com.habitrpg.android.habitica.databinding.FragmentFaqDetailBinding
|
||||||
import com.habitrpg.android.habitica.extensions.applyScrollContentWindowInsets
|
|
||||||
import com.habitrpg.android.habitica.ui.fragments.BaseMainFragment
|
import com.habitrpg.android.habitica.ui.fragments.BaseMainFragment
|
||||||
import com.habitrpg.common.habitica.helpers.MarkdownParser
|
import com.habitrpg.common.habitica.helpers.MarkdownParser
|
||||||
import com.habitrpg.common.habitica.helpers.launchCatching
|
import com.habitrpg.common.habitica.helpers.launchCatching
|
||||||
|
|
@ -61,6 +60,5 @@ class FAQDetailFragment : BaseMainFragment<FragmentFaqDetailBinding>() {
|
||||||
}
|
}
|
||||||
|
|
||||||
binding?.answerTextView?.movementMethod = LinkMovementMethod.getInstance()
|
binding?.answerTextView?.movementMethod = LinkMovementMethod.getInstance()
|
||||||
binding?.scrollContent?.let { applyScrollContentWindowInsets(it) }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,6 @@ import com.habitrpg.android.habitica.R
|
||||||
import com.habitrpg.android.habitica.data.FAQRepository
|
import com.habitrpg.android.habitica.data.FAQRepository
|
||||||
import com.habitrpg.android.habitica.databinding.FragmentFaqOverviewBinding
|
import com.habitrpg.android.habitica.databinding.FragmentFaqOverviewBinding
|
||||||
import com.habitrpg.android.habitica.databinding.SupportFaqItemBinding
|
import com.habitrpg.android.habitica.databinding.SupportFaqItemBinding
|
||||||
import com.habitrpg.android.habitica.extensions.applyScrollContentWindowInsets
|
|
||||||
import com.habitrpg.android.habitica.helpers.AppConfigManager
|
import com.habitrpg.android.habitica.helpers.AppConfigManager
|
||||||
import com.habitrpg.android.habitica.ui.fragments.BaseMainFragment
|
import com.habitrpg.android.habitica.ui.fragments.BaseMainFragment
|
||||||
import com.habitrpg.android.habitica.ui.viewmodels.MainUserViewModel
|
import com.habitrpg.android.habitica.ui.viewmodels.MainUserViewModel
|
||||||
|
|
@ -172,8 +171,6 @@ class FAQOverviewFragment : BaseMainFragment<FragmentFaqOverviewBinding>() {
|
||||||
binding?.moreHelpTextView?.movementMethod = LinkMovementMethod.getInstance()
|
binding?.moreHelpTextView?.movementMethod = LinkMovementMethod.getInstance()
|
||||||
|
|
||||||
this.loadArticles()
|
this.loadArticles()
|
||||||
|
|
||||||
binding?.scrollContent?.let { applyScrollContentWindowInsets(it) }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onDestroy() {
|
override fun onDestroy() {
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ import androidx.lifecycle.lifecycleScope
|
||||||
import com.habitrpg.android.habitica.R
|
import com.habitrpg.android.habitica.R
|
||||||
import com.habitrpg.android.habitica.data.FAQRepository
|
import com.habitrpg.android.habitica.data.FAQRepository
|
||||||
import com.habitrpg.android.habitica.databinding.FragmentSupportMainBinding
|
import com.habitrpg.android.habitica.databinding.FragmentSupportMainBinding
|
||||||
import com.habitrpg.android.habitica.extensions.applyScrollContentWindowInsets
|
|
||||||
import com.habitrpg.android.habitica.helpers.AppConfigManager
|
import com.habitrpg.android.habitica.helpers.AppConfigManager
|
||||||
import com.habitrpg.android.habitica.ui.fragments.BaseMainFragment
|
import com.habitrpg.android.habitica.ui.fragments.BaseMainFragment
|
||||||
import com.habitrpg.android.habitica.ui.views.HabiticaSnackbar
|
import com.habitrpg.android.habitica.ui.views.HabiticaSnackbar
|
||||||
|
|
@ -76,8 +75,6 @@ class SupportMainFragment : BaseMainFragment<FragmentSupportMainBinding>() {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
binding?.resetTutorialButtonWrapper?.let { applyScrollContentWindowInsets(it) }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onDestroy() {
|
override fun onDestroy() {
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ import android.widget.TextView
|
||||||
import androidx.appcompat.view.menu.ActionMenuItemView
|
import androidx.appcompat.view.menu.ActionMenuItemView
|
||||||
import androidx.appcompat.widget.ActionMenuView
|
import androidx.appcompat.widget.ActionMenuView
|
||||||
import androidx.appcompat.widget.Toolbar
|
import androidx.appcompat.widget.Toolbar
|
||||||
|
import com.google.android.material.appbar.AppBarLayout
|
||||||
import com.habitrpg.android.habitica.R
|
import com.habitrpg.android.habitica.R
|
||||||
import com.habitrpg.common.habitica.extensions.getThemeColor
|
import com.habitrpg.common.habitica.extensions.getThemeColor
|
||||||
import com.habitrpg.common.habitica.extensions.waitForLayout
|
import com.habitrpg.common.habitica.extensions.waitForLayout
|
||||||
|
|
@ -43,12 +44,14 @@ object ToolbarColorHelper {
|
||||||
toolbar: Toolbar,
|
toolbar: Toolbar,
|
||||||
activity: Activity?,
|
activity: Activity?,
|
||||||
iconColor: Int? = null,
|
iconColor: Int? = null,
|
||||||
backgroundColor: Int? = null
|
backgroundColor: Int? = null,
|
||||||
|
appbar: AppBarLayout? = null
|
||||||
) {
|
) {
|
||||||
if (activity == null) return
|
if (activity == null) return
|
||||||
toolbar.setBackgroundColor(
|
toolbar.setBackgroundColor(
|
||||||
backgroundColor ?: activity.getThemeColor(R.attr.headerBackgroundColor)
|
backgroundColor ?: activity.getThemeColor(R.attr.headerBackgroundColor)
|
||||||
)
|
)
|
||||||
|
appbar?.setBackgroundColor(backgroundColor ?: activity.getThemeColor(R.attr.headerBackgroundColor))
|
||||||
val toolbarIconsColor = iconColor ?: activity.getThemeColor(R.attr.headerTextColor)
|
val toolbarIconsColor = iconColor ?: activity.getThemeColor(R.attr.headerTextColor)
|
||||||
val colorFilter = PorterDuffColorFilter(toolbarIconsColor, PorterDuff.Mode.MULTIPLY)
|
val colorFilter = PorterDuffColorFilter(toolbarIconsColor, PorterDuff.Mode.MULTIPLY)
|
||||||
for (i in 0 until toolbar.childCount) {
|
for (i in 0 until toolbar.childCount) {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
package com.habitrpg.android.habitica.ui.views
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.util.AttributeSet
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import androidx.core.view.children
|
||||||
|
import androidx.core.widget.NestedScrollView
|
||||||
|
import com.habitrpg.android.habitica.R
|
||||||
|
import com.habitrpg.android.habitica.extensions.applyScrollContentWindowInsets
|
||||||
|
|
||||||
|
class HabiticaScrollView @JvmOverloads constructor(
|
||||||
|
context: Context, attrs: AttributeSet? = null
|
||||||
|
) : NestedScrollView(context, attrs) {
|
||||||
|
private var skipDirectChild = false
|
||||||
|
|
||||||
|
init {
|
||||||
|
context.theme?.obtainStyledAttributes(attrs, R.styleable.HabiticaScrollView, 0, 0)?.let {
|
||||||
|
skipDirectChild = it.getBoolean(R.styleable.HabiticaScrollView_skipDirectchild, false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onAttachedToWindow() {
|
||||||
|
super.onAttachedToWindow()
|
||||||
|
var paddedChildren = children
|
||||||
|
if (skipDirectChild) {
|
||||||
|
paddedChildren = (paddedChildren.firstOrNull() as? ViewGroup)?.children ?: emptySequence()
|
||||||
|
}
|
||||||
|
paddedChildren.forEach {
|
||||||
|
applyScrollContentWindowInsets(it,
|
||||||
|
applyBottom = paddedChildren.lastOrNull() == it)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,8 +1,11 @@
|
||||||
package com.habitrpg.android.habitica.ui.views.social
|
package com.habitrpg.android.habitica.ui.views.social
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
import android.content.res.Configuration
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
import android.view.inputmethod.EditorInfo
|
||||||
|
import android.view.inputmethod.InputMethodManager
|
||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
|
|
@ -75,6 +78,16 @@ class ChatBarView : LinearLayout {
|
||||||
updateTextIndicator(binding.chatEditText.text.toString())
|
updateTextIndicator(binding.chatEditText.text.toString())
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
binding.chatEditText.setOnEditorActionListener { v, actionId, _ ->
|
||||||
|
if (actionId == EditorInfo.IME_ACTION_SEND) {
|
||||||
|
sendButtonPressed()
|
||||||
|
if (context.resources.configuration.orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||||
|
val inputService = context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
|
||||||
|
inputService.hideSoftInputFromWindow(v.windowToken, 0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
binding.sendButton.setOnClickListener { sendButtonPressed() }
|
binding.sendButton.setOnClickListener { sendButtonPressed() }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
NAME=4.7.0
|
NAME=4.7.0
|
||||||
CODE=12381
|
CODE=12401
|
||||||