mirror of
https://codeberg.org/gitnex/GitNex.git
synced 2024-12-16 15:48:13 +08:00
Dynamic colors - Android 12+ (#1257)
Closes #1222 Need `Android 12L API 32` if want to test on emulator. Change to Dynamic colors in Settings -> Appearance -> Themes. Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1257 Reviewed-by: qwerty287 <qwerty287@noreply.codeberg.org>
This commit is contained in:
parent
a55276dbad
commit
fb77e541a0
@ -54,16 +54,16 @@ configurations {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
def lifecycle_version = '2.6.0-alpha05'
|
||||
def lifecycle_version = '2.6.0-rc01'
|
||||
def markwon_version = '4.6.2'
|
||||
def work_version = "2.7.1"
|
||||
def work_version = '2.8.0'
|
||||
def acra = '5.9.7'
|
||||
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
implementation 'androidx.appcompat:appcompat:1.6.0'
|
||||
implementation 'com.google.android.material:material:1.9.0-alpha01'
|
||||
implementation 'androidx.compose.material3:material3:1.1.0-alpha05'
|
||||
implementation 'androidx.compose.material3:material3-window-size-class:1.1.0-alpha05'
|
||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||||
implementation 'com.google.android.material:material:1.9.0-alpha02'
|
||||
implementation 'androidx.compose.material3:material3:1.1.0-alpha07'
|
||||
implementation 'androidx.compose.material3:material3-window-size-class:1.1.0-alpha07'
|
||||
implementation 'androidx.viewpager2:viewpager2:1.1.0-beta01'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||
implementation "androidx.legacy:legacy-support-v4:1.0.0"
|
||||
@ -111,7 +111,7 @@ dependencies {
|
||||
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.1.5"
|
||||
implementation 'androidx.biometric:biometric:1.1.0'
|
||||
implementation 'com.github.chrisvest:stormpot:2.4.2'
|
||||
implementation 'androidx.browser:browser:1.4.0'
|
||||
implementation 'androidx.browser:browser:1.5.0'
|
||||
implementation 'com.google.android.flexbox:flexbox:3.0.0'
|
||||
implementation('org.codeberg.gitnex:tea4j-autodeploy:3111bc1b18') {
|
||||
exclude module: 'org.apache.oltu.oauth2.common'
|
||||
|
@ -16,6 +16,7 @@
|
||||
android:resizeableActivity="true"
|
||||
android:roundIcon="@mipmap/app_logo_round"
|
||||
android:supportsRtl="true"
|
||||
android:exported="true"
|
||||
tools:targetApi="n">
|
||||
<activity
|
||||
android:name=".activities.MergePullRequestActivity"
|
||||
|
@ -76,6 +76,9 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
case 7:
|
||||
setTheme(R.style.AppThemeSystemPitchBlack);
|
||||
break;
|
||||
case 8:
|
||||
setTheme(R.style.AppThemeDynamicSystem);
|
||||
break;
|
||||
default:
|
||||
setTheme(R.style.AppThemeSystem);
|
||||
break;
|
||||
|
@ -4,6 +4,7 @@ import android.content.Intent;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
@ -724,6 +725,15 @@ public class IssueDetailActivity extends BaseActivity
|
||||
ctx.getResources()
|
||||
.getColor(R.color.retroThemeColorPrimary, null)));
|
||||
}
|
||||
} else if (tinyDB.getInt("themeId") == 8) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||
ImageViewCompat.setImageTintList(
|
||||
viewBinding.issuePrState,
|
||||
ColorStateList.valueOf(
|
||||
ctx.getResources()
|
||||
.getColor(
|
||||
android.R.color.system_accent1_300, null)));
|
||||
}
|
||||
} else {
|
||||
ImageViewCompat.setImageTintList(
|
||||
viewBinding.issuePrState,
|
||||
@ -765,6 +775,14 @@ public class IssueDetailActivity extends BaseActivity
|
||||
ctx.getResources()
|
||||
.getColor(R.color.retroThemeColorPrimary, null)));
|
||||
}
|
||||
} else if (tinyDB.getInt("themeId") == 8) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||
ImageViewCompat.setImageTintList(
|
||||
viewBinding.issuePrState,
|
||||
ColorStateList.valueOf(
|
||||
ctx.getResources()
|
||||
.getColor(android.R.color.system_accent1_300, null)));
|
||||
}
|
||||
} else {
|
||||
ImageViewCompat.setImageTintList(
|
||||
viewBinding.issuePrState,
|
||||
|
@ -2,6 +2,7 @@ package org.mian.gitnex.activities;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.app.TimePickerDialog;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
@ -47,7 +48,12 @@ public class SettingsAppearanceActivity extends BaseActivity {
|
||||
LinearLayout darkTimeFrame = activitySettingsAppearanceBinding.darkThemeTimeSelectionFrame;
|
||||
|
||||
customFontList = getResources().getStringArray(R.array.fonts);
|
||||
themeList = getResources().getStringArray(R.array.themes);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S || "S".equals(Build.VERSION.CODENAME)) {
|
||||
themeList = getResources().getStringArray(R.array.themesAndroid12);
|
||||
} else {
|
||||
themeList = getResources().getStringArray(R.array.themes);
|
||||
}
|
||||
|
||||
initCloseListener();
|
||||
closeActivity.setOnClickListener(onClickListener);
|
||||
|
@ -1,5 +1,7 @@
|
||||
package org.mian.gitnex.adapters;
|
||||
|
||||
import static org.mian.gitnex.helpers.AppUtil.isNightModeThemeDynamic;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
@ -550,6 +552,10 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
text.indexOf('|'),
|
||||
text.indexOf('|') + 1,
|
||||
Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
if (!isNightModeThemeDynamic(context)) {
|
||||
textView.setTextColor(
|
||||
AppUtil.dynamicColorResource(context));
|
||||
}
|
||||
textView.setText(spannableString);
|
||||
timelineData.addView(textView);
|
||||
},
|
||||
@ -572,11 +578,9 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
} catch (JSONException ignored) {
|
||||
}
|
||||
|
||||
String commitText =
|
||||
context.getResources().getString(R.string.commitsText);
|
||||
String commitText = context.getResources().getString(R.string.commitsText);
|
||||
if (Objects.requireNonNull(commitsShaArray).length() == 1) {
|
||||
commitText =
|
||||
context.getResources().getString(R.string.commitText);
|
||||
commitText = context.getResources().getString(R.string.commitText);
|
||||
}
|
||||
|
||||
String commitString =
|
||||
@ -585,6 +589,9 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
issueComment.getUser().getLogin(),
|
||||
commitText,
|
||||
info);
|
||||
if (!isNightModeThemeDynamic(context)) {
|
||||
start.setTextColor(AppUtil.dynamicColorResource(context));
|
||||
}
|
||||
start.setText(HtmlCompat.fromHtml(commitString, HtmlCompat.FROM_HTML_MODE_LEGACY));
|
||||
start.setTextSize(fontSize);
|
||||
|
||||
@ -643,6 +650,10 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
|
||||
TextView start = new TextView(context);
|
||||
|
||||
if (!isNightModeThemeDynamic(context)) {
|
||||
start.setTextColor(AppUtil.dynamicColorResource(context));
|
||||
}
|
||||
|
||||
if (issueComment.isRemovedAssignee()) {
|
||||
|
||||
if (issueComment
|
||||
@ -694,6 +705,10 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
|
||||
TextView start = new TextView(context);
|
||||
|
||||
if (!isNightModeThemeDynamic(context)) {
|
||||
start.setTextColor(AppUtil.dynamicColorResource(context));
|
||||
}
|
||||
|
||||
if (issueComment.getMilestone() != null) {
|
||||
start.setText(
|
||||
context.getString(
|
||||
@ -732,6 +747,10 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
|
||||
TextView start = new TextView(context);
|
||||
|
||||
if (!isNightModeThemeDynamic(context)) {
|
||||
start.setTextColor(AppUtil.dynamicColorResource(context));
|
||||
}
|
||||
|
||||
if (issue.getIssueType().equalsIgnoreCase("Issue")) {
|
||||
if (issueComment.getType().equals("close")) {
|
||||
start.setText(
|
||||
@ -850,6 +869,10 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
|
||||
TextView start = new TextView(context);
|
||||
|
||||
if (!isNightModeThemeDynamic(context)) {
|
||||
start.setTextColor(AppUtil.dynamicColorResource(context));
|
||||
}
|
||||
|
||||
if (issueComment.getType().equalsIgnoreCase("review")) {
|
||||
timelineView.setVisibility(View.GONE);
|
||||
timelineDividerView.setVisibility(View.GONE);
|
||||
@ -874,6 +897,11 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
else if (issueComment.getType().equalsIgnoreCase("change_title")) {
|
||||
|
||||
TextView start = new TextView(context);
|
||||
|
||||
if (!isNightModeThemeDynamic(context)) {
|
||||
start.setTextColor(AppUtil.dynamicColorResource(context));
|
||||
}
|
||||
|
||||
start.setText(
|
||||
context.getString(
|
||||
R.string.timelineChangeTitle,
|
||||
@ -893,6 +921,10 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
|
||||
TextView start = new TextView(context);
|
||||
|
||||
if (!isNightModeThemeDynamic(context)) {
|
||||
start.setTextColor(AppUtil.dynamicColorResource(context));
|
||||
}
|
||||
|
||||
if (issueComment.getType().equalsIgnoreCase("lock")) {
|
||||
start.setText(
|
||||
context.getString(
|
||||
@ -921,6 +953,10 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
|
||||
TextView start = new TextView(context);
|
||||
|
||||
if (!isNightModeThemeDynamic(context)) {
|
||||
start.setTextColor(AppUtil.dynamicColorResource(context));
|
||||
}
|
||||
|
||||
if (issueComment.getType().equalsIgnoreCase("add_dependency")) {
|
||||
start.setText(
|
||||
context.getString(
|
||||
@ -950,6 +986,10 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
|
||||
TextView start = new TextView(context);
|
||||
|
||||
if (!isNightModeThemeDynamic(context)) {
|
||||
start.setTextColor(AppUtil.dynamicColorResource(context));
|
||||
}
|
||||
|
||||
if (issueComment.getProjectId() > 0) {
|
||||
start.setText(
|
||||
context.getString(
|
||||
@ -978,6 +1018,10 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
|
||||
TextView start = new TextView(context);
|
||||
|
||||
if (!isNightModeThemeDynamic(context)) {
|
||||
start.setTextColor(AppUtil.dynamicColorResource(context));
|
||||
}
|
||||
|
||||
// TODO pretty-print
|
||||
if (issueComment.getType().equalsIgnoreCase("added_deadline")) {
|
||||
start.setText(
|
||||
@ -1016,6 +1060,10 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
|
||||
TextView start = new TextView(context);
|
||||
|
||||
if (!isNightModeThemeDynamic(context)) {
|
||||
start.setTextColor(AppUtil.dynamicColorResource(context));
|
||||
}
|
||||
|
||||
if (issueComment.getType().equalsIgnoreCase("change_target_branch")) {
|
||||
start.setText(
|
||||
context.getString(
|
||||
@ -1049,6 +1097,10 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
|
||||
TextView start = new TextView(context);
|
||||
|
||||
if (!isNightModeThemeDynamic(context)) {
|
||||
start.setTextColor(AppUtil.dynamicColorResource(context));
|
||||
}
|
||||
|
||||
if (issueComment.getType().equalsIgnoreCase("start_tracking")) {
|
||||
start.setText(
|
||||
context.getString(
|
||||
|
@ -2,6 +2,7 @@ package org.mian.gitnex.core;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import com.google.android.material.color.DynamicColors;
|
||||
import org.acra.ACRA;
|
||||
import org.acra.BuildConfig;
|
||||
import org.acra.ReportField;
|
||||
@ -41,6 +42,7 @@ public class MainApplication extends Application {
|
||||
FontsOverride.setDefaultFont(getBaseContext());
|
||||
|
||||
Notifications.createChannels(appCtx);
|
||||
DynamicColors.applyToActivitiesIfAvailable(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -663,4 +663,26 @@ public class AppUtil {
|
||||
|
||||
void onProgressChanged(short progress);
|
||||
}
|
||||
|
||||
public static boolean isNightModeThemeDynamic(Context context) {
|
||||
|
||||
TinyDB tinyDB = TinyDB.getInstance(context);
|
||||
int nightModeFlags =
|
||||
context.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
|
||||
|
||||
if (tinyDB.getInt("themeId") == 8) {
|
||||
return nightModeFlags == Configuration.UI_MODE_NIGHT_YES;
|
||||
} else {
|
||||
return nightModeFlags == Configuration.UI_MODE_NIGHT_NO;
|
||||
}
|
||||
}
|
||||
|
||||
public static int dynamicColorResource(Context context) {
|
||||
|
||||
int resource = 0;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||
resource = context.getResources().getColor(android.R.color.system_accent1_900, null);
|
||||
}
|
||||
return resource;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package org.mian.gitnex.helpers;
|
||||
|
||||
import static org.mian.gitnex.helpers.AppUtil.isNightModeThemeDynamic;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Typeface;
|
||||
@ -366,6 +368,10 @@ public class Markdown {
|
||||
tf = AppUtil.getTypeface(context);
|
||||
}
|
||||
textView.setTypeface(tf);
|
||||
if (!isNightModeThemeDynamic(context)) {
|
||||
textView.setTextColor(
|
||||
AppUtil.dynamicColorResource(context));
|
||||
}
|
||||
super.beforeSetText(textView, markdown);
|
||||
}
|
||||
|
||||
|
@ -48,6 +48,8 @@
|
||||
android:id="@+id/nav_view"
|
||||
app:headerLayout="@layout/nav_header"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
app:itemIconTint="?attr/primaryTextColor"
|
||||
app:itemTextColor="?attr/primaryTextColor"
|
||||
app:menu="@menu/drawer_menu"/>
|
||||
|
||||
</androidx.drawerlayout.widget.DrawerLayout>
|
||||
|
@ -261,7 +261,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/label_title_frame"
|
||||
android:layout_marginStart="@dimen/dimen24dp"
|
||||
android:layout_marginEnd="@dimen/dimen72dp"
|
||||
android:layout_marginEnd="@dimen/dimen84dp"
|
||||
android:text="@string/settingsLabelsInListHint"
|
||||
android:textColor="?attr/hintColor"
|
||||
android:textSize="@dimen/dimen12sp" />
|
||||
|
@ -17,7 +17,7 @@
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginTop="@dimen/dimen12dp"
|
||||
android:orientation="vertical"
|
||||
tools:ignore="UselessParent">
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:contentDescription="@string/appName"
|
||||
android:src="@mipmap/app_logo"/>
|
||||
android:src="@mipmap/app_logo" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
@ -49,29 +49,43 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginTop="@dimen/dimen6dp"
|
||||
android:text="@string/appName"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold"/>
|
||||
android:textSize="@dimen/dimen24sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/appVersionBuild"
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="@string/appVersionBuild"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="14sp"/>
|
||||
android:layout_marginTop="@dimen/dimen6dp"
|
||||
app:cardBackgroundColor="@color/colorWhite"
|
||||
app:cardCornerRadius="@dimen/dimen36dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/appVersionBuild"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="@string/appVersionBuild"
|
||||
android:textColor="@color/iconPrMergedColor"
|
||||
android:textIsSelectable="true"
|
||||
android:paddingTop="@dimen/dimen8dp"
|
||||
android:paddingBottom="@dimen/dimen8dp"
|
||||
android:paddingStart="@dimen/dimen10dp"
|
||||
android:paddingEnd="@dimen/dimen10dp"
|
||||
android:textSize="@dimen/dimen14sp" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginTop="@dimen/dimen16dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- user server version -->
|
||||
@ -79,23 +93,23 @@
|
||||
android:id="@+id/userServerVersionHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:paddingStart="28dp"
|
||||
android:paddingEnd="28dp"
|
||||
android:layout_marginTop="@dimen/dimen24dp"
|
||||
android:paddingStart="@dimen/dimen28dp"
|
||||
android:paddingEnd="@dimen/dimen28dp"
|
||||
android:text="@string/commitPage"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"/>
|
||||
android:textSize="@dimen/dimen16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/userServerVersion"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="28dp"
|
||||
android:paddingEnd="28dp"
|
||||
android:paddingStart="@dimen/dimen28dp"
|
||||
android:paddingEnd="@dimen/dimen28dp"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="14sp"/>
|
||||
android:textSize="@dimen/dimen14sp" />
|
||||
<!-- user server version -->
|
||||
|
||||
<!-- support -->
|
||||
@ -103,37 +117,37 @@
|
||||
android:id="@+id/supportHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:paddingStart="28dp"
|
||||
android:paddingEnd="28dp"
|
||||
android:layout_marginTop="@dimen/dimen24dp"
|
||||
android:paddingStart="@dimen/dimen28dp"
|
||||
android:paddingEnd="@dimen/dimen28dp"
|
||||
android:text="@string/supportText"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"/>
|
||||
android:textSize="@dimen/dimen16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/donationLinkPatreon"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:autoLink="web"
|
||||
android:paddingStart="28dp"
|
||||
android:paddingEnd="28dp"
|
||||
android:paddingStart="@dimen/dimen28dp"
|
||||
android:paddingEnd="@dimen/dimen28dp"
|
||||
android:text="@string/supportTextPatreon"
|
||||
android:textColor="@color/lightBlue"
|
||||
android:textColorLink="@color/lightBlue"
|
||||
android:textSize="14sp"/>
|
||||
android:textSize="@dimen/dimen14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/donationLinkBuyMeaCoffee"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:autoLink="web"
|
||||
android:paddingStart="28dp"
|
||||
android:paddingEnd="28dp"
|
||||
android:paddingStart="@dimen/dimen28dp"
|
||||
android:paddingEnd="@dimen/dimen28dp"
|
||||
android:text="@string/supportTextBuyMeaCoffee"
|
||||
android:textColor="@color/lightBlue"
|
||||
android:textColorLink="@color/lightBlue"
|
||||
android:textSize="14sp"/>
|
||||
android:textSize="@dimen/dimen14sp" />
|
||||
<!-- support -->
|
||||
|
||||
<!-- translate -->
|
||||
@ -141,13 +155,13 @@
|
||||
android:id="@+id/translateHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:paddingStart="28dp"
|
||||
android:paddingEnd="28dp"
|
||||
android:layout_marginTop="@dimen/dimen24dp"
|
||||
android:paddingStart="@dimen/dimen28dp"
|
||||
android:paddingEnd="@dimen/dimen28dp"
|
||||
android:text="@string/translateText"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"/>
|
||||
android:textSize="@dimen/dimen16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/translateLink"
|
||||
@ -155,13 +169,13 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:autoLink="web"
|
||||
android:gravity="start"
|
||||
android:paddingStart="28dp"
|
||||
android:paddingEnd="28dp"
|
||||
android:paddingStart="@dimen/dimen28dp"
|
||||
android:paddingEnd="@dimen/dimen28dp"
|
||||
android:text="@string/translateWithCrowdin"
|
||||
android:textColor="@color/lightBlue"
|
||||
android:textColorLink="@color/lightBlue"
|
||||
android:textSize="14sp"
|
||||
android:visibility="visible"/>
|
||||
android:textSize="@dimen/dimen14sp"
|
||||
android:visibility="visible" />
|
||||
<!-- translate -->
|
||||
|
||||
</LinearLayout>
|
||||
@ -174,8 +188,8 @@
|
||||
android:layout_margin="@dimen/dimen24dp"
|
||||
android:text="@string/websiteText"
|
||||
android:textColor="@color/btnTextColor"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"/>
|
||||
android:textSize="@dimen/dimen16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -64,7 +64,7 @@
|
||||
android:paddingBottom="@dimen/dimen10dp"
|
||||
android:paddingStart="@dimen/dimen0dp"
|
||||
android:paddingEnd="@dimen/dimen0dp"
|
||||
android:textColor="@color/lightGray"/>
|
||||
android:textColor="?attr/hintColor"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/repoMetaDataExpandCollapse"
|
||||
@ -456,7 +456,7 @@
|
||||
android:paddingEnd="@dimen/dimen0dp"
|
||||
android:autoLink="web"
|
||||
android:textColorLink="@color/lightBlue"
|
||||
android:textColor="@color/lightGray"/>
|
||||
android:textColor="?attr/hintColor"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/repoFilenameExpandCollapse"
|
||||
|
@ -1,7 +1,7 @@
|
||||
<resources>
|
||||
|
||||
<style name="AppThemeSystem" parent="AppTheme"/>
|
||||
|
||||
<style name="AppThemeSystemPitchBlack" parent="AppThemePitchBlack"/>
|
||||
|
||||
<style name="AppThemeDynamicSystem" parent="AppThemeDarkDynamicColors"/>
|
||||
</resources>
|
||||
|
100
app/src/main/res/values-v31/themes.xml
Normal file
100
app/src/main/res/values-v31/themes.xml
Normal file
@ -0,0 +1,100 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="AppThemeDarkDynamicColors" parent="Theme.Material3.Dark.NoActionBar">
|
||||
<item name="android:statusBarColor">@android:color/system_neutral1_900</item>
|
||||
<item name="android:typeface">monospace</item>
|
||||
<item name="colorAccent">@android:color/system_neutral1_800</item>
|
||||
<item name="android:textColorSecondary">@android:color/system_accent1_0</item>
|
||||
<item name="android:textColorPrimary">@android:color/system_accent1_0</item>
|
||||
<item name="colorPrimary">@android:color/system_accent1_300</item>
|
||||
<item name="colorSecondary">@android:color/system_accent1_0</item>
|
||||
<item name="colorOnSurfaceVariant">@android:color/system_accent1_0</item>
|
||||
<item name="colorSecondaryContainer">@android:color/system_neutral1_800</item>
|
||||
<item name="materialCardBackgroundColor">@android:color/system_neutral1_800</item>
|
||||
|
||||
<item name="diffAddedColor">@color/diffAddedColor</item>
|
||||
<item name="diffRemovedColor">@color/diffRemovedColor</item>
|
||||
<item name="diffSelectedColor">@color/diffSelectedColor</item>
|
||||
<item name="primaryTextColor">@android:color/system_accent1_0</item>
|
||||
<item name="primaryBackgroundColor">@android:color/system_neutral1_900</item>
|
||||
<item name="inputBackgroundColor">@android:color/system_neutral1_800</item>
|
||||
<item name="inputSelectedColor">@android:color/system_accent1_300</item>
|
||||
<item name="inputTextColor">@android:color/system_accent1_0</item>
|
||||
<item name="checkboxStyle">@style/AppThemeCheckBoxStyle</item>
|
||||
<item name="selectedTextColor">@android:color/system_accent1_300</item>
|
||||
<item name="alertDialogTheme">@style/AppThemeConfirmDialog</item>
|
||||
<item name="popupMenuStyle">@style/AppThemePopupMenuStyle</item>
|
||||
<item name="android:homeAsUpIndicator">@drawable/ic_arrow_back</item>
|
||||
<item name="autoCompleteTextViewStyle">@style/AppThemeDarkSearchAutoCompleteTextView</item>
|
||||
<item name="hintColor">@android:color/system_accent1_10</item>
|
||||
<item name="colorControlActivated">@android:color/system_accent1_300</item>
|
||||
<item name="dividerColor">@android:color/system_accent2_600</item>
|
||||
<item name="bottomSheetDialogTheme">@style/AppThemeDarkBottomSheetDialog</item>
|
||||
<item name="searchViewStyle">@style/AppSearchViewStyle</item>
|
||||
<item name="progressIndicatorColor">@android:color/system_accent1_300</item>
|
||||
<item name="fabColor">@android:color/system_accent1_300</item>
|
||||
<item name="iconsColor">@android:color/system_accent1_300</item>
|
||||
<item name="pagerTabIndicatorColor">@android:color/system_accent1_300</item>
|
||||
<item name="android:actionOverflowButtonStyle">@style/customOverflowButtonStyle</item>
|
||||
<item name="actionOverflowMenuStyle">@style/customOverflowMenuStyle</item>
|
||||
<item name="colorSurface">@android:color/system_neutral1_800</item>
|
||||
<item name="shapeAppearanceSmallComponent">@style/inputsMaterialComponentCorner</item>
|
||||
<item name="android:windowAnimationStyle">@style/WindowAnimationTransition</item>
|
||||
<item name="materialSwitchStyle">@style/materialSwitchStyle</item>
|
||||
<item name="isDark">1</item>
|
||||
</style>
|
||||
|
||||
<style name="AppThemeLightDynamicColors" parent="Theme.Material3.Dark.NoActionBar">
|
||||
<item name="android:statusBarColor">@android:color/system_neutral1_10</item>
|
||||
<item name="android:windowLightStatusBar">true</item>
|
||||
<item name="android:typeface">monospace</item>
|
||||
<item name="materialCardBackgroundColor">@android:color/system_accent2_50</item>
|
||||
<item name="colorOnSurfaceVariant">@android:color/system_accent2_900</item>
|
||||
<item name="colorSecondaryContainer">@android:color/system_accent1_200</item>
|
||||
<item name="colorPrimary">@android:color/system_accent1_300</item>
|
||||
<item name="colorAccent">@android:color/system_neutral1_800</item>
|
||||
<item name="android:textColorSecondary">@android:color/system_neutral1_800</item>
|
||||
<item name="android:textColorPrimary">@android:color/system_neutral1_800</item>
|
||||
<item name="colorSecondary">@android:color/system_accent1_200</item>
|
||||
<item name="colorOnSurface">@android:color/system_accent2_900</item>
|
||||
|
||||
<item name="diffAddedColor">@color/diffAddedColor</item>
|
||||
<item name="diffRemovedColor">@color/diffRemovedColor</item>
|
||||
<item name="diffSelectedColor">@color/diffSelectedColor</item>
|
||||
<item name="primaryTextColor">@android:color/system_accent2_900</item>
|
||||
<item name="primaryBackgroundColor">@android:color/system_neutral1_10</item>
|
||||
<item name="hintColor">@android:color/system_accent1_800</item>
|
||||
<item name="dividerColor">@android:color/system_accent2_600</item>
|
||||
<item name="colorSurface">@android:color/system_neutral1_10</item>
|
||||
<item name="checkboxStyle">@style/AppThemeLightCheckBoxStyle</item>
|
||||
<item name="alertDialogTheme">@style/AppThemeLightConfirmDialog</item>
|
||||
<item name="popupMenuStyle">@style/AppThemeLightPopupMenuStyle</item>
|
||||
<item name="android:homeAsUpIndicator">@drawable/ic_arrow_back</item>
|
||||
<item name="autoCompleteTextViewStyle">@style/AppThemeLightSearchAutoCompleteTextView</item>
|
||||
<item name="bottomSheetDialogTheme">@style/AppThemeLightBottomSheetDialog</item>
|
||||
<item name="searchViewStyle">@style/AppSearchViewStyle</item>
|
||||
<item name="android:actionOverflowButtonStyle">@style/customOverflowButtonStyle</item>
|
||||
<item name="actionOverflowMenuStyle">@style/customOverflowMenuStyle</item>
|
||||
<item name="shapeAppearanceSmallComponent">@style/inputsMaterialComponentCorner</item>
|
||||
<item name="android:windowAnimationStyle">@style/WindowAnimationTransition</item>
|
||||
<item name="progressIndicatorColor">@android:color/system_accent1_300</item>
|
||||
<item name="fabColor">@android:color/system_accent1_300</item>
|
||||
<item name="iconsColor">@android:color/system_accent1_300</item>
|
||||
<item name="pagerTabIndicatorColor">@android:color/system_accent1_300</item>
|
||||
<item name="selectedTextColor">@android:color/system_accent1_300</item>
|
||||
<item name="colorControlActivated">@android:color/system_accent1_300</item>
|
||||
<item name="inputBackgroundColor">@android:color/system_neutral1_50</item>
|
||||
<item name="inputSelectedColor">@android:color/system_accent1_300</item>
|
||||
<item name="inputTextColor">@android:color/system_accent2_900</item>
|
||||
<item name="materialSwitchStyle">@style/materialSwitchStyle</item>
|
||||
<item name="isDark">0</item>
|
||||
</style>
|
||||
|
||||
<style name="AppThemeLightCheckBoxStyle" parent="Widget.Material3.CompoundButton.CheckBox">
|
||||
<item name="buttonTint">@android:color/system_accent1_300</item>
|
||||
</style>
|
||||
|
||||
<style name="materialSwitchStyle" parent="Widget.Material3.CompoundButton.MaterialSwitch">
|
||||
<item name="thumbTint">@android:color/system_accent1_0</item>
|
||||
</style>
|
||||
</resources>
|
@ -39,6 +39,18 @@
|
||||
<item>@string/followSystemBlack</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="themesAndroid12">
|
||||
<item>Dark</item>
|
||||
<item>Light</item>
|
||||
<item>Auto (Light/Dark)</item>
|
||||
<item>Retro</item>
|
||||
<item>Auto (Retro/Dark)</item>
|
||||
<item>Pitch Black</item>
|
||||
<item>@string/followSystem</item>
|
||||
<item>@string/followSystemBlack</item>
|
||||
<item>@string/dynamicColorsFollowSystem</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="appDefaultHomeScreen">
|
||||
<item>@string/navMyRepos</item>
|
||||
<item>@string/pageTitleStarredRepos</item>
|
||||
|
@ -766,6 +766,7 @@
|
||||
<string name="notLoggedIn">%s \u25CF not logged in</string>
|
||||
<string name="followSystem">Follow system (Light/Dark)</string>
|
||||
<string name="followSystemBlack">Follow system (Light/Pitch Black)</string>
|
||||
<string name="dynamicColorsFollowSystem">Dynamic colors - Follow system (Light/Dark)</string>
|
||||
<string name="repoForkOf">Fork of: %s</string>
|
||||
<string name="adoptRepo">Adopt</string>
|
||||
<string name="repoAdopted">Adopted repository %s</string>
|
||||
|
@ -42,6 +42,7 @@
|
||||
<item name="colorSurface">@color/inputBackground</item>
|
||||
<item name="shapeAppearanceSmallComponent">@style/inputsMaterialComponentCorner</item>
|
||||
<item name="android:windowAnimationStyle">@style/WindowAnimationTransition</item>
|
||||
<item name="materialSwitchStyle">@style/m3SwitchStyle</item>
|
||||
<item name="isDark">1</item>
|
||||
</style>
|
||||
<!-- Dark theme - default -->
|
||||
@ -176,10 +177,15 @@
|
||||
<item name="colorSurface">@color/inputBackground</item>
|
||||
<item name="shapeAppearanceSmallComponent">@style/inputsMaterialComponentCorner</item>
|
||||
<item name="android:windowAnimationStyle">@style/WindowAnimationTransition</item>
|
||||
<item name="materialSwitchStyle">@style/m3SwitchStyle</item>
|
||||
<item name="isDark">1</item>
|
||||
</style>
|
||||
<!-- Pitch black theme -->
|
||||
|
||||
<style name="m3SwitchStyle" parent="Widget.Material3.CompoundButton.MaterialSwitch">
|
||||
<item name="thumbTint">@color/colorWhite</item>
|
||||
</style>
|
||||
|
||||
<!-- Custom Material cards -->
|
||||
<style name="CustomMaterCardViewStyle" parent="@style/Widget.MaterialComponents.CardView">
|
||||
<item name="shapeAppearanceOverlay">@style/ShapeAppearanceOverlay.card.custom.corners</item>
|
||||
@ -387,4 +393,5 @@
|
||||
|
||||
<style name="AppThemeSystemPitchBlack" parent="AppThemeLight"/>
|
||||
|
||||
<style name="AppThemeDynamicSystem" parent="AppThemeLightDynamicColors"/>
|
||||
</resources>
|
||||
|
Loading…
Reference in New Issue
Block a user