From 670dd5373b27a5ffc772839014e122d9a504b5ca Mon Sep 17 00:00:00 2001 From: ByAyzen <189399597+ByAyzen@users.noreply.github.com> Date: Sat, 29 Aug 2026 05:27:46 +0300 Subject: [PATCH 1/5] feat: round profile avatar --- .../cloudstream3/ui/account/AccountAdapter.kt | 64 ++--------- .../cloudstream3/ui/account/AccountHelper.kt | 5 +- .../AccountSelectLinearItemDecoration.kt | 2 +- app/src/main/res/drawable/rounded_outline.xml | 26 +++-- .../main/res/layout/account_edit_dialog.xml | 90 ++++++++++----- app/src/main/res/layout/account_list_item.xml | 99 ++++++++-------- .../main/res/layout/account_list_item_add.xml | 65 +++++++---- .../res/layout/account_list_item_edit.xml | 108 ++++++++++-------- .../main/res/layout/account_select_linear.xml | 2 + .../res/layout/activity_account_select.xml | 2 + 10 files changed, 252 insertions(+), 211 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/account/AccountAdapter.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/account/AccountAdapter.kt index 92d33d0f349..57d59252385 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/account/AccountAdapter.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/account/AccountAdapter.kt @@ -1,11 +1,8 @@ package com.lagradost.cloudstream3.ui.account -import android.os.Build import android.view.LayoutInflater import android.view.ViewGroup -import androidx.core.content.ContextCompat import androidx.core.view.isVisible -import coil3.transform.RoundedCornersTransformation import com.lagradost.cloudstream3.R import com.lagradost.cloudstream3.databinding.AccountListItemAddBinding import com.lagradost.cloudstream3.databinding.AccountListItemBinding @@ -47,45 +44,23 @@ class AccountAdapter( when (val binding = holder.view) { is AccountListItemBinding -> binding.apply { val isTv = isLayout(TV or EMULATOR) || !root.isInTouchMode - val isLastUsedAccount = item.keyIndex == DataStoreHelper.selectedKeyIndex accountName.text = item.name accountImage.loadImage(item.image) lockIcon.isVisible = item.lockPin != null - outline.isVisible = !isTv && isLastUsedAccount - if (isTv) { - // For emulator but this is fine on TV also - root.isFocusableInTouchMode = true - if (isLastUsedAccount) { - root.requestFocus() - } + if (isLastUsedAccount) root.requestFocus() - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - root.foreground = ContextCompat.getDrawable( - root.context, - R.drawable.outline_drawable - ) - } - } else { + if (!isTv) { root.setOnLongClickListener { showAccountEditDialog( context = root.context, account = item, isNewAccount = false, - accountEditCallback = { account -> - accountEditCallback.invoke( - account - ) - }, - accountDeleteCallback = { account -> - accountDeleteCallback.invoke( - account - ) - } + accountEditCallback = { account -> accountEditCallback.invoke(account) }, + accountDeleteCallback = { account -> accountDeleteCallback.invoke(account) } ) - true } } @@ -96,31 +71,13 @@ class AccountAdapter( } is AccountListItemEditBinding -> binding.apply { - val isTv = isLayout(TV or EMULATOR) || !root.isInTouchMode - val isLastUsedAccount = item.keyIndex == DataStoreHelper.selectedKeyIndex accountName.text = item.name - accountImage.loadImage(item.image) { - RoundedCornersTransformation(10f) - } + accountImage.loadImage(item.image) lockIcon.isVisible = item.lockPin != null - outline.isVisible = !isTv && isLastUsedAccount - if (isTv) { - // For emulator but this is fine on TV also - root.isFocusableInTouchMode = true - if (isLastUsedAccount) { - root.requestFocus() - } - - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - root.foreground = ContextCompat.getDrawable( - root.context, - R.drawable.outline_drawable - ) - } - } + if (isLastUsedAccount) root.requestFocus() root.setOnClickListener { showAccountEditDialog( @@ -128,11 +85,7 @@ class AccountAdapter( account = item, isNewAccount = false, accountEditCallback = { account -> accountEditCallback.invoke(account) }, - accountDeleteCallback = { account -> - accountDeleteCallback.invoke( - account - ) - } + accountDeleteCallback = { account -> accountDeleteCallback.invoke(account) } ) } } @@ -142,6 +95,9 @@ class AccountAdapter( override fun onBindFooter(holder: ViewHolderState) { val binding = holder.view as? AccountListItemAddBinding ?: return binding.apply { + if (isLayout(TV or EMULATOR) || !root.isInTouchMode) { + root.isFocusableInTouchMode = true + } root.setOnClickListener { val accounts = this@AccountAdapter.immutableCurrentList diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/account/AccountHelper.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/account/AccountHelper.kt index 7725bad9128..1bb359b9f60 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/account/AccountHelper.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/account/AccountHelper.kt @@ -56,6 +56,7 @@ object AccountHelper { var currentEditAccount = account val dialog = builder.show() + binding.accountImageHolder.requestFocus() if (!isNewAccount) binding.title.setText(R.string.edit_account) @@ -100,7 +101,7 @@ object AccountHelper { // Handle the profile picture and its interactions binding.accountImage.loadImage(account.image) - binding.accountImage.setOnClickListener { + binding.accountImageHolder.setOnClickListener { // Roll the image forwards once currentEditAccount = currentEditAccount.copy(customImage = null) currentEditAccount = @@ -166,7 +167,7 @@ object AccountHelper { canSetPin = true - binding.editProfilePhotoButton.setOnClickListener { + binding.editProfilePhotoButtonHolder.setOnClickListener { val bottomSheetDialog = BottomSheetDialog(context) val sheetBinding = BottomInputDialogBinding.inflate(LayoutInflater.from(context)) bottomSheetDialog.setContentView(sheetBinding.root) diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/account/AccountSelectLinearItemDecoration.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/account/AccountSelectLinearItemDecoration.kt index eb907b34472..91e0caa2a9a 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/account/AccountSelectLinearItemDecoration.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/account/AccountSelectLinearItemDecoration.kt @@ -8,7 +8,7 @@ class AccountSelectLinearItemDecoration(private val size: Int) : RecyclerView.It override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State) { val layoutParams = view.layoutParams as RecyclerView.LayoutParams layoutParams.width = size - layoutParams.height = size + layoutParams.height = RecyclerView.LayoutParams.WRAP_CONTENT view.layoutParams = layoutParams } } \ No newline at end of file diff --git a/app/src/main/res/drawable/rounded_outline.xml b/app/src/main/res/drawable/rounded_outline.xml index b85ace8ea19..b1b48921f2a 100644 --- a/app/src/main/res/drawable/rounded_outline.xml +++ b/app/src/main/res/drawable/rounded_outline.xml @@ -1,13 +1,21 @@ - - - + + - - + - + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/account_edit_dialog.xml b/app/src/main/res/layout/account_edit_dialog.xml index f52c8ea5196..30158090b12 100644 --- a/app/src/main/res/layout/account_edit_dialog.xml +++ b/app/src/main/res/layout/account_edit_dialog.xml @@ -37,32 +37,59 @@ android:layout_marginBottom="60dp" android:orientation="vertical"> - - - + + - - + + + + + + + - + android:focusable="true" + android:clickable="true" + android:foreground="@drawable/rounded_outline" + android:nextFocusLeft="@id/account_image_holder" + android:nextFocusUp="@id/account_image_holder" + android:nextFocusDown="@id/account_name" + app:cardCornerRadius="16dp" + app:cardElevation="4dp" + app:cardBackgroundColor="?attr/primaryGrayBackground"> + + + + @@ -83,10 +109,12 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:buttonTint="?attr/textColor" + android:focusable="true" + android:nextFocusUp="@id/account_name" + android:nextFocusDown="@id/apply_btt" android:text="@string/lock_profile" android:textColor="?attr/grayTextColor" /> - @@ -113,6 +143,9 @@ android:layout_width="wrap_content" android:layout_gravity="center_vertical|end" android:layout_toStartOf="@+id/cancel_btt" + android:focusable="true" + android:nextFocusUp="@id/lockProfileCheckbox" + android:nextFocusDown="@id/cancel_btt" android:nextFocusLeft="@id/delete_btt" android:nextFocusRight="@id/cancel_btt" android:text="@string/sort_apply" /> @@ -123,6 +156,9 @@ android:layout_width="wrap_content" android:layout_alignParentEnd="true" android:layout_gravity="center_vertical|end" + android:focusable="true" + android:nextFocusUp="@id/apply_btt" + android:nextFocusDown="@id/apply_btt" android:nextFocusLeft="@id/apply_btt" android:text="@string/sort_cancel" /> diff --git a/app/src/main/res/layout/account_list_item.xml b/app/src/main/res/layout/account_list_item.xml index 3cbfc72fb1e..c16ed031de4 100644 --- a/app/src/main/res/layout/account_list_item.xml +++ b/app/src/main/res/layout/account_list_item.xml @@ -1,59 +1,66 @@ - - - - - - - + android:focusableInTouchMode="true"> + + + + + + + + + + + android:textSize="15sp" + tools:text="anime" /> - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/account_list_item_add.xml b/app/src/main/res/layout/account_list_item_add.xml index dea64484fdb..201ed468747 100644 --- a/app/src/main/res/layout/account_list_item_add.xml +++ b/app/src/main/res/layout/account_list_item_add.xml @@ -1,29 +1,50 @@ - + android:focusableInTouchMode="true"> - + - \ No newline at end of file + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/account_list_item_edit.xml b/app/src/main/res/layout/account_list_item_edit.xml index 3f41a23c230..0f86922b1c4 100644 --- a/app/src/main/res/layout/account_list_item_edit.xml +++ b/app/src/main/res/layout/account_list_item_edit.xml @@ -1,67 +1,75 @@ - + android:focusableInTouchMode="true"> - + - + + + + + - + - + + android:textSize="15sp" + tools:text="anime" /> - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/account_select_linear.xml b/app/src/main/res/layout/account_select_linear.xml index b78c0d44c3c..65c2ffba9ce 100644 --- a/app/src/main/res/layout/account_select_linear.xml +++ b/app/src/main/res/layout/account_select_linear.xml @@ -26,6 +26,8 @@ android:layout_marginTop="10dp" android:layout_width="match_parent" android:layout_height="wrap_content" + android:clipChildren="false" + android:clipToPadding="false" app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" tools:itemCount="4" tools:listitem="@layout/account_list_item" /> diff --git a/app/src/main/res/layout/activity_account_select.xml b/app/src/main/res/layout/activity_account_select.xml index 9f62d56015c..895c45a5d6a 100644 --- a/app/src/main/res/layout/activity_account_select.xml +++ b/app/src/main/res/layout/activity_account_select.xml @@ -42,6 +42,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" + android:clipChildren="false" + android:clipToPadding="false" android:paddingLeft="16dp" android:paddingRight="16dp" /> From 25bbd882d88807f0fd1250a3685daac1d6050507 Mon Sep 17 00:00:00 2001 From: ByAyzen <189399597+ByAyzen@users.noreply.github.com> Date: Sun, 20 Sep 2026 13:54:16 +0300 Subject: [PATCH 2/5] Some oval things and improvements. --- .../outline_drawable_forced_round.xml | 8 ++++++-- .../main/res/drawable/oval_stroke_focus.xml | 5 +++++ app/src/main/res/drawable/rounded_outline.xml | 20 +++++-------------- .../main/res/layout/account_edit_dialog.xml | 4 ++-- .../main/res/layout/account_list_item_add.xml | 2 +- .../res/layout/account_list_item_edit.xml | 4 ++-- 6 files changed, 21 insertions(+), 22 deletions(-) create mode 100644 app/src/main/res/drawable/oval_stroke_focus.xml diff --git a/app/src/main/res/drawable/outline_drawable_forced_round.xml b/app/src/main/res/drawable/outline_drawable_forced_round.xml index 7736f088a9c..57ff5893240 100644 --- a/app/src/main/res/drawable/outline_drawable_forced_round.xml +++ b/app/src/main/res/drawable/outline_drawable_forced_round.xml @@ -1,5 +1,9 @@ - + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/oval_stroke_focus.xml b/app/src/main/res/drawable/oval_stroke_focus.xml new file mode 100644 index 00000000000..eb10de15f15 --- /dev/null +++ b/app/src/main/res/drawable/oval_stroke_focus.xml @@ -0,0 +1,5 @@ + + + + diff --git a/app/src/main/res/drawable/rounded_outline.xml b/app/src/main/res/drawable/rounded_outline.xml index b1b48921f2a..40831933e07 100644 --- a/app/src/main/res/drawable/rounded_outline.xml +++ b/app/src/main/res/drawable/rounded_outline.xml @@ -1,21 +1,11 @@ - - - - - - - - - - - + + + + - + - - - diff --git a/app/src/main/res/layout/account_edit_dialog.xml b/app/src/main/res/layout/account_edit_dialog.xml index 30158090b12..66ebedba33b 100644 --- a/app/src/main/res/layout/account_edit_dialog.xml +++ b/app/src/main/res/layout/account_edit_dialog.xml @@ -47,7 +47,7 @@ android:layout_width="@dimen/account_select_linear_item_size" android:layout_height="@dimen/account_select_linear_item_size" android:layout_gravity="center" - android:foreground="@drawable/rounded_outline" + android:foreground="@drawable/outline_drawable_forced_round" android:focusable="true" android:nextFocusRight="@id/edit_profile_photo_button_holder" android:nextFocusDown="@id/edit_profile_photo_button_holder" @@ -73,7 +73,7 @@ android:layout_gravity="bottom|end" android:focusable="true" android:clickable="true" - android:foreground="@drawable/rounded_outline" + android:foreground="@drawable/outline_drawable_forced_round" android:nextFocusLeft="@id/account_image_holder" android:nextFocusUp="@id/account_image_holder" android:nextFocusDown="@id/account_name" diff --git a/app/src/main/res/layout/account_list_item_add.xml b/app/src/main/res/layout/account_list_item_add.xml index 201ed468747..32821d7313d 100644 --- a/app/src/main/res/layout/account_list_item_add.xml +++ b/app/src/main/res/layout/account_list_item_add.xml @@ -20,7 +20,7 @@ android:layout_height="100dp" android:layout_gravity="center_horizontal" android:backgroundTint="?attr/primaryGrayBackground" - android:foreground="@drawable/rounded_outline" + android:foreground="@drawable/outline_drawable_forced_round" android:duplicateParentState="true" app:cardCornerRadius="100dp" app:cardElevation="0dp"> diff --git a/app/src/main/res/layout/account_list_item_edit.xml b/app/src/main/res/layout/account_list_item_edit.xml index 0f86922b1c4..25df43e55b3 100644 --- a/app/src/main/res/layout/account_list_item_edit.xml +++ b/app/src/main/res/layout/account_list_item_edit.xml @@ -52,8 +52,8 @@ From bdec99866e2ef952c02831cfb9f4773f988d53e3 Mon Sep 17 00:00:00 2001 From: ByAyzen <189399597+ByAyzen@users.noreply.github.com> Date: Tue, 22 Sep 2026 15:55:27 +0300 Subject: [PATCH 3/5] Transparency for unselected accounts. --- app/src/main/res/drawable/rounded_outline.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/drawable/rounded_outline.xml b/app/src/main/res/drawable/rounded_outline.xml index 40831933e07..6cb6d7f5556 100644 --- a/app/src/main/res/drawable/rounded_outline.xml +++ b/app/src/main/res/drawable/rounded_outline.xml @@ -5,7 +5,7 @@ - + From 2f57e592b6d51b53c5f2a5ce3e7bde0318ab576b Mon Sep 17 00:00:00 2001 From: ByAyzen <189399597+ByAyzen@users.noreply.github.com> Date: Wed, 23 Sep 2026 15:27:33 +0300 Subject: [PATCH 4/5] Fixes and Improvements --- .../cloudstream3/ui/account/AccountAdapter.kt | 13 ++++++++----- .../ui/account/AccountSelectActivity.kt | 5 +++++ app/src/main/res/color/account_edit_btn_tint.xml | 5 +++++ .../drawable/outline_drawable_forced_round.xml | 1 - app/src/main/res/drawable/oval_stroke_focus.xml | 2 +- app/src/main/res/drawable/rounded_outline.xml | 3 +-- app/src/main/res/layout/account_edit_dialog.xml | 15 +++++---------- app/src/main/res/layout/account_list_item.xml | 14 +++----------- .../main/res/layout/account_list_item_add.xml | 7 +++---- .../main/res/layout/account_list_item_edit.xml | 16 ++++------------ .../main/res/layout/activity_account_select.xml | 3 ++- app/src/main/res/values/attrs.xml | 1 + app/src/main/res/values/styles.xml | 2 ++ 13 files changed, 40 insertions(+), 47 deletions(-) create mode 100644 app/src/main/res/color/account_edit_btn_tint.xml diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/account/AccountAdapter.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/account/AccountAdapter.kt index 57d59252385..3b6518f0d61 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/account/AccountAdapter.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/account/AccountAdapter.kt @@ -50,7 +50,8 @@ class AccountAdapter( accountImage.loadImage(item.image) lockIcon.isVisible = item.lockPin != null - if (isLastUsedAccount) root.requestFocus() + if (isTv && isLastUsedAccount) root.requestFocus() + if (!isTv) cardView.foreground = null if (!isTv) { root.setOnLongClickListener { @@ -71,13 +72,15 @@ class AccountAdapter( } is AccountListItemEditBinding -> binding.apply { + val isTv = isLayout(TV or EMULATOR) || !root.isInTouchMode val isLastUsedAccount = item.keyIndex == DataStoreHelper.selectedKeyIndex accountName.text = item.name accountImage.loadImage(item.image) lockIcon.isVisible = item.lockPin != null - if (isLastUsedAccount) root.requestFocus() + if (isTv && isLastUsedAccount) root.requestFocus() + if (!isTv) cardView.foreground = null root.setOnClickListener { showAccountEditDialog( @@ -95,9 +98,9 @@ class AccountAdapter( override fun onBindFooter(holder: ViewHolderState) { val binding = holder.view as? AccountListItemAddBinding ?: return binding.apply { - if (isLayout(TV or EMULATOR) || !root.isInTouchMode) { - root.isFocusableInTouchMode = true - } + val isTv = isLayout(TV or EMULATOR) || !root.isInTouchMode + if (!isTv) cardView.foreground = null + root.setOnClickListener { val accounts = this@AccountAdapter.immutableCurrentList diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/account/AccountSelectActivity.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/account/AccountSelectActivity.kt index 3990bcc7839..28f5c15d83c 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/account/AccountSelectActivity.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/account/AccountSelectActivity.kt @@ -165,6 +165,11 @@ class AccountSelectActivity : FragmentActivity(), BiometricCallback { // Scroll to current account (which is focused by default) val layoutManager = recyclerView.layoutManager as GridLayoutManager layoutManager.scrollToPositionWithOffset(selectedKeyIndex, 0) + if (isLayout(TV or EMULATOR)) { + recyclerView.post { + layoutManager.findViewByPosition(selectedKeyIndex)?.requestFocus() + } + } } observe(accountViewModel.isEditing) { isEditing -> diff --git a/app/src/main/res/color/account_edit_btn_tint.xml b/app/src/main/res/color/account_edit_btn_tint.xml new file mode 100644 index 00000000000..7205c77fc86 --- /dev/null +++ b/app/src/main/res/color/account_edit_btn_tint.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/app/src/main/res/drawable/outline_drawable_forced_round.xml b/app/src/main/res/drawable/outline_drawable_forced_round.xml index 57ff5893240..e028ef10ad8 100644 --- a/app/src/main/res/drawable/outline_drawable_forced_round.xml +++ b/app/src/main/res/drawable/outline_drawable_forced_round.xml @@ -2,7 +2,6 @@ - diff --git a/app/src/main/res/drawable/oval_stroke_focus.xml b/app/src/main/res/drawable/oval_stroke_focus.xml index eb10de15f15..a2af717f1bb 100644 --- a/app/src/main/res/drawable/oval_stroke_focus.xml +++ b/app/src/main/res/drawable/oval_stroke_focus.xml @@ -1,5 +1,5 @@ - + diff --git a/app/src/main/res/drawable/rounded_outline.xml b/app/src/main/res/drawable/rounded_outline.xml index 6cb6d7f5556..117506429fe 100644 --- a/app/src/main/res/drawable/rounded_outline.xml +++ b/app/src/main/res/drawable/rounded_outline.xml @@ -2,10 +2,9 @@ - - + diff --git a/app/src/main/res/layout/account_edit_dialog.xml b/app/src/main/res/layout/account_edit_dialog.xml index 66ebedba33b..ae91c16a504 100644 --- a/app/src/main/res/layout/account_edit_dialog.xml +++ b/app/src/main/res/layout/account_edit_dialog.xml @@ -48,7 +48,7 @@ android:layout_height="@dimen/account_select_linear_item_size" android:layout_gravity="center" android:foreground="@drawable/outline_drawable_forced_round" - android:focusable="true" + android:defaultFocusHighlightEnabled="false" android:nextFocusRight="@id/edit_profile_photo_button_holder" android:nextFocusDown="@id/edit_profile_photo_button_holder" app:cardCornerRadius="100dp" @@ -71,15 +71,14 @@ android:layout_width="32dp" android:layout_height="32dp" android:layout_gravity="bottom|end" - android:focusable="true" - android:clickable="true" + android:defaultFocusHighlightEnabled="false" android:foreground="@drawable/outline_drawable_forced_round" android:nextFocusLeft="@id/account_image_holder" android:nextFocusUp="@id/account_image_holder" android:nextFocusDown="@id/account_name" app:cardCornerRadius="16dp" - app:cardElevation="4dp" - app:cardBackgroundColor="?attr/primaryGrayBackground"> + app:cardElevation="0dp" + app:cardBackgroundColor="@color/primaryGrayBackground"> + app:tint="@color/white" /> @@ -109,7 +108,6 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:buttonTint="?attr/textColor" - android:focusable="true" android:nextFocusUp="@id/account_name" android:nextFocusDown="@id/apply_btt" android:text="@string/lock_profile" @@ -132,7 +130,6 @@ android:layout_width="wrap_content" android:layout_alignParentStart="true" android:layout_gravity="center_vertical" - android:focusable="true" android:nextFocusUp="@id/lockProfileCheckbox" android:nextFocusRight="@id/apply_btt" android:text="@string/delete" /> @@ -143,7 +140,6 @@ android:layout_width="wrap_content" android:layout_gravity="center_vertical|end" android:layout_toStartOf="@+id/cancel_btt" - android:focusable="true" android:nextFocusUp="@id/lockProfileCheckbox" android:nextFocusDown="@id/cancel_btt" android:nextFocusLeft="@id/delete_btt" @@ -156,7 +152,6 @@ android:layout_width="wrap_content" android:layout_alignParentEnd="true" android:layout_gravity="center_vertical|end" - android:focusable="true" android:nextFocusUp="@id/apply_btt" android:nextFocusDown="@id/apply_btt" android:nextFocusLeft="@id/apply_btt" diff --git a/app/src/main/res/layout/account_list_item.xml b/app/src/main/res/layout/account_list_item.xml index c16ed031de4..c0145baf4b2 100644 --- a/app/src/main/res/layout/account_list_item.xml +++ b/app/src/main/res/layout/account_list_item.xml @@ -11,8 +11,7 @@ android:layout_margin="10dp" android:clipChildren="false" android:clipToPadding="false" - android:focusable="true" - android:focusableInTouchMode="true"> + android:defaultFocusHighlightEnabled="false"> - - @@ -59,7 +51,7 @@ android:gravity="center" android:maxLines="2" android:ellipsize="end" - android:textColor="@color/textColor" + android:textColor="?attr/textColor" android:textSize="15sp" tools:text="anime" /> diff --git a/app/src/main/res/layout/account_list_item_add.xml b/app/src/main/res/layout/account_list_item_add.xml index 32821d7313d..90089f7500e 100644 --- a/app/src/main/res/layout/account_list_item_add.xml +++ b/app/src/main/res/layout/account_list_item_add.xml @@ -11,8 +11,7 @@ android:layout_margin="10dp" android:clipChildren="false" android:clipToPadding="false" - android:focusable="true" - android:focusableInTouchMode="true"> + android:defaultFocusHighlightEnabled="false"> + app:tint="?attr/textColor" /> @@ -43,7 +42,7 @@ android:gravity="center" android:maxLines="2" android:ellipsize="end" - android:textColor="@color/textColor" + android:textColor="?attr/textColor" android:textSize="15sp" android:text="@string/add_account" /> diff --git a/app/src/main/res/layout/account_list_item_edit.xml b/app/src/main/res/layout/account_list_item_edit.xml index 25df43e55b3..568daf16e8e 100644 --- a/app/src/main/res/layout/account_list_item_edit.xml +++ b/app/src/main/res/layout/account_list_item_edit.xml @@ -11,8 +11,7 @@ android:layout_margin="10dp" android:clipChildren="false" android:clipToPadding="false" - android:focusable="true" - android:focusableInTouchMode="true"> + android:defaultFocusHighlightEnabled="false"> - - + app:tint="?attr/textColor" /> @@ -68,7 +60,7 @@ android:gravity="center" android:maxLines="2" android:ellipsize="end" - android:textColor="@color/textColor" + android:textColor="?attr/textColor" android:textSize="15sp" tools:text="anime" /> diff --git a/app/src/main/res/layout/activity_account_select.xml b/app/src/main/res/layout/activity_account_select.xml index 895c45a5d6a..c91071fe491 100644 --- a/app/src/main/res/layout/activity_account_select.xml +++ b/app/src/main/res/layout/activity_account_select.xml @@ -18,7 +18,7 @@ android:nextFocusDown="@id/account_recycler_view" android:background="?attr/selectableItemBackgroundBorderless" android:contentDescription="@string/manage_accounts" - app:tint="@color/player_on_button_tv_attr" /> + app:tint="@color/account_edit_btn_tint" /> + diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index a63b4726445..a5f8492dc9d 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -63,6 +63,7 @@ @color/iconColor @color/white @color/black + @color/grayTextColor ?android:attr/selectableItemBackground @style/CustomPreferenceThemeOverlay @@ -178,6 +179,7 @@ @color/lightGrayTextColor @color/black @color/white + @color/transparent @color/blackText true true From 7d55d8cb4b0a6d4ca782f4eb1ca876f0297c942d Mon Sep 17 00:00:00 2001 From: ByAyzen <189399597+ByAyzen@users.noreply.github.com> Date: Wed, 23 Sep 2026 22:23:55 +0300 Subject: [PATCH 5/5] Ripple effect. --- .../cloudstream3/ui/account/AccountAdapter.kt | 14 +++++++++++--- .../cloudstream3/ui/account/AccountHelper.kt | 9 +++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/account/AccountAdapter.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/account/AccountAdapter.kt index 3b6518f0d61..0b87509c49b 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/account/AccountAdapter.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/account/AccountAdapter.kt @@ -15,6 +15,8 @@ import com.lagradost.cloudstream3.ui.settings.Globals.TV import com.lagradost.cloudstream3.ui.settings.Globals.isLayout import com.lagradost.cloudstream3.utils.DataStoreHelper import com.lagradost.cloudstream3.utils.ImageLoader.loadImage +import android.util.TypedValue +import android.view.View class AccountAdapter( private val accountSelectCallback: (DataStoreHelper.Account) -> Unit, @@ -26,6 +28,12 @@ class AccountAdapter( companion object { const val VIEW_TYPE_SELECT_ACCOUNT = 0 const val VIEW_TYPE_EDIT_ACCOUNT = 2 + + fun View.setRippleForeground() { + val outValue = TypedValue() + context.theme.resolveAttribute(android.R.attr.selectableItemBackgroundBorderless, outValue, true) + foreground = context.getDrawable(outValue.resourceId) + } } @@ -51,7 +59,7 @@ class AccountAdapter( lockIcon.isVisible = item.lockPin != null if (isTv && isLastUsedAccount) root.requestFocus() - if (!isTv) cardView.foreground = null + if (!isTv) cardView.setRippleForeground() if (!isTv) { root.setOnLongClickListener { @@ -80,7 +88,7 @@ class AccountAdapter( lockIcon.isVisible = item.lockPin != null if (isTv && isLastUsedAccount) root.requestFocus() - if (!isTv) cardView.foreground = null + if (!isTv) cardView.setRippleForeground() root.setOnClickListener { showAccountEditDialog( @@ -99,7 +107,7 @@ class AccountAdapter( val binding = holder.view as? AccountListItemAddBinding ?: return binding.apply { val isTv = isLayout(TV or EMULATOR) || !root.isInTouchMode - if (!isTv) cardView.foreground = null + if (!isTv) cardView.setRippleForeground() root.setOnClickListener { val accounts = this@AccountAdapter.immutableCurrentList diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/account/AccountHelper.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/account/AccountHelper.kt index 1bb359b9f60..15c87deac2d 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/account/AccountHelper.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/account/AccountHelper.kt @@ -41,6 +41,10 @@ import com.lagradost.cloudstream3.utils.UIHelper.hideProgress import com.lagradost.cloudstream3.utils.UIHelper.navigate import com.lagradost.cloudstream3.utils.UIHelper.showInputMethod import com.lagradost.cloudstream3.utils.UIHelper.showProgress +import com.lagradost.cloudstream3.ui.account.AccountAdapter.Companion.setRippleForeground +import com.lagradost.cloudstream3.ui.settings.Globals.EMULATOR +import com.lagradost.cloudstream3.ui.settings.Globals.TV +import com.lagradost.cloudstream3.ui.settings.Globals.isLayout object AccountHelper { fun showAccountEditDialog( @@ -58,6 +62,11 @@ object AccountHelper { val dialog = builder.show() binding.accountImageHolder.requestFocus() + if (!isLayout(TV or EMULATOR)) { + binding.accountImageHolder.setRippleForeground() + binding.editProfilePhotoButtonHolder.setRippleForeground() + } + if (!isNewAccount) binding.title.setText(R.string.edit_account) // Set up the dialog content