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