theme account chooser dialog

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2022-07-29 23:58:22 +02:00
parent a6ba545aef
commit 53168d1953
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
3 changed files with 26 additions and 2 deletions

View file

@ -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("");

View file

@ -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)

View file

@ -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