-
Notifications
You must be signed in to change notification settings - Fork 56
Improve dark mode for profiles screen #137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
87dcd88
7d7e7f6
d134a71
408eed4
91e6d68
7384e8a
95eba4c
ece11d3
5bbaa57
8d6bb94
67976bd
a659c1c
513e829
11cceff
0cacfd6
1cbe974
5e4f1a5
4913cb6
8299be0
0963bcf
eb2b4d6
991f2f1
642dc3e
00f3321
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,8 @@ | |
| android:layout_width="match_parent" | ||
| android:layout_height="wrap_content" | ||
| android:layout_margin="8dp" | ||
| android:theme="@style/Theme.NetBird.Card" | ||
| app:cardBackgroundColor="@color/profile_card_background" | ||
| app:cardCornerRadius="8dp" | ||
| app:cardElevation="2dp"> | ||
|
|
||
|
|
@@ -17,10 +19,10 @@ | |
| android:id="@+id/icon_profile" | ||
| android:layout_width="40dp" | ||
| android:layout_height="40dp" | ||
| android:src="@drawable/ic_menu_profile" | ||
| android:contentDescription="@string/menu_profiles" | ||
| app:layout_constraintTop_toTopOf="parent" | ||
| android:src="@drawable/ic_menu_profile" | ||
| app:layout_constraintStart_toStartOf="parent" | ||
| app:layout_constraintTop_toTopOf="parent" | ||
| app:tint="@color/nb_txt" /> | ||
|
|
||
| <TextView | ||
|
|
@@ -29,18 +31,18 @@ | |
| android:layout_height="wrap_content" | ||
| android:layout_marginStart="16dp" | ||
| android:layout_marginEnd="8dp" | ||
| android:textSize="18sp" | ||
| android:textStyle="bold" | ||
| android:textColor="@color/nb_txt" | ||
| android:ellipsize="end" | ||
| android:maxLines="1" | ||
| tools:text="default" | ||
| app:layout_constraintTop_toTopOf="@id/icon_profile" | ||
| app:layout_constraintBottom_toBottomOf="@id/icon_profile" | ||
| app:layout_constraintStart_toEndOf="@id/icon_profile" | ||
| android:textColor="@color/nb_txt" | ||
| android:textSize="18sp" | ||
| android:textStyle="bold" | ||
| app:layout_constraintBottom_toBottomOf="@+id/icon_profile" | ||
| app:layout_constraintEnd_toStartOf="@id/badge_active" | ||
| app:layout_constraintHorizontal_bias="0" | ||
| app:layout_constraintHorizontal_chainStyle="packed" /> | ||
| app:layout_constraintHorizontal_chainStyle="packed" | ||
| app:layout_constraintStart_toEndOf="@id/icon_profile" | ||
| app:layout_constraintTop_toTopOf="@+id/icon_profile" | ||
|
Comment on lines
+39
to
+44
|
||
| tools:text="default" /> | ||
|
|
||
| <TextView | ||
| android:id="@+id/badge_active" | ||
|
|
@@ -55,62 +57,62 @@ | |
| android:textColor="@android:color/white" | ||
| android:textSize="12sp" | ||
| android:visibility="gone" | ||
| tools:visibility="visible" | ||
| app:layout_constraintTop_toTopOf="@id/icon_profile" | ||
| app:layout_constraintBottom_toBottomOf="@id/icon_profile" | ||
| app:layout_constraintStart_toEndOf="@id/text_profile_name" | ||
| app:layout_constraintBottom_toBottomOf="@+id/icon_profile" | ||
| app:layout_constraintEnd_toEndOf="parent" | ||
| app:layout_constraintHorizontal_bias="0" /> | ||
| app:layout_constraintHorizontal_bias="0" | ||
| app:layout_constraintStart_toEndOf="@id/text_profile_name" | ||
| app:layout_constraintTop_toTopOf="@+id/icon_profile" | ||
|
Comment on lines
+60
to
+64
|
||
| tools:visibility="visible" /> | ||
|
|
||
| <Button | ||
| android:id="@+id/btn_switch" | ||
| style="@style/Widget.MaterialComponents.Button.OutlinedButton" | ||
| android:layout_width="0dp" | ||
| android:layout_height="wrap_content" | ||
| android:layout_marginTop="12dp" | ||
| android:layout_marginEnd="4dp" | ||
| android:text="@string/profiles_switch" | ||
| android:textSize="11sp" | ||
| android:paddingStart="8dp" | ||
| android:paddingEnd="8dp" | ||
| style="@style/Widget.MaterialComponents.Button.OutlinedButton" | ||
| app:layout_constraintTop_toBottomOf="@id/icon_profile" | ||
| app:layout_constraintStart_toStartOf="parent" | ||
| android:text="@string/profiles_switch" | ||
| android:textSize="11sp" | ||
| app:layout_constraintEnd_toStartOf="@id/btn_logout" | ||
| app:layout_constraintHorizontal_weight="1" /> | ||
| app:layout_constraintHorizontal_weight="1" | ||
| app:layout_constraintStart_toStartOf="parent" | ||
| app:layout_constraintTop_toBottomOf="@id/icon_profile" /> | ||
|
|
||
| <Button | ||
| android:id="@+id/btn_logout" | ||
| style="@style/Widget.MaterialComponents.Button.TextButton" | ||
| android:layout_width="0dp" | ||
| android:layout_height="wrap_content" | ||
| android:layout_marginTop="12dp" | ||
| android:layout_marginStart="4dp" | ||
| android:layout_marginTop="12dp" | ||
| android:layout_marginEnd="4dp" | ||
| android:text="@string/profiles_logout" | ||
| android:textSize="11sp" | ||
| android:paddingStart="8dp" | ||
| android:paddingEnd="8dp" | ||
| style="@style/Widget.MaterialComponents.Button.TextButton" | ||
| app:layout_constraintTop_toBottomOf="@id/icon_profile" | ||
| app:layout_constraintStart_toEndOf="@id/btn_switch" | ||
| android:text="@string/profiles_logout" | ||
| android:textSize="11sp" | ||
| app:layout_constraintEnd_toStartOf="@id/btn_remove" | ||
| app:layout_constraintHorizontal_weight="1" /> | ||
| app:layout_constraintHorizontal_weight="1" | ||
| app:layout_constraintStart_toEndOf="@id/btn_switch" | ||
| app:layout_constraintTop_toBottomOf="@id/icon_profile" /> | ||
|
|
||
| <Button | ||
| android:id="@+id/btn_remove" | ||
| style="@style/Widget.MaterialComponents.Button.TextButton" | ||
| android:layout_width="0dp" | ||
| android:layout_height="wrap_content" | ||
| android:layout_marginTop="12dp" | ||
| android:layout_marginStart="4dp" | ||
| android:text="@string/profiles_remove" | ||
| android:textSize="11sp" | ||
| android:layout_marginTop="12dp" | ||
| android:paddingStart="8dp" | ||
| android:paddingEnd="8dp" | ||
| style="@style/Widget.MaterialComponents.Button.TextButton" | ||
| app:layout_constraintTop_toBottomOf="@id/icon_profile" | ||
| app:layout_constraintStart_toEndOf="@id/btn_logout" | ||
| android:text="@string/profiles_remove" | ||
| android:textSize="11sp" | ||
| app:layout_constraintEnd_toEndOf="parent" | ||
| app:layout_constraintHorizontal_weight="1" /> | ||
| app:layout_constraintHorizontal_weight="1" | ||
| app:layout_constraintStart_toEndOf="@id/btn_logout" | ||
| app:layout_constraintTop_toBottomOf="@id/icon_profile" /> | ||
|
|
||
| </androidx.constraintlayout.widget.ConstraintLayout> | ||
|
|
||
| </com.google.android.material.card.MaterialCardView> | ||
| </com.google.android.material.card.MaterialCardView> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
android:themereferences@style/Theme.NetBird.Card, but that style is only defined invalues-night/themes.xml. In light mode this style won't resolve at runtime (and can also break resource linking), causing the profile list item to fail to inflate. Add a non-night definition ofTheme.NetBird.Cardinapp/src/main/res/values/themes.xml(likely using a light/neutral ThemeOverlay), keeping the dark parent only in thevalues-nightvariant.