Dark theme support.

This commit is contained in:
Alex Ning
2019-05-07 23:55:49 +08:00
parent 297db53aa3
commit c8d1a9e37a
20 changed files with 207 additions and 158 deletions

View File

@@ -46,21 +46,22 @@
android:layout_height="24dp"
android:layout_gravity="center_vertical"
android:layout_marginEnd="32dp"
android:src="@drawable/ic_outline_account_circle_24px" />
android:src="@drawable/ic_outline_account_circle_24px"
android:tint="@color/primaryTextColor"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/profile"
android:textColor="@android:color/black" />
android:textColor="@color/primaryTextColor" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#E0E0E0" />
android:background="@color/dividerColor" />
<TextView
android:id="@+id/following_label_main_activity"

View File

@@ -78,7 +78,7 @@
android:layout_height="wrap_content"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:textColor="#000000"
android:textColor="@color/primaryTextColor"
android:textSize="18sp" />
<ru.noties.markwon.view.MarkwonView
@@ -104,7 +104,7 @@
android:layout_marginEnd="8dp"
android:textColor="@android:color/white"
android:layout_centerVertical="true"
app:chipBackgroundColor="@color/colorPrimaryDark"/>
app:chipBackgroundColor="@color/backgroundColorPrimaryDark"/>
<ImageView
android:id="@+id/gilded_image_view_view_post_detail"
@@ -197,9 +197,10 @@
android:layout_width="match_parent"
android:layout_height="150dp"
android:layout_marginTop="16dp"
android:background="#E0E0E0"
android:background="@color/grey"
android:scaleType="center"
android:src="@drawable/ic_link"
android:tint="@android:color/tab_indicator_text"
android:visibility="gone" />
<RelativeLayout
@@ -267,9 +268,10 @@
android:layout_marginBottom="16dp"
app:mlpb_progress_stoke_width="3dp"
app:mlpb_progress_color="@color/colorAccent"
app:mlpb_background_color="@color/circularProgressBarBackground"
android:layout_gravity="center_horizontal"/>
<androidx.cardview.widget.CardView
<com.google.android.material.card.MaterialCardView
android:id="@+id/comment_card_view_view_post_detail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -290,7 +292,7 @@
android:paddingStart="16dp"
android:paddingTop="16dp"
android:text="@string/comments"
android:textColor="#000000"
android:textColor="@color/primaryTextColor"
android:textSize="18sp" />
<com.multilevelview.MultiLevelRecyclerView
@@ -300,7 +302,7 @@
</LinearLayout>
</androidx.cardview.widget.CardView>
</com.google.android.material.card.MaterialCardView>
<LinearLayout
android:id="@+id/no_comment_wrapper_linear_layout_view_post_detail"

View File

@@ -48,7 +48,7 @@
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:layout_below="@id/banner_image_view_view_subreddit_detail_activity"
android:background="@android:color/white">
android:background="@color/backgroundColor">
<TextView
android:id="@+id/subreddit_name_text_view_view_subreddit_detail_activity"
@@ -77,7 +77,7 @@
android:id="@+id/subscriber_count_text_view_view_subreddit_detail_activity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/black"
android:textColor="@color/primaryTextColor"
android:layout_alignParentStart="true"
android:layout_toStartOf="@id/online_subscriber_count_text_view_view_subreddit_detail_activity" />
@@ -86,7 +86,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:textColor="@android:color/black" />
android:textColor="@color/primaryTextColor" />
</RelativeLayout>
@@ -95,7 +95,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:textColor="@android:color/black"
android:textColor="@color/primaryTextColor"
android:visibility="gone"/>
</LinearLayout>

View File

@@ -48,7 +48,7 @@
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:layout_below="@id/banner_image_view_view_user_detail_activity"
android:background="@android:color/white">
android:background="@color/backgroundColor">
<TextView
android:id="@+id/user_name_text_view_view_user_detail_activity"
@@ -56,7 +56,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:textSize="18sp"
android:textColor="@color/colorPrimaryDark"
android:textColor="@color/textColorPrimaryDark"
android:layout_gravity="center_horizontal"/>
<TextView
@@ -65,7 +65,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
android:textColor="@android:color/black"
android:textColor="@color/primaryTextColor"
android:layout_gravity="center_horizontal"/>
<com.google.android.material.chip.Chip

View File

@@ -14,6 +14,7 @@
android:layout_marginBottom="16dp"
app:mlpb_progress_stoke_width="3dp"
app:mlpb_progress_color="@color/colorAccent"
app:mlpb_background_color="@color/circularProgressBarBackground"
android:layout_gravity="center_horizontal"/>
<androidx.recyclerview.widget.RecyclerView

View File

@@ -1,129 +1,134 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/linear_layout_item_post_comment">
<View
android:id="@+id/vertical_block_item_post_comment"
android:layout_width="0dp"
android:layout_height="match_parent"
android:background="@color/colorPrimary"/>
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:layout_marginBottom="12dp"
android:orientation="vertical">
android:layout_height="wrap_content">
<View
android:id="@+id/vertical_block_item_post_comment"
android:layout_width="0dp"
android:layout_height="match_parent"
android:background="@color/textColorPrimaryDark"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp">
android:layout_marginTop="12dp"
android:layout_marginBottom="12dp"
android:orientation="vertical">
<TextView
android:id="@+id/author_text_view_item_post_comment"
android:layout_width="0dp"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginEnd="16dp"
android:textColor="@color/colorPrimary"/>
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp">
<TextView
android:id="@+id/comment_time_text_view_item_post_comment"
android:layout_width="0dp"
<TextView
android:id="@+id/author_text_view_item_post_comment"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginEnd="16dp"
android:textColor="@color/textColorPrimaryDark"/>
<TextView
android:id="@+id/comment_time_text_view_item_post_comment"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="end" />
</LinearLayout>
<ru.noties.markwon.view.MarkwonView
android:id="@+id/comment_markdown_view_item_post_comment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="end" />
android:layout_marginTop="8dp"
android:layout_marginStart="32dp"
android:layout_marginEnd="32dp"
android:layout_marginBottom="8dp"
android:textColor="@color/primaryTextColor"/>
<RelativeLayout
android:id="@+id/relative_layout_item_post_comment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp">
<ImageView
android:id="@+id/plus_button_item_post_comment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:src="@drawable/ic_arrow_upward_black_20dp"
android:layout_centerVertical="true"
android:tint="@android:color/tab_indicator_text"
android:background="?actionBarItemBackground"
android:clickable="true"
android:focusable="true"/>
<TextView
android:id="@+id/score_text_view_item_post_comment"
android:layout_width="64dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toEndOf="@id/plus_button_item_post_comment"
android:gravity="center"/>
<ImageView
android:id="@+id/minus_button_item_post_comment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toEndOf="@id/score_text_view_item_post_comment"
android:src="@drawable/ic_arrow_downward_black_20dp"
android:tint="@android:color/tab_indicator_text"
android:background="?actionBarItemBackground"
android:clickable="true"
android:focusable="true"/>
<ProgressBar
android:id="@+id/load_more_comments_progress_bar"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginEnd="16dp"
android:layout_toStartOf="@id/expand_button_item_post_comment"
android:visibility="gone"/>
<ImageView
android:id="@+id/expand_button_item_post_comment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toStartOf="@id/reply_button_item_post_comment"
android:layout_centerVertical="true"
android:layout_marginEnd="16dp"
android:tint="@android:color/tab_indicator_text"
android:background="?actionBarItemBackground"
android:clickable="true"
android:focusable="true"
android:visibility="gone"/>
<ImageView
android:id="@+id/reply_button_item_post_comment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentEnd="true"
android:src="@drawable/ic_reply_black_20dp"
android:tint="@android:color/tab_indicator_text"
android:background="?actionBarItemBackground"
android:clickable="true"
android:focusable="true"/>
</RelativeLayout>
</LinearLayout>
<ru.noties.markwon.view.MarkwonView
android:id="@+id/comment_markdown_view_item_post_comment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginStart="32dp"
android:layout_marginEnd="32dp"
android:layout_marginBottom="8dp"
android:textColor="@android:color/black"/>
<RelativeLayout
android:id="@+id/relative_layout_item_post_comment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp">
<ImageView
android:id="@+id/plus_button_item_post_comment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:src="@drawable/ic_arrow_upward_black_20dp"
android:layout_centerVertical="true"
android:tint="@android:color/tab_indicator_text"
android:background="?actionBarItemBackground"
android:clickable="true"
android:focusable="true"/>
<TextView
android:id="@+id/score_text_view_item_post_comment"
android:layout_width="64dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toEndOf="@id/plus_button_item_post_comment"
android:gravity="center"/>
<ImageView
android:id="@+id/minus_button_item_post_comment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toEndOf="@id/score_text_view_item_post_comment"
android:src="@drawable/ic_arrow_downward_black_20dp"
android:tint="@android:color/tab_indicator_text"
android:background="?actionBarItemBackground"
android:clickable="true"
android:focusable="true"/>
<ProgressBar
android:id="@+id/load_more_comments_progress_bar"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginEnd="16dp"
android:layout_toStartOf="@id/expand_button_item_post_comment"
android:visibility="gone"/>
<ImageView
android:id="@+id/expand_button_item_post_comment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toStartOf="@id/reply_button_item_post_comment"
android:layout_centerVertical="true"
android:layout_marginEnd="16dp"
android:tint="@android:color/tab_indicator_text"
android:background="?actionBarItemBackground"
android:clickable="true"
android:focusable="true"
android:visibility="gone"/>
<ImageView
android:id="@+id/reply_button_item_post_comment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentEnd="true"
android:src="@drawable/ic_reply_black_20dp"
android:tint="@android:color/tab_indicator_text"
android:background="?actionBarItemBackground"
android:clickable="true"
android:focusable="true"/>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>

View File

@@ -50,7 +50,7 @@
android:layout_height="24dp"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:tint="@color/colorPrimary"
android:tint="@color/textColorPrimaryDark"
android:visibility="gone"
app:layout_constraintStart_toEndOf="@id/subreddit_icon_name_linear_layout_view_item_best_post"
app:layout_constraintEnd_toStartOf="@+id/post_time_text_view_best_post_item"
@@ -77,7 +77,7 @@
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:textSize="18sp"
android:textColor="#000000"/>
android:textColor="@color/primaryTextColor"/>
<RelativeLayout
android:layout_width="match_parent"
@@ -93,7 +93,7 @@
android:layout_marginEnd="16dp"
android:textColor="@android:color/white"
android:layout_centerVertical="true"
app:chipBackgroundColor="@color/colorPrimaryDark" />
app:chipBackgroundColor="@color/backgroundColorPrimaryDark" />
<ImageView
android:id="@+id/gilded_image_view_item_best_post"
@@ -187,7 +187,8 @@
android:layout_marginTop="16dp"
android:scaleType="center"
android:src="@drawable/ic_link"
android:background="#E0E0E0"
android:tint="@android:color/tab_indicator_text"
android:background="@color/grey"
android:visibility="gone"/>
<RelativeLayout

View File

@@ -24,7 +24,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="32dp"
android:textColor="@android:color/black"
android:textColor="@color/primaryTextColor"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/subreddit_icon_gif_image_view_item_subreddit_listing"
app:layout_constraintTop_toTopOf="parent" />
@@ -34,9 +34,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:src="@drawable/baseline_add_white_24"
android:tint="@color/colorPrimary"
android:tint="@color/textColorPrimaryDark"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"

View File

@@ -18,7 +18,7 @@
android:id="@+id/subreddit_name_text_view_item_subscribed_subreddit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/black"
android:textColor="@color/primaryTextColor"
android:layout_gravity="center_vertical"/>
</LinearLayout>

View File

@@ -24,7 +24,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="32dp"
android:textColor="@android:color/black"
android:textColor="@color/primaryTextColor"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/user_icon_gif_image_view_item_user_listing"
app:layout_constraintTop_toTopOf="parent" />
@@ -34,9 +34,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:src="@drawable/baseline_add_white_24"
android:tint="@color/colorPrimary"
android:tint="@color/textColorPrimaryDark"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#242424</color>
<color name="colorPrimaryDark">#141414</color>
<color name="colorAccent">#FF4081</color>
<color name="minusButtonColor">#E91E63</color>
<color name="transparentActionBarColor">#88000000</color>
<color name="gold">#FFC107</color>
<color name="primaryTextColor">#FFFFFF</color>
<color name="textColorPrimaryDark">#1E88E5</color>
<color name="circularProgressBarBackground">#242424</color>
<color name="dividerColor">#69666C</color>
<color name="grey">#424242</color>
<color name="backgroundColor">#181818</color>
<color name="backgroundColorPrimaryDark">#1976D2</color>
</resources>

View File

@@ -1,7 +1,7 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.MaterialComponents.Light">
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>

View File

@@ -9,4 +9,18 @@
<color name="transparentActionBarColor">#88000000</color>
<color name="gold">#FFC107</color>
<color name="primaryTextColor">#000000</color>
<color name="textColorPrimaryDark">@color/colorPrimaryDark</color>
<color name="circularProgressBarBackground">#242424</color>
<color name="dividerColor">#E0E0E0</color>
<color name="grey">#E0E0E0</color>
<color name="backgroundColor">#FFFFFF</color>
<color name="backgroundColorPrimaryDark">@color/colorPrimaryDark</color>
</resources>

View File

@@ -1,7 +1,7 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.MaterialComponents.Light">
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
@@ -31,7 +31,7 @@
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.DayNight" />
<style name="Theme.AppCompat.Transparent" parent="AppTheme.ActionBar.Transparent">
<item name="android:windowNoTitle">true</item>