From 19d9034e65ecddd29112eaa1178ab70c200e2625 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Sun, 5 Nov 2023 11:05:53 -0700 Subject: [PATCH] Cleanup --- .../cloudstream3/ui/account/AccountAdapter.kt | 1 + .../cloudstream3/ui/account/AccountHelper.kt | 8 +-- .../main/res/layout/account_edit_dialog.xml | 55 ++++++---------- app/src/main/res/layout/account_list_item.xml | 64 +++++++++---------- .../main/res/layout/account_list_item_add.xml | 5 +- .../res/layout/account_list_item_edit.xml | 10 +-- .../main/res/layout/account_select_linear.xml | 44 ++++--------- .../res/layout/activity_account_select.xml | 3 +- 8 files changed, 75 insertions(+), 115 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 0d43c39a..644018ac 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 @@ -98,6 +98,7 @@ class AccountAdapter( } if (isTv) { + // For emulator but this is fine on TV also root.isFocusableInTouchMode = true if (isLastUsedAccount) { root.requestFocus() 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 d388cd1f..1e2797e3 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 @@ -48,7 +48,7 @@ object AccountHelper { var currentEditAccount = account val dialog = builder.show() - if (!isNewAccount) binding.text1.setText(R.string.edit_account) + if (!isNewAccount) binding.title.setText(R.string.edit_account) // Set up the dialog content binding.accountName.text = Editable.Factory.getInstance()?.newEditable(account.name) @@ -98,12 +98,12 @@ object AccountHelper { } // Handle the profile picture and its interactions - binding.profilePic.setImage(account.image) - binding.profilePic.setOnClickListener { + binding.accountImage.setImage(account.image) + binding.accountImage.setOnClickListener { // Roll the image forwards once currentEditAccount = currentEditAccount.copy(defaultImageIndex = (currentEditAccount.defaultImageIndex + 1) % DataStoreHelper.profileImages.size) - binding.profilePic.setImage(currentEditAccount.image) + binding.accountImage.setImage(currentEditAccount.image) } // Handle applying changes diff --git a/app/src/main/res/layout/account_edit_dialog.xml b/app/src/main/res/layout/account_edit_dialog.xml index cd9c07d3..9d39425a 100644 --- a/app/src/main/res/layout/account_edit_dialog.xml +++ b/app/src/main/res/layout/account_edit_dialog.xml @@ -15,13 +15,12 @@ android:orientation="horizontal"> - - + android:foreground="@drawable/outline_drawable_forced_round" + android:layout_width="match_parent" + android:layout_height="60dp" + android:layout_gravity="center" /> + + android:layout_marginTop="-60dp"> + style="@style/BlackButton" /> + style="@style/WhiteButton" /> - + style="@style/BlackButton" /> + \ No newline at end of file diff --git a/app/src/main/res/layout/account_list_item.xml b/app/src/main/res/layout/account_list_item.xml index 3331b85b..f133d6c3 100644 --- a/app/src/main/res/layout/account_list_item.xml +++ b/app/src/main/res/layout/account_list_item.xml @@ -9,9 +9,9 @@ android:animateLayoutChanges="true" android:backgroundTint="?attr/primaryGrayBackground" android:foreground="?attr/selectableItemBackground" - app:cardCornerRadius="@dimen/rounded_image_radius" android:layout_margin="10dp" android:focusable="true" + app:cardCornerRadius="@dimen/rounded_image_radius" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintDimensionRatio="1" app:layout_constraintEnd_toEndOf="parent" @@ -19,38 +19,38 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent"> - + - + - + - + - \ 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 e43417af..dea64484 100644 --- a/app/src/main/res/layout/account_list_item_add.xml +++ b/app/src/main/res/layout/account_list_item_add.xml @@ -8,9 +8,9 @@ android:animateLayoutChanges="true" android:backgroundTint="?attr/primaryGrayBackground" android:foreground="?attr/selectableItemBackground" - app:cardCornerRadius="@dimen/rounded_image_radius" android:layout_margin="10dp" android:focusable="true" + app:cardCornerRadius="@dimen/rounded_image_radius" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintDimensionRatio="1" app:layout_constraintEnd_toEndOf="parent" @@ -26,5 +26,4 @@ android:scaleType="centerCrop" android:contentDescription="@string/add_account" /> - - + \ 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 4732ae49..0adade19 100644 --- a/app/src/main/res/layout/account_list_item_edit.xml +++ b/app/src/main/res/layout/account_list_item_edit.xml @@ -9,9 +9,9 @@ android:animateLayoutChanges="true" android:backgroundTint="?attr/primaryGrayBackground" android:foreground="?attr/selectableItemBackground" - app:cardCornerRadius="@dimen/rounded_image_radius" android:layout_margin="10dp" android:focusable="true" + app:cardCornerRadius="@dimen/rounded_image_radius" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintDimensionRatio="1" app:layout_constraintEnd_toEndOf="parent" @@ -24,16 +24,15 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:alpha="0.1" - android:contentDescription="@string/profile_background_des" android:scaleType="centerCrop" /> + android:visibility="gone" + tools:visibility="visible" /> + android:visibility="gone" + tools:visibility="visible" /> + + android:layout_height="match_parent"> - - - - + android:layout_height="wrap_content" + android:layout_marginTop="20dp" /> - - - + tools:listitem="@layout/account_list_item" /> + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_account_select.xml b/app/src/main/res/layout/activity_account_select.xml index 3bf5e065..bd6007dc 100644 --- a/app/src/main/res/layout/activity_account_select.xml +++ b/app/src/main/res/layout/activity_account_select.xml @@ -44,5 +44,6 @@ android:layout_gravity="center_horizontal" android:paddingLeft="16dp" android:paddingRight="16dp" /> + - + \ No newline at end of file