diff --git a/app/src/main/java/app/fedilab/android/BaseMainActivity.java b/app/src/main/java/app/fedilab/android/BaseMainActivity.java index a68279d50..d155eb616 100644 --- a/app/src/main/java/app/fedilab/android/BaseMainActivity.java +++ b/app/src/main/java/app/fedilab/android/BaseMainActivity.java @@ -139,6 +139,7 @@ import app.fedilab.android.helper.Helper; import app.fedilab.android.helper.MastodonHelper; import app.fedilab.android.helper.PinnedTimelineHelper; import app.fedilab.android.helper.PushHelper; +import app.fedilab.android.helper.ThemeHelper; import app.fedilab.android.ui.fragment.timeline.FragmentMastodonConversation; import app.fedilab.android.ui.fragment.timeline.FragmentMastodonTimeline; import app.fedilab.android.ui.fragment.timeline.FragmentNotificationContainer; @@ -301,7 +302,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt } else { BaseMainActivity.currentToken = sharedpreferences.getString(Helper.PREF_USER_TOKEN, null); } - + ThemeHelper.initiliazeColors(BaseMainActivity.this); mamageNewIntent(getIntent()); filterFetched = false; diff --git a/app/src/main/java/app/fedilab/android/helper/ThemeHelper.java b/app/src/main/java/app/fedilab/android/helper/ThemeHelper.java index 3ce1b2d63..1bd3e3b0d 100644 --- a/app/src/main/java/app/fedilab/android/helper/ThemeHelper.java +++ b/app/src/main/java/app/fedilab/android/helper/ThemeHelper.java @@ -60,6 +60,19 @@ public class ThemeHelper { return typedValue.data; } + public static void initiliazeColors(Activity activity) { + TypedValue typedValue = new TypedValue(); + Resources.Theme theme = activity.getTheme(); + theme.resolveAttribute(R.attr.linkColor, typedValue, true); + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity); + linkColor = -1; + if (prefs.getBoolean("use_custom_theme", false)) { + linkColor = prefs.getInt("theme_link_color", -1); + } + if (linkColor == -1) { + linkColor = typedValue.data; + } + } public static int fetchAccentColor(Context context) { TypedValue typedValue = new TypedValue(); diff --git a/app/src/main/res/layout/fragment_login_join.xml b/app/src/main/res/layout/fragment_login_join.xml index 2a0de3fba..74e8bf947 100644 --- a/app/src/main/res/layout/fragment_login_join.xml +++ b/app/src/main/res/layout/fragment_login_join.xml @@ -19,7 +19,8 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="?backgroundColor" + + android:background="?android:windowBackground" android:orientation="vertical" android:padding="12dp" tools:context=".activities.LoginActivity"> diff --git a/app/src/main/res/layout/fragment_login_main.xml b/app/src/main/res/layout/fragment_login_main.xml index 90fda3133..bba6be971 100644 --- a/app/src/main/res/layout/fragment_login_main.xml +++ b/app/src/main/res/layout/fragment_login_main.xml @@ -17,7 +17,7 @@ diff --git a/app/src/main/res/layout/fragment_login_register_mastodon.xml b/app/src/main/res/layout/fragment_login_register_mastodon.xml index b3d1d581a..9bf162f9f 100644 --- a/app/src/main/res/layout/fragment_login_register_mastodon.xml +++ b/app/src/main/res/layout/fragment_login_register_mastodon.xml @@ -18,7 +18,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="?backgroundColor" + android:background="?android:windowBackground" android:orientation="vertical" android:padding="12dp"> diff --git a/app/src/main/res/layout/fragment_pagination.xml b/app/src/main/res/layout/fragment_pagination.xml index 293002c7f..103a57141 100644 --- a/app/src/main/res/layout/fragment_pagination.xml +++ b/app/src/main/res/layout/fragment_pagination.xml @@ -16,8 +16,10 @@ --> @@ -98,9 +100,9 @@ android:layout_alignParentEnd="true" android:layout_alignParentBottom="true" android:layout_margin="@dimen/fab_margin" - android:contentDescription="@string/create_domain_block" android:src="@drawable/ic_baseline_add_24" android:visibility="gone" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" /> + app:layout_constraintEnd_toEndOf="parent" + tools:ignore="ContentDescription" /> diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 0a609cec9..4f4ec9f36 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -1,4 +1,5 @@ +