Replacements
This commit is contained in:
parent
216887800b
commit
11ea166a0d
|
@ -139,6 +139,7 @@ import app.fedilab.android.helper.Helper;
|
||||||
import app.fedilab.android.helper.MastodonHelper;
|
import app.fedilab.android.helper.MastodonHelper;
|
||||||
import app.fedilab.android.helper.PinnedTimelineHelper;
|
import app.fedilab.android.helper.PinnedTimelineHelper;
|
||||||
import app.fedilab.android.helper.PushHelper;
|
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.FragmentMastodonConversation;
|
||||||
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonTimeline;
|
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonTimeline;
|
||||||
import app.fedilab.android.ui.fragment.timeline.FragmentNotificationContainer;
|
import app.fedilab.android.ui.fragment.timeline.FragmentNotificationContainer;
|
||||||
|
@ -301,7 +302,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
|
||||||
} else {
|
} else {
|
||||||
BaseMainActivity.currentToken = sharedpreferences.getString(Helper.PREF_USER_TOKEN, null);
|
BaseMainActivity.currentToken = sharedpreferences.getString(Helper.PREF_USER_TOKEN, null);
|
||||||
}
|
}
|
||||||
|
ThemeHelper.initiliazeColors(BaseMainActivity.this);
|
||||||
|
|
||||||
mamageNewIntent(getIntent());
|
mamageNewIntent(getIntent());
|
||||||
filterFetched = false;
|
filterFetched = false;
|
||||||
|
|
|
@ -60,6 +60,19 @@ public class ThemeHelper {
|
||||||
return typedValue.data;
|
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) {
|
public static int fetchAccentColor(Context context) {
|
||||||
TypedValue typedValue = new TypedValue();
|
TypedValue typedValue = new TypedValue();
|
||||||
|
|
|
@ -19,7 +19,8 @@
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?backgroundColor"
|
|
||||||
|
android:background="?android:windowBackground"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="12dp"
|
android:padding="12dp"
|
||||||
tools:context=".activities.LoginActivity">
|
tools:context=".activities.LoginActivity">
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:background="?backgroundColor"
|
android:background="?android:windowBackground"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?backgroundColor"
|
android:background="?android:windowBackground"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="12dp">
|
android:padding="12dp">
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?backgroundColor"
|
android:background="?android:windowBackground"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="12dp">
|
android:padding="12dp">
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,10 @@
|
||||||
-->
|
-->
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:background="?android:windowBackground"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<!-- Listview status -->
|
<!-- Listview status -->
|
||||||
|
@ -98,9 +100,9 @@
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_margin="@dimen/fab_margin"
|
android:layout_margin="@dimen/fab_margin"
|
||||||
android:contentDescription="@string/create_domain_block"
|
|
||||||
android:src="@drawable/ic_baseline_add_24"
|
android:src="@drawable/ic_baseline_add_24"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent" />
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
tools:ignore="ContentDescription" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<resources>
|
<resources>
|
||||||
|
<attr name="linkColor" type="color" />
|
||||||
|
|
||||||
<style name="AppTheme" parent="Theme.Material3.Light.NoActionBar">
|
<style name="AppTheme" parent="Theme.Material3.Light.NoActionBar">
|
||||||
<item name="colorPrimary">@color/deep_purple_700</item>
|
<item name="colorPrimary">@color/deep_purple_700</item>
|
||||||
|
@ -9,7 +10,7 @@
|
||||||
<item name="colorSecondaryVariant">@color/indigo_900</item>
|
<item name="colorSecondaryVariant">@color/indigo_900</item>
|
||||||
<item name="colorOnSecondary">@color/white</item>
|
<item name="colorOnSecondary">@color/white</item>
|
||||||
|
|
||||||
|
<item name="linkColor">@color/light_link_toot</item>
|
||||||
<item name="colorError">@color/red_900</item>
|
<item name="colorError">@color/red_900</item>
|
||||||
<item name="windowNoTitle">true</item>
|
<item name="windowNoTitle">true</item>
|
||||||
|
|
||||||
|
@ -31,7 +32,7 @@
|
||||||
<item name="colorSecondary">@color/indigo_700</item>
|
<item name="colorSecondary">@color/indigo_700</item>
|
||||||
<item name="colorSecondaryVariant">@color/indigo_900</item>
|
<item name="colorSecondaryVariant">@color/indigo_900</item>
|
||||||
<item name="colorOnSecondary">@color/indigo_600</item>
|
<item name="colorOnSecondary">@color/indigo_600</item>
|
||||||
|
<item name="linkColor">@color/dark_link_toot</item>
|
||||||
<item name="colorError">@color/red_900</item>
|
<item name="colorError">@color/red_900</item>
|
||||||
<item name="windowNoTitle">true</item>
|
<item name="windowNoTitle">true</item>
|
||||||
<!-- specify enter and exit transitions -->
|
<!-- specify enter and exit transitions -->
|
||||||
|
@ -52,7 +53,7 @@
|
||||||
<item name="colorPrimary">@color/deep_purple_700</item>
|
<item name="colorPrimary">@color/deep_purple_700</item>
|
||||||
<item name="colorPrimaryVariant">@color/deep_purple_900</item>
|
<item name="colorPrimaryVariant">@color/deep_purple_900</item>
|
||||||
<item name="colorOnPrimary">@color/white</item>
|
<item name="colorOnPrimary">@color/white</item>
|
||||||
|
<item name="linkColor">@color/light_link_toot</item>
|
||||||
<item name="colorSecondary">@color/indigo_700</item>
|
<item name="colorSecondary">@color/indigo_700</item>
|
||||||
<item name="colorSecondaryVariant">@color/indigo_900</item>
|
<item name="colorSecondaryVariant">@color/indigo_900</item>
|
||||||
<item name="colorOnSecondary">@color/white</item>
|
<item name="colorOnSecondary">@color/white</item>
|
||||||
|
@ -66,7 +67,7 @@
|
||||||
<item name="colorPrimary">@color/deep_purple_700</item>
|
<item name="colorPrimary">@color/deep_purple_700</item>
|
||||||
<item name="colorPrimaryVariant">@color/deep_purple_900</item>
|
<item name="colorPrimaryVariant">@color/deep_purple_900</item>
|
||||||
<item name="colorOnPrimary">@color/white</item>
|
<item name="colorOnPrimary">@color/white</item>
|
||||||
|
<item name="linkColor">@color/dark_link_toot</item>
|
||||||
<item name="colorSecondary">@color/indigo_700</item>
|
<item name="colorSecondary">@color/indigo_700</item>
|
||||||
<item name="colorSecondaryVariant">@color/indigo_900</item>
|
<item name="colorSecondaryVariant">@color/indigo_900</item>
|
||||||
<item name="colorOnSecondary">@color/white</item>
|
<item name="colorOnSecondary">@color/white</item>
|
||||||
|
|
Loading…
Reference in New Issue