Skip to content

Commit

Permalink
Ultra Black theme
Browse files Browse the repository at this point in the history
  • Loading branch information
QuantumBadger committed Dec 3, 2016
1 parent 9c3e438 commit 18a5546
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 5 deletions.
3 changes: 2 additions & 1 deletion assets/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
77/1.9.7
Added low-contrast night mode
Added low-contrast night theme
Added Ultra Black theme
Added higher font scale options
Added accessibility descriptions to bezel toolbar
Hungarian translation (thanks to András Lengyel-Nagy)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public static AppearanceTwopane appearance_twopane(final Context context, final
}

public enum AppearanceTheme {
RED, GREEN, BLUE, LTBLUE, ORANGE, GRAY, NIGHT, NIGHT_LOWCONTRAST
RED, GREEN, BLUE, LTBLUE, ORANGE, GRAY, NIGHT, NIGHT_LOWCONTRAST, ULTRABLACK
}

public static boolean isNightMode(final Context context) {
Expand Down Expand Up @@ -166,6 +166,10 @@ public static void applyTheme(@NonNull final Activity activity) {
case NIGHT_LOWCONTRAST:
activity.setTheme(R.style.RR_Dark_LowContrast);
break;

case ULTRABLACK:
activity.setTheme(R.style.RR_Dark_UltraBlack);
break;
}

applyLanguage(activity, prefs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,30 @@
package org.quantumbadger.redreader.views;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.graphics.Typeface;
import android.widget.LinearLayout;
import android.widget.TextView;
import org.quantumbadger.redreader.R;
import org.quantumbadger.redreader.common.General;


public final class PostListingHeader extends LinearLayout {

public PostListingHeader(final Context context, final String titleText, final String subtitleText) {

super(context);

{
final TypedArray appearance = context.obtainStyledAttributes(new int[]{
R.attr.rrPostListHeaderBackgroundCol});

setBackgroundColor(appearance.getColor(0, General.COLOR_INVALID));

appearance.recycle();
}

final float dpScale = context.getResources().getDisplayMetrics().density;

setOrientation(LinearLayout.VERTICAL);
Expand All @@ -52,7 +65,5 @@ public PostListingHeader(final Context context, final String titleText, final St
subtitle.setText(subtitleText);
subtitle.setTextColor(Color.rgb(200, 200, 200));
addView(subtitle);

setBackgroundColor(Color.rgb(50, 50, 50)); // TODO theme color
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import android.widget.TextView;
import org.quantumbadger.redreader.R;
import org.quantumbadger.redreader.common.BetterSSB;
import org.quantumbadger.redreader.common.General;
import org.quantumbadger.redreader.common.LinkHandler;
import org.quantumbadger.redreader.common.RRTime;
import org.quantumbadger.redreader.reddit.prepared.RedditPreparedPost;
Expand Down Expand Up @@ -67,7 +68,14 @@ public RedditPostHeaderView(final AppCompatActivity activity, final RedditPrepar
subtitle.setTextColor(Color.rgb(200, 200, 200));
addView(subtitle);

setBackgroundColor(Color.rgb(50, 50, 50)); // TODO color
{
final TypedArray appearance = activity.obtainStyledAttributes(new int[]{
R.attr.rrPostListHeaderBackgroundCol});

setBackgroundColor(appearance.getColor(0, General.COLOR_INVALID));

appearance.recycle();
}

setOnClickListener(new OnClickListener() {
@Override
Expand Down
2 changes: 2 additions & 0 deletions src/main/res/values/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@
<item>@string/theme_name_ltblue</item>
<item>@string/theme_name_orange</item>
<item>@string/theme_name_gray</item>
<item>@string/theme_name_ultrablack</item>
</string-array>

<!-- Constants. Do not change. -->
Expand All @@ -199,6 +200,7 @@
<item>ltblue</item>
<item>orange</item>
<item>gray</item>
<item>ultrablack</item>
</string-array>

<string-array name="pref_appearance_langforce">
Expand Down
2 changes: 2 additions & 0 deletions src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
<attr name="rrListHeaderLineCol" format="color" />
<attr name="rrListSubtitleCol" format="color" />

<attr name="rrPostListHeaderBackgroundCol" format="color"/>

<attr name="rrIndentBackgroundCol" format="color" />
<attr name="rrIndentLineCol" format="color" />

Expand Down
1 change: 1 addition & 0 deletions src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -940,5 +940,6 @@

<!-- 2016-12-03 -->
<string name="theme_name_night_lowcontrast">Night (low contrast)</string>
<string name="theme_name_ultrablack">Ultra Black</string>

</resources>
70 changes: 70 additions & 0 deletions src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
<item name="colorPrimaryDark">#000000</item>
<item name="colorAccent">#99DDDD</item>

<item name="rrPostListHeaderBackgroundCol">#323232</item>

<item name="rrMainTextCol">#FFFFFF</item>
<item name="rrSubTextCol">#AAAAAA</item>

Expand Down Expand Up @@ -111,6 +113,8 @@
<item name="colorPrimaryDark">#000000</item>
<item name="colorAccent">#99DDDD</item>

<item name="rrPostListHeaderBackgroundCol">#444444</item>

<item name="rrMainTextCol">#999999</item>
<item name="rrSubTextCol">#777777</item>

Expand Down Expand Up @@ -165,6 +169,70 @@

</style>

<style name="RR.Dark.UltraBlack" parent="RR.Dark">

<item name="android:actionOverflowButtonStyle">@style/RR.Base.Widget.AppCompat.ActionButton.Overflow</item>

<item name="colorPrimary">#000000</item>
<item name="colorPrimaryDark">#000000</item>
<item name="colorAccent">#99DDDD</item>

<item name="rrPostListHeaderBackgroundCol">#000000</item>

<item name="rrMainTextCol">#FFFFFF</item>
<item name="rrSubTextCol">#AAAAAA</item>

<item name="android:windowBackground">@color/darkWindowBackground</item>

<item name="rrListItemBackgroundCol">#000000</item>
<item name="rrListItemBackgroundHighlightCol">#555555</item>
<item name="rrListBackgroundCol">#111111</item>

<item name="rrIndentBackgroundCol">#000000</item>
<item name="rrIndentLineCol">#222222</item>

<item name="rrListDividerCol">#000000</item>
<item name="rrListHeaderTextCol">#CCCCCC</item>
<item name="rrListHeaderLineCol">#444444</item>
<item name="rrListSubtitleCol">#CCCCCC</item>

<item name="rrLoadingRingForegroundCol">#C8C8C8</item>
<item name="rrLoadingRingBackgroundCol">#000000</item>

<item name="alertDialogTheme">@style/Theme.AppCompat.Dialog.Alert</item>
<item name="rrActionBarPopupThemeStyle">@style/ThemeOverlay.AppCompat.Dark</item>

<item name="actionBarSize">48dp</item>

<!-- Post -->

<item name="rrPostTitleCol">#DDDDDD</item>
<item name="rrPostTitleReadCol">#909090</item>
<item name="rrPostSubtitleCol">#909090</item>
<item name="rrPostSubtitleBoldCol">#BBBBBB</item>
<item name="rrPostSubtitleUpvoteCol">#FF9B76</item>
<item name="rrPostSubtitleDownvoteCol">#9494FF</item>
<item name="rrPostCommentsButtonBackCol">#000000</item>
<item name="rrPostCommentsButtonHighlightCol">#777777</item>
<item name="rrPostCommentsButtonTextCol">#BBBBBB</item>
<item name="rrPostThumbnailBackground">#000000</item>
<item name="rrPostFlingTextCol">#FFFFFF</item>
<item name="rrFlairBackCol">#222222</item>
<item name="rrFlairTextCol">#AAAAAA</item>
<item name="rrGoldBackCol">#B0923C</item>
<item name="rrGoldTextCol">#000000</item>

<!-- Comment -->

<item name="rrCommentBodyCol">#DDDDDD</item>
<item name="rrCommentHeaderCol">#BBBBBB</item> <!-- TODO -->
<item name="rrCommentHeaderBoldCol">#CCCCCC</item>
<item name="rrCommentHeaderAuthorCol">#FFFFFF</item>
<item name="rrCommentSpecificThreadHeaderBackCol">#000000</item>
<item name="rrCommentSpecificThreadHeaderTextCol">#FFFFFF</item>

</style>

<style name="RR.Settings" parent="Theme.AppCompat">

<item name="alertDialogTheme">@style/Theme.AppCompat.Dialog.Alert</item>
Expand All @@ -186,6 +254,8 @@
<item name="colorPrimaryDark">#111111</item>
<item name="colorAccent">?colorPrimaryDark</item>

<item name="rrPostListHeaderBackgroundCol">#323232</item>

<item name="rrMainTextCol">#000000</item>
<item name="rrSubTextCol">#777777</item>

Expand Down

0 comments on commit 18a5546

Please sign in to comment.