Przeglądaj źródła

theme account chooser dialog

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Andy Scherzinger 2 lat temu
rodzic
commit
53168d1953

+ 4 - 0
app/src/main/java/com/nextcloud/talk/ui/dialog/ChooseAccountDialogFragment.java

@@ -114,6 +114,10 @@ public class ChooseAccountDialogFragment extends DialogFragment {
         super.onViewCreated(view, savedInstanceState);
         NextcloudTalkApplication.Companion.getSharedApplication().getComponentApplication().inject(this);
 
+        viewThemeUtils.themeDialog(binding.getRoot());
+        viewThemeUtils.themeDialogDivider(binding.dividerTop);
+        viewThemeUtils.themeDialogDivider(binding.dividerBottom);
+
         // Defining user picture
         binding.currentAccount.userIcon.setTag("");
 

+ 19 - 0
app/src/main/java/com/nextcloud/talk/ui/theme/ViewThemeUtils.kt

@@ -53,6 +53,7 @@ import com.google.android.material.floatingactionbutton.FloatingActionButton
 import com.google.android.material.progressindicator.LinearProgressIndicator
 import com.google.android.material.tabs.TabLayout
 import com.google.android.material.textfield.TextInputLayout
+import com.google.android.material.textview.MaterialTextView
 import com.nextcloud.talk.R
 import com.nextcloud.talk.utils.DisplayUtils
 import com.nextcloud.talk.utils.DrawableUtils
@@ -111,6 +112,12 @@ class ViewThemeUtils @Inject constructor(private val theme: ServerTheme, private
         }
     }
 
+    fun themeSearchBarText(searchText: MaterialTextView) {
+        withScheme(searchText) { scheme ->
+            searchText.setHintTextColor(scheme.onSurfaceVariant)
+        }
+    }
+
     fun themeStatusBar(activity: Activity, view: View) {
         withScheme(view) { scheme ->
             DisplayUtils.applyColorToStatusBar(activity, scheme.surface)
@@ -128,6 +135,18 @@ class ViewThemeUtils @Inject constructor(private val theme: ServerTheme, private
         )
     }
 
+    fun themeDialog(view: View) {
+        withScheme(view) { scheme ->
+            view.setBackgroundColor(scheme.surface)
+        }
+    }
+
+    fun themeDialogDivider(view: View) {
+        withScheme(view) { scheme ->
+            view.setBackgroundColor(scheme.surfaceVariant)
+        }
+    }
+
     fun themeFAB(fab: FloatingActionButton) {
         withScheme(fab) { scheme ->
             fab.backgroundTintList = ColorStateList.valueOf(scheme.primaryContainer)

+ 3 - 2
app/src/main/res/layout/dialog_choose_account.xml

@@ -45,6 +45,7 @@
         tools:visibility="visible">
 
         <View
+            android:id="@+id/dividerTop"
             android:layout_width="match_parent"
             android:layout_height="1dp"
             android:layout_marginTop="4dp"
@@ -71,7 +72,7 @@
     </LinearLayout>
 
     <View
-        android:id="@+id/separator_line"
+        android:id="@+id/dividerBottom"
         android:layout_width="0dp"
         android:layout_height="1dp"
         android:layout_marginTop="4dp"
@@ -90,7 +91,7 @@
         app:layout_constraintBottom_toTopOf="@+id/add_account"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/separator_line"
+        app:layout_constraintTop_toBottomOf="@+id/dividerBottom"
         tools:listitem="@layout/account_item" />
 
     <com.google.android.material.button.MaterialButton