Split activities

This commit is contained in:
Thomas 2022-11-30 11:00:53 +01:00
parent 7d6f7167fd
commit 13b9a43bc3
30 changed files with 305 additions and 590 deletions

View File

@ -244,11 +244,6 @@
android:label="@string/action_about"
android:theme="@style/AppThemeBar" />
<activity
android:name=".activities.ThemeSettingsActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/theming"
android:theme="@style/AppThemeBar" />
<activity
android:name=".activities.admin.AdminDomainBlockActivity"
android:configChanges="keyboardHidden|orientation|screenSize"

View File

@ -45,15 +45,6 @@ public class MainApplication extends MultiDexApplication {
return app;
}
private static final int[] HARMONIZED_MATERIAL_ATTRIBUTES =
new int[]{
R.attr.colorOnPrimary,
R.attr.colorPrimaryContainer,
R.attr.colorError,
R.attr.colorOnError,
R.attr.colorErrorContainer,
R.attr.colorOnErrorContainer
};
@Override
public void onCreate() {
@ -61,19 +52,12 @@ public class MainApplication extends MultiDexApplication {
app = this;
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(MainApplication.this);
DynamicColors.applyToActivitiesIfAvailable(this);
boolean custom_theme = sharedpreferences.getBoolean("use_custom_theme", false);
boolean no_theme_set = sharedpreferences.getBoolean("no_theme_set", true);
if (no_theme_set && !custom_theme) {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean("no_theme_set", false);
editor.apply();
boolean dynamicColor = sharedpreferences.getBoolean(getString(R.string.SET_DYNAMICCOLOR), false);
if (dynamicColor) {
DynamicColors.applyToActivitiesIfAvailable(this);
}
StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
StrictMode.setVmPolicy(builder.build());
Toasty.Config.getInstance().apply();
}

View File

@ -40,7 +40,7 @@ import app.fedilab.android.helper.MastodonHelper;
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
public class AboutActivity extends BaseActivity {
public class AboutActivity extends BaseBarActivity {
private ActivityAboutBinding binding;

View File

@ -39,7 +39,7 @@ import app.fedilab.android.ui.drawer.StatusReportAdapter;
import app.fedilab.android.viewmodel.mastodon.AdminVM;
import es.dmoral.toasty.Toasty;
public class AccountReportActivity extends BaseActivity {
public class AccountReportActivity extends BaseBarActivity {
private String account_id;

View File

@ -30,7 +30,7 @@ import app.fedilab.android.ui.fragment.timeline.FragmentMastodonAccount;
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonDomainBlock;
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonTimeline;
public class ActionActivity extends BaseActivity {
public class ActionActivity extends BaseBarActivity {
private ActivityActionsBinding binding;
private boolean canGoBack;

View File

@ -15,39 +15,32 @@ package app.fedilab.android.activities;
* see <http://www.gnu.org/licenses>. */
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.MenuItem;
import app.fedilab.android.databinding.ActivityThemeSettingsBinding;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import com.vanniktech.emoji.EmojiManager;
import com.vanniktech.emoji.one.EmojiOneProvider;
import app.fedilab.android.helper.Helper;
import app.fedilab.android.helper.ThemeHelper;
public class ThemeSettingsActivity extends BaseActivity {
private ActivityThemeSettingsBinding binding;
@SuppressLint("Registered")
public class BaseBarActivity extends AppCompatActivity {
static {
Helper.installProvider();
EmojiManager.install(new EmojiOneProvider());
}
@Override
protected void onCreate(Bundle savedInstanceState) {
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = ActivityThemeSettingsBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
ThemeHelper.adjustFontScale(this, getResources().getConfiguration());
Helper.setLocale(this);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == android.R.id.home) {
finish();
return true;
}
return super.onOptionsItemSelected(item);
}
}

View File

@ -42,7 +42,7 @@ import app.fedilab.android.helper.CacheHelper;
import app.fedilab.android.helper.Helper;
import app.fedilab.android.ui.drawer.CacheAdapter;
public class CacheActivity extends BaseActivity {
public class CacheActivity extends BaseBarActivity {
private ActivityCacheBinding binding;
private List<CacheAccount> cacheAccounts;

View File

@ -48,7 +48,7 @@ import es.dmoral.toasty.Toasty;
* Share status metadata to remote content aggregators
*/
public class CustomSharingActivity extends BaseActivity implements OnCustomSharingInterface {
public class CustomSharingActivity extends BaseBarActivity implements OnCustomSharingInterface {
private String title, keywords, custom_sharing_url, encodedCustomSharingURL;
private String bundle_url;

View File

@ -52,7 +52,7 @@ import app.fedilab.android.helper.MastodonHelper;
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
import es.dmoral.toasty.Toasty;
public class EditProfileActivity extends BaseActivity {
public class EditProfileActivity extends BaseBarActivity {
public static final int PICK_MEDIA_AVATAR = 5705;
public static final int PICK_MEDIA_HEADER = 5706;

View File

@ -45,7 +45,7 @@ import app.fedilab.android.ui.drawer.FilterAdapter;
import app.fedilab.android.ui.drawer.KeywordAdapter;
import app.fedilab.android.viewmodel.mastodon.FiltersVM;
public class FilterActivity extends BaseActivity implements FilterAdapter.Delete {
public class FilterActivity extends BaseBarActivity implements FilterAdapter.Delete {
private ActivityFiltersBinding binding;
private List<Filter> filterList;

View File

@ -44,7 +44,7 @@ import app.fedilab.android.viewmodel.mastodon.TagVM;
import es.dmoral.toasty.Toasty;
public class FollowedTagActivity extends BaseActivity implements FollowedTagAdapter.ActionOnTag {
public class FollowedTagActivity extends BaseBarActivity implements FollowedTagAdapter.ActionOnTag {
private ActivityFollowedTagsBinding binding;

View File

@ -60,7 +60,7 @@ import app.fedilab.android.viewmodel.mastodon.TimelinesVM;
import es.dmoral.toasty.Toasty;
public class MastodonListActivity extends BaseActivity implements MastodonListAdapter.ActionOnList {
public class MastodonListActivity extends BaseBarActivity implements MastodonListAdapter.ActionOnList {
AccountListAdapter accountsInListAdapter;

View File

@ -40,7 +40,7 @@ import app.fedilab.android.helper.MastodonHelper;
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
public class PartnerShipActivity extends BaseActivity {
public class PartnerShipActivity extends BaseBarActivity {
@Override

View File

@ -71,7 +71,7 @@ import okhttp3.RequestBody;
import okhttp3.Response;
public class ReorderTimelinesActivity extends BaseActivity implements OnStartDragListener {
public class ReorderTimelinesActivity extends BaseBarActivity implements OnStartDragListener {
private ItemTouchHelper touchHelper;

View File

@ -43,7 +43,7 @@ import app.fedilab.android.viewmodel.mastodon.AccountsVM;
import es.dmoral.toasty.Toasty;
public class ReportActivity extends BaseActivity {
public class ReportActivity extends BaseBarActivity {
private ActivityReportBinding binding;
private Status status;

View File

@ -45,7 +45,7 @@ import app.fedilab.android.ui.fragment.timeline.FragmentMastodonTimeline;
import es.dmoral.toasty.Toasty;
public class SearchResultTabActivity extends BaseActivity {
public class SearchResultTabActivity extends BaseBarActivity {
private String search;

View File

@ -23,7 +23,7 @@ import androidx.navigation.ui.setupActionBarWithNavController
import app.fedilab.android.R
import app.fedilab.android.databinding.ActivitySettingsBinding
class SettingsActivity : BaseActivity() {
class SettingsActivity : BaseBarActivity() {
private lateinit var binding: ActivitySettingsBinding
private lateinit var appBarConfiguration: AppBarConfiguration

View File

@ -30,7 +30,7 @@ import app.fedilab.android.viewmodel.mastodon.StatusesVM;
import es.dmoral.toasty.Toasty;
public class StatusHistoryActivity extends BaseActivity {
public class StatusHistoryActivity extends BaseBarActivity {
public static Resources.Theme theme;

View File

@ -25,7 +25,7 @@ import app.fedilab.android.helper.Helper;
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonSuggestion;
public class SuggestionActivity extends BaseActivity {
public class SuggestionActivity extends BaseBarActivity {
@Override

View File

@ -37,7 +37,7 @@ import app.fedilab.android.ui.fragment.timeline.FragmentMastodonTag;
import app.fedilab.android.ui.fragment.timeline.FragmentMastodonTimeline;
public class TrendsActivity extends BaseActivity {
public class TrendsActivity extends BaseBarActivity {
private ActivityTrendsBinding binding;

View File

@ -36,7 +36,7 @@ import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.google.gson.annotations.SerializedName;
import app.fedilab.android.R;
import app.fedilab.android.activities.BaseActivity;
import app.fedilab.android.activities.BaseBarActivity;
import app.fedilab.android.client.entities.api.admin.AdminDomainBlock;
import app.fedilab.android.databinding.ActivityAdminActionsBinding;
import app.fedilab.android.databinding.PopupAdminFilterAccountsBinding;
@ -47,7 +47,7 @@ import app.fedilab.android.ui.fragment.admin.FragmentAdminAccount;
import app.fedilab.android.ui.fragment.admin.FragmentAdminDomain;
import app.fedilab.android.ui.fragment.admin.FragmentAdminReport;
public class AdminActionActivity extends BaseActivity {
public class AdminActionActivity extends BaseBarActivity {
public static Boolean local = true, remote = true, active = true, pending = true, disabled = true, silenced = true, suspended = true, staff = null, orderByMostRecent = true;
public static Boolean resolved = null, reportLocal = true, reportRemote = true;

View File

@ -31,7 +31,7 @@ import androidx.lifecycle.ViewModelProvider;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import app.fedilab.android.R;
import app.fedilab.android.activities.BaseActivity;
import app.fedilab.android.activities.BaseBarActivity;
import app.fedilab.android.activities.MainActivity;
import app.fedilab.android.client.entities.api.admin.AdminDomainBlock;
import app.fedilab.android.databinding.ActivityAdminDomainblockBinding;
@ -39,7 +39,7 @@ import app.fedilab.android.helper.Helper;
import app.fedilab.android.viewmodel.mastodon.AdminVM;
import es.dmoral.toasty.Toasty;
public class AdminDomainBlockActivity extends BaseActivity {
public class AdminDomainBlockActivity extends BaseBarActivity {
private final String[] severityChoices = {"silence", "suspend", "noop"};

View File

@ -54,7 +54,7 @@ import java.util.concurrent.TimeUnit;
import app.fedilab.android.BaseMainActivity;
import app.fedilab.android.R;
import app.fedilab.android.activities.BaseActivity;
import app.fedilab.android.activities.BaseBarActivity;
import app.fedilab.android.activities.InstanceProfileActivity;
import app.fedilab.android.activities.MediaActivity;
import app.fedilab.android.client.entities.api.Account;
@ -70,7 +70,7 @@ import app.fedilab.android.viewmodel.mastodon.NodeInfoVM;
import es.dmoral.toasty.Toasty;
public class AdminReportActivity extends BaseActivity {
public class AdminReportActivity extends BaseBarActivity {
private AdminAccount adminAccount;
private Account account;

View File

@ -283,7 +283,9 @@ public class ThemeHelper {
public enum themes {
LIGHT,
DARK,
SYSTEM
SYSTEM,
SOLARIZED_LIGHT,
SOLARIZED_DARK
}
public interface SlideAnimation {

View File

@ -14,54 +14,14 @@ package app.fedilab.android.ui.fragment.settings;
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
import static android.app.Activity.RESULT_OK;
import static app.fedilab.android.BaseMainActivity.currentAccount;
import static app.fedilab.android.helper.LogoHelper.getMainLogo;
import android.Manifest;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.LinearLayout;
import android.widget.Toast;
import androidx.appcompat.app.AlertDialog;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import androidx.preference.ListPreference;
import androidx.preference.Preference;
import androidx.preference.PreferenceCategory;
import androidx.preference.PreferenceFragmentCompat;
import androidx.preference.PreferenceManager;
import com.bumptech.glide.Glide;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.nio.charset.StandardCharsets;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.List;
import app.fedilab.android.R;
import app.fedilab.android.activities.ComposeActivity;
import app.fedilab.android.databinding.ActivityThemeSettingsBinding;
import app.fedilab.android.databinding.PopupStatusThemeBinding;
import app.fedilab.android.helper.Helper;
import app.fedilab.android.helper.ThemeHelper;
import es.dmoral.toasty.Toasty;
@ -69,17 +29,10 @@ import es.dmoral.toasty.Toasty;
public class FragmentThemingSettings extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener {
private final int PICK_IMPORT_THEME = 5557;
private List<LinkedHashMap<String, String>> listOfThemes;
private SharedPreferences appPref;
private SharedPreferences cyneaPref;
@Override
public void onCreatePreferences(Bundle bundle, String s) {
cyneaPref = requireActivity().getSharedPreferences("com.jaredrummler.cyanea", Context.MODE_PRIVATE);
appPref = PreferenceManager.getDefaultSharedPreferences(requireActivity());
createPref();
listOfThemes = ThemeHelper.getContributorsTheme(requireActivity());
}
@ -105,9 +58,6 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
if (key.equals("use_custom_theme")) {
createPref();
}
if (key.compareTo(getString(R.string.SET_THEME_BASE)) == 0) {
ListPreference SET_THEME_BASE = findPreference(getString(R.string.SET_THEME_BASE));
if (SET_THEME_BASE != null) {
@ -118,180 +68,6 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements
}
@SuppressWarnings("deprecation")
@SuppressLint("ApplySharedPref")
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == PICK_IMPORT_THEME && resultCode == RESULT_OK) {
if (data == null || data.getData() == null) {
Toasty.error(requireActivity(), getString(R.string.theme_file_error), Toast.LENGTH_LONG).show();
return;
}
if (data.getData() != null) {
try {
InputStream inputStream = requireActivity().getContentResolver().openInputStream(data.getData());
readFileAndApply(inputStream);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
} else {
Toasty.error(requireActivity(), getString(R.string.theme_file_error), Toast.LENGTH_LONG).show();
}
}
}
@SuppressLint("SetTextI18n")
@SuppressWarnings("ConstantConditions")
private void applyColors(PopupStatusThemeBinding binding, int position) {
LinkedHashMap<String, String> themeData = listOfThemes.get(position);
int linksColor = -1;
int iconsColor = -1;
int textColor = -1;
int boostHeaderColor = -1;
int statusColor = -1;
int displayNameColor = -1;
int userNameColor = -1;
int colorAccent = -1;
int backgroundColor = -1;
if (themeData.containsKey("theme_link_color")) {
linksColor = Integer.parseInt(themeData.get("theme_link_color"));
}
if (themeData.containsKey("theme_accent")) {
colorAccent = Integer.parseInt(themeData.get("theme_accent"));
}
if (themeData.containsKey("theme_icons_color")) {
iconsColor = Integer.parseInt(themeData.get("theme_icons_color"));
}
if (themeData.containsKey("theme_text_color")) {
textColor = Integer.parseInt(themeData.get("theme_text_color"));
}
if (themeData.containsKey("theme_boost_header_color")) {
boostHeaderColor = Integer.parseInt(themeData.get("theme_boost_header_color"));
}
if (themeData.containsKey("theme_statuses_color")) {
statusColor = Integer.parseInt(themeData.get("theme_statuses_color"));
}
if (themeData.containsKey("theme_text_header_1_line")) {
displayNameColor = Integer.parseInt(themeData.get("theme_text_header_1_line"));
}
if (themeData.containsKey("theme_text_header_2_line")) {
userNameColor = Integer.parseInt(themeData.get("theme_text_header_2_line"));
}
if (themeData.containsKey("pref_color_background")) {
backgroundColor = Integer.parseInt(themeData.get("pref_color_background"));
}
if (colorAccent != -1) {
binding.spoilerExpand.setTextColor(colorAccent);
binding.cardTitle.setTextColor(colorAccent);
}
if (backgroundColor != -1) {
binding.background.setBackgroundColor(backgroundColor);
}
if (statusColor != -1) {
binding.cardviewContainer.setBackgroundColor(statusColor);
binding.card.setBackgroundColor(statusColor);
}
if (boostHeaderColor != -1) {
binding.headerContainer.setBackgroundColor(boostHeaderColor);
}
if (textColor != -1) {
binding.statusContent.setTextColor(textColor);
binding.statusContentTranslated.setTextColor(textColor);
binding.spoiler.setTextColor(textColor);
binding.cardDescription.setTextColor(textColor);
binding.time.setTextColor(textColor);
binding.reblogsCount.setTextColor(textColor);
binding.favoritesCount.setTextColor(textColor);
Helper.changeDrawableColor(requireActivity(), binding.repeatInfo, textColor);
Helper.changeDrawableColor(requireActivity(), binding.favInfo, textColor);
}
if (linksColor != -1) {
binding.cardUrl.setTextColor(linksColor);
} else {
binding.cardUrl.setTextColor(ThemeHelper.getAttColor(requireActivity(), R.attr.colorPrimary));
}
if (iconsColor == -1) {
iconsColor = ThemeHelper.getAttColor(requireActivity(), R.attr.colorControlNormal);
}
Helper.changeDrawableColor(requireActivity(), binding.actionButtonReply, iconsColor);
Helper.changeDrawableColor(requireActivity(), binding.actionButtonMore, iconsColor);
Helper.changeDrawableColor(requireActivity(), binding.actionButtonBoost, iconsColor);
Helper.changeDrawableColor(requireActivity(), binding.actionButtonFavorite, iconsColor);
Helper.changeDrawableColor(requireActivity(), R.drawable.ic_person, iconsColor);
if (displayNameColor != -1) {
binding.displayName.setTextColor(displayNameColor);
}
if (userNameColor != -1) {
binding.username.setTextColor(userNameColor);
Helper.changeDrawableColor(requireActivity(), binding.statusBoostIcon, userNameColor);
}
Glide.with(binding.getRoot().getContext())
.load(R.drawable.fedilab_logo_bubbles)
.into(binding.statusBoosterAvatar);
Glide.with(binding.getRoot().getContext())
.load(R.drawable.fedilab_logo_bubbles)
.into(binding.avatar);
binding.displayName.setText("Fedilab");
binding.username.setText("@apps@toot.fedilab.app");
binding.author.setText(themeData.get("author"));
binding.title.setText(themeData.get("name"));
binding.cardviewContainer.invalidate();
binding.time.setText(Helper.dateToString(new Date()));
}
@SuppressLint("ApplySharedPref")
private void readFileAndApply(InputStream inputStream) {
BufferedReader br = null;
try {
br = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8));
String sCurrentLine;
SharedPreferences.Editor appEditor = appPref.edit();
appEditor.putBoolean("use_custom_theme", true);
while ((sCurrentLine = br.readLine()) != null) {
String[] line = sCurrentLine.split(",");
if (line.length > 1) {
String key = line[0];
String value = line[1];
if (key.compareTo("pref_color_navigation_bar") == 0) {
} else if (key.compareTo("pref_color_background") == 0) {
} else if (key.compareTo("base_theme") == 0) {
} else if (key.compareTo("theme_accent") == 0) {
} else if (key.compareTo("theme_primary") == 0) {
} else {
if (value != null && value.matches("-?\\d+")) {
appEditor.putInt(key, Integer.parseInt(value));
} else {
appEditor.remove(key);
}
}
}
}
appEditor.commit();
Helper.recreateMainActivity(requireActivity());
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (br != null) br.close();
} catch (IOException ex) {
ex.printStackTrace();
}
}
}
@SuppressWarnings("deprecation")
private void createPref() {
if (getPreferenceScreen() != null) {
getPreferenceScreen().removeAll();
@ -299,268 +75,8 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements
addPreferencesFromResource(R.xml.pref_theming);
if (getPreferenceScreen() == null) {
Toasty.error(requireActivity(), getString(R.string.toast_error), Toasty.LENGTH_SHORT).show();
return;
}
Preference launch_custom_theme = findPreference("launch_custom_theme");
if (launch_custom_theme != null) {
launch_custom_theme.setOnPreferenceClickListener(preference -> {
startActivity(new Intent(requireActivity(), ActivityThemeSettingsBinding.class));
return false;
});
}
Preference contributors_themes = findPreference("contributors_themes");
if (contributors_themes != null) {
contributors_themes.setOnPreferenceClickListener(preference -> {
final int[] currentPosition = {0};
AlertDialog.Builder builderSingle = new AlertDialog.Builder(requireActivity());
builderSingle.setTitle(getString(R.string.select_a_theme));
PopupStatusThemeBinding binding = PopupStatusThemeBinding.inflate(getLayoutInflater(), new LinearLayout(requireActivity()), false);
binding.selectTheme.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int position, long l) {
currentPosition[0] = position;
applyColors(binding, position);
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
});
applyColors(binding, 0);
builderSingle.setView(binding.getRoot());
String[] listOfTheme = new String[listOfThemes.size()];
int i = 0;
for (LinkedHashMap<String, String> values : listOfThemes) {
listOfTheme[i] = values.get("name");
i++;
}
//fill data in spinner
ArrayAdapter<String> adapter = new ArrayAdapter<>(requireActivity(), android.R.layout.simple_spinner_dropdown_item, listOfTheme);
binding.selectTheme.setAdapter(adapter);
binding.selectTheme.setSelection(0);
builderSingle.setPositiveButton(R.string.validate, (dialog, which) -> {
try {
String[] list = requireActivity().getAssets().list("themes/contributors");
InputStream is = requireActivity().getAssets().open("themes/contributors/" + list[currentPosition[0]]);
readFileAndApply(is);
} catch (IOException e) {
e.printStackTrace();
}
dialog.dismiss();
});
builderSingle.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
builderSingle.show();
return false;
});
}
ListPreference settings_theme = findPreference("settings_theme");
Preference theme_link_color = findPreference("theme_link_color");
Preference theme_boost_header_color = findPreference("theme_boost_header_color");
Preference theme_text_header_1_line = findPreference("theme_text_header_1_line");
Preference theme_text_header_2_line = findPreference("theme_text_header_2_line");
Preference theme_statuses_color = findPreference("theme_statuses_color");
Preference theme_icons_color = findPreference("theme_icons_color");
Preference theme_text_color = findPreference("theme_text_color");
Preference pref_import = findPreference("pref_import");
Preference pref_export = findPreference("pref_export");
Preference reset_pref = findPreference("reset_pref");
PreferenceCategory cyanea_preference_category = getPreferenceScreen().findPreference("cyanea_preference_category");
//No custom theme data must be removed
if (!appPref.getBoolean("use_custom_theme", false) && cyanea_preference_category != null) {
if (theme_link_color != null) {
cyanea_preference_category.removePreference(theme_link_color);
}
if (theme_boost_header_color != null) {
cyanea_preference_category.removePreference(theme_boost_header_color);
}
if (theme_text_header_1_line != null) {
cyanea_preference_category.removePreference(theme_text_header_1_line);
}
if (theme_text_header_2_line != null) {
cyanea_preference_category.removePreference(theme_text_header_2_line);
}
if (contributors_themes != null) {
cyanea_preference_category.removePreference(contributors_themes);
}
if (theme_statuses_color != null) {
cyanea_preference_category.removePreference(theme_statuses_color);
}
if (theme_icons_color != null) {
cyanea_preference_category.removePreference(theme_icons_color);
}
if (theme_text_color != null) {
cyanea_preference_category.removePreference(theme_text_color);
}
if (reset_pref != null) {
cyanea_preference_category.removePreference(reset_pref);
}
if (pref_export != null) {
cyanea_preference_category.removePreference(pref_export);
}
}
//These are default values (first three ones)
if (pref_export != null) {
pref_export.setOnPreferenceClickListener(preference -> {
exportColors();
return true;
});
}
if (pref_import != null) {
pref_import.setOnPreferenceClickListener(preference -> {
if (ContextCompat.checkSelfPermission(requireActivity(), Manifest.permission.READ_EXTERNAL_STORAGE) !=
PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(requireActivity(),
new String[]{Manifest.permission.READ_EXTERNAL_STORAGE},
ComposeActivity.MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE);
return true;
}
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("*/*");
String[] mimetypes = {"*/*"};
intent.putExtra(Intent.EXTRA_MIME_TYPES, mimetypes);
startActivityForResult(intent, PICK_IMPORT_THEME);
return true;
});
}
if (reset_pref != null) {
reset_pref.setOnPreferenceClickListener(preference -> {
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(requireActivity());
dialogBuilder.setMessage(R.string.reset_color);
dialogBuilder.setPositiveButton(R.string.reset, (dialog, id) -> {
reset();
dialog.dismiss();
setPreferenceScreen(null);
createPref();
});
dialogBuilder.setNegativeButton(R.string.cancel, (dialog, id) -> dialog.dismiss());
AlertDialog alertDialog = dialogBuilder.create();
alertDialog.setCancelable(false);
alertDialog.show();
return true;
});
}
}
@SuppressLint("ApplySharedPref")
private void reset() {
SharedPreferences.Editor editor = appPref.edit();
editor.remove("theme_link_color");
editor.remove("theme_boost_header_color");
editor.remove("theme_text_header_1_line");
editor.remove("theme_text_header_2_line");
editor.remove("theme_icons_color");
editor.remove("theme_text_color");
editor.remove("use_custom_theme");
editor.commit();
}
private void exportColors() {
try {
String fileName = "Fedilab_color_export_" + Helper.dateFileToString(getActivity(), new Date()) + ".csv";
String filePath = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath();
String fullPath = filePath + "/" + fileName;
PrintWriter pw = new PrintWriter(new OutputStreamWriter(new FileOutputStream(fullPath), StandardCharsets.UTF_8));
StringBuilder builder = new StringBuilder();
int theme_boost_header_color = appPref.getInt("theme_boost_header_color", -1);
int theme_text_header_1_line = appPref.getInt("theme_text_header_1_line", -1);
int theme_text_header_2_line = appPref.getInt("theme_text_header_2_line", -1);
int theme_statuses_color = appPref.getInt("theme_statuses_color", -1);
int theme_link_color = appPref.getInt("theme_link_color", -1);
int theme_icons_color = appPref.getInt("theme_icons_color", -1);
int pref_color_background;
if (cyneaPref.getString("base_theme", "DARK").compareTo("DARK") == 0) {
pref_color_background = cyneaPref.getInt("background_dark", -1);
} else {
pref_color_background = cyneaPref.getInt("background_light", -1);
}
boolean pref_color_navigation_bar = cyneaPref.getBoolean("pref_color_navigation_bar", true);
boolean pref_color_status_bar = cyneaPref.getBoolean("pref_color_status_bar", true);
int theme_accent = cyneaPref.getInt("accent", -1);
int theme_text_color = appPref.getInt("theme_text_color", -1);
int theme_primary = cyneaPref.getInt("primary", -1);
int theme = appPref.getInt(getString(R.string.SET_THEME), 0);
builder.append("base_theme").append(',');
builder.append(theme);
builder.append('\n');
builder.append("theme_boost_header_color").append(',');
builder.append(theme_boost_header_color);
builder.append('\n');
builder.append("theme_text_header_1_line").append(',');
builder.append(theme_text_header_1_line);
builder.append('\n');
builder.append("theme_text_header_2_line").append(',');
builder.append(theme_text_header_2_line);
builder.append('\n');
builder.append("theme_statuses_color").append(',');
builder.append(theme_statuses_color);
builder.append('\n');
builder.append("theme_link_color").append(',');
builder.append(theme_link_color);
builder.append('\n');
builder.append("theme_icons_color").append(',');
builder.append(theme_icons_color);
builder.append('\n');
builder.append("pref_color_background").append(',');
builder.append(pref_color_background);
builder.append('\n');
builder.append("pref_color_navigation_bar").append(',');
builder.append(pref_color_navigation_bar);
builder.append('\n');
builder.append("pref_color_status_bar").append(',');
builder.append(pref_color_status_bar);
builder.append('\n');
builder.append("theme_accent").append(',');
builder.append(theme_accent);
builder.append('\n');
builder.append("theme_text_color").append(',');
builder.append(theme_text_color);
builder.append('\n');
builder.append("theme_primary").append(',');
builder.append(theme_primary);
builder.append('\n');
pw.write(builder.toString());
pw.close();
String message = getString(R.string.data_export_theme_success);
Intent intentOpen = new Intent();
intentOpen.setAction(android.content.Intent.ACTION_VIEW);
Uri uri = Uri.parse("file://" + fullPath);
intentOpen.setDataAndType(uri, "text/csv");
String title = getString(R.string.data_export_theme);
Helper.notify_user(getActivity(), currentAccount, intentOpen, BitmapFactory.decodeResource(requireActivity().getResources(),
getMainLogo(requireActivity())), Helper.NotifType.BACKUP, title, message);
} catch (Exception e) {
e.printStackTrace();
Toasty.error(requireActivity(), getString(R.string.toast_error), Toast.LENGTH_LONG).show();
}
}
}

View File

@ -100,4 +100,72 @@
<style name="AlertDialog" parent="Theme.Material3.Dark.Dialog.Alert" />
<style name="SolarizedAppTheme" parent="AppTheme">
<item name="colorPrimary">@color/solarized_md_theme_dark_primary</item>
<item name="colorOnPrimary">@color/solarized_md_theme_dark_onPrimary</item>
<item name="colorPrimaryContainer">@color/solarized_md_theme_dark_primaryContainer</item>
<item name="colorOnPrimaryContainer">@color/solarized_md_theme_dark_onPrimaryContainer
</item>
<item name="colorSecondary">@color/solarized_md_theme_dark_secondary</item>
<item name="colorOnSecondary">@color/solarized_md_theme_dark_onSecondary</item>
<item name="colorSecondaryContainer">@color/solarized_md_theme_dark_secondaryContainer
</item>
<item name="colorOnSecondaryContainer">@color/solarized_md_theme_dark_onSecondaryContainer
</item>
<item name="colorTertiary">@color/solarized_md_theme_dark_tertiary</item>
<item name="colorOnTertiary">@color/solarized_md_theme_dark_onTertiary</item>
<item name="colorTertiaryContainer">@color/solarized_md_theme_dark_tertiaryContainer</item>
<item name="colorOnTertiaryContainer">@color/solarized_md_theme_dark_onTertiaryContainer
</item>
<item name="colorError">@color/solarized_md_theme_dark_error</item>
<item name="colorErrorContainer">@color/solarized_md_theme_dark_errorContainer</item>
<item name="colorOnError">@color/solarized_md_theme_dark_onError</item>
<item name="colorOnErrorContainer">@color/solarized_md_theme_dark_onErrorContainer</item>
<item name="android:colorBackground">@color/solarized_md_theme_dark_background</item>
<item name="colorOnBackground">@color/solarized_md_theme_dark_onBackground</item>
<item name="colorSurface">@color/solarized_md_theme_dark_surface</item>
<item name="colorOnSurface">@color/solarized_md_theme_dark_onSurface</item>
<item name="colorSurfaceVariant">@color/solarized_md_theme_dark_surfaceVariant</item>
<item name="colorOnSurfaceVariant">@color/solarized_md_theme_dark_onSurfaceVariant</item>
<item name="colorOutline">@color/solarized_md_theme_dark_outline</item>
<item name="colorOnSurfaceInverse">@color/solarized_md_theme_dark_inverseOnSurface</item>
<item name="colorSurfaceInverse">@color/solarized_md_theme_dark_inverseSurface</item>
<item name="colorPrimaryInverse">@color/solarized_md_theme_dark_inversePrimary</item>
</style>
<style name="SolarizedAppThemeBar" parent="AppThemeBar">
<item name="colorPrimary">@color/solarized_md_theme_dark_primary</item>
<item name="colorOnPrimary">@color/solarized_md_theme_dark_onPrimary</item>
<item name="colorPrimaryContainer">@color/solarized_md_theme_dark_primaryContainer</item>
<item name="colorOnPrimaryContainer">@color/solarized_md_theme_dark_onPrimaryContainer
</item>
<item name="colorSecondary">@color/solarized_md_theme_dark_secondary</item>
<item name="colorOnSecondary">@color/solarized_md_theme_dark_onSecondary</item>
<item name="colorSecondaryContainer">@color/solarized_md_theme_dark_secondaryContainer
</item>
<item name="colorOnSecondaryContainer">@color/solarized_md_theme_dark_onSecondaryContainer
</item>
<item name="colorTertiary">@color/solarized_md_theme_dark_tertiary</item>
<item name="colorOnTertiary">@color/solarized_md_theme_dark_onTertiary</item>
<item name="colorTertiaryContainer">@color/solarized_md_theme_dark_tertiaryContainer</item>
<item name="colorOnTertiaryContainer">@color/solarized_md_theme_dark_onTertiaryContainer
</item>
<item name="colorError">@color/solarized_md_theme_dark_error</item>
<item name="colorErrorContainer">@color/solarized_md_theme_dark_errorContainer</item>
<item name="colorOnError">@color/solarized_md_theme_dark_onError</item>
<item name="colorOnErrorContainer">@color/solarized_md_theme_dark_onErrorContainer</item>
<item name="android:colorBackground">@color/solarized_md_theme_dark_background</item>
<item name="colorOnBackground">@color/solarized_md_theme_dark_onBackground</item>
<item name="colorSurface">@color/solarized_md_theme_dark_surface</item>
<item name="colorOnSurface">@color/solarized_md_theme_dark_onSurface</item>
<item name="colorSurfaceVariant">@color/solarized_md_theme_dark_surfaceVariant</item>
<item name="colorOnSurfaceVariant">@color/solarized_md_theme_dark_onSurfaceVariant</item>
<item name="colorOutline">@color/solarized_md_theme_dark_outline</item>
<item name="colorOnSurfaceInverse">@color/solarized_md_theme_dark_inverseOnSurface</item>
<item name="colorSurfaceInverse">@color/solarized_md_theme_dark_inverseSurface</item>
<item name="colorPrimaryInverse">@color/solarized_md_theme_dark_inversePrimary</item>
</style>
</resources>

View File

@ -130,4 +130,68 @@
<color name="decoration_12">#FF8A65</color> <!-- Deep Orange 300 -->
<color name="decoration_end">#9E9E9E</color> <!-- Gray 300 -->
<!--- SOLARIZED THEME -->
<color name="seed_solarized">#859900</color>
<color name="solarized_md_theme_light_primary">#576500</color>
<color name="solarized_md_theme_light_onPrimary">#FFFFFF</color>
<color name="solarized_md_theme_light_primaryContainer">#D7EE5E</color>
<color name="solarized_md_theme_light_onPrimaryContainer">#191E00</color>
<color name="solarized_md_theme_light_secondary">#5D6145</color>
<color name="solarized_md_theme_light_onSecondary">#FFFFFF</color>
<color name="solarized_md_theme_light_secondaryContainer">#E2E5C2</color>
<color name="solarized_md_theme_light_onSecondaryContainer">#1A1D08</color>
<color name="solarized_md_theme_light_tertiary">#3B665C</color>
<color name="solarized_md_theme_light_onTertiary">#FFFFFF</color>
<color name="solarized_md_theme_light_tertiaryContainer">#BDECDF</color>
<color name="solarized_md_theme_light_onTertiaryContainer">#00201A</color>
<color name="solarized_md_theme_light_error">#BA1A1A</color>
<color name="solarized_md_theme_light_errorContainer">#FFDAD6</color>
<color name="solarized_md_theme_light_onError">#FFFFFF</color>
<color name="solarized_md_theme_light_onErrorContainer">#410002</color>
<color name="solarized_md_theme_light_background">#FFFCF4</color>
<color name="solarized_md_theme_light_onBackground">#1C1C17</color>
<color name="solarized_md_theme_light_surface">#FFFCF4</color>
<color name="solarized_md_theme_light_onSurface">#1C1C17</color>
<color name="solarized_md_theme_light_surfaceVariant">#E4E3D3</color>
<color name="solarized_md_theme_light_onSurfaceVariant">#46483B</color>
<color name="solarized_md_theme_light_outline">#77786A</color>
<color name="solarized_md_theme_light_inverseOnSurface">#F3F1E8</color>
<color name="solarized_md_theme_light_inverseSurface">#31312B</color>
<color name="solarized_md_theme_light_inversePrimary">#BBD144</color>
<color name="solarized_md_theme_light_shadow">#000000</color>
<color name="solarized_md_theme_light_surfaceTint">#576500</color>
<color name="solarized_md_theme_light_outlineVariant">#C7C7B7</color>
<color name="solarized_md_theme_light_scrim">#000000</color>
<color name="solarized_md_theme_dark_primary">#BBD144</color>
<color name="solarized_md_theme_dark_onPrimary">#2C3400</color>
<color name="solarized_md_theme_dark_primaryContainer">#414C00</color>
<color name="solarized_md_theme_dark_onPrimaryContainer">#D7EE5E</color>
<color name="solarized_md_theme_dark_secondary">#C6C9A8</color>
<color name="solarized_md_theme_dark_onSecondary">#2F321B</color>
<color name="solarized_md_theme_dark_secondaryContainer">#45492F</color>
<color name="solarized_md_theme_dark_onSecondaryContainer">#E2E5C2</color>
<color name="solarized_md_theme_dark_tertiary">#A2D0C3</color>
<color name="solarized_md_theme_dark_onTertiary">#05372E</color>
<color name="solarized_md_theme_dark_tertiaryContainer">#224E44</color>
<color name="solarized_md_theme_dark_onTertiaryContainer">#BDECDF</color>
<color name="solarized_md_theme_dark_error">#FFB4AB</color>
<color name="solarized_md_theme_dark_errorContainer">#93000A</color>
<color name="solarized_md_theme_dark_onError">#690005</color>
<color name="solarized_md_theme_dark_onErrorContainer">#FFDAD6</color>
<color name="solarized_md_theme_dark_background">#1C1C17</color>
<color name="solarized_md_theme_dark_onBackground">#E5E2DA</color>
<color name="solarized_md_theme_dark_surface">#1C1C17</color>
<color name="solarized_md_theme_dark_onSurface">#E5E2DA</color>
<color name="solarized_md_theme_dark_surfaceVariant">#46483B</color>
<color name="solarized_md_theme_dark_onSurfaceVariant">#C7C7B7</color>
<color name="solarized_md_theme_dark_outline">#919283</color>
<color name="solarized_md_theme_dark_inverseOnSurface">#1C1C17</color>
<color name="solarized_md_theme_dark_inverseSurface">#E5E2DA</color>
<color name="solarized_md_theme_dark_inversePrimary">#576500</color>
<color name="solarized_md_theme_dark_shadow">#000000</color>
<color name="solarized_md_theme_dark_surfaceTint">#BBD144</color>
<color name="solarized_md_theme_dark_outlineVariant">#46483B</color>
<color name="solarized_md_theme_dark_scrim">#000000</color>
</resources>

View File

@ -700,13 +700,37 @@
<item>Light</item>
<item>Dark</item>
<item>System default</item>
<item>Solarized (Light)</item>
<item>Solarized (Dark)</item>
</string-array>
<string-array name="SET_THEME_MODE_VALUE" translatable="false">
<item>LIGHT</item>
<item>DARK</item>
<item>SYSTEM</item>
<item>SOLARIZED_LIGHT</item>
<item>SOLARIZED_DARK</item>
</string-array>
<string-array name="set_default_theme_light">
<item>Light</item>
<item>Solarized (Light)</item>
</string-array>
<string-array name="SET_DEFAULT_THEME_LIGHT" translatable="false">
<item>LIGHT</item>
<item>SOLARIZED_LIGHT</item>
</string-array>
<string-array name="set_default_theme_dark">
<item>Dark</item>
<item>Solarized (Dark)</item>
</string-array>
<string-array name="SET_THEME_DEFAULT_DARK" translatable="false">
<item>DARK</item>
<item>SOLARIZED_DARK</item>
</string-array>
<string-array name="set_notification_type_value">
<item>Push notifications</item>
<item>Fetch at fixed times</item>
@ -1265,6 +1289,11 @@
<string name="SET_DISABLE_ANIMATED_EMOJI" translatable="false">SET_DISABLE_ANIMATED_EMOJI</string>
<string name="SET_CAPITALIZE" translatable="false">SET_CAPITALIZE</string>
<string name="SET_THEME_BASE" translatable="false">SET_THEME_BASE</string>
<string name="SET_DYNAMICCOLOR" translatable="false">SET_DYNAMICCOLOR</string>
<string name="SET_THEME_DEFAULT_LIGHT" translatable="false">SET_THEME_DEFAULT_LIGHT</string>
<string name="SET_THEME_DEFAULT_DARK" translatable="false">SET_THEME_DEFAULT_DARK</string>
<string name="SET_DEFAULT_THEME" translatable="false">SYSTEM</string>
<string name="SET_FULL_PREVIEW" translatable="false">SET_FULL_PREVIEW</string>
@ -1975,4 +2004,8 @@
<string name="type_of_theme">Pickup a mode for the theme</string>
<string name="pref_customize">Customize colors</string>
<string name="pref_customize_summary">Allow to set your custom colors for themes.</string>
<string name="set_dynamic_color">Dynamic Color</string>
<string name="set_dynamic_color_indication">Align tonally with the color scheme of your personal wallpaper.</string>
<string name="type_default_theme_light">Default light theme</string>
<string name="type_default_theme_dark">Default dark theme</string>
</resources>

View File

@ -96,7 +96,75 @@
<item name="android:isLightTheme" tools:targetApi="q">true</item>
</style>
<style name="AlertDialog" parent="Theme.Material3.Light.Dialog.Alert" />
<style name="SolarizedAppTheme" parent="AppTheme">
<item name="colorPrimary">@color/solarized_md_theme_light_primary</item>
<item name="colorOnPrimary">@color/solarized_md_theme_light_onPrimary</item>
<item name="colorPrimaryContainer">@color/solarized_md_theme_light_primaryContainer</item>
<item name="colorOnPrimaryContainer">@color/solarized_md_theme_light_onPrimaryContainer
</item>
<item name="colorSecondary">@color/solarized_md_theme_light_secondary</item>
<item name="colorOnSecondary">@color/solarized_md_theme_light_onSecondary</item>
<item name="colorSecondaryContainer">@color/solarized_md_theme_light_secondaryContainer
</item>
<item name="colorOnSecondaryContainer">
@color/solarized_md_theme_light_onSecondaryContainer
</item>
<item name="colorTertiary">@color/solarized_md_theme_light_tertiary</item>
<item name="colorOnTertiary">@color/solarized_md_theme_light_onTertiary</item>
<item name="colorTertiaryContainer">@color/solarized_md_theme_light_tertiaryContainer</item>
<item name="colorOnTertiaryContainer">@color/solarized_md_theme_light_onTertiaryContainer
</item>
<item name="colorError">@color/solarized_md_theme_light_error</item>
<item name="colorErrorContainer">@color/solarized_md_theme_light_errorContainer</item>
<item name="colorOnError">@color/solarized_md_theme_light_onError</item>
<item name="colorOnErrorContainer">@color/solarized_md_theme_light_onErrorContainer</item>
<item name="android:colorBackground">@color/solarized_md_theme_light_background</item>
<item name="colorOnBackground">@color/solarized_md_theme_light_onBackground</item>
<item name="colorSurface">@color/solarized_md_theme_light_surface</item>
<item name="colorOnSurface">@color/solarized_md_theme_light_onSurface</item>
<item name="colorSurfaceVariant">@color/solarized_md_theme_light_surfaceVariant</item>
<item name="colorOnSurfaceVariant">@color/solarized_md_theme_light_onSurfaceVariant</item>
<item name="colorOutline">@color/solarized_md_theme_light_outline</item>
<item name="colorOnSurfaceInverse">@color/solarized_md_theme_light_inverseOnSurface</item>
<item name="colorSurfaceInverse">@color/solarized_md_theme_light_inverseSurface</item>
<item name="colorPrimaryInverse">@color/solarized_md_theme_light_inversePrimary</item>
</style>
<style name="SolarizedAppThemeBar" parent="AppThemeBar">
<item name="colorPrimary">@color/solarized_md_theme_light_primary</item>
<item name="colorOnPrimary">@color/solarized_md_theme_light_onPrimary</item>
<item name="colorPrimaryContainer">@color/solarized_md_theme_light_primaryContainer</item>
<item name="colorOnPrimaryContainer">@color/solarized_md_theme_light_onPrimaryContainer
</item>
<item name="colorSecondary">@color/solarized_md_theme_light_secondary</item>
<item name="colorOnSecondary">@color/solarized_md_theme_light_onSecondary</item>
<item name="colorSecondaryContainer">@color/solarized_md_theme_light_secondaryContainer
</item>
<item name="colorOnSecondaryContainer">
@color/solarized_md_theme_light_onSecondaryContainer
</item>
<item name="colorTertiary">@color/solarized_md_theme_light_tertiary</item>
<item name="colorOnTertiary">@color/solarized_md_theme_light_onTertiary</item>
<item name="colorTertiaryContainer">@color/solarized_md_theme_light_tertiaryContainer</item>
<item name="colorOnTertiaryContainer">@color/solarized_md_theme_light_onTertiaryContainer
</item>
<item name="colorError">@color/solarized_md_theme_light_error</item>
<item name="colorErrorContainer">@color/solarized_md_theme_light_errorContainer</item>
<item name="colorOnError">@color/solarized_md_theme_light_onError</item>
<item name="colorOnErrorContainer">@color/solarized_md_theme_light_onErrorContainer</item>
<item name="android:colorBackground">@color/solarized_md_theme_light_background</item>
<item name="colorOnBackground">@color/solarized_md_theme_light_onBackground</item>
<item name="colorSurface">@color/solarized_md_theme_light_surface</item>
<item name="colorOnSurface">@color/solarized_md_theme_light_onSurface</item>
<item name="colorSurfaceVariant">@color/solarized_md_theme_light_surfaceVariant</item>
<item name="colorOnSurfaceVariant">@color/solarized_md_theme_light_onSurfaceVariant</item>
<item name="colorOutline">@color/solarized_md_theme_light_outline</item>
<item name="colorOnSurfaceInverse">@color/solarized_md_theme_light_inverseOnSurface</item>
<item name="colorSurfaceInverse">@color/solarized_md_theme_light_inverseSurface</item>
<item name="colorPrimaryInverse">@color/solarized_md_theme_light_inversePrimary</item>
</style>
</resources>

View File

@ -15,41 +15,33 @@
app:title="@string/type_of_theme"
app:useSimpleSummaryProvider="true" />
<Preference
<SwitchPreferenceCompat
app:defaultValue="false"
app:iconSpaceReserved="false"
app:key="launch_custom_theme"
app:summary="@string/pref_customize_summary"
app:title="@string/pref_customize" />
app:key="@string/SET_DYNAMICCOLOR"
app:singleLineTitle="false"
app:summary="@string/set_dynamic_color_indication"
app:title="@string/set_dynamic_color" />
<Preference
<ListPreference
app:defaultValue="LIGHT"
app:dialogTitle="@string/type_default_theme_light"
app:entries="@array/set_default_theme_light"
app:entryValues="@array/SET_DEFAULT_THEME_LIGHT"
app:iconSpaceReserved="false"
app:key="contributors_themes"
app:summary="@string/pref_contributor_summary"
app:title="@string/pref_contributor" />
app:key="@string/SET_THEME_DEFAULT_LIGHT"
app:title="@string/type_default_theme_light"
app:useSimpleSummaryProvider="true" />
<androidx.preference.PreferenceCategory
android:key="cyanea_preference_category"
android:title="@string/customize_timelines"
app:iconSpaceReserved="false">
<ListPreference
app:defaultValue="DARK"
app:dialogTitle="@string/type_default_theme_dark"
app:entries="@array/set_default_theme_dark"
app:entryValues="@array/SET_THEME_DEFAULT_DARK"
app:iconSpaceReserved="false"
app:key="@string/SET_THEME_DEFAULT_DARK"
app:title="@string/type_of_theme"
app:useSimpleSummaryProvider="true" />
<Preference
app:iconSpaceReserved="false"
app:key="reset_pref"
app:summary="@string/clik_reset"
app:title="@string/reset_color" />
<Preference
app:iconSpaceReserved="false"
app:key="pref_import"
app:summary="@string/import_theme_title"
app:title="@string/import_theme" />
<Preference
app:iconSpaceReserved="false"
app:key="pref_export"
app:summary="@string/export_theme_title"
app:title="@string/export_theme" />
</androidx.preference.PreferenceCategory>
</androidx.preference.PreferenceScreen>