small wearos fixes

This commit is contained in:
Phillip Thelen 2023-09-18 10:59:33 +02:00
parent 8de7b52f44
commit 6c65e1108e
7 changed files with 26 additions and 7 deletions

View file

@ -1,2 +1,2 @@
NAME=4.3
CODE=6561
CODE=6581

View file

@ -13,6 +13,13 @@ class HabiticaRecyclerView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null
) : WearableRecyclerView(context, attrs) {
init {
isVerticalScrollBarEnabled = true
focusable = View.FOCUSABLE
isFocusableInTouchMode = true
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
post {

View file

@ -3,6 +3,7 @@ package com.habitrpg.wearos.habitica.ui.views
import android.content.Context
import android.content.res.Resources
import android.util.AttributeSet
import android.view.View
import androidx.core.view.children
import androidx.core.widget.NestedScrollView
import com.habitrpg.common.habitica.extensions.dpToPx
@ -12,6 +13,12 @@ class HabiticaScrollView @JvmOverloads constructor(
attrs: AttributeSet? = null
) : NestedScrollView(context, attrs) {
init {
isVerticalScrollBarEnabled = true
focusable = View.FOCUSABLE
isFocusableInTouchMode = true
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
requestFocus()

View file

@ -7,7 +7,9 @@
android:id="@+id/scroll_view"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:scrollbars="vertical"
android:scrollbarStyle="insideOverlay">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"

View file

@ -9,7 +9,8 @@
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">
android:visibility="gone"
android:scrollbars="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -84,4 +85,4 @@
android:layout_margin="@dimen/spacing_xlarge"
android:visibility="gone"
tools:visibility="visible"/>
</FrameLayout>
</FrameLayout>

View file

@ -2,7 +2,8 @@
<com.habitrpg.wearos.habitica.ui.views.HabiticaScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto"
android:scrollbars="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -52,4 +53,4 @@
app:chipText="@string/edit_on_phone" />
</LinearLayout>
</com.habitrpg.wearos.habitica.ui.views.HabiticaScrollView>
</com.habitrpg.wearos.habitica.ui.views.HabiticaScrollView>

View file

@ -3,7 +3,8 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto"
android:scrollbars="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">