From ccf7ac5cffebd25cbbde921a14aa3b51a474845c Mon Sep 17 00:00:00 2001 From: Thomas Date: Mon, 28 Nov 2022 10:37:57 +0100 Subject: [PATCH] Remove cyanea --- app/build.gradle | 1 - app/src/main/AndroidManifest.xml | 8 +- .../app/fedilab/android/BaseMainActivity.java | 42 +--- .../app/fedilab/android/MainApplication.java | 9 - .../android/activities/AboutActivity.java | 7 +- .../activities/AccountReportActivity.java | 5 +- .../android/activities/ActionActivity.java | 5 +- .../activities/AnnouncementActivity.java | 6 +- .../android/activities/BaseActivity.java | 4 +- .../activities/BaseFragmentActivity.java | 5 +- .../android/activities/CacheActivity.java | 10 +- .../android/activities/ComposeActivity.java | 10 +- .../android/activities/ContextActivity.java | 7 +- .../activities/CustomSharingActivity.java | 6 +- .../android/activities/DraftActivity.java | 12 +- .../activities/EditProfileActivity.java | 20 +- .../android/activities/FilterActivity.java | 9 +- .../activities/FollowRequestActivity.java | 6 +- .../activities/FollowedTagActivity.java | 9 +- .../android/activities/HashTagActivity.java | 7 +- .../android/activities/InstanceActivity.java | 6 +- .../activities/InstanceHealthActivity.java | 2 - .../activities/InstanceProfileActivity.java | 3 +- .../android/activities/LoginActivity.java | 3 +- .../activities/MastodonListActivity.java | 13 +- .../android/activities/MediaActivity.java | 5 +- .../activities/PartnerShipActivity.java | 5 +- .../android/activities/ProfileActivity.java | 27 +-- .../activities/ReorderTimelinesActivity.java | 8 +- .../android/activities/ReportActivity.java | 6 +- .../android/activities/ScheduledActivity.java | 9 +- .../activities/SearchResultTabActivity.java | 8 +- .../android/activities/SettingsActivity.kt | 19 +- .../activities/StatusHistoryActivity.java | 6 +- .../activities/StatusInfoActivity.java | 6 +- .../activities/SuggestionActivity.java | 7 +- .../android/activities/TrendsActivity.java | 8 +- .../android/activities/WebviewActivity.java | 7 +- .../activities/WebviewConnectActivity.java | 3 +- .../admin/AdminAccountActivity.java | 8 +- .../activities/admin/AdminActionActivity.java | 9 +- .../admin/AdminDomainBlockActivity.java | 8 +- .../activities/admin/AdminReportActivity.java | 8 +- .../android/helper/CirclesDrawingView.java | 2 +- .../android/helper/CrossActionHelper.java | 6 +- .../app/fedilab/android/helper/Helper.java | 12 +- .../android/helper/MastodonHelper.java | 2 +- .../fedilab/android/helper/MediaHelper.java | 4 +- .../android/helper/PinnedTimelineHelper.java | 23 +- .../fedilab/android/helper/PushHelper.java | 4 +- .../android/helper/SpannableHelper.java | 16 +- .../fedilab/android/helper/ThemeHelper.java | 209 ++---------------- .../android/ui/drawer/AccountAdapter.java | 9 +- .../android/ui/drawer/AccountListAdapter.java | 1 - .../ui/drawer/AnnouncementAdapter.java | 2 +- .../android/ui/drawer/ComposeAdapter.java | 24 +- .../android/ui/drawer/DomainBlockAdapter.java | 3 +- .../android/ui/drawer/FilterAdapter.java | 3 +- .../android/ui/drawer/ReorderTabAdapter.java | 3 +- .../android/ui/drawer/StatusAdapter.java | 29 +-- .../android/ui/drawer/StatusDraftAdapter.java | 2 +- .../ui/drawer/StatusHistoryAdapter.java | 3 - .../ui/drawer/StatusScheduledAdapter.java | 2 +- .../android/ui/drawer/SuggestionAdapter.java | 3 - .../fedilab/android/ui/drawer/TagAdapter.java | 4 - .../android/ui/drawer/TopMenuAdapter.java | 2 +- .../fragment/admin/FragmentAdminAccount.java | 4 +- .../fragment/admin/FragmentAdminDomain.java | 4 +- .../fragment/admin/FragmentAdminReport.java | 4 +- .../ui/fragment/login/FragmentLoginMain.java | 3 +- .../login/FragmentLoginRegisterMastodon.java | 2 +- .../settings/FragmentComposeSettings.java | 6 - .../settings/FragmentInterfaceSettings.java | 1 - .../settings/FragmentLanguageSettings.java | 3 - .../FragmentNotificationsSettings.java | 10 +- .../settings/FragmentPrivacySettings.java | 4 - .../settings/FragmentThemingSettings.java | 56 +---- .../settings/FragmentTimelinesSettings.java | 2 - .../timeline/FragmentMastodonAccount.java | 4 +- .../FragmentMastodonAnnouncement.java | 4 +- .../timeline/FragmentMastodonContext.java | 4 +- .../FragmentMastodonConversation.java | 4 +- .../timeline/FragmentMastodonDomainBlock.java | 4 +- .../FragmentMastodonNotification.java | 4 +- .../timeline/FragmentMastodonSuggestion.java | 4 +- .../timeline/FragmentMastodonTag.java | 4 +- .../timeline/FragmentMastodonTimeline.java | 4 +- .../FragmentNotificationContainer.java | 21 +- .../timeline/FragmentProfileTimeline.java | 4 - .../drawable/ic_compose_attachment_play.xml | 2 +- app/src/main/res/drawable/ic_display_less.xml | 2 +- app/src/main/res/drawable/ic_display_more.xml | 2 +- .../main/res/drawable/menu_selector_dark.xml | 6 +- .../main/res/drawable/menu_selector_light.xml | 6 +- app/src/main/res/drawable/shape_counter.xml | 2 +- .../main/res/drawable/translation_border.xml | 2 +- app/src/main/res/layout/activity_about.xml | 8 +- app/src/main/res/layout/activity_actions.xml | 30 +-- .../res/layout/activity_admin_account.xml | 18 +- .../res/layout/activity_admin_actions.xml | 15 +- .../res/layout/activity_admin_domainblock.xml | 14 +- .../main/res/layout/activity_admin_report.xml | 32 +-- .../main/res/layout/activity_announcement.xml | 3 +- app/src/main/res/layout/activity_cache.xml | 1 - .../main/res/layout/activity_conversation.xml | 3 +- .../res/layout/activity_custom_sharing.xml | 1 - app/src/main/res/layout/activity_drafts.xml | 4 +- .../main/res/layout/activity_edit_profile.xml | 35 +-- app/src/main/res/layout/activity_filters.xml | 5 +- app/src/main/res/layout/activity_hashtag.xml | 6 +- app/src/main/res/layout/activity_instance.xml | 6 +- .../res/layout/activity_instance_profile.xml | 1 - .../res/layout/activity_instance_social.xml | 1 - app/src/main/res/layout/activity_main.xml | 7 - .../main/res/layout/activity_media_pager.xml | 3 +- .../main/res/layout/activity_pagination.xml | 3 +- app/src/main/res/layout/activity_profile.xml | 5 - app/src/main/res/layout/activity_proxy.xml | 1 - .../main/res/layout/activity_reorder_tabs.xml | 4 +- .../main/res/layout/activity_scheduled.xml | 3 - .../layout/activity_search_result_tabs.xml | 2 - .../res/layout/activity_status_history.xml | 3 +- .../main/res/layout/activity_status_info.xml | 4 +- app/src/main/res/layout/activity_trends.xml | 2 - app/src/main/res/layout/activity_webview.xml | 4 +- .../res/layout/activity_webview_connect.xml | 1 - app/src/main/res/layout/compose_poll.xml | 1 - app/src/main/res/layout/datetime_picker.xml | 1 - app/src/main/res/layout/drawer_account.xml | 9 +- .../main/res/layout/drawer_account_reply.xml | 4 +- .../main/res/layout/drawer_admin_account.xml | 1 - .../main/res/layout/drawer_announcement.xml | 1 - app/src/main/res/layout/drawer_cache.xml | 3 - app/src/main/res/layout/drawer_checkbox.xml | 4 +- .../main/res/layout/drawer_conversation.xml | 1 - .../main/res/layout/drawer_domain_block.xml | 7 +- app/src/main/res/layout/drawer_fetch_more.xml | 12 +- app/src/main/res/layout/drawer_filter.xml | 8 +- app/src/main/res/layout/drawer_follow.xml | 5 +- .../main/res/layout/drawer_instance_reg.xml | 5 +- app/src/main/res/layout/drawer_keyword.xml | 3 +- app/src/main/res/layout/drawer_list.xml | 4 +- .../main/res/layout/drawer_release_note.xml | 3 +- app/src/main/res/layout/drawer_reorder.xml | 1 - app/src/main/res/layout/drawer_status.xml | 18 +- .../main/res/layout/drawer_status_compose.xml | 4 - .../main/res/layout/drawer_status_draft.xml | 1 - .../res/layout/drawer_status_filtered.xml | 4 +- .../main/res/layout/drawer_status_report.xml | 1 - app/src/main/res/layout/drawer_suggestion.xml | 5 +- app/src/main/res/layout/drawer_tag.xml | 1 - .../main/res/layout/drawer_top_menu_item.xml | 1 - .../main/res/layout/fragment_login_join.xml | 1 - .../main/res/layout/fragment_login_main.xml | 1 - .../fragment_login_register_mastodon.xml | 4 +- .../fragment_notification_container.xml | 3 - .../main/res/layout/fragment_pagination.xml | 3 - .../res/layout/fragment_profile_timelines.xml | 2 - .../main/res/layout/fragment_scheduled.xml | 1 - .../main/res/layout/fragment_slide_media.xml | 1 - app/src/main/res/layout/layout_poll.xml | 1 - app/src/main/res/layout/layout_poll_item.xml | 1 - app/src/main/res/layout/popup_add_filter.xml | 24 +- app/src/main/res/layout/popup_contact.xml | 1 - app/src/main/res/layout/popup_links.xml | 20 +- .../res/layout/popup_manage_accounts_list.xml | 1 - .../layout/popup_notification_settings.xml | 20 +- app/src/main/res/layout/popup_record.xml | 1 - .../main/res/layout/popup_release_notes.xml | 6 +- .../main/res/layout/popup_status_theme.xml | 5 +- app/src/main/res/layout/simple_bar.xml | 1 - app/src/main/res/values/colors.xml | 4 +- app/src/main/res/values/styles.xml | 146 +++--------- 173 files changed, 343 insertions(+), 1159 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index bb994c69..2b854be5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -88,7 +88,6 @@ dependencies { implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' implementation 'androidx.preference:preference:1.2.0' implementation "org.conscrypt:conscrypt-android:2.5.2" - implementation 'com.github.evozi:Cyanea:1.0.7' implementation 'com.vanniktech:emoji-one:0.6.0' implementation 'com.github.GrenderG:Toasty:1.5.2' implementation 'org.framagit.tom79:SparkButton:1.0.13' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index be259dfd..cbb97072 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -287,15 +287,15 @@ android:name=".activities.InstanceActivity" android:configChanges="keyboardHidden|orientation|screenSize" android:label="@string/action_about_instance" - android:theme="@style/DialogDark" /> + android:theme="@style/MaterialAlertDialog.Material3" /> + android:theme="@style/MaterialAlertDialog.Material3" /> + android:theme="@style/MaterialAlertDialog.Material3" /> @@ -310,7 +310,7 @@ + android:theme="@style/MaterialAlertDialog.Material3" /> startActivity(new Intent(this, ComposeActivity.class))); headerMenuOpen = false; - binding.bottomNavView.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary))); - binding.navView.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary))); + // Passing each menu ID as a set of Ids because each @@ -537,14 +525,14 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt }); headerMainBinding.headerOptionInfo.setOnClickListener(v -> { - PopupMenu popup = new PopupMenu(new ContextThemeWrapper(BaseMainActivity.this, Helper.popupStyle()), headerMainBinding.headerOptionInfo); + PopupMenu popup = new PopupMenu(BaseMainActivity.this, headerMainBinding.headerOptionInfo); popup.getMenuInflater() .inflate(R.menu.main, popup.getMenu()); popup.setOnMenuItemClickListener(item -> { int itemId = item.getItemId(); if (itemId == R.id.action_logout_account) { - AlertDialog.Builder alt_bld = new AlertDialog.Builder(BaseMainActivity.this, Helper.dialogStyle()); + AlertDialog.Builder alt_bld = new AlertDialog.Builder(BaseMainActivity.this); alt_bld.setTitle(R.string.action_logout); if (currentAccount.mastodon_account != null && currentAccount.mastodon_account.username != null && currentAccount.instance != null) { alt_bld.setMessage(getString(R.string.logout_account_confirmation, currentAccount.mastodon_account.username, currentAccount.instance)); @@ -1123,7 +1111,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt view = binding.bottomNavView.findViewById(R.id.nav_public); showExtendedFilter = false; } - PopupMenu popup = new PopupMenu(new ContextThemeWrapper(BaseMainActivity.this, Helper.popupStyle()), view, Gravity.TOP); + PopupMenu popup = new PopupMenu(BaseMainActivity.this, view, Gravity.TOP); popup.getMenuInflater() .inflate(R.menu.option_filter_toots, popup.getMenu()); Menu menu = popup.getMenu(); @@ -1190,7 +1178,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt itemShowReplies.setChecked(show_replies); editor.apply(); } else if (itemId == R.id.action_filter) { - AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(BaseMainActivity.this, Helper.dialogStyle()); + AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(BaseMainActivity.this); LayoutInflater inflater = getLayoutInflater(); View dialogView = inflater.inflate(R.layout.popup_filter_regex, new LinearLayout(BaseMainActivity.this), false); dialogBuilder.setView(dialogView); @@ -1269,8 +1257,6 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt if (!singleBar) { if (count > 0) { binding.bottomNavView.getOrCreateBadge(R.id.nav_privates).setNumber(count); - binding.bottomNavView.getBadge(R.id.nav_privates).setBackgroundColor(ContextCompat.getColor(BaseMainActivity.this, R.color.cyanea_accent_reference)); - binding.bottomNavView.getBadge(R.id.nav_privates).setBadgeTextColor(ThemeHelper.getAttColor(BaseMainActivity.this, R.attr.mTextColor)); } else { binding.bottomNavView.removeBadge(R.id.nav_privates); } @@ -1289,8 +1275,6 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt if (!singleBar) { if (count > 0) { binding.bottomNavView.getOrCreateBadge(R.id.nav_notifications).setNumber(count); - binding.bottomNavView.getBadge(R.id.nav_notifications).setBackgroundColor(ContextCompat.getColor(BaseMainActivity.this, R.color.cyanea_accent_reference)); - binding.bottomNavView.getBadge(R.id.nav_notifications).setBadgeTextColor(ThemeHelper.getAttColor(BaseMainActivity.this, R.attr.mTextColor)); } else { binding.bottomNavView.removeBadge(R.id.nav_notifications); } @@ -1355,8 +1339,6 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt case HOME: if (count > 0) { binding.bottomNavView.getOrCreateBadge(R.id.nav_home).setNumber(count); - binding.bottomNavView.getBadge(R.id.nav_home).setBackgroundColor(ContextCompat.getColor(BaseMainActivity.this, R.color.cyanea_accent_reference)); - binding.bottomNavView.getBadge(R.id.nav_home).setBadgeTextColor(ThemeHelper.getAttColor(BaseMainActivity.this, R.attr.mTextColor)); } else { binding.bottomNavView.removeBadge(R.id.nav_home); } @@ -1364,8 +1346,6 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt case LOCAL: if (count > 0) { binding.bottomNavView.getOrCreateBadge(R.id.nav_local).setNumber(count); - binding.bottomNavView.getBadge(R.id.nav_local).setBackgroundColor(ContextCompat.getColor(BaseMainActivity.this, R.color.cyanea_accent_reference)); - binding.bottomNavView.getBadge(R.id.nav_local).setBadgeTextColor(ThemeHelper.getAttColor(BaseMainActivity.this, R.attr.mTextColor)); } else { binding.bottomNavView.removeBadge(R.id.nav_local); } @@ -1373,8 +1353,6 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt case PUBLIC: if (count > 0) { binding.bottomNavView.getOrCreateBadge(R.id.nav_public).setNumber(count); - binding.bottomNavView.getBadge(R.id.nav_public).setBackgroundColor(ContextCompat.getColor(BaseMainActivity.this, R.color.cyanea_accent_reference)); - binding.bottomNavView.getBadge(R.id.nav_public).setBadgeTextColor(ThemeHelper.getAttColor(BaseMainActivity.this, R.attr.mTextColor)); } else { binding.bottomNavView.removeBadge(R.id.nav_public); } @@ -1382,8 +1360,6 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt case NOTIFICATION: if (count > 0) { binding.bottomNavView.getOrCreateBadge(R.id.nav_notifications).setNumber(count); - binding.bottomNavView.getBadge(R.id.nav_notifications).setBackgroundColor(ContextCompat.getColor(BaseMainActivity.this, R.color.cyanea_accent_reference)); - binding.bottomNavView.getBadge(R.id.nav_notifications).setBadgeTextColor(ThemeHelper.getAttColor(BaseMainActivity.this, R.attr.mTextColor)); } else { binding.bottomNavView.removeBadge(R.id.nav_notifications); } @@ -1391,8 +1367,6 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt case DIRECT: if (count > 0) { binding.bottomNavView.getOrCreateBadge(R.id.nav_privates).setNumber(count); - binding.bottomNavView.getBadge(R.id.nav_privates).setBackgroundColor(ContextCompat.getColor(BaseMainActivity.this, R.color.cyanea_accent_reference)); - binding.bottomNavView.getBadge(R.id.nav_privates).setBadgeTextColor(ThemeHelper.getAttColor(BaseMainActivity.this, R.attr.mTextColor)); } else { binding.bottomNavView.removeBadge(R.id.nav_privates); } @@ -1525,7 +1499,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt @Override public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == R.id.action_logout) { - AlertDialog.Builder alt_bld = new AlertDialog.Builder(BaseMainActivity.this, Helper.dialogStyle()); + AlertDialog.Builder alt_bld = new AlertDialog.Builder(BaseMainActivity.this); alt_bld.setTitle(R.string.action_logout); alt_bld.setMessage(getString(R.string.logout_account_confirmation, account.mastodon_account.username, account.instance)); alt_bld.setPositiveButton(R.string.action_logout, (dialog, id) -> { diff --git a/app/src/main/java/app/fedilab/android/MainApplication.java b/app/src/main/java/app/fedilab/android/MainApplication.java index a2d40e7d..0f699a8e 100644 --- a/app/src/main/java/app/fedilab/android/MainApplication.java +++ b/app/src/main/java/app/fedilab/android/MainApplication.java @@ -23,9 +23,6 @@ import androidx.multidex.MultiDex; import androidx.multidex.MultiDexApplication; import androidx.preference.PreferenceManager; -import com.jaredrummler.cyanea.Cyanea; -import com.jaredrummler.cyanea.prefs.CyaneaTheme; - import org.acra.ACRA; import org.acra.ReportField; import org.acra.config.CoreConfigurationBuilder; @@ -33,8 +30,6 @@ import org.acra.config.DialogConfigurationBuilder; import org.acra.config.MailSenderConfigurationBuilder; import org.acra.data.StringFormat; -import java.util.List; - import es.dmoral.toasty.Toasty; @@ -54,12 +49,9 @@ public class MainApplication extends MultiDexApplication { SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(MainApplication.this); - Cyanea.init(this, super.getResources()); - List list = CyaneaTheme.Companion.from(getAssets(), "themes/cyanea_themes.json"); 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) { - list.get(0).apply(Cyanea.getInstance()); SharedPreferences.Editor editor = sharedpreferences.edit(); editor.putBoolean("no_theme_set", false); editor.apply(); @@ -92,7 +84,6 @@ public class MainApplication extends MultiDexApplication { .withResIcon(R.mipmap.ic_launcher) .withText(getString(R.string.crash_title)) .withCommentPrompt(getString(R.string.crash_message)) - .withResTheme(R.style.DialogDark) .withPositiveButtonText(getString(R.string.send_email)) .withNegativeButtonText(getString(R.string.cancel)) .build() diff --git a/app/src/main/java/app/fedilab/android/activities/AboutActivity.java b/app/src/main/java/app/fedilab/android/activities/AboutActivity.java index 54974a2c..78df3fe8 100644 --- a/app/src/main/java/app/fedilab/android/activities/AboutActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/AboutActivity.java @@ -18,13 +18,11 @@ package app.fedilab.android.activities; import android.content.Intent; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; -import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.view.MenuItem; import android.view.View; import androidx.core.app.ActivityOptionsCompat; -import androidx.core.content.ContextCompat; import androidx.lifecycle.ViewModelProvider; import java.util.ArrayList; @@ -39,7 +37,6 @@ import app.fedilab.android.databinding.ActivityAboutBinding; import app.fedilab.android.helper.CrossActionHelper; import app.fedilab.android.helper.Helper; import app.fedilab.android.helper.MastodonHelper; -import app.fedilab.android.helper.ThemeHelper; import app.fedilab.android.viewmodel.mastodon.AccountsVM; @@ -52,13 +49,12 @@ public class AboutActivity extends BaseActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ThemeHelper.applyThemeBar(this); + binding = ActivityAboutBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); - getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary))); } try { @@ -79,7 +75,6 @@ public class AboutActivity extends BaseActivity { } binding.aboutSupportPaypal.setOnClickListener(v -> Helper.openBrowser(AboutActivity.this, "https://www.paypal.me/Mastalab")); - binding.accountFollow.setBackgroundTintList(ThemeHelper.getButtonActionColorStateList(AboutActivity.this)); if (BuildConfig.DONATIONS) { binding.aboutSupportPaypal.setVisibility(View.VISIBLE); } else { diff --git a/app/src/main/java/app/fedilab/android/activities/AccountReportActivity.java b/app/src/main/java/app/fedilab/android/activities/AccountReportActivity.java index 63257fed..cca0b073 100644 --- a/app/src/main/java/app/fedilab/android/activities/AccountReportActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/AccountReportActivity.java @@ -17,7 +17,6 @@ package app.fedilab.android.activities; import android.app.Activity; import android.graphics.PorterDuff; -import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.view.MenuItem; import android.view.View; @@ -36,7 +35,6 @@ import app.fedilab.android.client.entities.api.admin.AdminAccount; import app.fedilab.android.client.entities.api.admin.AdminReport; import app.fedilab.android.databinding.ActivityAdminReportBinding; import app.fedilab.android.helper.Helper; -import app.fedilab.android.helper.ThemeHelper; import app.fedilab.android.ui.drawer.StatusReportAdapter; import app.fedilab.android.viewmodel.mastodon.AdminVM; import es.dmoral.toasty.Toasty; @@ -52,13 +50,12 @@ public class AccountReportActivity extends BaseActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ThemeHelper.applyThemeBar(this); + binding = ActivityAdminReportBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); - getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary))); } report = null; diff --git a/app/src/main/java/app/fedilab/android/activities/ActionActivity.java b/app/src/main/java/app/fedilab/android/activities/ActionActivity.java index 0088f7c3..a452c1b2 100644 --- a/app/src/main/java/app/fedilab/android/activities/ActionActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/ActionActivity.java @@ -14,12 +14,10 @@ package app.fedilab.android.activities; * You should have received a copy of the GNU General Public License along with Fedilab; if not, * see . */ -import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.view.MenuItem; import androidx.annotation.Nullable; -import androidx.core.content.ContextCompat; import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentTransaction; @@ -43,13 +41,12 @@ public class ActionActivity extends BaseActivity { @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ThemeHelper.applyThemeBar(this); + binding = ActivityActionsBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); - getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary))); } canGoBack = false; binding.favourites.setOnClickListener(v -> displayTimeline(Timeline.TimeLineEnum.FAVOURITE_TIMELINE)); diff --git a/app/src/main/java/app/fedilab/android/activities/AnnouncementActivity.java b/app/src/main/java/app/fedilab/android/activities/AnnouncementActivity.java index fca3e910..6197235f 100644 --- a/app/src/main/java/app/fedilab/android/activities/AnnouncementActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/AnnouncementActivity.java @@ -19,13 +19,11 @@ import static app.fedilab.android.BaseMainActivity.currentInstance; import static app.fedilab.android.BaseMainActivity.emojis; import android.content.SharedPreferences; -import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.util.TypedValue; import android.view.MenuItem; import androidx.appcompat.app.ActionBar; -import androidx.core.content.ContextCompat; import androidx.preference.PreferenceManager; import app.fedilab.android.R; @@ -33,7 +31,6 @@ import app.fedilab.android.client.entities.api.EmojiInstance; import app.fedilab.android.databinding.ActivityAnnouncementBinding; import app.fedilab.android.exception.DBException; import app.fedilab.android.helper.Helper; -import app.fedilab.android.helper.ThemeHelper; import app.fedilab.android.ui.fragment.timeline.FragmentMastodonAnnouncement; @@ -43,7 +40,7 @@ public class AnnouncementActivity extends BaseActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ThemeHelper.applyTheme(this); + ActivityAnnouncementBinding binding = ActivityAnnouncementBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); @@ -53,7 +50,6 @@ public class AnnouncementActivity extends BaseActivity { //Remove title if (actionBar != null) { actionBar.setDisplayShowTitleEnabled(false); - actionBar.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary))); } binding.title.setText(R.string.action_announcements); if (getSupportActionBar() != null) { diff --git a/app/src/main/java/app/fedilab/android/activities/BaseActivity.java b/app/src/main/java/app/fedilab/android/activities/BaseActivity.java index a61b0665..102d0f98 100644 --- a/app/src/main/java/app/fedilab/android/activities/BaseActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/BaseActivity.java @@ -19,8 +19,8 @@ import android.annotation.SuppressLint; import android.os.Bundle; import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; -import com.jaredrummler.cyanea.app.CyaneaAppCompatActivity; import com.vanniktech.emoji.EmojiManager; import com.vanniktech.emoji.one.EmojiOneProvider; @@ -29,7 +29,7 @@ import app.fedilab.android.helper.ThemeHelper; @SuppressLint("Registered") -public class BaseActivity extends CyaneaAppCompatActivity { +public class BaseActivity extends AppCompatActivity { static { Helper.installProvider(); diff --git a/app/src/main/java/app/fedilab/android/activities/BaseFragmentActivity.java b/app/src/main/java/app/fedilab/android/activities/BaseFragmentActivity.java index e5364165..a4170406 100644 --- a/app/src/main/java/app/fedilab/android/activities/BaseFragmentActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/BaseFragmentActivity.java @@ -16,7 +16,8 @@ package app.fedilab.android.activities; import android.annotation.SuppressLint; -import com.jaredrummler.cyanea.app.CyaneaFragmentActivity; +import androidx.fragment.app.FragmentActivity; + import com.vanniktech.emoji.EmojiManager; import com.vanniktech.emoji.one.EmojiOneProvider; @@ -24,7 +25,7 @@ import app.fedilab.android.helper.Helper; @SuppressLint("Registered") -public class BaseFragmentActivity extends CyaneaFragmentActivity { +public class BaseFragmentActivity extends FragmentActivity { static { diff --git a/app/src/main/java/app/fedilab/android/activities/CacheActivity.java b/app/src/main/java/app/fedilab/android/activities/CacheActivity.java index 19cc67d4..58c18468 100644 --- a/app/src/main/java/app/fedilab/android/activities/CacheActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/CacheActivity.java @@ -15,7 +15,6 @@ package app.fedilab.android.activities; * see . */ -import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.os.Handler; import android.os.Looper; @@ -25,7 +24,6 @@ import android.view.MenuItem; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; -import androidx.core.content.ContextCompat; import androidx.recyclerview.widget.LinearLayoutManager; import java.util.ArrayList; @@ -42,7 +40,6 @@ import app.fedilab.android.databinding.ActivityCacheBinding; import app.fedilab.android.exception.DBException; import app.fedilab.android.helper.CacheHelper; import app.fedilab.android.helper.Helper; -import app.fedilab.android.helper.ThemeHelper; import app.fedilab.android.ui.drawer.CacheAdapter; public class CacheActivity extends BaseActivity { @@ -54,12 +51,11 @@ public class CacheActivity extends BaseActivity { @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ThemeHelper.applyThemeBar(this); + binding = ActivityCacheBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); - getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary))); } CacheHelper.getCacheValues(CacheActivity.this, size -> { if (size > 0) { @@ -123,7 +119,7 @@ public class CacheActivity extends BaseActivity { finish(); return true; } else if (item.getItemId() == R.id.action_clear) { - AlertDialog.Builder deleteConfirm = new AlertDialog.Builder(CacheActivity.this, Helper.dialogStyle()); + AlertDialog.Builder deleteConfirm = new AlertDialog.Builder(CacheActivity.this); deleteConfirm.setTitle(getString(R.string.delete_cache)); deleteConfirm.setMessage(getString(R.string.delete_cache_message)); deleteConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); @@ -133,7 +129,7 @@ public class CacheActivity extends BaseActivity { size = size / 1000000.0f; } binding.fileCacheSize.setText(String.format("%s %s", String.format(Locale.getDefault(), "%.2f", size), getString(R.string.cache_units))); - AlertDialog.Builder restartBuilder = new AlertDialog.Builder(CacheActivity.this, Helper.dialogStyle()); + AlertDialog.Builder restartBuilder = new AlertDialog.Builder(CacheActivity.this); restartBuilder.setMessage(getString(R.string.restart_the_app)); restartBuilder.setNegativeButton(R.string.no, (dialogRestart, whichRestart) -> { recreate(); diff --git a/app/src/main/java/app/fedilab/android/activities/ComposeActivity.java b/app/src/main/java/app/fedilab/android/activities/ComposeActivity.java index 78e2eb78..276a26f8 100644 --- a/app/src/main/java/app/fedilab/android/activities/ComposeActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/ComposeActivity.java @@ -28,7 +28,6 @@ import android.content.Intent; import android.content.IntentFilter; import android.content.SharedPreferences; import android.content.pm.PackageManager; -import android.graphics.drawable.ColorDrawable; import android.net.Uri; import android.os.Build; import android.os.Bundle; @@ -86,7 +85,6 @@ import app.fedilab.android.helper.DividerDecorationSimple; import app.fedilab.android.helper.Helper; import app.fedilab.android.helper.MastodonHelper; import app.fedilab.android.helper.MediaHelper; -import app.fedilab.android.helper.ThemeHelper; import app.fedilab.android.interfaces.OnDownloadInterface; import app.fedilab.android.jobs.ComposeWorker; import app.fedilab.android.jobs.ScheduleThreadWorker; @@ -216,7 +214,7 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana } if (canBeSent(statusDraft)) { if (promptSaveDraft) { - AlertDialog.Builder alt_bld = new AlertDialog.Builder(ComposeActivity.this, Helper.dialogStyle()); + AlertDialog.Builder alt_bld = new AlertDialog.Builder(ComposeActivity.this); alt_bld.setMessage(R.string.save_draft); alt_bld.setPositiveButton(R.string.save, (dialog, id) -> { dialog.dismiss(); @@ -317,7 +315,7 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana } else if (item.getItemId() == R.id.action_photo_camera) { photoFileUri = MediaHelper.dispatchTakePictureIntent(ComposeActivity.this); } else if (item.getItemId() == R.id.action_contacts) { - AlertDialog.Builder builderSingle = new AlertDialog.Builder(ComposeActivity.this, Helper.dialogStyle()); + AlertDialog.Builder builderSingle = new AlertDialog.Builder(ComposeActivity.this); builderSingle.setTitle(getString(R.string.select_accounts)); PopupContactBinding popupContactBinding = PopupContactBinding.inflate(getLayoutInflater(), new LinearLayout(ComposeActivity.this), false); @@ -444,7 +442,7 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ThemeHelper.applyTheme(this); + binding = ActivityPaginationBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); setSupportActionBar(binding.toolbar); @@ -454,7 +452,6 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana //Remove title if (actionBar != null) { actionBar.setDisplayShowTitleEnabled(false); - actionBar.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary))); } if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); @@ -500,7 +497,6 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana if (sharedTitle != null && sharedSubject != null && sharedSubject.length() > sharedTitle.length()) { sharedTitle = sharedSubject; } - binding.toolbar.setPopupTheme(Helper.popupStyle()); //Edit a scheduled status from server if (scheduledStatus != null) { statusDraft = new StatusDraft(); diff --git a/app/src/main/java/app/fedilab/android/activities/ContextActivity.java b/app/src/main/java/app/fedilab/android/activities/ContextActivity.java index 75def795..243e90b0 100644 --- a/app/src/main/java/app/fedilab/android/activities/ContextActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/ContextActivity.java @@ -20,7 +20,6 @@ import static app.fedilab.android.ui.drawer.StatusAdapter.sendAction; import android.content.SharedPreferences; import android.content.res.Resources; -import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.os.Handler; import android.os.Looper; @@ -30,7 +29,6 @@ import android.view.MenuItem; import androidx.annotation.NonNull; import androidx.appcompat.app.ActionBar; -import androidx.core.content.ContextCompat; import androidx.fragment.app.Fragment; import androidx.lifecycle.ViewModelProvider; import androidx.preference.PreferenceManager; @@ -43,7 +41,6 @@ import app.fedilab.android.databinding.ActivityConversationBinding; import app.fedilab.android.exception.DBException; import app.fedilab.android.helper.Helper; import app.fedilab.android.helper.MastodonHelper; -import app.fedilab.android.helper.ThemeHelper; import app.fedilab.android.ui.fragment.timeline.FragmentMastodonContext; import app.fedilab.android.viewmodel.mastodon.StatusesVM; @@ -57,7 +54,7 @@ public class ContextActivity extends BaseActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ThemeHelper.applyTheme(this); + app.fedilab.android.databinding.ActivityConversationBinding binding = ActivityConversationBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); setSupportActionBar(binding.toolbar); @@ -65,7 +62,6 @@ public class ContextActivity extends BaseActivity { //Remove title if (actionBar != null) { actionBar.setDisplayShowTitleEnabled(false); - actionBar.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary))); } binding.title.setText(R.string.context_conversation); SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(this); @@ -76,7 +72,6 @@ public class ContextActivity extends BaseActivity { getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true); } - binding.toolbar.setPopupTheme(Helper.popupStyle()); Bundle b = getIntent().getExtras(); displayCW = sharedpreferences.getBoolean(getString(R.string.SET_EXPAND_CW), false); Status focusedStatus = null; // or other values diff --git a/app/src/main/java/app/fedilab/android/activities/CustomSharingActivity.java b/app/src/main/java/app/fedilab/android/activities/CustomSharingActivity.java index f64786df..635386e3 100644 --- a/app/src/main/java/app/fedilab/android/activities/CustomSharingActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/CustomSharingActivity.java @@ -17,7 +17,6 @@ package app.fedilab.android.activities; import static app.fedilab.android.BaseMainActivity.currentAccount; import android.content.SharedPreferences; -import android.graphics.drawable.ColorDrawable; import android.net.Uri; import android.os.Build; import android.os.Bundle; @@ -26,7 +25,6 @@ import android.text.TextUtils; import android.view.MenuItem; import android.widget.Toast; -import androidx.core.content.ContextCompat; import androidx.preference.PreferenceManager; import java.util.List; @@ -39,7 +37,6 @@ import app.fedilab.android.client.entities.api.Status; import app.fedilab.android.client.entities.api.Tag; import app.fedilab.android.databinding.ActivityCustomSharingBinding; import app.fedilab.android.helper.Helper; -import app.fedilab.android.helper.ThemeHelper; import app.fedilab.android.helper.customsharing.CustomSharingAsyncTask; import app.fedilab.android.helper.customsharing.CustomSharingResponse; import app.fedilab.android.helper.customsharing.OnCustomSharingInterface; @@ -66,14 +63,13 @@ public class CustomSharingActivity extends BaseActivity implements OnCustomShari @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ThemeHelper.applyThemeBar(this); + SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(CustomSharingActivity.this); binding = ActivityCustomSharingBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true); - getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary))); } Bundle b = getIntent().getExtras(); status = null; diff --git a/app/src/main/java/app/fedilab/android/activities/DraftActivity.java b/app/src/main/java/app/fedilab/android/activities/DraftActivity.java index ccfe83a8..ed41a6e1 100644 --- a/app/src/main/java/app/fedilab/android/activities/DraftActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/DraftActivity.java @@ -17,7 +17,6 @@ package app.fedilab.android.activities; import static app.fedilab.android.BaseMainActivity.currentAccount; import android.content.SharedPreferences; -import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.os.Handler; import android.os.Looper; @@ -30,7 +29,6 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.ActionBar; import androidx.appcompat.app.AlertDialog; -import androidx.core.content.ContextCompat; import androidx.lifecycle.ViewModelProvider; import androidx.preference.PreferenceManager; import androidx.recyclerview.widget.LinearLayoutManager; @@ -45,8 +43,6 @@ import app.fedilab.android.client.entities.api.Status; import app.fedilab.android.client.entities.app.StatusDraft; import app.fedilab.android.databinding.ActivityDraftsBinding; import app.fedilab.android.exception.DBException; -import app.fedilab.android.helper.Helper; -import app.fedilab.android.helper.ThemeHelper; import app.fedilab.android.ui.drawer.StatusDraftAdapter; import app.fedilab.android.viewmodel.mastodon.TimelinesVM; @@ -62,20 +58,16 @@ public class DraftActivity extends BaseActivity implements StatusDraftAdapter.Dr @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ThemeHelper.applyTheme(this); + binding = ActivityDraftsBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); setSupportActionBar(binding.toolbar); ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary))); - } //Remove title if (actionBar != null) { actionBar.setDisplayShowTitleEnabled(false); } - binding.toolbar.setPopupTheme(Helper.popupStyle()); binding.title.setText(R.string.drafts); SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(this); float scale = sharedpreferences.getFloat(getString(R.string.SET_FONT_SCALE), 1.1f); @@ -105,7 +97,7 @@ public class DraftActivity extends BaseActivity implements StatusDraftAdapter.Dr finish(); return true; } else if (item.getItemId() == R.id.action_delete) { - AlertDialog.Builder unfollowConfirm = new AlertDialog.Builder(DraftActivity.this, Helper.dialogStyle()); + AlertDialog.Builder unfollowConfirm = new AlertDialog.Builder(DraftActivity.this); unfollowConfirm.setTitle(getString(R.string.delete_all)); unfollowConfirm.setMessage(getString(R.string.remove_draft)); unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); diff --git a/app/src/main/java/app/fedilab/android/activities/EditProfileActivity.java b/app/src/main/java/app/fedilab/android/activities/EditProfileActivity.java index 8efe171b..8c210d9f 100644 --- a/app/src/main/java/app/fedilab/android/activities/EditProfileActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/EditProfileActivity.java @@ -18,7 +18,6 @@ import static app.fedilab.android.BaseMainActivity.currentAccount; import static app.fedilab.android.BaseMainActivity.instanceInfo; import android.content.Intent; -import android.graphics.drawable.ColorDrawable; import android.net.Uri; import android.os.Build; import android.os.Bundle; @@ -31,8 +30,6 @@ import android.view.View; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; -import androidx.core.content.ContextCompat; -import androidx.core.graphics.drawable.DrawableCompat; import androidx.lifecycle.ViewModelProvider; import androidx.localbroadcastmanager.content.LocalBroadcastManager; @@ -52,7 +49,6 @@ import app.fedilab.android.databinding.ActivityEditProfileBinding; import app.fedilab.android.exception.DBException; import app.fedilab.android.helper.Helper; import app.fedilab.android.helper.MastodonHelper; -import app.fedilab.android.helper.ThemeHelper; import app.fedilab.android.viewmodel.mastodon.AccountsVM; import es.dmoral.toasty.Toasty; @@ -66,12 +62,11 @@ public class EditProfileActivity extends BaseActivity { @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ThemeHelper.applyThemeBar(this); + binding = ActivityEditProfileBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); - getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary))); } new ViewModelProvider(EditProfileActivity.this).get(AccountsVM.class).getConnectedAccount(BaseMainActivity.currentInstance, BaseMainActivity.currentToken) @@ -140,7 +135,7 @@ public class EditProfileActivity extends BaseActivity { value = Html.fromHtml(field.value).toString(); fieldItemBinding.value.setText(value); fieldItemBinding.remove.setOnClickListener(v -> { - AlertDialog.Builder deleteConfirm = new AlertDialog.Builder(EditProfileActivity.this, Helper.dialogStyle()); + AlertDialog.Builder deleteConfirm = new AlertDialog.Builder(EditProfileActivity.this); deleteConfirm.setTitle(getString(R.string.delete_field)); deleteConfirm.setMessage(getString(R.string.delete_field_confirm)); deleteConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); @@ -162,7 +157,7 @@ public class EditProfileActivity extends BaseActivity { binding.addField.setOnClickListener(view -> { AccountFieldItemBinding fieldItemBinding = AccountFieldItemBinding.inflate(getLayoutInflater()); fieldItemBinding.remove.setOnClickListener(v -> { - AlertDialog.Builder deleteConfirm = new AlertDialog.Builder(EditProfileActivity.this, Helper.dialogStyle()); + AlertDialog.Builder deleteConfirm = new AlertDialog.Builder(EditProfileActivity.this); deleteConfirm.setTitle(getString(R.string.delete_field)); deleteConfirm.setMessage(getString(R.string.delete_field_confirm)); deleteConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); @@ -183,15 +178,6 @@ public class EditProfileActivity extends BaseActivity { } }); - ThemeHelper.changeColorOutlineButton(EditProfileActivity.this, binding.visibilityPublic); - ThemeHelper.changeColorOutlineButton(EditProfileActivity.this, binding.visibilityUnlisted); - ThemeHelper.changeColorOutlineButton(EditProfileActivity.this, binding.visibilityPrivate); - ThemeHelper.changeColorOutlineButton(EditProfileActivity.this, binding.visibilityDirect); - DrawableCompat.setTintList(DrawableCompat.wrap(binding.bot.getThumbDrawable()), ThemeHelper.getSwitchCompatThumbDrawable(EditProfileActivity.this)); - DrawableCompat.setTintList(DrawableCompat.wrap(binding.discoverable.getThumbDrawable()), ThemeHelper.getSwitchCompatThumbDrawable(EditProfileActivity.this)); - DrawableCompat.setTintList(DrawableCompat.wrap(binding.sensitive.getThumbDrawable()), ThemeHelper.getSwitchCompatThumbDrawable(EditProfileActivity.this)); - ThemeHelper.changeColorOutlineButton(EditProfileActivity.this, binding.locked); - ThemeHelper.changeColorOutlineButton(EditProfileActivity.this, binding.unlocked); //Actions with the activity accountsVM = new ViewModelProvider(EditProfileActivity.this).get(AccountsVM.class); diff --git a/app/src/main/java/app/fedilab/android/activities/FilterActivity.java b/app/src/main/java/app/fedilab/android/activities/FilterActivity.java index ed8d616a..34dc9d0e 100644 --- a/app/src/main/java/app/fedilab/android/activities/FilterActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/FilterActivity.java @@ -15,7 +15,6 @@ package app.fedilab.android.activities; * see . */ import android.content.Context; -import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.view.LayoutInflater; import android.view.MenuItem; @@ -28,7 +27,6 @@ import android.widget.Button; import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; -import androidx.core.content.ContextCompat; import androidx.lifecycle.LifecycleOwner; import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelStoreOwner; @@ -43,8 +41,6 @@ import app.fedilab.android.R; import app.fedilab.android.client.entities.api.Filter; import app.fedilab.android.databinding.ActivityFiltersBinding; import app.fedilab.android.databinding.PopupAddFilterBinding; -import app.fedilab.android.helper.Helper; -import app.fedilab.android.helper.ThemeHelper; import app.fedilab.android.ui.drawer.FilterAdapter; import app.fedilab.android.ui.drawer.KeywordAdapter; import app.fedilab.android.viewmodel.mastodon.FiltersVM; @@ -63,7 +59,7 @@ public class FilterActivity extends BaseActivity implements FilterAdapter.Delete * @param listener - {@link FilterAdapter.FilterAction} */ public static void addEditFilter(Context context, Filter filter, FilterAdapter.FilterAction listener) { - AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(context, Helper.dialogStyle()); + AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(context); PopupAddFilterBinding popupAddFilterBinding = PopupAddFilterBinding.inflate(LayoutInflater.from(context)); FiltersVM filtersVM = new ViewModelProvider((ViewModelStoreOwner) context).get(FiltersVM.class); dialogBuilder.setView(popupAddFilterBinding.getRoot()); @@ -250,13 +246,12 @@ public class FilterActivity extends BaseActivity implements FilterAdapter.Delete @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ThemeHelper.applyThemeBar(this); + binding = ActivityFiltersBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); filterList = new ArrayList<>(); if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); - getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary))); } FiltersVM filtersVM = new ViewModelProvider(FilterActivity.this).get(FiltersVM.class); diff --git a/app/src/main/java/app/fedilab/android/activities/FollowRequestActivity.java b/app/src/main/java/app/fedilab/android/activities/FollowRequestActivity.java index 54414374..21a208ec 100644 --- a/app/src/main/java/app/fedilab/android/activities/FollowRequestActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/FollowRequestActivity.java @@ -15,13 +15,11 @@ package app.fedilab.android.activities; * see . */ -import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.view.MenuItem; import android.view.View; import androidx.annotation.NonNull; -import androidx.core.content.ContextCompat; import androidx.lifecycle.ViewModelProvider; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; @@ -35,7 +33,6 @@ import app.fedilab.android.client.entities.api.Account; import app.fedilab.android.client.entities.api.Accounts; import app.fedilab.android.databinding.ActivityStatusInfoBinding; import app.fedilab.android.helper.MastodonHelper; -import app.fedilab.android.helper.ThemeHelper; import app.fedilab.android.ui.drawer.AccountFollowRequestAdapter; import app.fedilab.android.viewmodel.mastodon.AccountsVM; @@ -51,14 +48,13 @@ public class FollowRequestActivity extends BaseActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ThemeHelper.applyTheme(this); + binding = ActivityStatusInfoBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); setSupportActionBar(binding.toolbar); if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true); - getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary))); } accountList = new ArrayList<>(); flagLoading = false; diff --git a/app/src/main/java/app/fedilab/android/activities/FollowedTagActivity.java b/app/src/main/java/app/fedilab/android/activities/FollowedTagActivity.java index cf9c3207..5e7aef20 100644 --- a/app/src/main/java/app/fedilab/android/activities/FollowedTagActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/FollowedTagActivity.java @@ -15,7 +15,6 @@ package app.fedilab.android.activities; * see . */ -import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.text.InputFilter; import android.view.Menu; @@ -24,7 +23,6 @@ import android.view.View; import androidx.annotation.NonNull; import androidx.appcompat.app.AlertDialog; -import androidx.core.content.ContextCompat; import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentTransaction; import androidx.lifecycle.ViewModelProvider; @@ -60,14 +58,13 @@ public class FollowedTagActivity extends BaseActivity implements FollowedTagAdap @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ThemeHelper.applyThemeBar(this); + binding = ActivityFollowedTagsBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); canGoBack = false; if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true); - getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary))); } tagVM = new ViewModelProvider(FollowedTagActivity.this).get(TagVM.class); tagVM.followedTags(BaseMainActivity.currentInstance, BaseMainActivity.currentToken) @@ -91,7 +88,7 @@ public class FollowedTagActivity extends BaseActivity implements FollowedTagAdap onBackPressed(); return true; } else if (item.getItemId() == R.id.action_unfollow && tag != null) { - AlertDialog.Builder alt_bld = new AlertDialog.Builder(FollowedTagActivity.this, Helper.dialogStyle()); + AlertDialog.Builder alt_bld = new AlertDialog.Builder(FollowedTagActivity.this); alt_bld.setTitle(R.string.action_unfollow_tag); alt_bld.setMessage(R.string.action_unfollow_tag_confirm); alt_bld.setPositiveButton(R.string.unfollow, (dialog, id) -> { @@ -123,7 +120,7 @@ public class FollowedTagActivity extends BaseActivity implements FollowedTagAdap AlertDialog alert = alt_bld.create(); alert.show(); } else if (item.getItemId() == R.id.action_follow_tag) { - AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(FollowedTagActivity.this, Helper.dialogStyle()); + AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(FollowedTagActivity.this); PopupAddFollowedTagtBinding popupAddFollowedTagtBinding = PopupAddFollowedTagtBinding.inflate(getLayoutInflater()); dialogBuilder.setView(popupAddFollowedTagtBinding.getRoot()); popupAddFollowedTagtBinding.addTag.setFilters(new InputFilter[]{new InputFilter.LengthFilter(255)}); diff --git a/app/src/main/java/app/fedilab/android/activities/HashTagActivity.java b/app/src/main/java/app/fedilab/android/activities/HashTagActivity.java index e5d8a1fe..d2b5d1c9 100644 --- a/app/src/main/java/app/fedilab/android/activities/HashTagActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/HashTagActivity.java @@ -18,7 +18,6 @@ package app.fedilab.android.activities; import static app.fedilab.android.BaseMainActivity.currentAccount; import android.content.Intent; -import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.os.Handler; import android.os.Looper; @@ -27,7 +26,6 @@ import android.view.MenuItem; import androidx.annotation.NonNull; import androidx.appcompat.app.ActionBar; -import androidx.core.content.ContextCompat; import androidx.lifecycle.ViewModelProvider; import androidx.localbroadcastmanager.content.LocalBroadcastManager; @@ -46,7 +44,6 @@ import app.fedilab.android.client.entities.app.Timeline; import app.fedilab.android.databinding.ActivityHashtagBinding; import app.fedilab.android.exception.DBException; import app.fedilab.android.helper.Helper; -import app.fedilab.android.helper.ThemeHelper; import app.fedilab.android.ui.fragment.timeline.FragmentMastodonTimeline; import app.fedilab.android.viewmodel.mastodon.FiltersVM; import app.fedilab.android.viewmodel.mastodon.ReorderVM; @@ -68,7 +65,7 @@ public class HashTagActivity extends BaseActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ThemeHelper.applyTheme(this); + ActivityHashtagBinding binding = ActivityHashtagBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); @@ -86,7 +83,6 @@ public class HashTagActivity extends BaseActivity { //Remove title if (actionBar != null) { actionBar.setDisplayShowTitleEnabled(false); - actionBar.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary))); } binding.title.setText(tag); if (getSupportActionBar() != null) { @@ -141,7 +137,6 @@ public class HashTagActivity extends BaseActivity { bundle.putSerializable(Helper.ARG_TIMELINE_TYPE, Timeline.TimeLineEnum.TAG); bundle.putString(Helper.ARG_SEARCH_KEYWORD, tag); Helper.addFragment(getSupportFragmentManager(), R.id.nav_host_fragment_tags, new FragmentMastodonTimeline(), bundle, null, null); - binding.toolbar.setPopupTheme(Helper.popupStyle()); binding.compose.setOnClickListener(v -> { Intent intentToot = new Intent(HashTagActivity.this, ComposeActivity.class); StatusDraft statusDraft = new StatusDraft(); diff --git a/app/src/main/java/app/fedilab/android/activities/InstanceActivity.java b/app/src/main/java/app/fedilab/android/activities/InstanceActivity.java index 0f8e3a91..7fb93935 100644 --- a/app/src/main/java/app/fedilab/android/activities/InstanceActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/InstanceActivity.java @@ -45,7 +45,6 @@ import app.fedilab.android.R; import app.fedilab.android.client.entities.api.Instance; import app.fedilab.android.databinding.ActivityInstanceBinding; import app.fedilab.android.helper.Helper; -import app.fedilab.android.helper.ThemeHelper; import app.fedilab.android.viewmodel.mastodon.InstancesVM; @@ -58,7 +57,6 @@ public class InstanceActivity extends BaseActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ThemeHelper.applyThemeDialog(this); binding = ActivityInstanceBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); @@ -71,13 +69,13 @@ public class InstanceActivity extends BaseActivity { final SpannableString contentAbout = new SpannableString(getString(R.string.action_about_instance)); contentAbout.setSpan(new UnderlineSpan(), 0, contentAbout.length(), 0); - contentAbout.setSpan(new ForegroundColorSpan(ContextCompat.getColor(InstanceActivity.this, R.color.cyanea_accent_reference)), 0, contentAbout.length(), + contentAbout.setSpan(new ForegroundColorSpan(ContextCompat.getColor(InstanceActivity.this, R.color.colorAccent)), 0, contentAbout.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE); binding.tos.setText(contentAbout); final SpannableString contentPrivacy = new SpannableString(getString(R.string.action_privacy_policy)); contentPrivacy.setSpan(new UnderlineSpan(), 0, contentPrivacy.length(), 0); - contentPrivacy.setSpan(new ForegroundColorSpan(ContextCompat.getColor(InstanceActivity.this, R.color.cyanea_accent_reference)), 0, contentPrivacy.length(), + contentPrivacy.setSpan(new ForegroundColorSpan(ContextCompat.getColor(InstanceActivity.this, R.color.colorAccent)), 0, contentPrivacy.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE); binding.privacy.setText(contentPrivacy); diff --git a/app/src/main/java/app/fedilab/android/activities/InstanceHealthActivity.java b/app/src/main/java/app/fedilab/android/activities/InstanceHealthActivity.java index f4a44a25..1efe1a9c 100644 --- a/app/src/main/java/app/fedilab/android/activities/InstanceHealthActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/InstanceHealthActivity.java @@ -34,7 +34,6 @@ import app.fedilab.android.R; import app.fedilab.android.client.entities.app.InstanceSocial; import app.fedilab.android.databinding.ActivityInstanceSocialBinding; import app.fedilab.android.helper.Helper; -import app.fedilab.android.helper.ThemeHelper; import app.fedilab.android.viewmodel.mastodon.InstanceSocialVM; @@ -45,7 +44,6 @@ public class InstanceHealthActivity extends BaseActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ThemeHelper.applyThemeDialog(this); binding = ActivityInstanceSocialBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); diff --git a/app/src/main/java/app/fedilab/android/activities/InstanceProfileActivity.java b/app/src/main/java/app/fedilab/android/activities/InstanceProfileActivity.java index 934127de..cc2ea674 100644 --- a/app/src/main/java/app/fedilab/android/activities/InstanceProfileActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/InstanceProfileActivity.java @@ -28,7 +28,6 @@ import androidx.lifecycle.ViewModelProvider; import app.fedilab.android.R; import app.fedilab.android.databinding.ActivityInstanceProfileBinding; import app.fedilab.android.helper.Helper; -import app.fedilab.android.helper.ThemeHelper; import app.fedilab.android.viewmodel.mastodon.NodeInfoVM; import es.dmoral.toasty.Toasty; @@ -41,7 +40,7 @@ public class InstanceProfileActivity extends BaseActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ThemeHelper.applyThemeDialog(this); + binding = ActivityInstanceProfileBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); getWindow().setLayout(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); diff --git a/app/src/main/java/app/fedilab/android/activities/LoginActivity.java b/app/src/main/java/app/fedilab/android/activities/LoginActivity.java index d76d8810..b4dc2c00 100644 --- a/app/src/main/java/app/fedilab/android/activities/LoginActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/LoginActivity.java @@ -35,7 +35,6 @@ import java.util.regex.Matcher; import app.fedilab.android.R; import app.fedilab.android.client.entities.app.Account; import app.fedilab.android.helper.Helper; -import app.fedilab.android.helper.ThemeHelper; import app.fedilab.android.ui.fragment.login.FragmentLoginMain; import app.fedilab.android.viewmodel.mastodon.AccountsVM; import app.fedilab.android.viewmodel.mastodon.AdminVM; @@ -109,7 +108,7 @@ public class LoginActivity extends BaseActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ThemeHelper.applyTheme(this); + SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(LoginActivity.this); setContentView(new FrameLayout(this)); FragmentLoginMain fragmentLoginMain = new FragmentLoginMain(); diff --git a/app/src/main/java/app/fedilab/android/activities/MastodonListActivity.java b/app/src/main/java/app/fedilab/android/activities/MastodonListActivity.java index 4b9d35d7..8e899c68 100644 --- a/app/src/main/java/app/fedilab/android/activities/MastodonListActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/MastodonListActivity.java @@ -16,7 +16,6 @@ package app.fedilab.android.activities; import android.content.Intent; -import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.text.Editable; import android.text.InputFilter; @@ -28,7 +27,6 @@ import android.view.View; import androidx.annotation.NonNull; import androidx.appcompat.app.AlertDialog; -import androidx.core.content.ContextCompat; import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentTransaction; import androidx.lifecycle.ViewModelProvider; @@ -82,14 +80,13 @@ public class MastodonListActivity extends BaseActivity implements MastodonListAd @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ThemeHelper.applyThemeBar(this); + binding = ActivityListBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); canGoBack = false; if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true); - getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary))); } flagLoading = false; orderASC = true; @@ -147,7 +144,7 @@ public class MastodonListActivity extends BaseActivity implements MastodonListAd onBackPressed(); return true; } else if (item.getItemId() == R.id.action_manage_users) { - AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(MastodonListActivity.this, Helper.dialogStyle()); + AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(MastodonListActivity.this); PopupManageAccountsListBinding popupManageAccountsListBinding = PopupManageAccountsListBinding.inflate(getLayoutInflater()); dialogBuilder.setView(popupManageAccountsListBinding.getRoot()); popupManageAccountsListBinding.loader.setVisibility(View.VISIBLE); @@ -244,7 +241,7 @@ public class MastodonListActivity extends BaseActivity implements MastodonListAd dialogBuilder.setPositiveButton(R.string.close, (dialog, id) -> dialog.dismiss()); dialogBuilder.create().show(); } else if (item.getItemId() == R.id.action_delete && mastodonList != null) { - AlertDialog.Builder alt_bld = new AlertDialog.Builder(MastodonListActivity.this, Helper.dialogStyle()); + AlertDialog.Builder alt_bld = new AlertDialog.Builder(MastodonListActivity.this); alt_bld.setTitle(R.string.action_lists_delete); alt_bld.setMessage(R.string.action_lists_confirm_delete); alt_bld.setPositiveButton(R.string.delete, (dialog, id) -> { @@ -282,7 +279,7 @@ public class MastodonListActivity extends BaseActivity implements MastodonListAd AlertDialog alert = alt_bld.create(); alert.show(); } else if (item.getItemId() == R.id.action_add_list) { - AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(MastodonListActivity.this, Helper.dialogStyle()); + AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(MastodonListActivity.this); PopupAddListBinding popupAddListBinding = PopupAddListBinding.inflate(getLayoutInflater()); dialogBuilder.setView(popupAddListBinding.getRoot()); popupAddListBinding.addList.setFilters(new InputFilter[]{new InputFilter.LengthFilter(255)}); @@ -322,7 +319,7 @@ public class MastodonListActivity extends BaseActivity implements MastodonListAd dialogBuilder.setNegativeButton(R.string.cancel, (dialog, id) -> dialog.dismiss()); dialogBuilder.create().show(); } else if (item.getItemId() == R.id.action_edit) { - AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(MastodonListActivity.this, Helper.dialogStyle()); + AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(MastodonListActivity.this); PopupAddListBinding popupAddListBinding = PopupAddListBinding.inflate(getLayoutInflater()); dialogBuilder.setView(popupAddListBinding.getRoot()); popupAddListBinding.addList.setFilters(new InputFilter[]{new InputFilter.LengthFilter(255)}); diff --git a/app/src/main/java/app/fedilab/android/activities/MediaActivity.java b/app/src/main/java/app/fedilab/android/activities/MediaActivity.java index bb10f198..16a9f538 100644 --- a/app/src/main/java/app/fedilab/android/activities/MediaActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/MediaActivity.java @@ -24,7 +24,6 @@ import android.content.IntentFilter; import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.graphics.Point; -import android.graphics.drawable.ColorDrawable; import android.net.Uri; import android.os.Build; import android.os.Bundle; @@ -64,7 +63,6 @@ import app.fedilab.android.client.entities.api.Status; import app.fedilab.android.databinding.ActivityMediaPagerBinding; import app.fedilab.android.helper.Helper; import app.fedilab.android.helper.MediaHelper; -import app.fedilab.android.helper.ThemeHelper; import app.fedilab.android.interfaces.OnDownloadInterface; import app.fedilab.android.ui.fragment.media.FragmentMedia; import es.dmoral.toasty.Toasty; @@ -114,7 +112,7 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface { @Override protected void onCreate(Bundle savedInstanceState) { getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY); - ThemeHelper.applyThemeBar(this); + super.onCreate(savedInstanceState); ActivityCompat.postponeEnterTransition(MediaActivity.this); binding = ActivityMediaPagerBinding.inflate(getLayoutInflater()); @@ -132,7 +130,6 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface { if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true); - getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary))); } if (attachments == null || attachments.size() == 0) diff --git a/app/src/main/java/app/fedilab/android/activities/PartnerShipActivity.java b/app/src/main/java/app/fedilab/android/activities/PartnerShipActivity.java index 353897f1..3d7955b0 100644 --- a/app/src/main/java/app/fedilab/android/activities/PartnerShipActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/PartnerShipActivity.java @@ -16,7 +16,6 @@ package app.fedilab.android.activities; import android.content.Intent; -import android.graphics.drawable.ColorDrawable; import android.net.Uri; import android.os.Bundle; import android.text.method.LinkMovementMethod; @@ -25,7 +24,6 @@ import android.view.View; import android.widget.TextView; import androidx.core.app.ActivityOptionsCompat; -import androidx.core.content.ContextCompat; import androidx.lifecycle.ViewModelProvider; import java.util.ArrayList; @@ -49,13 +47,12 @@ public class PartnerShipActivity extends BaseActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ThemeHelper.applyThemeBar(this); + ActivityPartnershipBinding binding = ActivityPartnershipBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); - getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary))); } TextView about_partnership = findViewById(R.id.about_partnership); diff --git a/app/src/main/java/app/fedilab/android/activities/ProfileActivity.java b/app/src/main/java/app/fedilab/android/activities/ProfileActivity.java index edcd50c1..3cfa1a24 100644 --- a/app/src/main/java/app/fedilab/android/activities/ProfileActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/ProfileActivity.java @@ -25,7 +25,6 @@ import android.content.Intent; import android.content.IntentFilter; import android.content.SharedPreferences; import android.content.res.ColorStateList; -import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.text.SpannableString; @@ -135,7 +134,7 @@ public class ProfileActivity extends BaseActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ThemeHelper.applyTheme(this); + binding = ActivityProfileBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); setSupportActionBar(binding.toolbar); @@ -154,7 +153,6 @@ public class ProfileActivity extends BaseActivity { //Remove title if (actionBar != null) { actionBar.setDisplayShowTitleEnabled(false); - actionBar.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary))); } if (getSupportActionBar() != null) { @@ -164,7 +162,6 @@ public class ProfileActivity extends BaseActivity { SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(this); float scale = sharedpreferences.getFloat(getString(R.string.SET_FONT_SCALE), 1.1f); binding.title.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18 * 1.1f / scale); - binding.toolbar.setPopupTheme(Helper.popupStyle()); accountsVM = new ViewModelProvider(ProfileActivity.this).get(AccountsVM.class); if (account != null) { initializeView(account); @@ -263,8 +260,6 @@ public class ProfileActivity extends BaseActivity { public void onTabReselected(TabLayout.Tab tab) { } }); - binding.accountTabLayout.setTabTextColors(ThemeHelper.getAttColor(ProfileActivity.this, R.attr.mTextColor), ContextCompat.getColor(ProfileActivity.this, R.color.cyanea_accent_dark_reference)); - binding.accountTabLayout.setTabIconTint(ThemeHelper.getColorStateList(ProfileActivity.this)); boolean disableGif = sharedpreferences.getBoolean(getString(R.string.SET_DISABLE_GIF), false); String targetedUrl = disableGif ? account.avatar_static : account.avatar; Glide.with(ProfileActivity.this) @@ -314,7 +309,7 @@ public class ProfileActivity extends BaseActivity { final SpannableString content = new SpannableString(getString(R.string.disclaimer_full)); content.setSpan(new UnderlineSpan(), 0, content.length(), 0); - content.setSpan(new ForegroundColorSpan(ContextCompat.getColor(ProfileActivity.this, R.color.cyanea_accent_reference)), 0, content.length(), + content.setSpan(new ForegroundColorSpan(ContextCompat.getColor(ProfileActivity.this, R.color.colorAccent)), 0, content.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE); binding.warningMessage.setText(content); binding.warningMessage.setOnClickListener(view -> { @@ -427,7 +422,7 @@ public class ProfileActivity extends BaseActivity { } else if (doAction == action.UNFOLLOW) { boolean confirm_unfollow = sharedpreferences.getBoolean(getString(R.string.SET_UNFOLLOW_VALIDATION), true); if (confirm_unfollow) { - AlertDialog.Builder unfollowConfirm = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle()); + AlertDialog.Builder unfollowConfirm = new AlertDialog.Builder(ProfileActivity.this); unfollowConfirm.setTitle(getString(R.string.unfollow_confirm)); unfollowConfirm.setMessage(account.acct); unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); @@ -512,7 +507,7 @@ public class ProfileActivity extends BaseActivity { //Recyclerview for identity proof has not been inflated yet if (identityProofsRecycler == null) { identity_proofs_indicator.setOnClickListener(v -> { - AlertDialog.Builder builder = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle()); + AlertDialog.Builder builder = new AlertDialog.Builder(ProfileActivity.this); identityProofsRecycler = new RecyclerView(ProfileActivity.this); LinearLayoutManager mLayoutManager = new LinearLayoutManager(ProfileActivity.this); identityProofsRecycler.setLayoutManager(mLayoutManager); @@ -603,7 +598,7 @@ public class ProfileActivity extends BaseActivity { binding.personalNote.setText(relationship.note); } binding.personalNote.setOnClickListener(view -> { - AlertDialog.Builder builderInner = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle()); + AlertDialog.Builder builderInner = new AlertDialog.Builder(ProfileActivity.this); builderInner.setTitle(R.string.note_for_account); EditText input = new EditText(ProfileActivity.this); LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams( @@ -778,7 +773,7 @@ public class ProfileActivity extends BaseActivity { }); return true; } else if (itemId == R.id.action_filter) { - AlertDialog.Builder filterTagDialog = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle()); + AlertDialog.Builder filterTagDialog = new AlertDialog.Builder(ProfileActivity.this); Set featuredTagsSet = sharedpreferences.getStringSet(getString(R.string.SET_FEATURED_TAGS), null); List tags = new ArrayList<>(); if (featuredTagsSet != null) { @@ -847,7 +842,7 @@ public class ProfileActivity extends BaseActivity { } accountsVM.getListContainingAccount(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, account.id) .observe(ProfileActivity.this, mastodonListUserIs -> { - AlertDialog.Builder builderSingle = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle()); + AlertDialog.Builder builderSingle = new AlertDialog.Builder(ProfileActivity.this); builderSingle.setTitle(getString(R.string.action_lists_add_to)); builderSingle.setPositiveButton(R.string.close, (dialog, which) -> dialog.dismiss()); String[] listsId = new String[mastodonLists.size()]; @@ -935,7 +930,7 @@ public class ProfileActivity extends BaseActivity { }); return true; } - builderInner = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle()); + builderInner = new AlertDialog.Builder(ProfileActivity.this); builderInner.setTitle(stringArrayConf[0]); builderInner.setNeutralButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); @@ -963,7 +958,7 @@ public class ProfileActivity extends BaseActivity { }); return true; } else if (itemId == R.id.action_report) { - AlertDialog.Builder builderInner = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle()); + AlertDialog.Builder builderInner = new AlertDialog.Builder(ProfileActivity.this); builderInner.setTitle(R.string.report_account); //Text for report EditText input = new EditText(ProfileActivity.this); @@ -983,7 +978,7 @@ public class ProfileActivity extends BaseActivity { builderInner.show(); return true; } else if (itemId == R.id.action_block) { - AlertDialog.Builder builderInner = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle()); + AlertDialog.Builder builderInner = new AlertDialog.Builder(ProfileActivity.this); if (relationship != null) { if (relationship.blocking) { builderInner.setTitle(stringArrayConf[5]); @@ -1023,7 +1018,7 @@ public class ProfileActivity extends BaseActivity { }); builderInner.show(); } else if (itemId == R.id.action_block_instance) { - AlertDialog.Builder builderInner = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle()); + AlertDialog.Builder builderInner = new AlertDialog.Builder(ProfileActivity.this); String domain = account.acct.split("@")[1]; builderInner.setMessage(getString(R.string.block_domain_confirm_message, domain)); builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); diff --git a/app/src/main/java/app/fedilab/android/activities/ReorderTimelinesActivity.java b/app/src/main/java/app/fedilab/android/activities/ReorderTimelinesActivity.java index dc1eb145..3706cd97 100644 --- a/app/src/main/java/app/fedilab/android/activities/ReorderTimelinesActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/ReorderTimelinesActivity.java @@ -20,7 +20,6 @@ import static app.fedilab.android.helper.PinnedTimelineHelper.sortPositionAsc; import android.content.Intent; import android.content.SharedPreferences; -import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.text.Editable; import android.text.TextWatcher; @@ -34,7 +33,6 @@ import android.widget.Toast; import androidx.annotation.NonNull; import androidx.appcompat.app.AlertDialog; -import androidx.core.content.ContextCompat; import androidx.lifecycle.ViewModelProvider; import androidx.localbroadcastmanager.content.LocalBroadcastManager; import androidx.preference.PreferenceManager; @@ -57,7 +55,6 @@ import app.fedilab.android.databinding.ActivityReorderTabsBinding; import app.fedilab.android.databinding.PopupSearchInstanceBinding; import app.fedilab.android.exception.DBException; import app.fedilab.android.helper.Helper; -import app.fedilab.android.helper.ThemeHelper; import app.fedilab.android.helper.itemtouchhelper.OnStartDragListener; import app.fedilab.android.helper.itemtouchhelper.SimpleItemTouchHelperCallback; import app.fedilab.android.ui.drawer.ReorderBottomMenuAdapter; @@ -100,13 +97,12 @@ public class ReorderTimelinesActivity extends BaseActivity implements OnStartDra @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ThemeHelper.applyThemeBar(this); + binding = ActivityReorderTabsBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); searchInstanceRunning = false; if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); - getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary))); } SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(ReorderTimelinesActivity.this); @@ -174,7 +170,7 @@ public class ReorderTimelinesActivity extends BaseActivity implements OnStartDra } private void addInstance() { - AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(ReorderTimelinesActivity.this, Helper.dialogStyle()); + AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(ReorderTimelinesActivity.this); PopupSearchInstanceBinding popupSearchInstanceBinding = PopupSearchInstanceBinding.inflate(getLayoutInflater()); dialogBuilder.setView(popupSearchInstanceBinding.getRoot()); TextWatcher textWatcher = autoComplete(popupSearchInstanceBinding); diff --git a/app/src/main/java/app/fedilab/android/activities/ReportActivity.java b/app/src/main/java/app/fedilab/android/activities/ReportActivity.java index bff5392e..8fcfbf12 100644 --- a/app/src/main/java/app/fedilab/android/activities/ReportActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/ReportActivity.java @@ -14,7 +14,6 @@ package app.fedilab.android.activities; * You should have received a copy of the GNU General Public License along with Fedilab; if not, * see . */ -import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.view.MenuItem; import android.view.View; @@ -22,7 +21,6 @@ import android.widget.RadioButton; import androidx.annotation.Nullable; import androidx.appcompat.widget.LinearLayoutCompat; -import androidx.core.content.ContextCompat; import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentTransaction; import androidx.lifecycle.ViewModelProvider; @@ -39,7 +37,6 @@ import app.fedilab.android.client.entities.api.Status; import app.fedilab.android.client.entities.app.Timeline; import app.fedilab.android.databinding.ActivityReportBinding; import app.fedilab.android.helper.Helper; -import app.fedilab.android.helper.ThemeHelper; import app.fedilab.android.ui.drawer.RulesAdapter; import app.fedilab.android.ui.fragment.timeline.FragmentMastodonTimeline; import app.fedilab.android.viewmodel.mastodon.AccountsVM; @@ -64,14 +61,13 @@ public class ReportActivity extends BaseActivity { @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ThemeHelper.applyThemeBar(this); + binding = ActivityReportBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); - getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary))); } Bundle b = getIntent().getExtras(); diff --git a/app/src/main/java/app/fedilab/android/activities/ScheduledActivity.java b/app/src/main/java/app/fedilab/android/activities/ScheduledActivity.java index 527dd931..15b82002 100644 --- a/app/src/main/java/app/fedilab/android/activities/ScheduledActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/ScheduledActivity.java @@ -17,14 +17,12 @@ package app.fedilab.android.activities; import static app.fedilab.android.BaseMainActivity.currentAccount; import android.content.SharedPreferences; -import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.util.TypedValue; import android.view.MenuItem; import androidx.annotation.Nullable; import androidx.appcompat.app.ActionBar; -import androidx.core.content.ContextCompat; import androidx.preference.PreferenceManager; import com.google.android.material.tabs.TabLayout; @@ -32,7 +30,6 @@ import com.google.android.material.tabs.TabLayout; import app.fedilab.android.R; import app.fedilab.android.databinding.ActivityScheduledBinding; import app.fedilab.android.helper.MastodonHelper; -import app.fedilab.android.helper.ThemeHelper; import app.fedilab.android.ui.pageadapter.FedilabScheduledPageAdapter; public class ScheduledActivity extends BaseActivity { @@ -42,7 +39,7 @@ public class ScheduledActivity extends BaseActivity { @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ThemeHelper.applyTheme(this); + binding = ActivityScheduledBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); setSupportActionBar(binding.toolbar); @@ -50,7 +47,6 @@ public class ScheduledActivity extends BaseActivity { //Remove title if (actionBar != null) { actionBar.setDisplayShowTitleEnabled(false); - actionBar.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary))); } if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); @@ -68,8 +64,7 @@ public class ScheduledActivity extends BaseActivity { binding.scheduleViewpager.setAdapter(new FedilabScheduledPageAdapter(getSupportFragmentManager())); binding.scheduleViewpager.setOffscreenPageLimit(3); binding.scheduleViewpager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(binding.scheduleTablayout)); - binding.scheduleTablayout.setTabTextColors(ThemeHelper.getAttColor(ScheduledActivity.this, R.attr.mTextColor), ContextCompat.getColor(ScheduledActivity.this, R.color.cyanea_accent_dark_reference)); - binding.scheduleTablayout.setTabIconTint(ThemeHelper.getColorStateList(ScheduledActivity.this)); + binding.scheduleTablayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { @Override diff --git a/app/src/main/java/app/fedilab/android/activities/SearchResultTabActivity.java b/app/src/main/java/app/fedilab/android/activities/SearchResultTabActivity.java index 90742677..a5ac039a 100644 --- a/app/src/main/java/app/fedilab/android/activities/SearchResultTabActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/SearchResultTabActivity.java @@ -16,7 +16,6 @@ package app.fedilab.android.activities; import android.app.SearchManager; import android.content.Context; -import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.view.Menu; import android.view.MenuInflater; @@ -27,7 +26,6 @@ import android.widget.Toast; import androidx.annotation.NonNull; import androidx.appcompat.widget.SearchView; -import androidx.core.content.ContextCompat; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentStatePagerAdapter; @@ -41,7 +39,6 @@ import org.jetbrains.annotations.NotNull; import app.fedilab.android.R; import app.fedilab.android.databinding.ActivitySearchResultTabsBinding; import app.fedilab.android.helper.Helper; -import app.fedilab.android.helper.ThemeHelper; import app.fedilab.android.ui.fragment.timeline.FragmentMastodonAccount; import app.fedilab.android.ui.fragment.timeline.FragmentMastodonTag; import app.fedilab.android.ui.fragment.timeline.FragmentMastodonTimeline; @@ -58,7 +55,7 @@ public class SearchResultTabActivity extends BaseActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ThemeHelper.applyThemeBar(this); + binding = ActivitySearchResultTabsBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); @@ -75,7 +72,6 @@ public class SearchResultTabActivity extends BaseActivity { if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); - getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary))); } setTitle(search); initial = binding.searchTabLayout.newTab(); @@ -83,8 +79,6 @@ public class SearchResultTabActivity extends BaseActivity { binding.searchTabLayout.addTab(binding.searchTabLayout.newTab().setText(getString(R.string.accounts))); binding.searchTabLayout.addTab(binding.searchTabLayout.newTab().setText(getString(R.string.toots))); binding.searchTabLayout.addTab(binding.searchTabLayout.newTab().setText(getString(R.string.action_cache))); - binding.searchTabLayout.setTabTextColors(ThemeHelper.getAttColor(SearchResultTabActivity.this, R.attr.mTextColor), ContextCompat.getColor(SearchResultTabActivity.this, R.color.cyanea_accent_dark_reference)); - binding.searchTabLayout.setTabIconTint(ThemeHelper.getColorStateList(SearchResultTabActivity.this)); binding.searchTabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { @Override public void onTabSelected(TabLayout.Tab tab) { diff --git a/app/src/main/java/app/fedilab/android/activities/SettingsActivity.kt b/app/src/main/java/app/fedilab/android/activities/SettingsActivity.kt index f80760e0..02a7aba5 100644 --- a/app/src/main/java/app/fedilab/android/activities/SettingsActivity.kt +++ b/app/src/main/java/app/fedilab/android/activities/SettingsActivity.kt @@ -16,24 +16,20 @@ package app.fedilab.android.activities import android.os.Bundle import android.view.MenuItem -import androidx.appcompat.app.AlertDialog import androidx.navigation.findNavController import androidx.navigation.ui.AppBarConfiguration import androidx.navigation.ui.navigateUp import androidx.navigation.ui.setupActionBarWithNavController import app.fedilab.android.R import app.fedilab.android.databinding.ActivitySettingsBinding -import app.fedilab.android.helper.Helper -import app.fedilab.android.helper.ThemeHelper -import app.fedilab.android.ui.fragment.settings.FragmentThemingSettings -class SettingsActivity : BaseActivity(), FragmentThemingSettings.ActionTheming { +class SettingsActivity : BaseActivity() { private lateinit var binding: ActivitySettingsBinding private lateinit var appBarConfiguration: AppBarConfiguration override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - ThemeHelper.applyThemeBar(this) + binding = ActivitySettingsBinding.inflate(layoutInflater) setContentView(binding.root) @@ -56,15 +52,4 @@ class SettingsActivity : BaseActivity(), FragmentThemingSettings.ActionTheming { return super.onOptionsItemSelected(item) } - override fun restart() { - val restartBuilder = AlertDialog.Builder(this, Helper.dialogStyle()) - restartBuilder.setTitle(getString(R.string.restart_the_app)) - restartBuilder.setMessage(getString(R.string.restart_the_app_theme)) - restartBuilder.setNegativeButton(R.string.no) { dialog, which -> dialog.dismiss() } - restartBuilder.setPositiveButton(R.string.restart) { dialog, which -> - dialog.dismiss() - Helper.restart(this) - } - restartBuilder.create().show() - } } diff --git a/app/src/main/java/app/fedilab/android/activities/StatusHistoryActivity.java b/app/src/main/java/app/fedilab/android/activities/StatusHistoryActivity.java index 24a9c6b7..0bce132b 100644 --- a/app/src/main/java/app/fedilab/android/activities/StatusHistoryActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/StatusHistoryActivity.java @@ -16,18 +16,15 @@ package app.fedilab.android.activities; import android.content.res.Resources; -import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.view.MenuItem; -import androidx.core.content.ContextCompat; import androidx.lifecycle.ViewModelProvider; import androidx.recyclerview.widget.LinearLayoutManager; import app.fedilab.android.R; import app.fedilab.android.databinding.ActivityStatusHistoryBinding; import app.fedilab.android.helper.Helper; -import app.fedilab.android.helper.ThemeHelper; import app.fedilab.android.ui.drawer.StatusHistoryAdapter; import app.fedilab.android.viewmodel.mastodon.StatusesVM; import es.dmoral.toasty.Toasty; @@ -40,14 +37,13 @@ public class StatusHistoryActivity extends BaseActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ThemeHelper.applyTheme(this); + ActivityStatusHistoryBinding binding = ActivityStatusHistoryBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); - getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary))); } Bundle b = getIntent().getExtras(); diff --git a/app/src/main/java/app/fedilab/android/activities/StatusInfoActivity.java b/app/src/main/java/app/fedilab/android/activities/StatusInfoActivity.java index 29f3b2dc..dc7047a0 100644 --- a/app/src/main/java/app/fedilab/android/activities/StatusInfoActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/StatusInfoActivity.java @@ -15,13 +15,11 @@ package app.fedilab.android.activities; * see . */ -import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.view.MenuItem; import android.view.View; import androidx.annotation.NonNull; -import androidx.core.content.ContextCompat; import androidx.lifecycle.ViewModelProvider; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; @@ -37,7 +35,6 @@ import app.fedilab.android.client.entities.api.RelationShip; import app.fedilab.android.client.entities.api.Status; import app.fedilab.android.databinding.ActivityStatusInfoBinding; import app.fedilab.android.helper.Helper; -import app.fedilab.android.helper.ThemeHelper; import app.fedilab.android.ui.drawer.AccountAdapter; import app.fedilab.android.viewmodel.mastodon.AccountsVM; import app.fedilab.android.viewmodel.mastodon.StatusesVM; @@ -56,14 +53,13 @@ public class StatusInfoActivity extends BaseActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ThemeHelper.applyTheme(this); + binding = ActivityStatusInfoBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); setSupportActionBar(binding.toolbar); if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true); - getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary))); } accountList = new ArrayList<>(); Bundle b = getIntent().getExtras(); diff --git a/app/src/main/java/app/fedilab/android/activities/SuggestionActivity.java b/app/src/main/java/app/fedilab/android/activities/SuggestionActivity.java index b9175901..c6c12cec 100644 --- a/app/src/main/java/app/fedilab/android/activities/SuggestionActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/SuggestionActivity.java @@ -14,18 +14,14 @@ package app.fedilab.android.activities; * You should have received a copy of the GNU General Public License along with Fedilab; if not, * see . */ -import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.view.MenuItem; -import androidx.core.content.ContextCompat; - import org.jetbrains.annotations.NotNull; import app.fedilab.android.R; import app.fedilab.android.databinding.ActivitySuggestionsBinding; import app.fedilab.android.helper.Helper; -import app.fedilab.android.helper.ThemeHelper; import app.fedilab.android.ui.fragment.timeline.FragmentMastodonSuggestion; @@ -35,14 +31,13 @@ public class SuggestionActivity extends BaseActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ThemeHelper.applyThemeBar(this); + ActivitySuggestionsBinding binding = ActivitySuggestionsBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); - getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary))); } Helper.addFragment(getSupportFragmentManager(), R.id.nav_host_fragment_suggestions, new FragmentMastodonSuggestion(), null, null, null); diff --git a/app/src/main/java/app/fedilab/android/activities/TrendsActivity.java b/app/src/main/java/app/fedilab/android/activities/TrendsActivity.java index ec520ce0..c234ae73 100644 --- a/app/src/main/java/app/fedilab/android/activities/TrendsActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/TrendsActivity.java @@ -14,13 +14,11 @@ package app.fedilab.android.activities; * You should have received a copy of the GNU General Public License along with Fedilab; if not, * see . */ -import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.view.MenuItem; import android.view.ViewGroup; import androidx.annotation.NonNull; -import androidx.core.content.ContextCompat; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentStatePagerAdapter; @@ -35,7 +33,6 @@ import app.fedilab.android.R; import app.fedilab.android.client.entities.app.Timeline; import app.fedilab.android.databinding.ActivityTrendsBinding; import app.fedilab.android.helper.Helper; -import app.fedilab.android.helper.ThemeHelper; import app.fedilab.android.ui.fragment.timeline.FragmentMastodonTag; import app.fedilab.android.ui.fragment.timeline.FragmentMastodonTimeline; @@ -48,20 +45,17 @@ public class TrendsActivity extends BaseActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ThemeHelper.applyThemeBar(this); + binding = ActivityTrendsBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); - getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary))); } binding.searchTabLayout.addTab(binding.searchTabLayout.newTab().setText(getString(R.string.tags))); binding.searchTabLayout.addTab(binding.searchTabLayout.newTab().setText(getString(R.string.toots))); - binding.searchTabLayout.setTabTextColors(ThemeHelper.getAttColor(TrendsActivity.this, R.attr.mTextColor), ContextCompat.getColor(TrendsActivity.this, R.color.cyanea_accent_dark_reference)); - binding.searchTabLayout.setTabIconTint(ThemeHelper.getColorStateList(TrendsActivity.this)); binding.searchTabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { @Override public void onTabSelected(TabLayout.Tab tab) { diff --git a/app/src/main/java/app/fedilab/android/activities/WebviewActivity.java b/app/src/main/java/app/fedilab/android/activities/WebviewActivity.java index 5c355ee6..ab216959 100644 --- a/app/src/main/java/app/fedilab/android/activities/WebviewActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/WebviewActivity.java @@ -20,7 +20,6 @@ import android.annotation.SuppressLint; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; -import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.LayerDrawable; import android.net.Uri; @@ -46,7 +45,6 @@ import app.fedilab.android.R; import app.fedilab.android.databinding.ActivityWebviewBinding; import app.fedilab.android.helper.CountDrawable; import app.fedilab.android.helper.Helper; -import app.fedilab.android.helper.ThemeHelper; import app.fedilab.android.webview.CustomWebview; import app.fedilab.android.webview.FedilabWebChromeClient; import app.fedilab.android.webview.FedilabWebViewClient; @@ -67,7 +65,7 @@ public class WebviewActivity extends BaseActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ThemeHelper.applyTheme(this); + binding = ActivityWebviewBinding.inflate(getLayoutInflater()); View view = binding.getRoot(); setContentView(view); @@ -80,7 +78,6 @@ public class WebviewActivity extends BaseActivity { if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true); - getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary))); } Bundle b = getIntent().getExtras(); if (b != null) { @@ -193,7 +190,7 @@ public class WebviewActivity extends BaseActivity { final ArrayAdapter arrayAdapter = new ArrayAdapter<>(WebviewActivity.this, R.layout.domains_blocked); arrayAdapter.addAll(domains); - AlertDialog.Builder builder = new AlertDialog.Builder(WebviewActivity.this, Helper.dialogStyle()); + AlertDialog.Builder builder = new AlertDialog.Builder(WebviewActivity.this); builder.setTitle(R.string.list_of_blocked_domains); builder.setNegativeButton(R.string.close, (dialog, which) -> dialog.dismiss()); diff --git a/app/src/main/java/app/fedilab/android/activities/WebviewConnectActivity.java b/app/src/main/java/app/fedilab/android/activities/WebviewConnectActivity.java index 89f0972f..cf1e782c 100644 --- a/app/src/main/java/app/fedilab/android/activities/WebviewConnectActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/WebviewConnectActivity.java @@ -57,7 +57,6 @@ import app.fedilab.android.client.entities.app.Account; import app.fedilab.android.databinding.ActivityWebviewConnectBinding; import app.fedilab.android.exception.DBException; import app.fedilab.android.helper.Helper; -import app.fedilab.android.helper.ThemeHelper; import app.fedilab.android.viewmodel.mastodon.AccountsVM; import app.fedilab.android.viewmodel.mastodon.AdminVM; import app.fedilab.android.viewmodel.mastodon.OauthVM; @@ -119,7 +118,7 @@ public class WebviewConnectActivity extends BaseActivity { @SuppressLint("SetJavaScriptEnabled") public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ThemeHelper.applyTheme(this); + SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(WebviewConnectActivity.this); binding = ActivityWebviewConnectBinding.inflate(getLayoutInflater()); diff --git a/app/src/main/java/app/fedilab/android/activities/admin/AdminAccountActivity.java b/app/src/main/java/app/fedilab/android/activities/admin/AdminAccountActivity.java index 01a18ccd..ee6403ff 100644 --- a/app/src/main/java/app/fedilab/android/activities/admin/AdminAccountActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/admin/AdminAccountActivity.java @@ -19,7 +19,6 @@ import android.content.ClipData; import android.content.ClipboardManager; import android.content.Intent; import android.content.SharedPreferences; -import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.text.SpannableString; @@ -65,7 +64,6 @@ import app.fedilab.android.databinding.ActivityAdminAccountBinding; import app.fedilab.android.helper.Helper; import app.fedilab.android.helper.MastodonHelper; import app.fedilab.android.helper.SpannableHelper; -import app.fedilab.android.helper.ThemeHelper; import app.fedilab.android.viewmodel.mastodon.AdminVM; import app.fedilab.android.viewmodel.mastodon.NodeInfoVM; import es.dmoral.toasty.Toasty; @@ -83,7 +81,7 @@ public class AdminAccountActivity extends BaseActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ThemeHelper.applyTheme(this); + binding = ActivityAdminAccountBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); setSupportActionBar(binding.toolbar); @@ -99,7 +97,6 @@ public class AdminAccountActivity extends BaseActivity { //Remove title if (actionBar != null) { actionBar.setDisplayShowTitleEnabled(false); - actionBar.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary))); } SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(this); float scale = sharedpreferences.getFloat(getString(R.string.SET_FONT_SCALE), 1.1f); @@ -108,7 +105,6 @@ public class AdminAccountActivity extends BaseActivity { getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true); } - binding.toolbar.setPopupTheme(Helper.popupStyle()); adminVM = new ViewModelProvider(AdminAccountActivity.this).get(AdminVM.class); if (account_id != null) { adminVM.getAccount(MainActivity.currentInstance, MainActivity.currentToken, account_id).observe(this, this::initializeView); @@ -295,7 +291,7 @@ public class AdminAccountActivity extends BaseActivity { final SpannableString content = new SpannableString(getString(R.string.disclaimer_full)); content.setSpan(new UnderlineSpan(), 0, content.length(), 0); - content.setSpan(new ForegroundColorSpan(ContextCompat.getColor(AdminAccountActivity.this, R.color.cyanea_accent_reference)), 0, content.length(), + content.setSpan(new ForegroundColorSpan(ContextCompat.getColor(AdminAccountActivity.this, R.color.colorAccent)), 0, content.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE); //This account was moved to another one diff --git a/app/src/main/java/app/fedilab/android/activities/admin/AdminActionActivity.java b/app/src/main/java/app/fedilab/android/activities/admin/AdminActionActivity.java index a703ff41..cca679db 100644 --- a/app/src/main/java/app/fedilab/android/activities/admin/AdminActionActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/admin/AdminActionActivity.java @@ -22,7 +22,6 @@ import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; -import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; @@ -30,7 +29,6 @@ import android.view.MenuItem; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; -import androidx.core.content.ContextCompat; import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentTransaction; import androidx.localbroadcastmanager.content.LocalBroadcastManager; @@ -81,13 +79,12 @@ public class AdminActionActivity extends BaseActivity { @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ThemeHelper.applyThemeBar(this); + binding = ActivityAdminActionsBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); LocalBroadcastManager.getInstance(this).registerReceiver(mReceiver, new IntentFilter(Helper.BROADCAST_DATA)); if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); - getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary))); } canGoBack = false; binding.reports.setOnClickListener(v -> displayTimeline(REPORT)); @@ -167,7 +164,7 @@ public class AdminActionActivity extends BaseActivity { return true; } else if (item.getItemId() == R.id.action_filter) { if (getTitle().toString().equalsIgnoreCase(getString(R.string.accounts))) { - AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(AdminActionActivity.this, Helper.dialogStyle()); + AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(AdminActionActivity.this); PopupAdminFilterAccountsBinding binding = PopupAdminFilterAccountsBinding.inflate(getLayoutInflater()); alertDialogBuilder.setView(binding.getRoot()); if (local != null && remote == null) { @@ -261,7 +258,7 @@ public class AdminActionActivity extends BaseActivity { AlertDialog alert = alertDialogBuilder.create(); alert.show(); } else { - AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(AdminActionActivity.this, Helper.dialogStyle()); + AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(AdminActionActivity.this); PopupAdminFilterReportsBinding binding = PopupAdminFilterReportsBinding.inflate(getLayoutInflater()); alertDialogBuilder.setView(binding.getRoot()); if (resolved == null) { diff --git a/app/src/main/java/app/fedilab/android/activities/admin/AdminDomainBlockActivity.java b/app/src/main/java/app/fedilab/android/activities/admin/AdminDomainBlockActivity.java index c14affb4..169ff5d7 100644 --- a/app/src/main/java/app/fedilab/android/activities/admin/AdminDomainBlockActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/admin/AdminDomainBlockActivity.java @@ -18,7 +18,6 @@ package app.fedilab.android.activities.admin; import static app.fedilab.android.helper.Helper.BROADCAST_DATA; import android.content.Intent; -import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; @@ -28,7 +27,6 @@ import android.widget.ArrayAdapter; import androidx.annotation.NonNull; import androidx.appcompat.app.AlertDialog; -import androidx.core.content.ContextCompat; import androidx.lifecycle.ViewModelProvider; import androidx.localbroadcastmanager.content.LocalBroadcastManager; @@ -38,7 +36,6 @@ import app.fedilab.android.activities.MainActivity; import app.fedilab.android.client.entities.api.admin.AdminDomainBlock; import app.fedilab.android.databinding.ActivityAdminDomainblockBinding; import app.fedilab.android.helper.Helper; -import app.fedilab.android.helper.ThemeHelper; import app.fedilab.android.viewmodel.mastodon.AdminVM; import es.dmoral.toasty.Toasty; @@ -52,12 +49,11 @@ public class AdminDomainBlockActivity extends BaseActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ThemeHelper.applyThemeBar(this); + ActivityAdminDomainblockBinding binding = ActivityAdminDomainblockBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); - getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary))); } Bundle b = getIntent().getExtras(); if (b != null) { @@ -133,7 +129,7 @@ public class AdminDomainBlockActivity extends BaseActivity { return true; } else if (itemId == R.id.action_delete) { if (adminDomainBlock.id != null) { - AlertDialog.Builder builder = new AlertDialog.Builder(AdminDomainBlockActivity.this, Helper.dialogStyle()); + AlertDialog.Builder builder = new AlertDialog.Builder(AdminDomainBlockActivity.this); builder.setMessage(getString(R.string.unblock_domain_confirm, adminDomainBlock.domain)); builder .setPositiveButton(R.string.unblock_domain, (dialog, which) -> { diff --git a/app/src/main/java/app/fedilab/android/activities/admin/AdminReportActivity.java b/app/src/main/java/app/fedilab/android/activities/admin/AdminReportActivity.java index 5ff001d0..ce841b7b 100644 --- a/app/src/main/java/app/fedilab/android/activities/admin/AdminReportActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/admin/AdminReportActivity.java @@ -19,7 +19,6 @@ import android.content.ClipData; import android.content.ClipboardManager; import android.content.Intent; import android.content.SharedPreferences; -import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.text.SpannableString; @@ -66,7 +65,6 @@ import app.fedilab.android.databinding.ActivityAdminAccountBinding; import app.fedilab.android.helper.Helper; import app.fedilab.android.helper.MastodonHelper; import app.fedilab.android.helper.SpannableHelper; -import app.fedilab.android.helper.ThemeHelper; import app.fedilab.android.viewmodel.mastodon.AdminVM; import app.fedilab.android.viewmodel.mastodon.NodeInfoVM; import es.dmoral.toasty.Toasty; @@ -83,7 +81,7 @@ public class AdminReportActivity extends BaseActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ThemeHelper.applyTheme(this); + binding = ActivityAdminAccountBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); setSupportActionBar(binding.toolbar); @@ -100,7 +98,6 @@ public class AdminReportActivity extends BaseActivity { //Remove title if (actionBar != null) { actionBar.setDisplayShowTitleEnabled(false); - actionBar.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.cyanea_primary))); } SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(this); float scale = sharedpreferences.getFloat(getString(R.string.SET_FONT_SCALE), 1.1f); @@ -109,7 +106,6 @@ public class AdminReportActivity extends BaseActivity { getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true); } - binding.toolbar.setPopupTheme(Helper.popupStyle()); if (account != null) { initializeView(account); } else { @@ -314,7 +310,7 @@ public class AdminReportActivity extends BaseActivity { final SpannableString content = new SpannableString(getString(R.string.disclaimer_full)); content.setSpan(new UnderlineSpan(), 0, content.length(), 0); - content.setSpan(new ForegroundColorSpan(ContextCompat.getColor(AdminReportActivity.this, R.color.cyanea_accent_reference)), 0, content.length(), + content.setSpan(new ForegroundColorSpan(ContextCompat.getColor(AdminReportActivity.this, R.color.colorAccent)), 0, content.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE); //This account was moved to another one diff --git a/app/src/main/java/app/fedilab/android/helper/CirclesDrawingView.java b/app/src/main/java/app/fedilab/android/helper/CirclesDrawingView.java index 33672f60..b85b9df2 100644 --- a/app/src/main/java/app/fedilab/android/helper/CirclesDrawingView.java +++ b/app/src/main/java/app/fedilab/android/helper/CirclesDrawingView.java @@ -63,7 +63,7 @@ public class CirclesDrawingView extends View { // Generate bitmap used for background mCirclePaint = new Paint(); - mCirclePaint.setColor(ResourcesCompat.getColor(getContext().getResources(), R.color.cyanea_accent, getContext().getTheme())); + mCirclePaint.setColor(ResourcesCompat.getColor(getContext().getResources(), R.color.colorAccent, getContext().getTheme())); mCirclePaint.setStrokeWidth(10); mCirclePaint.setStyle(Paint.Style.STROKE); } diff --git a/app/src/main/java/app/fedilab/android/helper/CrossActionHelper.java b/app/src/main/java/app/fedilab/android/helper/CrossActionHelper.java index 40e62117..cb63be28 100644 --- a/app/src/main/java/app/fedilab/android/helper/CrossActionHelper.java +++ b/app/src/main/java/app/fedilab/android/helper/CrossActionHelper.java @@ -81,7 +81,7 @@ public class CrossActionHelper { } Handler mainHandler = new Handler(Looper.getMainLooper()); Runnable myRunnable = () -> { - AlertDialog.Builder builderSingle = new AlertDialog.Builder(context, Helper.dialogStyle()); + AlertDialog.Builder builderSingle = new AlertDialog.Builder(context); builderSingle.setTitle(context.getString(R.string.choose_accounts)); final AccountsSearchAdapter accountsSearchAdapter = new AccountsSearchAdapter(context, accountList); final BaseAccount[] accountArray = new BaseAccount[accounts.size()]; @@ -96,7 +96,7 @@ public class CrossActionHelper { boolean confirmBoost = sharedpreferences.getBoolean(context.getString(R.string.SET_NOTIF_VALIDATION), true); BaseAccount selectedAccount = accountArray[which]; if ((actionType == TypeOfCrossAction.REBLOG_ACTION && confirmBoost) || (actionType == TypeOfCrossAction.FAVOURITE_ACTION && confirmFav)) { - AlertDialog.Builder alt_bld = new AlertDialog.Builder(context, Helper.dialogStyle()); + AlertDialog.Builder alt_bld = new AlertDialog.Builder(context); if (actionType == TypeOfCrossAction.REBLOG_ACTION) { alt_bld.setMessage(context.getString(R.string.reblog_add)); } else { @@ -409,7 +409,7 @@ public class CrossActionHelper { context.startActivity(intentToot); ((BaseActivity) context).finish(); } else { - AlertDialog.Builder builderSingle = new AlertDialog.Builder(context, Helper.dialogStyle()); + AlertDialog.Builder builderSingle = new AlertDialog.Builder(context); builderSingle.setTitle(context.getString(R.string.choose_accounts)); final AccountsSearchAdapter accountsSearchAdapter = new AccountsSearchAdapter(context, accountList); final BaseAccount[] accountArray = new BaseAccount[accounts.size()]; diff --git a/app/src/main/java/app/fedilab/android/helper/Helper.java b/app/src/main/java/app/fedilab/android/helper/Helper.java index 57e1ce80..41036d8f 100644 --- a/app/src/main/java/app/fedilab/android/helper/Helper.java +++ b/app/src/main/java/app/fedilab/android/helper/Helper.java @@ -107,7 +107,6 @@ import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonToken; import com.google.gson.stream.JsonWriter; -import com.jaredrummler.cyanea.Cyanea; import org.conscrypt.Conscrypt; @@ -473,7 +472,7 @@ public class Helper { * @param url String download url */ public static void manageDownloads(final Context context, final String url) { - final AlertDialog.Builder builder = new AlertDialog.Builder(context, Helper.dialogStyle()); + final AlertDialog.Builder builder = new AlertDialog.Builder(context); final DownloadManager.Request request; try { request = new DownloadManager.Request(Uri.parse(url.trim())); @@ -941,13 +940,6 @@ public class Helper { return fragment; } - public static int dialogStyle() { - return Cyanea.getInstance().isDark() ? R.style.DialogDark : R.style.Dialog; - } - - public static int popupStyle() { - return Cyanea.getInstance().isDark() ? R.style.PopupDark : R.style.Popup; - } /** * Load a media into a view @@ -1832,7 +1824,7 @@ public class Helper { is.close(); String json = new String(buffer, StandardCharsets.UTF_8); Gson gson = new Gson(); - AlertDialog.Builder dialogBuilderOptin = new AlertDialog.Builder(activity, Helper.dialogStyle()); + AlertDialog.Builder dialogBuilderOptin = new AlertDialog.Builder(activity); PopupReleaseNotesBinding binding = PopupReleaseNotesBinding.inflate(activity.getLayoutInflater()); dialogBuilderOptin.setView(binding.getRoot()); try { diff --git a/app/src/main/java/app/fedilab/android/helper/MastodonHelper.java b/app/src/main/java/app/fedilab/android/helper/MastodonHelper.java index 2a8b7584..4d7936d4 100644 --- a/app/src/main/java/app/fedilab/android/helper/MastodonHelper.java +++ b/app/src/main/java/app/fedilab/android/helper/MastodonHelper.java @@ -357,7 +357,7 @@ public class MastodonHelper { * @param status {@link Status} */ public static void scheduleBoost(Context context, ScheduleType scheduleType, Status status, Account account, TimedMuted listener) { - AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(context, Helper.dialogStyle()); + AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(context); DatetimePickerBinding binding = DatetimePickerBinding.inflate(((Activity) context).getLayoutInflater()); dialogBuilder.setView(binding.getRoot()); final AlertDialog alertDialogBoost = dialogBuilder.create(); diff --git a/app/src/main/java/app/fedilab/android/helper/MediaHelper.java b/app/src/main/java/app/fedilab/android/helper/MediaHelper.java index 93c1b8d3..1603b57d 100644 --- a/app/src/main/java/app/fedilab/android/helper/MediaHelper.java +++ b/app/src/main/java/app/fedilab/android/helper/MediaHelper.java @@ -293,7 +293,7 @@ public class MediaHelper { AudioRecorder mAudioRecorder = AudioRecorder.getInstance(); File mAudioFile = new File(filePath); PopupRecordBinding binding = PopupRecordBinding.inflate(activity.getLayoutInflater()); - AlertDialog.Builder audioPopup = new AlertDialog.Builder(activity, Helper.dialogStyle()); + AlertDialog.Builder audioPopup = new AlertDialog.Builder(activity); audioPopup.setView(binding.getRoot()); AlertDialog alert = audioPopup.create(); alert.show(); @@ -341,7 +341,7 @@ public class MediaHelper { * @param listener - OnSchedule */ public static void scheduleMessage(Activity activity, OnSchedule listener) { - AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(activity, Helper.dialogStyle()); + AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(activity); DatetimePickerBinding binding = DatetimePickerBinding.inflate(activity.getLayoutInflater()); dialogBuilder.setView(binding.getRoot()); diff --git a/app/src/main/java/app/fedilab/android/helper/PinnedTimelineHelper.java b/app/src/main/java/app/fedilab/android/helper/PinnedTimelineHelper.java index d42b0ae6..6521c9dd 100644 --- a/app/src/main/java/app/fedilab/android/helper/PinnedTimelineHelper.java +++ b/app/src/main/java/app/fedilab/android/helper/PinnedTimelineHelper.java @@ -28,7 +28,6 @@ import android.os.Bundle; import android.text.Editable; import android.text.TextWatcher; import android.util.TypedValue; -import android.view.ContextThemeWrapper; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; @@ -423,7 +422,7 @@ public class PinnedTimelineHelper { Pinned finalPinned = pinned; int finalToRemove1 = toRemove; activityMainBinding.moreTimelines.setOnClickListener(v -> { - PopupMenu popup = new PopupMenu(new ContextThemeWrapper(activity, Helper.popupStyle()), v); + PopupMenu popup = new PopupMenu(activity, v); try { @SuppressLint("PrivateApi") Method method = popup.getMenu().getClass().getDeclaredMethod("setOptionalIconsVisible", boolean.class); @@ -615,7 +614,7 @@ public class PinnedTimelineHelper { */ public static void defaultClick(BaseMainActivity activity, Timeline.TimeLineEnum timeLineEnum, View view, ActivityMainBinding activityMainBinding, int position) { boolean showExtendedFilter = timeLineEnum == Timeline.TimeLineEnum.HOME; - PopupMenu popup = new PopupMenu(new ContextThemeWrapper(activity, Helper.popupStyle()), view); + PopupMenu popup = new PopupMenu(activity, view); popup.getMenuInflater() .inflate(R.menu.option_filter_toots, popup.getMenu()); Menu menu = popup.getMenu(); @@ -681,7 +680,7 @@ public class PinnedTimelineHelper { itemShowReplies.setChecked(show_replies); editor.apply(); } else if (itemId == R.id.action_filter) { - AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(activity, Helper.dialogStyle()); + AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(activity); LayoutInflater inflater = activity.getLayoutInflater(); View dialogView = inflater.inflate(R.layout.popup_filter_regex, new LinearLayout(activity), false); dialogBuilder.setView(dialogView); @@ -770,7 +769,7 @@ public class PinnedTimelineHelper { */ public static void tagClick(BaseMainActivity activity, Pinned pinned, View view, ActivityMainBinding activityMainBinding, int position, String slug) { int toRemove = itemToRemoveInBottomMenu(activity); - PopupMenu popup = new PopupMenu(new ContextThemeWrapper(activity, Helper.popupStyle()), view); + PopupMenu popup = new PopupMenu(activity, view); int offSetPosition = position - (BOTTOM_TIMELINE_COUNT - toRemove); SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(activity); boolean singleBar = sharedpreferences.getBoolean(activity.getString(R.string.SET_USE_SINGLE_TOPBAR), false); @@ -870,7 +869,7 @@ public class PinnedTimelineHelper { e.printStackTrace(); } } else if (itemId == R.id.action_any) { - AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(activity, Helper.dialogStyle()); + AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(activity); LayoutInflater inflater = activity.getLayoutInflater(); View dialogView = inflater.inflate(R.layout.tags_any, new LinearLayout(activity), false); dialogBuilder.setView(dialogView); @@ -899,7 +898,7 @@ public class PinnedTimelineHelper { LayoutInflater inflater; View dialogView; AlertDialog alertDialog; - dialogBuilder = new AlertDialog.Builder(activity, Helper.dialogStyle()); + dialogBuilder = new AlertDialog.Builder(activity); inflater = activity.getLayoutInflater(); dialogView = inflater.inflate(R.layout.tags_all, new LinearLayout(activity), false); dialogBuilder.setView(dialogView); @@ -928,7 +927,7 @@ public class PinnedTimelineHelper { LayoutInflater inflater; View dialogView; AlertDialog alertDialog; - dialogBuilder = new AlertDialog.Builder(activity, Helper.dialogStyle()); + dialogBuilder = new AlertDialog.Builder(activity); inflater = activity.getLayoutInflater(); dialogView = inflater.inflate(R.layout.tags_all, new LinearLayout(activity), false); dialogBuilder.setView(dialogView); @@ -957,7 +956,7 @@ public class PinnedTimelineHelper { LayoutInflater inflater; View dialogView; AlertDialog alertDialog; - dialogBuilder = new AlertDialog.Builder(activity, Helper.dialogStyle()); + dialogBuilder = new AlertDialog.Builder(activity); inflater = activity.getLayoutInflater(); dialogView = inflater.inflate(R.layout.tags_name, new LinearLayout(activity), false); dialogBuilder.setView(dialogView); @@ -997,7 +996,7 @@ public class PinnedTimelineHelper { */ public static void instanceClick(BaseMainActivity activity, Pinned pinned, View view, ActivityMainBinding activityMainBinding, int position, String slug) { - PopupMenu popup = new PopupMenu(new ContextThemeWrapper(activity, Helper.popupStyle()), view); + PopupMenu popup = new PopupMenu(activity, view); int toRemove = itemToRemoveInBottomMenu(activity); int offSetPosition = position - (BOTTOM_TIMELINE_COUNT - toRemove); SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(activity); @@ -1145,7 +1144,7 @@ public class PinnedTimelineHelper { } }); changes[0] = true; - AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(activity, Helper.dialogStyle()); + AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(activity); LayoutInflater inflater = activity.getLayoutInflater(); View dialogView = inflater.inflate(R.layout.tags_instance, new LinearLayout(activity), false); dialogBuilder.setView(dialogView); @@ -1229,7 +1228,7 @@ public class PinnedTimelineHelper { if (remoteInstance == null) return; String accounts = remoteInstance.host; - AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(activity, Helper.dialogStyle()); + AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(activity); LayoutInflater inflater = activity.getLayoutInflater(); View dialogView = inflater.inflate(R.layout.tags_any, new LinearLayout(activity), false); dialogBuilder.setView(dialogView); diff --git a/app/src/main/java/app/fedilab/android/helper/PushHelper.java b/app/src/main/java/app/fedilab/android/helper/PushHelper.java index 2f32d517..419b6687 100644 --- a/app/src/main/java/app/fedilab/android/helper/PushHelper.java +++ b/app/src/main/java/app/fedilab/android/helper/PushHelper.java @@ -57,7 +57,7 @@ public class PushHelper { Runnable myRunnable = () -> { List distributors = UnifiedPush.getDistributors(context, new ArrayList<>()); if (distributors.size() == 0) { - AlertDialog.Builder alert = new AlertDialog.Builder(context, Helper.dialogStyle()); + AlertDialog.Builder alert = new AlertDialog.Builder(context); alert.setTitle(R.string.no_distributors_found); final TextView message = new TextView(context); String link = "https://fedilab.app/wiki/features/push-notifications/"; @@ -134,7 +134,7 @@ public class PushHelper { return; } - AlertDialog.Builder alert = new AlertDialog.Builder(context, Helper.dialogStyle()); + AlertDialog.Builder alert = new AlertDialog.Builder(context); alert.setTitle(R.string.select_distributors); String[] distributorsStr = distributors.toArray(new String[0]); alert.setSingleChoiceItems(distributorsStr, -1, (dialog, item) -> { diff --git a/app/src/main/java/app/fedilab/android/helper/SpannableHelper.java b/app/src/main/java/app/fedilab/android/helper/SpannableHelper.java index 46df2e4e..6db5b1ff 100644 --- a/app/src/main/java/app/fedilab/android/helper/SpannableHelper.java +++ b/app/src/main/java/app/fedilab/android/helper/SpannableHelper.java @@ -252,7 +252,7 @@ public class SpannableHelper { @Override public void onLongClick(View view) { Context mContext = view.getContext(); - AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(mContext, Helper.dialogStyle()); + AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(mContext); PopupLinksBinding popupLinksBinding = PopupLinksBinding.inflate(LayoutInflater.from(context)); dialogBuilder.setView(popupLinksBinding.getRoot()); AlertDialog alertDialog = dialogBuilder.create(); @@ -270,7 +270,7 @@ public class SpannableHelper { } String finalURl1 = finalURl; popupLinksBinding.displayFullLink.setOnClickListener(v -> { - AlertDialog.Builder builder = new AlertDialog.Builder(mContext, Helper.dialogStyle()); + AlertDialog.Builder builder = new AlertDialog.Builder(mContext); builder.setMessage(finalURl1); builder.setTitle(context.getString(R.string.display_full_link)); builder.setPositiveButton(R.string.close, (dialog, which) -> dialog.dismiss()) @@ -347,7 +347,7 @@ public class SpannableHelper { Handler mainHandler = new Handler(context.getMainLooper()); String finalRedirect = redirect; Runnable myRunnable = () -> { - AlertDialog.Builder builder1 = new AlertDialog.Builder(view.getContext(), Helper.dialogStyle()); + AlertDialog.Builder builder1 = new AlertDialog.Builder(view.getContext()); if (finalRedirect != null) { builder1.setMessage(context.getString(R.string.redirect_detected, finalURl1, finalRedirect)); builder1.setNegativeButton(R.string.copy_link, (dialog, which) -> { @@ -488,7 +488,7 @@ public class SpannableHelper { @Override public void onLongClick(View view) { Context mContext = view.getContext(); - AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(mContext, Helper.dialogStyle()); + AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(mContext); PopupLinksBinding popupLinksBinding = PopupLinksBinding.inflate(LayoutInflater.from(context)); dialogBuilder.setView(popupLinksBinding.getRoot()); AlertDialog alertDialog = dialogBuilder.create(); @@ -499,7 +499,7 @@ public class SpannableHelper { } String finalURl1 = finalURl; popupLinksBinding.displayFullLink.setOnClickListener(v -> { - AlertDialog.Builder builder = new AlertDialog.Builder(mContext, Helper.dialogStyle()); + AlertDialog.Builder builder = new AlertDialog.Builder(mContext); builder.setMessage(finalURl1); builder.setTitle(context.getString(R.string.display_full_link)); builder.setPositiveButton(R.string.close, (dialog, which) -> dialog.dismiss()) @@ -576,7 +576,7 @@ public class SpannableHelper { Handler mainHandler = new Handler(context.getMainLooper()); String finalRedirect = redirect; Runnable myRunnable = () -> { - AlertDialog.Builder builder1 = new AlertDialog.Builder(view.getContext(), Helper.dialogStyle()); + AlertDialog.Builder builder1 = new AlertDialog.Builder(view.getContext()); if (finalRedirect != null) { builder1.setMessage(context.getString(R.string.redirect_detected, finalURl1, finalRedirect)); builder1.setNegativeButton(R.string.copy_link, (dialog, which) -> { @@ -908,7 +908,7 @@ public class SpannableHelper { return; } } - AlertDialog.Builder builder = new AlertDialog.Builder(context, Helper.dialogStyle()); + AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setMessage(context.getString(R.string.mute_tag, tag)); builder .setPositiveButton(R.string.yes, (dialog, which) -> { @@ -977,7 +977,7 @@ public class SpannableHelper { int end = spannable.getSpanEnd(quoteSpan); int flags = spannable.getSpanFlags(quoteSpan); spannable.removeSpan(quoteSpan); - int colord = ContextCompat.getColor(context, R.color.cyanea_accent_reference); + int colord = ContextCompat.getColor(context, R.color.colorAccent); spannable.setSpan(new CustomQuoteSpan( ContextCompat.getColor(context, R.color.transparent), colord, 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 3a7f9937..088557a1 100644 --- a/app/src/main/java/app/fedilab/android/helper/ThemeHelper.java +++ b/app/src/main/java/app/fedilab/android/helper/ThemeHelper.java @@ -36,9 +36,6 @@ import androidx.core.content.ContextCompat; import androidx.core.graphics.ColorUtils; import androidx.preference.PreferenceManager; -import com.google.android.material.button.MaterialButton; -import com.jaredrummler.cyanea.Cyanea; - import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; @@ -49,7 +46,7 @@ import java.util.LinkedHashMap; import java.util.List; import app.fedilab.android.R; -import app.fedilab.android.activities.BaseActivity; + public class ThemeHelper { @@ -72,6 +69,25 @@ public class ThemeHelper { return color; } + + public static ColorStateList getButtonActionColorStateList(Context context) { + int[][] states = new int[][]{ + new int[]{android.R.attr.state_enabled}, // enabled + new int[]{-android.R.attr.state_enabled}, // disabled + new int[]{-android.R.attr.state_checked}, // unchecked + new int[]{android.R.attr.state_pressed} // pressed + }; + int alphaColor = ColorUtils.setAlphaComponent(ContextCompat.getColor(context, R.color.colorAccent), 0x33); + int color = ContextCompat.getColor(context, R.color.colorAccent); + int[] colors = new int[]{ + color, + alphaColor, + color, + color + }; + return new ColorStateList(states, colors); + } + /** * Initialize colors in a static variable * Currently link_color cannot be retrieved with getAttColor in ViewModel due to application and theme @@ -92,37 +108,7 @@ public class ThemeHelper { } } - public static void applyTheme(BaseActivity activity) { - if (Cyanea.getInstance().isDark()) { - activity.setTheme(R.style.AppThemeDark); - } else { - activity.setTheme(R.style.AppTheme); - } - } - public static void applyThemeDialog(BaseActivity activity) { - if (Cyanea.getInstance().isDark()) { - activity.setTheme(R.style.DialogDark); - } else { - activity.setTheme(R.style.Dialog); - } - } - - public static int getBackgroundColor(Context context) { - if (Cyanea.getInstance().isDark()) { - return ContextCompat.getColor(context, R.color.cyanea_background_dark); - } else { - return ContextCompat.getColor(context, R.color.cyanea_background_light); - } - } - - public static void applyThemeBar(BaseActivity activity) { - if (Cyanea.getInstance().isDark()) { - activity.setTheme(R.style.AppThemeBarDark); - } else { - activity.setTheme(R.style.AppThemeBar); - } - } /** * Animate two views, the current view will be hidden to left @@ -282,23 +268,6 @@ public class ThemeHelper { return new ColorStateList(states, colors); } - public static ColorStateList getButtonActionColorStateList(Context context) { - int[][] states = new int[][]{ - new int[]{android.R.attr.state_enabled}, // enabled - new int[]{-android.R.attr.state_enabled}, // disabled - new int[]{-android.R.attr.state_checked}, // unchecked - new int[]{android.R.attr.state_pressed} // pressed - }; - int alphaColor = ColorUtils.setAlphaComponent(ContextCompat.getColor(context, R.color.cyanea_accent_dark_reference), 0x33); - int color = ContextCompat.getColor(context, R.color.cyanea_accent_dark_reference); - int[] colors = new int[]{ - color, - alphaColor, - color, - color - }; - return new ColorStateList(states, colors); - } /** @@ -319,144 +288,6 @@ public class ThemeHelper { return new ColorStateList(states, colors); } - /** - * Allow to set colors for tablayout - * - * @param context - Context - * @return - ColorStateList - */ - public static ColorStateList getColorStateList(Context context) { - int[][] states = new int[][]{ - new int[]{android.R.attr.state_selected}, - new int[]{-android.R.attr.state_selected}, - }; - int[] colors = new int[]{ - ContextCompat.getColor(context, R.color.cyanea_accent_dark_reference), - getAttColor(context, R.attr.mTextColor) - }; - return new ColorStateList(states, colors); - } - - /** - * Change all color for a Material button - * - * @param context - Context - * @param materialButton - MaterialButton - */ - public static void changeButtonColor(Context context, MaterialButton materialButton) { - materialButton.setRippleColor(ThemeHelper.getButtonColorStateList(context)); - materialButton.setStrokeColor(ThemeHelper.getButtonColorStateList(context)); - materialButton.setTextColor(ThemeHelper.getButtonColorStateList(context)); - materialButton.setIconTint(ThemeHelper.getButtonColorStateList(context)); - materialButton.setBackgroundTintList(ThemeHelper.getBackgroundButtonColorStateList(context)); - } - - /** - * Allow to set ThumbDrawable colors for SwitchCompat - * - * @param context - Context - * @return - ColorStateList - */ - public static ColorStateList getSwitchCompatThumbDrawable(Context context) { - int[][] states = new int[][]{ - new int[]{android.R.attr.state_checked}, - new int[]{-android.R.attr.state_checked}, - }; - int alphaColor = ColorUtils.setAlphaComponent(ContextCompat.getColor(context, R.color.cyanea_accent_dark_reference), 0xee); - int alphaColorUnchecked = ColorUtils.setAlphaComponent(getAttColor(context, R.attr.mTextColor), 0xee); - int[] colors = new int[]{ - alphaColor, - alphaColorUnchecked - }; - return new ColorStateList(states, colors); - } - - /** - * Allow to set TrackDrawable colors for SwitchCompat - * - * @param context - Context - * @return - ColorStateList - */ - public static ColorStateList getSwitchCompatTrackDrawable(Context context) { - int[][] states = new int[][]{ - new int[]{android.R.attr.state_checked}, - new int[]{-android.R.attr.state_checked}, - }; - int alphaColor = ColorUtils.setAlphaComponent(ContextCompat.getColor(context, R.color.cyanea_accent_dark_reference), 0x33); - int alphaColorUnchecked = ColorUtils.setAlphaComponent(getAttColor(context, R.attr.mTextColor), 0x33); - int[] colors = new int[]{ - alphaColor, - alphaColorUnchecked - }; - return new ColorStateList(states, colors); - } - - /** - * Allow to set colors for Material buttons inside a toggle group - * - * @param context - Context - * @return - ColorStateList - */ - public static ColorStateList getButtonColorStateList(Context context) { - int[][] states = new int[][]{ - new int[]{android.R.attr.state_checked}, - new int[]{-android.R.attr.state_checked}, - }; - int[] colors = new int[]{ - ContextCompat.getColor(context, R.color.cyanea_accent_dark_reference), - getAttColor(context, R.attr.mTextColor) - }; - return new ColorStateList(states, colors); - } - - - public static void changeColorOutlineButton(Context context, MaterialButton materialButton) { - if (materialButton != null) { - materialButton.setStrokeColor(ThemeHelper.getButtonOutlineColorStateList(context)); - materialButton.setRippleColor(ThemeHelper.getButtonOutlineColorStateList(context)); - materialButton.setIconTint(ThemeHelper.getButtonOutlineColorStateList(context)); - materialButton.setTextColor(ThemeHelper.getButtonOutlineColorStateList(context)); - } - } - - /** - * Allow to set colors for Material buttons inside a toggle group - * - * @param context - Context - * @return - ColorStateList - */ - public static ColorStateList getButtonOutlineColorStateList(Context context) { - int[][] states = new int[][]{ - new int[]{android.R.attr.state_checked}, - new int[]{-android.R.attr.state_checked}, - }; - int alphaColorUnchecked = ColorUtils.setAlphaComponent(getAttColor(context, R.attr.mTextColor), 0xaa); - int[] colors = new int[]{ - ContextCompat.getColor(context, R.color.cyanea_accent_dark_reference), - alphaColorUnchecked - }; - return new ColorStateList(states, colors); - } - - - /** - * Allow to set background colors for Material buttons inside a toggle group - * - * @param context - Context - * @return - ColorStateList - */ - private static ColorStateList getBackgroundButtonColorStateList(Context context) { - int[][] states = new int[][]{ - new int[]{android.R.attr.state_checked}, - new int[]{-android.R.attr.state_checked}, - }; - int alphaColor = ColorUtils.setAlphaComponent(ContextCompat.getColor(context, R.color.cyanea_accent_dark_reference), 0x33); - int[] colors = new int[]{ - alphaColor, - ContextCompat.getColor(context, R.color.transparent) - }; - return new ColorStateList(states, colors); - } /** * Allow to change font scale in activities diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/AccountAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/AccountAdapter.java index a7cdcf67..ade37602 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/AccountAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/AccountAdapter.java @@ -48,7 +48,6 @@ import app.fedilab.android.client.entities.api.Account; import app.fedilab.android.databinding.DrawerAccountBinding; import app.fedilab.android.helper.Helper; import app.fedilab.android.helper.MastodonHelper; -import app.fedilab.android.helper.ThemeHelper; import app.fedilab.android.viewmodel.mastodon.AccountsVM; import es.dmoral.toasty.Toasty; @@ -79,12 +78,7 @@ public class AccountAdapter extends RecyclerView.Adapter dialog.dismiss()); diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/AccountListAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/AccountListAdapter.java index 356d880c..6d308693 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/AccountListAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/AccountListAdapter.java @@ -97,7 +97,6 @@ public class AccountListAdapter extends RecyclerView.Adapter { accountList.add(0, account); diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/AnnouncementAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/AnnouncementAdapter.java index 43f7a897..218f3a86 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/AnnouncementAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/AnnouncementAdapter.java @@ -147,7 +147,7 @@ public class AnnouncementAdapter extends RecyclerView.Adapter { - final AlertDialog.Builder builder = new AlertDialog.Builder(context, Helper.dialogStyle()); + final AlertDialog.Builder builder = new AlertDialog.Builder(context); int paddingPixel = 15; float density = context.getResources().getDisplayMetrics().density; int paddingDp = (int) (paddingPixel * density); diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/ComposeAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/ComposeAdapter.java index 8cacbff2..b4860ef4 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/ComposeAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/ComposeAdapter.java @@ -28,7 +28,6 @@ import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.PackageManager; -import android.content.res.ColorStateList; import android.graphics.Bitmap; import android.graphics.Color; import android.graphics.drawable.Drawable; @@ -61,7 +60,6 @@ import androidx.appcompat.widget.AppCompatEditText; import androidx.appcompat.widget.LinearLayoutCompat; import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; -import androidx.core.widget.ImageViewCompat; import androidx.lifecycle.LifecycleOwner; import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelStoreOwner; @@ -954,7 +952,7 @@ public class ComposeAdapter extends RecyclerView.Adapter { - AlertDialog.Builder builderInner = new AlertDialog.Builder(context, Helper.dialogStyle()); + AlertDialog.Builder builderInner = new AlertDialog.Builder(context); builderInner.setTitle(R.string.upload_form_description); PopupMediaDescriptionBinding popupMediaDescriptionBinding = PopupMediaDescriptionBinding.inflate(LayoutInflater.from(context), null, false); builderInner.setView(popupMediaDescriptionBinding.getRoot()); @@ -1011,7 +1009,7 @@ public class ComposeAdapter extends RecyclerView.Adapter { - AlertDialog.Builder builderInner = new AlertDialog.Builder(context, Helper.dialogStyle()); + AlertDialog.Builder builderInner = new AlertDialog.Builder(context); builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); builderInner.setPositiveButton(R.string.delete, (dialog, which) -> { attachmentList.remove(attachment); @@ -1142,8 +1140,6 @@ public class ComposeAdapter extends RecyclerView.Adapter { if (instanceInfo.configuration.media_attachments.supported_mime_types != null) { @@ -1395,11 +1387,7 @@ public class ComposeAdapter extends RecyclerView.Adapter { @@ -1456,7 +1444,7 @@ public class ComposeAdapter extends RecyclerView.Adapter { - AlertDialog.Builder alt_bld = new AlertDialog.Builder(context, Helper.dialogStyle()); + AlertDialog.Builder alt_bld = new AlertDialog.Builder(context); alt_bld.setMessage(context.getString(R.string.unblock_domain_confirm, domain)); alt_bld.setPositiveButton(R.string.yes, (dialog, id) -> { accountsVM.removeDomainBlocks(MainActivity.currentInstance, MainActivity.currentToken, domain); diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/FilterAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/FilterAdapter.java index 954369d4..6bed3b33 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/FilterAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/FilterAdapter.java @@ -32,7 +32,6 @@ import app.fedilab.android.R; import app.fedilab.android.activities.FilterActivity; import app.fedilab.android.client.entities.api.Filter; import app.fedilab.android.databinding.DrawerFilterBinding; -import app.fedilab.android.helper.Helper; import app.fedilab.android.viewmodel.mastodon.FiltersVM; @@ -88,7 +87,7 @@ public class FilterAdapter extends RecyclerView.Adapter { - AlertDialog.Builder builder = new AlertDialog.Builder(context, Helper.dialogStyle()); + AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle(R.string.action_filter_delete); builder.setMessage(R.string.action_lists_confirm_delete); builder.setIcon(android.R.drawable.ic_dialog_alert) diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/ReorderTabAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/ReorderTabAdapter.java index e85afc09..bef12491 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/ReorderTabAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/ReorderTabAdapter.java @@ -39,7 +39,6 @@ import app.fedilab.android.client.entities.app.PinnedTimeline; import app.fedilab.android.client.entities.app.Timeline; import app.fedilab.android.databinding.DrawerReorderBinding; import app.fedilab.android.exception.DBException; -import app.fedilab.android.helper.Helper; import app.fedilab.android.helper.itemtouchhelper.ItemTouchHelperAdapter; import app.fedilab.android.helper.itemtouchhelper.ItemTouchHelperViewHolder; import app.fedilab.android.helper.itemtouchhelper.OnStartDragListener; @@ -170,7 +169,7 @@ public class ReorderTabAdapter extends RecyclerView.Adapter { if (item.type == Timeline.TimeLineEnum.TAG || item.type == Timeline.TimeLineEnum.REMOTE || item.type == Timeline.TimeLineEnum.LIST) { - AlertDialog.Builder alt_bld = new AlertDialog.Builder(context, Helper.dialogStyle()); + AlertDialog.Builder alt_bld = new AlertDialog.Builder(context); String title = ""; String message = ""; alt_bld.setTitle(R.string.action_lists_delete); diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java index 43d2a498..f4e12e22 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java @@ -50,7 +50,6 @@ import android.text.Spanned; import android.text.TextUtils; import android.text.style.ForegroundColorSpan; import android.util.TypedValue; -import android.view.ContextThemeWrapper; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; @@ -439,7 +438,7 @@ public class StatusAdapter extends RecyclerView.Adapter }); holder.binding.statusAddCustomEmoji.setOnClickListener(v -> { - final AlertDialog.Builder builder = new AlertDialog.Builder(context, Helper.dialogStyle()); + final AlertDialog.Builder builder = new AlertDialog.Builder(context); int paddingPixel = 15; float density = context.getResources().getDisplayMetrics().density; int paddingDp = (int) (paddingPixel * density); @@ -526,7 +525,6 @@ public class StatusAdapter extends RecyclerView.Adapter holder.binding.statusEmoji.setVisibility(View.VISIBLE); } - Helper.changeDrawableColor(context, R.drawable.ic_baseline_mode_edit_message_24, R.color.cyanea_accent_reference); if (theme_icons_color != -1) { Helper.changeDrawableColor(context, holder.binding.actionButtonReply, theme_icons_color); Helper.changeDrawableColor(context, holder.binding.cacheIndicator, theme_icons_color); @@ -600,9 +598,6 @@ public class StatusAdapter extends RecyclerView.Adapter if (theme_statuses_color != -1) { holder.binding.cardviewContainer.setBackgroundColor(theme_statuses_color); holder.binding.translationLabel.setBackgroundColor(theme_statuses_color); - } else { - holder.binding.cardviewContainer.setBackgroundColor(ThemeHelper.getBackgroundColor(context)); - holder.binding.translationLabel.setBackgroundColor(ThemeHelper.getBackgroundColor(context)); } if (theme_boost_header_color != -1 && status.reblog != null) { holder.binding.statusBoosterInfo.setBackgroundColor(theme_boost_header_color); @@ -818,7 +813,7 @@ public class StatusAdapter extends RecyclerView.Adapter }); holder.binding.actionButtonBoost.setOnClickListener(v -> { if (confirmBoost) { - AlertDialog.Builder alt_bld = new AlertDialog.Builder(context, Helper.dialogStyle()); + AlertDialog.Builder alt_bld = new AlertDialog.Builder(context); if (statusToDeal.reblogged) { alt_bld.setMessage(context.getString(R.string.reblog_remove)); } else { @@ -888,7 +883,7 @@ public class StatusAdapter extends RecyclerView.Adapter }); holder.binding.actionButtonFavorite.setOnClickListener(v -> { if (confirmFav) { - AlertDialog.Builder alt_bld = new AlertDialog.Builder(context, Helper.dialogStyle()); + AlertDialog.Builder alt_bld = new AlertDialog.Builder(context); if (status.favourited) { alt_bld.setMessage(context.getString(R.string.favourite_remove)); } else { @@ -1534,7 +1529,7 @@ public class StatusAdapter extends RecyclerView.Adapter if (ownvotes != null && ownvotes.contains(j)) { Drawable img = ContextCompat.getDrawable(context, R.drawable.ic_baseline_check_24); assert img != null; - img.setColorFilter(ContextCompat.getColor(context, R.color.cyanea_accent_reference), PorterDuff.Mode.SRC_IN); + img.setColorFilter(ContextCompat.getColor(context, R.color.colorAccent), PorterDuff.Mode.SRC_IN); img.setBounds(0, 0, (int) (20 * scale + 0.5f), (int) (20 * scale + 0.5f)); pollItemBinding.pollItemText.setCompoundDrawables(null, null, img, null); } @@ -1551,7 +1546,6 @@ public class StatusAdapter extends RecyclerView.Adapter (holder.binding.poll.multipleChoice).removeAllViews(); for (Poll.PollItem pollOption : statusToDeal.poll.options) { CheckBox cb = new CheckBox(context); - cb.setButtonTintList(ThemeHelper.getButtonColorStateList(context)); cb.setText( pollOption.getSpanTitle(context, statusToDeal, new WeakReference<>(cb)), @@ -1565,7 +1559,6 @@ public class StatusAdapter extends RecyclerView.Adapter (holder.binding.poll.singleChoiceRadioGroup).removeAllViews(); for (Poll.PollItem pollOption : statusToDeal.poll.options) { RadioButton rb = new RadioButton(context); - rb.setButtonTintList(ThemeHelper.getButtonColorStateList(context)); rb.setText( pollOption.getSpanTitle(context, statusToDeal, new WeakReference<>(rb)), @@ -1739,7 +1732,7 @@ public class StatusAdapter extends RecyclerView.Adapter } holder.binding.actionButtonMore.setOnClickListener(v -> { boolean isOwner = statusToDeal.account.id.compareTo(BaseMainActivity.currentUserID) == 0; - PopupMenu popup = new PopupMenu(new ContextThemeWrapper(context, Helper.popupStyle()), holder.binding.actionButtonMore); + PopupMenu popup = new PopupMenu(context, holder.binding.actionButtonMore); popup.getMenuInflater() .inflate(R.menu.option_toot, popup.getMenu()); if (statusToDeal.visibility.equals("private") || status.visibility.equals("direct")) { @@ -1786,7 +1779,7 @@ public class StatusAdapter extends RecyclerView.Adapter popup.setOnMenuItemClickListener(item -> { int itemId = item.getItemId(); if (itemId == R.id.action_redraft) { - AlertDialog.Builder builderInner = new AlertDialog.Builder(context, Helper.dialogStyle()); + AlertDialog.Builder builderInner = new AlertDialog.Builder(context); builderInner.setTitle(stringArrayConf[1]); builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); builderInner.setPositiveButton(R.string.yes, (dialog, which) -> { @@ -1842,7 +1835,7 @@ public class StatusAdapter extends RecyclerView.Adapter } else if (itemId == R.id.action_open_browser) { Helper.openBrowser(context, statusToDeal.url); } else if (itemId == R.id.action_remove) { - AlertDialog.Builder builderInner = new AlertDialog.Builder(context, Helper.dialogStyle()); + AlertDialog.Builder builderInner = new AlertDialog.Builder(context); builderInner.setTitle(stringArrayConf[0]); builderInner.setMessage(statusToDeal.content); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) @@ -1859,7 +1852,7 @@ public class StatusAdapter extends RecyclerView.Adapter })); builderInner.show(); } else if (itemId == R.id.action_block_domain) { - AlertDialog.Builder builderInner = new AlertDialog.Builder(context, Helper.dialogStyle()); + AlertDialog.Builder builderInner = new AlertDialog.Builder(context); builderInner.setTitle(stringArrayConf[3]); String domain = statusToDeal.account.acct.split("@")[1]; builderInner.setMessage(context.getString(R.string.block_domain_confirm_message, domain)); @@ -1870,7 +1863,7 @@ public class StatusAdapter extends RecyclerView.Adapter }); builderInner.show(); } else if (itemId == R.id.action_mute) { - AlertDialog.Builder builderInner = new AlertDialog.Builder(context, Helper.dialogStyle()); + AlertDialog.Builder builderInner = new AlertDialog.Builder(context); builderInner.setTitle(stringArrayConf[0]); builderInner.setMessage(statusToDeal.account.acct); builderInner.setNeutralButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); @@ -1909,7 +1902,7 @@ public class StatusAdapter extends RecyclerView.Adapter MastodonHelper.scheduleBoost(context, MastodonHelper.ScheduleType.TIMED_MUTED, statusToDeal, null, null); return true; } else if (itemId == R.id.action_block) { - AlertDialog.Builder builderInner = new AlertDialog.Builder(context, Helper.dialogStyle()); + AlertDialog.Builder builderInner = new AlertDialog.Builder(context); builderInner.setTitle(stringArrayConf[1]); builderInner.setMessage(statusToDeal.account.acct); builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); @@ -2032,7 +2025,7 @@ public class StatusAdapter extends RecyclerView.Adapter } Handler mainHandler = new Handler(Looper.getMainLooper()); Runnable myRunnable = () -> { - AlertDialog.Builder builderSingle = new AlertDialog.Builder(context, Helper.dialogStyle()); + AlertDialog.Builder builderSingle = new AlertDialog.Builder(context); builderSingle.setTitle(context.getString(R.string.choose_accounts)); final AccountsSearchAdapter accountsSearchAdapter = new AccountsSearchAdapter(context, accountList); final BaseAccount[] accountArray = new BaseAccount[accounts.size()]; diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/StatusDraftAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/StatusDraftAdapter.java index 13403016..1942e61c 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/StatusDraftAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/StatusDraftAdapter.java @@ -95,7 +95,7 @@ public class StatusDraftAdapter extends RecyclerView.Adapter { - AlertDialog.Builder unfollowConfirm = new AlertDialog.Builder(context, Helper.dialogStyle()); + AlertDialog.Builder unfollowConfirm = new AlertDialog.Builder(context); unfollowConfirm.setMessage(context.getString(R.string.remove_draft)); unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); unfollowConfirm.setPositiveButton(R.string.delete, (dialog, which) -> { diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/StatusHistoryAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/StatusHistoryAdapter.java index f1fc2ff0..2d81d805 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/StatusHistoryAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/StatusHistoryAdapter.java @@ -22,7 +22,6 @@ import android.view.ViewGroup; import android.widget.TextView; import androidx.annotation.NonNull; -import androidx.core.content.ContextCompat; import androidx.preference.PreferenceManager; import androidx.recyclerview.widget.RecyclerView; @@ -93,8 +92,6 @@ public class StatusHistoryAdapter extends RecyclerView.Adapter { - AlertDialog.Builder unfollowConfirm = new AlertDialog.Builder(context, Helper.dialogStyle()); + AlertDialog.Builder unfollowConfirm = new AlertDialog.Builder(context); unfollowConfirm.setMessage(context.getString(R.string.remove_scheduled)); unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); unfollowConfirm.setPositiveButton(R.string.delete, (dialog, which) -> { diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/SuggestionAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/SuggestionAdapter.java index ced0db25..c1a817a4 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/SuggestionAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/SuggestionAdapter.java @@ -18,7 +18,6 @@ package app.fedilab.android.ui.drawer; import android.app.Activity; import android.content.Context; import android.content.Intent; -import android.content.res.ColorStateList; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; @@ -27,7 +26,6 @@ import android.widget.TextView; import androidx.annotation.NonNull; import androidx.core.app.ActivityOptionsCompat; -import androidx.core.content.ContextCompat; import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelStoreOwner; import androidx.recyclerview.widget.RecyclerView; @@ -92,7 +90,6 @@ public class SuggestionAdapter extends RecyclerView.Adapter { } tagViewHolder.binding.tagStats.setText(context.getString(R.string.talking_about, stat)); LineDataSet dataTrending = new LineDataSet(trendsEntry, context.getString(R.string.trending)); - dataTrending.setColor(ContextCompat.getColor(context, R.color.cyanea_accent_reference)); - dataTrending.setValueTextColor(ContextCompat.getColor(context, R.color.cyanea_accent_reference)); - dataTrending.setFillColor(ContextCompat.getColor(context, R.color.cyanea_accent_reference)); dataTrending.setDrawValues(false); dataTrending.setDrawFilled(true); dataTrending.setDrawCircles(false); diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/TopMenuAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/TopMenuAdapter.java index 439316e2..82f115a5 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/TopMenuAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/TopMenuAdapter.java @@ -83,7 +83,7 @@ public class TopMenuAdapter extends RecyclerView.Adapter { if (token != null) { - AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(requireActivity(), Helper.dialogStyle()); + AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(requireActivity()); dialogBuilder.setCancelable(false); dialogBuilder.setPositiveButton(R.string.validate, (dialog, which) -> { dialog.dismiss(); diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentComposeSettings.java b/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentComposeSettings.java index f40623d1..cf86ee08 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentComposeSettings.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentComposeSettings.java @@ -25,7 +25,6 @@ import androidx.preference.SwitchPreferenceCompat; import app.fedilab.android.BaseMainActivity; import app.fedilab.android.R; -import app.fedilab.android.helper.Helper; public class FragmentComposeSettings extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener { @@ -38,7 +37,6 @@ public class FragmentComposeSettings extends PreferenceFragmentCompat implements private void createPref() { SwitchPreferenceCompat SET_WATERMARK = findPreference(getString(R.string.SET_WATERMARK)); if (SET_WATERMARK != null) { - SET_WATERMARK.getContext().setTheme(Helper.dialogStyle()); } SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity()); EditTextPreference SET_WATERMARK_TEXT = findPreference(getString(R.string.SET_WATERMARK_TEXT)); @@ -47,10 +45,6 @@ public class FragmentComposeSettings extends PreferenceFragmentCompat implements SET_WATERMARK_TEXT.setText(val); } MultiSelectListPreference SET_SELECTED_LANGUAGE = findPreference(getString(R.string.SET_SELECTED_LANGUAGE)); - if (SET_SELECTED_LANGUAGE != null) { - SET_SELECTED_LANGUAGE.getContext().setTheme(Helper.dialogStyle()); - } - } @Override diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentInterfaceSettings.java b/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentInterfaceSettings.java index fcffbfb5..54ee23a2 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentInterfaceSettings.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentInterfaceSettings.java @@ -64,7 +64,6 @@ public class FragmentInterfaceSettings extends PreferenceFragmentCompat implemen } ListPreference SET_LOGO_LAUNCHER = findPreference(getString(R.string.SET_LOGO_LAUNCHER)); if (SET_LOGO_LAUNCHER != null) { - SET_LOGO_LAUNCHER.getContext().setTheme(Helper.dialogStyle()); SET_LOGO_LAUNCHER.setIcon(LogoHelper.getDrawable(SET_LOGO_LAUNCHER.getValue())); } recreate = false; diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentLanguageSettings.java b/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentLanguageSettings.java index 1f99ccaf..8ccd462c 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentLanguageSettings.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentLanguageSettings.java @@ -37,9 +37,6 @@ public class FragmentLanguageSettings extends PreferenceFragmentCompat implement @SuppressLint("ApplySharedPref") private void createPref() { ListPreference SET_DEFAULT_LOCALE_NEW = findPreference(getString(R.string.SET_DEFAULT_LOCALE_NEW)); - if (SET_DEFAULT_LOCALE_NEW != null) { - SET_DEFAULT_LOCALE_NEW.getContext().setTheme(Helper.dialogStyle()); - } Preference SET_TRANSLATE_VALUES_RESET = findPreference(getString(R.string.SET_TRANSLATE_VALUES_RESET)); SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity()); diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentNotificationsSettings.java b/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentNotificationsSettings.java index 56427025..4cfd746d 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentNotificationsSettings.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentNotificationsSettings.java @@ -36,7 +36,6 @@ import java.util.ArrayList; import java.util.List; import app.fedilab.android.R; -import app.fedilab.android.helper.Helper; import app.fedilab.android.helper.PushHelper; import app.fedilab.android.helper.settings.TimePreference; import app.fedilab.android.helper.settings.TimePreferenceDialogFragment; @@ -80,9 +79,7 @@ public class FragmentNotificationsSettings extends PreferenceFragmentCompat impl ListPreference SET_NOTIFICATION_TYPE = findPreference(getString(R.string.SET_NOTIFICATION_TYPE)); - if (SET_NOTIFICATION_TYPE != null) { - SET_NOTIFICATION_TYPE.getContext().setTheme(Helper.dialogStyle()); - } + String[] notificationValues = getResources().getStringArray(R.array.SET_NOTIFICATION_TYPE_VALUE); if (SET_NOTIFICATION_TYPE != null && SET_NOTIFICATION_TYPE.getValue().equals(notificationValues[2])) { PreferenceCategory notification_sounds = findPreference("notification_sounds"); @@ -108,9 +105,7 @@ public class FragmentNotificationsSettings extends PreferenceFragmentCompat impl return; } else if (SET_NOTIFICATION_TYPE != null && SET_NOTIFICATION_TYPE.getValue().equals(notificationValues[1])) { ListPreference SET_NOTIFICATION_DELAY_VALUE = findPreference(getString(R.string.SET_NOTIFICATION_DELAY_VALUE)); - if (SET_NOTIFICATION_DELAY_VALUE != null) { - SET_NOTIFICATION_DELAY_VALUE.getContext().setTheme(Helper.dialogStyle()); - } + ListPreference SET_PUSH_DISTRIBUTOR = findPreference("SET_PUSH_DISTRIBUTOR"); if (SET_PUSH_DISTRIBUTOR != null) { preferenceScreen.removePreferenceRecursively("SET_PUSH_DISTRIBUTOR"); @@ -122,7 +117,6 @@ public class FragmentNotificationsSettings extends PreferenceFragmentCompat impl } ListPreference SET_PUSH_DISTRIBUTOR = findPreference(getString(R.string.SET_PUSH_DISTRIBUTOR)); if (SET_PUSH_DISTRIBUTOR != null) { - SET_PUSH_DISTRIBUTOR.getContext().setTheme(Helper.dialogStyle()); List distributors = UnifiedPush.getDistributors(requireActivity(), new ArrayList<>()); SET_PUSH_DISTRIBUTOR.setValue(UnifiedPush.getDistributor(requireActivity())); SET_PUSH_DISTRIBUTOR.setEntries(distributors.toArray(new String[0])); diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentPrivacySettings.java b/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentPrivacySettings.java index aa8be58f..c6de48b6 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentPrivacySettings.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentPrivacySettings.java @@ -22,7 +22,6 @@ import androidx.preference.EditTextPreference; import androidx.preference.PreferenceFragmentCompat; import app.fedilab.android.R; -import app.fedilab.android.helper.Helper; public class FragmentPrivacySettings extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener { @@ -34,9 +33,6 @@ public class FragmentPrivacySettings extends PreferenceFragmentCompat implements private void createPref() { EditTextPreference SET_INVIDIOUS_HOST = findPreference(getString(R.string.SET_INVIDIOUS_HOST)); - if (SET_INVIDIOUS_HOST != null) { - SET_INVIDIOUS_HOST.getContext().setTheme(Helper.dialogStyle()); - } } @Override diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentThemingSettings.java b/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentThemingSettings.java index fa39d9cf..9816b48b 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentThemingSettings.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentThemingSettings.java @@ -44,9 +44,6 @@ import androidx.preference.PreferenceFragmentCompat; import androidx.preference.PreferenceManager; import com.bumptech.glide.Glide; -import com.jaredrummler.cyanea.Cyanea; -import com.jaredrummler.cyanea.prefs.CyaneaSettingsActivity; -import com.jaredrummler.cyanea.prefs.CyaneaTheme; import java.io.BufferedReader; import java.io.FileNotFoundException; @@ -63,7 +60,6 @@ import java.util.List; import app.fedilab.android.R; import app.fedilab.android.activities.ComposeActivity; -import app.fedilab.android.activities.SettingsActivity; import app.fedilab.android.databinding.PopupStatusThemeBinding; import app.fedilab.android.helper.Helper; import app.fedilab.android.helper.ThemeHelper; @@ -76,7 +72,6 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements private List> listOfThemes; private SharedPreferences appPref; private SharedPreferences cyneaPref; - public ActionTheming actionTheming; private boolean shouldRestart; @Override @@ -86,7 +81,6 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements createPref(); listOfThemes = ThemeHelper.getContributorsTheme(requireActivity()); shouldRestart = false; - actionTheming = (SettingsActivity) requireActivity(); } @@ -106,9 +100,7 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements getPreferenceScreen().getSharedPreferences() .unregisterOnSharedPreferenceChangeListener(this); } - if (shouldRestart && actionTheming != null) { - actionTheming.restart(); - } + } @Override @@ -121,9 +113,6 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements Helper.recreateMainActivity(requireActivity()); } - public interface ActionTheming { - void restart(); - } @SuppressWarnings("deprecation") @@ -264,7 +253,7 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements br = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8)); String sCurrentLine; SharedPreferences.Editor appEditor = appPref.edit(); - Cyanea.Editor cyaneaEditor = Cyanea.getInstance().edit(); + appEditor.putBoolean("use_custom_theme", true); while ((sCurrentLine = br.readLine()) != null) { String[] line = sCurrentLine.split(","); @@ -272,35 +261,15 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements String key = line[0]; String value = line[1]; if (key.compareTo("pref_color_navigation_bar") == 0) { - cyaneaEditor.shouldTintNavBar(Boolean.parseBoolean(value)); + } else if (key.compareTo("pref_color_background") == 0) { - cyaneaEditor.backgroundDarkLighter(Integer.parseInt(value)); - cyaneaEditor.backgroundLightDarker(Integer.parseInt(value)); - cyaneaEditor.backgroundDark(Integer.parseInt(value)); - cyaneaEditor.backgroundLightLighter(Integer.parseInt(value)); - cyaneaEditor.backgroundDarkDarker(Integer.parseInt(value)); - cyaneaEditor.background(Integer.parseInt(value)); - cyaneaEditor.backgroundDark(Integer.parseInt(value)); - cyaneaEditor.backgroundLight(Integer.parseInt(value)); + } else if (key.compareTo("base_theme") == 0) { - List list = CyaneaTheme.Companion.from(requireActivity().getAssets(), "themes/cyanea_themes.json"); - CyaneaTheme theme = list.get(Integer.parseInt(value)); - cyaneaEditor.baseTheme(theme.getBaseTheme()); - if (Integer.parseInt(value) == 0 || Integer.parseInt(value) == 2) { - cyaneaEditor.menuIconColor(ContextCompat.getColor(requireActivity(), R.color.dark_text)); - cyaneaEditor.subMenuIconColor(ContextCompat.getColor(requireActivity(), R.color.dark_text)); - } else { - cyaneaEditor.menuIconColor(ContextCompat.getColor(requireActivity(), R.color.black)); - cyaneaEditor.subMenuIconColor(ContextCompat.getColor(requireActivity(), R.color.black)); - } + } else if (key.compareTo("theme_accent") == 0) { - cyaneaEditor.accentLight(Integer.parseInt(value)); - cyaneaEditor.accent(Integer.parseInt(value)); - cyaneaEditor.accentDark(Integer.parseInt(value)); + } else if (key.compareTo("theme_primary") == 0) { - cyaneaEditor.primary(Integer.parseInt(value)); - cyaneaEditor.primaryLight(Integer.parseInt(value)); - cyaneaEditor.primaryDark(Integer.parseInt(value)); + } else { if (value != null && value.matches("-?\\d+")) { appEditor.putInt(key, Integer.parseInt(value)); @@ -311,7 +280,6 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements } } appEditor.commit(); - cyaneaEditor.apply().recreate(requireActivity()); Helper.recreateMainActivity(requireActivity()); } catch (IOException e) { e.printStackTrace(); @@ -337,7 +305,7 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements Preference launch_custom_theme = findPreference("launch_custom_theme"); if (launch_custom_theme != null) { launch_custom_theme.setOnPreferenceClickListener(preference -> { - startActivity(new Intent(requireActivity(), CyaneaSettingsActivity.class)); + shouldRestart = true; return false; }); @@ -347,7 +315,7 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements if (contributors_themes != null) { contributors_themes.setOnPreferenceClickListener(preference -> { final int[] currentPosition = {0}; - AlertDialog.Builder builderSingle = new AlertDialog.Builder(requireActivity(), Helper.dialogStyle()); + 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() { @@ -392,9 +360,7 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements } ListPreference settings_theme = findPreference("settings_theme"); - if (settings_theme != null) { - settings_theme.getContext().setTheme(Helper.dialogStyle()); - } + Preference theme_link_color = findPreference("theme_link_color"); Preference theme_boost_header_color = findPreference("theme_boost_header_color"); @@ -469,7 +435,7 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements } if (reset_pref != null) { reset_pref.setOnPreferenceClickListener(preference -> { - AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(requireActivity(), Helper.dialogStyle()); + AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(requireActivity()); dialogBuilder.setMessage(R.string.reset_color); dialogBuilder.setPositiveButton(R.string.reset, (dialog, id) -> { reset(); diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentTimelinesSettings.java b/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentTimelinesSettings.java index a8f2a5ee..a2420bb1 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentTimelinesSettings.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentTimelinesSettings.java @@ -22,7 +22,6 @@ import androidx.preference.PreferenceFragmentCompat; import androidx.preference.PreferenceManager; import app.fedilab.android.R; -import app.fedilab.android.helper.Helper; public class FragmentTimelinesSettings extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener { @@ -35,7 +34,6 @@ public class FragmentTimelinesSettings extends PreferenceFragmentCompat implemen private void createPref() { ListPreference SET_LOAD_MEDIA_TYPE = findPreference(getString(R.string.SET_LOAD_MEDIA_TYPE)); if (SET_LOAD_MEDIA_TYPE != null) { - SET_LOAD_MEDIA_TYPE.getContext().setTheme(Helper.dialogStyle()); } } diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonAccount.java b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonAccount.java index 0d7f9694..e160e3f5 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonAccount.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonAccount.java @@ -74,15 +74,13 @@ public class FragmentMastodonAccount extends Fragment { } flagLoading = false; binding = FragmentPaginationBinding.inflate(inflater, container, false); - binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity())); return binding.getRoot(); } @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); - int c1 = getResources().getColor(R.color.cyanea_accent_reference); - binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference)); + int c1 = ThemeHelper.getAttColor(requireActivity(), R.attr.colorAccent); binding.swipeContainer.setColorSchemeColors( c1, c1, c1 ); diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonAnnouncement.java b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonAnnouncement.java index 9c7ee82e..8684584c 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonAnnouncement.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonAnnouncement.java @@ -47,9 +47,7 @@ public class FragmentMastodonAnnouncement extends Fragment { binding = FragmentPaginationBinding.inflate(inflater, container, false); View root = binding.getRoot(); - binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity())); - int c1 = getResources().getColor(R.color.cyanea_accent_reference); - binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference)); + int c1 = ThemeHelper.getAttColor(requireActivity(), R.attr.colorAccent); binding.swipeContainer.setColorSchemeColors( c1, c1, c1 ); diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonContext.java b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonContext.java index 2388ecc1..bd38e85d 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonContext.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonContext.java @@ -151,12 +151,10 @@ public class FragmentMastodonContext extends Fragment { getChildFragmentManager().beginTransaction().remove(this).commit(); } binding = FragmentPaginationBinding.inflate(inflater, container, false); - int c1 = getResources().getColor(R.color.cyanea_accent_reference); - binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference)); + int c1 = ThemeHelper.getAttColor(requireActivity(), R.attr.colorAccent); binding.swipeContainer.setColorSchemeColors( c1, c1, c1 ); - binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity())); statusesVM = new ViewModelProvider(FragmentMastodonContext.this).get(StatusesVM.class); binding.recyclerView.setNestedScrollingEnabled(true); this.statuses = new ArrayList<>(); diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonConversation.java b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonConversation.java index eddc97b7..5e2aecfb 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonConversation.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonConversation.java @@ -81,7 +81,6 @@ public class FragmentMastodonConversation extends Fragment implements Conversati ViewGroup container, Bundle savedInstanceState) { flagLoading = false; binding = FragmentPaginationBinding.inflate(inflater, container, false); - binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity())); isViewInitialized = false; return binding.getRoot(); } @@ -239,8 +238,7 @@ public class FragmentMastodonConversation extends Fragment implements Conversati super.onViewCreated(view, savedInstanceState); - int c1 = getResources().getColor(R.color.cyanea_accent_reference); - binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference)); + int c1 = ThemeHelper.getAttColor(requireActivity(), R.attr.colorAccent); binding.swipeContainer.setColorSchemeColors( c1, c1, c1 ); diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonDomainBlock.java b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonDomainBlock.java index 65209c2f..b255ca16 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonDomainBlock.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonDomainBlock.java @@ -53,15 +53,13 @@ public class FragmentMastodonDomainBlock extends Fragment { ViewGroup container, Bundle savedInstanceState) { binding = FragmentPaginationBinding.inflate(inflater, container, false); - binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity())); return binding.getRoot(); } @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); - int c1 = getResources().getColor(R.color.cyanea_accent_reference); - binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference)); + int c1 = ThemeHelper.getAttColor(requireActivity(), R.attr.colorAccent); binding.swipeContainer.setColorSchemeColors( c1, c1, c1 ); diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonNotification.java b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonNotification.java index 65bb4163..14b632e3 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonNotification.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonNotification.java @@ -190,9 +190,7 @@ public class FragmentMastodonNotification extends Fragment implements Notificati notificationType = (NotificationTypeEnum) getArguments().get(Helper.ARG_NOTIFICATION_TYPE); } aggregateNotification = false; - binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity())); - int c1 = getResources().getColor(R.color.cyanea_accent_reference); - binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference)); + int c1 = ThemeHelper.getAttColor(requireActivity(), R.attr.colorAccent); binding.swipeContainer.setColorSchemeColors( c1, c1, c1 ); diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonSuggestion.java b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonSuggestion.java index 417876cd..9448f4ec 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonSuggestion.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonSuggestion.java @@ -52,15 +52,13 @@ public class FragmentMastodonSuggestion extends Fragment { ViewGroup container, Bundle savedInstanceState) { flagLoading = false; binding = FragmentPaginationBinding.inflate(inflater, container, false); - binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity())); return binding.getRoot(); } @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); - int c1 = getResources().getColor(R.color.cyanea_accent_reference); - binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference)); + int c1 = ThemeHelper.getAttColor(requireActivity(), R.attr.colorAccent); binding.swipeContainer.setColorSchemeColors( c1, c1, c1 ); diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonTag.java b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonTag.java index 984c19eb..ff429c73 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonTag.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonTag.java @@ -59,15 +59,13 @@ public class FragmentMastodonTag extends Fragment { } binding = FragmentPaginationBinding.inflate(inflater, container, false); - binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity())); return binding.getRoot(); } @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); - int c1 = getResources().getColor(R.color.cyanea_accent_reference); - binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference)); + int c1 = ThemeHelper.getAttColor(requireActivity(), R.attr.colorAccent); binding.swipeContainer.setColorSchemeColors( c1, c1, c1 ); diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonTimeline.java b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonTimeline.java index e23efb62..5289b647 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonTimeline.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonTimeline.java @@ -364,10 +364,8 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter. LocalBroadcastManager.getInstance(requireActivity()).registerReceiver(receive_action, new IntentFilter(Helper.RECEIVE_STATUS_ACTION)); binding = FragmentPaginationBinding.inflate(inflater, container, false); - binding.getRoot().setBackgroundColor(ThemeHelper.getBackgroundColor(requireActivity())); - int c1 = getResources().getColor(R.color.cyanea_accent_reference); - binding.swipeContainer.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.cyanea_primary_reference)); + int c1 = ThemeHelper.getAttColor(requireActivity(), R.attr.colorAccent); binding.swipeContainer.setColorSchemeColors( c1, c1, c1 ); diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentNotificationContainer.java b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentNotificationContainer.java index 97e0b50f..2b466ff5 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentNotificationContainer.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentNotificationContainer.java @@ -27,9 +27,7 @@ import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; -import androidx.core.content.ContextCompat; import androidx.core.content.res.ResourcesCompat; -import androidx.core.graphics.drawable.DrawableCompat; import androidx.fragment.app.Fragment; import androidx.lifecycle.ViewModelProvider; import androidx.preference.PreferenceManager; @@ -45,8 +43,6 @@ import app.fedilab.android.BaseMainActivity; import app.fedilab.android.R; import app.fedilab.android.databinding.FragmentNotificationContainerBinding; import app.fedilab.android.databinding.PopupNotificationSettingsBinding; -import app.fedilab.android.helper.Helper; -import app.fedilab.android.helper.ThemeHelper; import app.fedilab.android.ui.pageadapter.FedilabNotificationPageAdapter; import app.fedilab.android.viewmodel.mastodon.NotificationsVM; import es.dmoral.toasty.Toasty; @@ -89,24 +85,13 @@ public class FragmentNotificationContainer extends Fragment { } AtomicBoolean changes = new AtomicBoolean(false); binding.settings.setOnClickListener(v -> { - AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(requireActivity(), Helper.dialogStyle()); + AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(requireActivity()); PopupNotificationSettingsBinding dialogView = PopupNotificationSettingsBinding.inflate(getLayoutInflater()); dialogBuilder.setView(dialogView.getRoot()); - ThemeHelper.changeButtonColor(requireActivity(), dialogView.displayMentions); - ThemeHelper.changeButtonColor(requireActivity(), dialogView.displayFavourites); - ThemeHelper.changeButtonColor(requireActivity(), dialogView.displayReblogs); - ThemeHelper.changeButtonColor(requireActivity(), dialogView.displayPollResults); - ThemeHelper.changeButtonColor(requireActivity(), dialogView.displayUpdatesFromPeople); - ThemeHelper.changeButtonColor(requireActivity(), dialogView.displayFollows); - ThemeHelper.changeButtonColor(requireActivity(), dialogView.displayUpdates); - ThemeHelper.changeButtonColor(requireActivity(), dialogView.displaySignups); - ThemeHelper.changeButtonColor(requireActivity(), dialogView.displayReports); - DrawableCompat.setTintList(DrawableCompat.wrap(dialogView.displayAllCategories.getThumbDrawable()), ThemeHelper.getSwitchCompatThumbDrawable(requireActivity())); - DrawableCompat.setTintList(DrawableCompat.wrap(dialogView.displayAllCategories.getTrackDrawable()), ThemeHelper.getSwitchCompatTrackDrawable(requireActivity())); dialogView.clearAllNotif.setOnClickListener(v1 -> { - AlertDialog.Builder db = new AlertDialog.Builder(requireActivity(), Helper.dialogStyle()); + AlertDialog.Builder db = new AlertDialog.Builder(requireActivity()); db.setTitle(R.string.delete_notification_ask_all); db.setMessage(R.string.delete_notification_all_warning); db.setPositiveButton(R.string.delete_all, (dialog, id) -> { @@ -233,8 +218,6 @@ public class FragmentNotificationContainer extends Fragment { alertDialog.show(); }); - binding.tabLayout.setTabTextColors(ThemeHelper.getAttColor(requireActivity(), R.attr.mTextColor), ContextCompat.getColor(requireActivity(), R.color.cyanea_accent_dark_reference)); - binding.tabLayout.setTabIconTint(ThemeHelper.getColorStateList(requireActivity())); binding.viewpagerNotificationContainer.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(binding.tabLayout)); binding.tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { @Override diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentProfileTimeline.java b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentProfileTimeline.java index 03c76339..76bec3fb 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentProfileTimeline.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentProfileTimeline.java @@ -21,7 +21,6 @@ import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import androidx.core.content.ContextCompat; import androidx.fragment.app.Fragment; import com.google.android.material.tabs.TabLayout; @@ -30,7 +29,6 @@ import app.fedilab.android.R; import app.fedilab.android.client.entities.api.Account; import app.fedilab.android.databinding.FragmentProfileTimelinesBinding; import app.fedilab.android.helper.Helper; -import app.fedilab.android.helper.ThemeHelper; import app.fedilab.android.ui.pageadapter.FedilabProfilePageAdapter; public class FragmentProfileTimeline extends Fragment { @@ -56,8 +54,6 @@ public class FragmentProfileTimeline extends Fragment { binding.tabLayout.addTab(binding.tabLayout.newTab().setText(getString(R.string.toots))); binding.tabLayout.addTab(binding.tabLayout.newTab().setText(getString(R.string.replies))); binding.tabLayout.addTab(binding.tabLayout.newTab().setText(getString(R.string.media))); - binding.tabLayout.setTabTextColors(ThemeHelper.getAttColor(requireActivity(), R.attr.mTextColor), ContextCompat.getColor(requireActivity(), R.color.cyanea_accent_dark_reference)); - binding.tabLayout.setTabIconTint(ThemeHelper.getColorStateList(requireActivity())); binding.viewpager.setAdapter(new FedilabProfilePageAdapter(getChildFragmentManager(), account, checkRemotely)); binding.viewpager.setOffscreenPageLimit(3); binding.viewpager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(binding.tabLayout)); diff --git a/app/src/main/res/drawable/ic_compose_attachment_play.xml b/app/src/main/res/drawable/ic_compose_attachment_play.xml index 391d042b..9edb5960 100644 --- a/app/src/main/res/drawable/ic_compose_attachment_play.xml +++ b/app/src/main/res/drawable/ic_compose_attachment_play.xml @@ -4,7 +4,7 @@ android:viewportWidth="24" android:viewportHeight="24"> - - - + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/menu_selector_light.xml b/app/src/main/res/drawable/menu_selector_light.xml index acb32c17..4ec5c80b 100644 --- a/app/src/main/res/drawable/menu_selector_light.xml +++ b/app/src/main/res/drawable/menu_selector_light.xml @@ -1,7 +1,7 @@ - - - + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_counter.xml b/app/src/main/res/drawable/shape_counter.xml index 2356395e..ba8947a8 100644 --- a/app/src/main/res/drawable/shape_counter.xml +++ b/app/src/main/res/drawable/shape_counter.xml @@ -1,7 +1,7 @@ - + diff --git a/app/src/main/res/drawable/translation_border.xml b/app/src/main/res/drawable/translation_border.xml index f5c573b7..90d68440 100644 --- a/app/src/main/res/drawable/translation_border.xml +++ b/app/src/main/res/drawable/translation_border.xml @@ -2,6 +2,6 @@ + android:color="?attr/colorAccent" /> diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml index 9914f29a..cee4597a 100644 --- a/app/src/main/res/layout/activity_about.xml +++ b/app/src/main/res/layout/activity_about.xml @@ -131,8 +131,7 @@ android:layout_height="wrap_content" android:layout_gravity="center" android:text="@string/support_the_app_on_liberapay" - android:textColor="@color/cyanea_accent_dark_reference" - app:strokeColor="@color/cyanea_accent_dark_reference" /> + /> @@ -177,7 +174,6 @@ + app:iconTint="?attr/colorAccent" + app:strokeColor="?attr/colorAccent" /> + app:iconTint="?attr/colorAccent" + app:strokeColor="?attr/colorAccent" /> + app:iconTint="?attr/colorAccent" + app:strokeColor="?attr/colorAccent" /> + app:iconTint="?attr/colorAccent" + app:strokeColor="?attr/colorAccent" /> + app:iconTint="?attr/colorAccent" + app:strokeColor="?attr/colorAccent" /> diff --git a/app/src/main/res/layout/activity_admin_account.xml b/app/src/main/res/layout/activity_admin_account.xml index 664fb531..d0eba40e 100644 --- a/app/src/main/res/layout/activity_admin_account.xml +++ b/app/src/main/res/layout/activity_admin_account.xml @@ -26,13 +26,11 @@ android:id="@+id/appBar" android:layout_width="match_parent" android:layout_height="wrap_content" - android:backgroundTint="?backgroundColorLight" android:fitsSystemWindows="true"> + android:text="@string/approve" /> + android:text="@string/disable" /> + android:text="@string/silence" /> + android:text="@string/suspend" /> diff --git a/app/src/main/res/layout/activity_admin_actions.xml b/app/src/main/res/layout/activity_admin_actions.xml index 79ea3386..9f352c4b 100644 --- a/app/src/main/res/layout/activity_admin_actions.xml +++ b/app/src/main/res/layout/activity_admin_actions.xml @@ -20,11 +20,8 @@ android:paddingVertical="12dp" android:text="@string/reports" android:textAlignment="textStart" - android:textColor="@color/cyanea_accent_dark_reference" app:icon="@drawable/ic_baseline_navigate_next_24" - app:iconGravity="end" - app:iconTint="@color/cyanea_accent_dark_reference" - app:strokeColor="@color/cyanea_accent_dark_reference" /> + app:iconGravity="end" /> + app:iconGravity="end" /> + app:iconGravity="end" /> diff --git a/app/src/main/res/layout/activity_admin_domainblock.xml b/app/src/main/res/layout/activity_admin_domainblock.xml index 6e1e1caf..4c84c2f0 100644 --- a/app/src/main/res/layout/activity_admin_domainblock.xml +++ b/app/src/main/res/layout/activity_admin_domainblock.xml @@ -70,8 +70,7 @@ android:layout_height="wrap_content" android:layout_marginTop="10dp" android:layout_weight="1" - android:text="@string/admin_reject_media" - app:buttonTint="@color/cyanea_accent_dark_reference" /> + android:text="@string/admin_reject_media" /> + android:text="@string/admin_reject_reports" /> + android:text="@string/admin_reject_obfuscate" /> + app:icon="@drawable/ic_check_white_24dp" /> diff --git a/app/src/main/res/layout/activity_admin_report.xml b/app/src/main/res/layout/activity_admin_report.xml index 1dd0f3f2..bee3888c 100644 --- a/app/src/main/res/layout/activity_admin_report.xml +++ b/app/src/main/res/layout/activity_admin_report.xml @@ -31,11 +31,9 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="5dp" - android:textColor="@color/cyanea_accent_dark_reference" app:layout_constraintEnd_toStartOf="@id/status" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:strokeColor="@color/cyanea_accent_dark_reference" /> + app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintTop_toBottomOf="@id/stats_bottom_barrier" /> + app:layout_constraintTop_toBottomOf="@id/stats_bottom_barrier" /> + app:layout_constraintTop_toBottomOf="@id/allow_reject_buttons_barrier" /> + app:layout_constraintTop_toBottomOf="@id/allow_reject_buttons_barrier" /> + app:layout_constraintTop_toBottomOf="@id/warn_disable_buttons_barrier" /> + app:layout_constraintTop_toBottomOf="@id/warn_disable_buttons_barrier" /> + android:layout_height="wrap_content"> diff --git a/app/src/main/res/layout/activity_conversation.xml b/app/src/main/res/layout/activity_conversation.xml index 4497d09b..21bb55f4 100644 --- a/app/src/main/res/layout/activity_conversation.xml +++ b/app/src/main/res/layout/activity_conversation.xml @@ -31,8 +31,7 @@ + android:layout_height="wrap_content"> + android:layout_height="wrap_content"> diff --git a/app/src/main/res/layout/activity_edit_profile.xml b/app/src/main/res/layout/activity_edit_profile.xml index 0bae2305..a0e42f0d 100644 --- a/app/src/main/res/layout/activity_edit_profile.xml +++ b/app/src/main/res/layout/activity_edit_profile.xml @@ -50,11 +50,9 @@ android:padding="1dp" android:scaleType="centerCrop" android:src="@drawable/default_banner" - app:strokeColor="@color/cyanea_accent_dark_reference" app:strokeWidth="1dp" /> + app:layout_constraintTop_toBottomOf="@id/banner_pp_container" /> + app:layout_constraintStart_toEndOf="@id/account_pp_container" /> + app:icon="@drawable/ic_baseline_add_24" /> @@ -221,42 +208,38 @@ @@ -309,7 +292,7 @@ @@ -37,7 +36,6 @@ android:visibility="gone"> @@ -52,6 +50,5 @@ android:layout_gravity="bottom|end" android:layout_margin="@dimen/fab_margin" android:contentDescription="@string/add_filter" - android:src="@drawable/ic_baseline_add_24" - app:backgroundTint="@color/cyanea_accent_dark_reference" /> + android:src="@drawable/ic_baseline_add_24" /> diff --git a/app/src/main/res/layout/activity_hashtag.xml b/app/src/main/res/layout/activity_hashtag.xml index a8f10230..f3750296 100644 --- a/app/src/main/res/layout/activity_hashtag.xml +++ b/app/src/main/res/layout/activity_hashtag.xml @@ -30,8 +30,7 @@ + android:layout_height="wrap_content"> + android:src="@drawable/ic_baseline_mode_24" /> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_instance.xml b/app/src/main/res/layout/activity_instance.xml index d0a4aa4c..72076e86 100644 --- a/app/src/main/res/layout/activity_instance.xml +++ b/app/src/main/res/layout/activity_instance.xml @@ -126,7 +126,6 @@ tools:visibility="visible"> @@ -140,7 +139,6 @@ android:layout_margin="@dimen/fab_margin" android:contentDescription="@string/contact_instance_admin" android:src="@drawable/ic_baseline_mail_outline_24" - app:backgroundTint="@color/cyanea_accent_dark_reference" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" /> @@ -176,14 +174,12 @@ android:paddingVertical="12dp" android:text="@string/close" android:textAlignment="textStart" - android:textColor="@color/cyanea_accent_dark_reference" app:layout_constraintTop_toBottomOf="@+id/privacy" android:textAllCaps="false" android:textSize="16sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:strokeColor="@color/cyanea_accent_dark_reference" /> + app:layout_constraintStart_toStartOf="parent" /> diff --git a/app/src/main/res/layout/activity_instance_profile.xml b/app/src/main/res/layout/activity_instance_profile.xml index e7c6621e..445dae09 100644 --- a/app/src/main/res/layout/activity_instance_profile.xml +++ b/app/src/main/res/layout/activity_instance_profile.xml @@ -187,7 +187,6 @@ diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 603b54f1..1e002c16 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -60,7 +60,6 @@ android:layout_weight="1" android:background="@color/transparent" app:tabGravity="fill" - app:tabIndicatorColor="@color/cyanea_accent_dark_reference" app:tabMaxWidth="0dp" app:tabMode="scrollable" /> @@ -111,7 +110,6 @@ android:layout_margin="@dimen/fab_margin" android:contentDescription="@string/compose" android:src="@drawable/ic_baseline_mode_24" - app:backgroundTint="@color/cyanea_accent_dark_reference" app:layout_constraintBottom_toTopOf="@+id/bottom_nav_view" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -120,9 +118,6 @@ android:id="@+id/bottom_nav_view" android:layout_width="match_parent" android:layout_height="?actionBarSize" - app:backgroundTint="@color/cyanea_primary_reference" - app:itemIconTint="@color/cyanea_accent_dark_reference" - app:itemTextColor="@color/cyanea_accent_dark_reference" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" /> @@ -143,9 +138,7 @@ android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="start" - android:background="@color/cyanea_primary_dark_reference" android:fitsSystemWindows="false" - app:itemIconTint="?menuIconColor" app:menu="@menu/activity_main_drawer" /> diff --git a/app/src/main/res/layout/activity_media_pager.xml b/app/src/main/res/layout/activity_media_pager.xml index 510961f4..d4fdbd08 100644 --- a/app/src/main/res/layout/activity_media_pager.xml +++ b/app/src/main/res/layout/activity_media_pager.xml @@ -73,7 +73,7 @@ + android:layout_height="wrap_content"> @@ -395,8 +392,6 @@ android:id="@+id/account_tabLayout" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@color/cyanea_primary_dark_reference" - app:tabIndicatorColor="@color/cyanea_accent_dark_reference" app:tabGravity="fill" app:tabMode="fixed" /> diff --git a/app/src/main/res/layout/activity_proxy.xml b/app/src/main/res/layout/activity_proxy.xml index f1720dfd..daedaf7c 100644 --- a/app/src/main/res/layout/activity_proxy.xml +++ b/app/src/main/res/layout/activity_proxy.xml @@ -114,7 +114,6 @@ @@ -56,7 +56,7 @@ android:layout_height="wrap_content" android:layout_marginTop="20dp" android:text="@string/top_menu" - android:textColor="@color/cyanea_accent_reference" + android:textColor="?colorAccent" android:textSize="16sp" app:layout_constraintTop_toBottomOf="@+id/lv_reorder_bottom_container" /> diff --git a/app/src/main/res/layout/activity_scheduled.xml b/app/src/main/res/layout/activity_scheduled.xml index 8a556273..4d5b0b71 100644 --- a/app/src/main/res/layout/activity_scheduled.xml +++ b/app/src/main/res/layout/activity_scheduled.xml @@ -26,7 +26,6 @@ android:id="@+id/appBar" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@color/cyanea_primary_dark_reference" android:fitsSystemWindows="true"> diff --git a/app/src/main/res/layout/activity_search_result_tabs.xml b/app/src/main/res/layout/activity_search_result_tabs.xml index 0ffca4bf..065e3476 100644 --- a/app/src/main/res/layout/activity_search_result_tabs.xml +++ b/app/src/main/res/layout/activity_search_result_tabs.xml @@ -25,9 +25,7 @@ android:id="@+id/search_tabLayout" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@color/cyanea_primary_dark_reference" app:tabGravity="fill" - app:tabIndicatorColor="@color/cyanea_accent_dark_reference" app:tabMode="scrollable" /> + android:indeterminate="true" /> diff --git a/app/src/main/res/layout/activity_status_info.xml b/app/src/main/res/layout/activity_status_info.xml index 0248c2d8..ce7c2cbb 100644 --- a/app/src/main/res/layout/activity_status_info.xml +++ b/app/src/main/res/layout/activity_status_info.xml @@ -31,8 +31,7 @@ + android:layout_height="wrap_content"> diff --git a/app/src/main/res/layout/activity_trends.xml b/app/src/main/res/layout/activity_trends.xml index c4fa4f4e..c68cb883 100644 --- a/app/src/main/res/layout/activity_trends.xml +++ b/app/src/main/res/layout/activity_trends.xml @@ -25,9 +25,7 @@ android:id="@+id/search_tabLayout" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@color/cyanea_primary_dark_reference" app:tabGravity="fill" - app:tabIndicatorColor="@color/cyanea_accent_dark_reference" app:tabMode="fixed" /> + android:layout_height="wrap_content"> . --> + android:layout_height="wrap_content" /> diff --git a/app/src/main/res/layout/drawer_cache.xml b/app/src/main/res/layout/drawer_cache.xml index 5b8ecb28..be24b045 100644 --- a/app/src/main/res/layout/drawer_cache.xml +++ b/app/src/main/res/layout/drawer_cache.xml @@ -45,7 +45,6 @@ android:layout_marginTop="10dp" android:checked="true" android:text="@string/messages_in_cache_for_home" - app:buttonTint="@color/cyanea_accent_dark_reference" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/pp" /> @@ -68,7 +67,6 @@ android:layout_marginTop="10dp" android:checked="true" android:text="@string/messages_in_cache_for_other_timelines" - app:buttonTint="@color/cyanea_accent_dark_reference" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/label_home_timeline_cache_count" /> @@ -91,7 +89,6 @@ android:layout_marginTop="10dp" android:checked="false" android:text="@string/messages_stored_in_drafts" - app:buttonTint="@color/cyanea_accent_dark_reference" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/label_timelines_cache_count" /> diff --git a/app/src/main/res/layout/drawer_checkbox.xml b/app/src/main/res/layout/drawer_checkbox.xml index 06ded683..43798ea1 100644 --- a/app/src/main/res/layout/drawer_checkbox.xml +++ b/app/src/main/res/layout/drawer_checkbox.xml @@ -1,7 +1,5 @@ + android:layout_height="wrap_content" /> diff --git a/app/src/main/res/layout/drawer_conversation.xml b/app/src/main/res/layout/drawer_conversation.xml index 722c67dd..7f07c14d 100644 --- a/app/src/main/res/layout/drawer_conversation.xml +++ b/app/src/main/res/layout/drawer_conversation.xml @@ -88,7 +88,6 @@ android:layout_marginHorizontal="6dp" android:layout_marginTop="6dp" android:textAppearance="@style/TextAppearance.AppCompat.Body2" - android:textColor="@color/cyanea_accent_dark_reference" tools:text="Show content >" /> + app:icon="@drawable/ic_baseline_delete_24" /> \ No newline at end of file diff --git a/app/src/main/res/layout/drawer_fetch_more.xml b/app/src/main/res/layout/drawer_fetch_more.xml index 794f3581..10108a13 100644 --- a/app/src/main/res/layout/drawer_fetch_more.xml +++ b/app/src/main/res/layout/drawer_fetch_more.xml @@ -11,14 +11,11 @@ + app:icon="@drawable/ic_baseline_keyboard_double_arrow_down_24" /> + app:icon="@drawable/ic_baseline_keyboard_double_arrow_up_24" /> diff --git a/app/src/main/res/layout/drawer_filter.xml b/app/src/main/res/layout/drawer_filter.xml index b68cba97..4a057d61 100644 --- a/app/src/main/res/layout/drawer_filter.xml +++ b/app/src/main/res/layout/drawer_filter.xml @@ -40,25 +40,21 @@ \ No newline at end of file diff --git a/app/src/main/res/layout/drawer_follow.xml b/app/src/main/res/layout/drawer_follow.xml index 37a41359..cf6fc94e 100644 --- a/app/src/main/res/layout/drawer_follow.xml +++ b/app/src/main/res/layout/drawer_follow.xml @@ -20,7 +20,6 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="6dp" - android:backgroundTint="@color/cyanea_primary_dark_reference" app:cardElevation="0dp"> + android:src="@drawable/ic_baseline_supervised_user_circle_24" /> @@ -123,7 +121,6 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="6dp" - android:backgroundTint="@color/cyanea_accent_dark_reference" android:src="@drawable/ic_check_white_24dp" /> diff --git a/app/src/main/res/layout/drawer_instance_reg.xml b/app/src/main/res/layout/drawer_instance_reg.xml index 44e53624..c78c6eb5 100644 --- a/app/src/main/res/layout/drawer_instance_reg.xml +++ b/app/src/main/res/layout/drawer_instance_reg.xml @@ -89,12 +89,9 @@ android:layout_height="wrap_content" android:layout_marginTop="10dp" android:text="@string/watch_trends_for_instance" - android:textColor="@color/cyanea_accent_dark_reference" app:icon="@drawable/ic_baseline_remove_red_eye_24" - app:iconTint="@color/cyanea_accent_dark_reference" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintTop_toBottomOf="@+id/instance_description" - app:strokeColor="@color/cyanea_accent_dark_reference" /> + app:layout_constraintTop_toBottomOf="@+id/instance_description" /> diff --git a/app/src/main/res/layout/drawer_keyword.xml b/app/src/main/res/layout/drawer_keyword.xml index 50829c52..8f9b12c9 100644 --- a/app/src/main/res/layout/drawer_keyword.xml +++ b/app/src/main/res/layout/drawer_keyword.xml @@ -1,6 +1,5 @@ + /> \ No newline at end of file + /> \ No newline at end of file diff --git a/app/src/main/res/layout/drawer_release_note.xml b/app/src/main/res/layout/drawer_release_note.xml index 168d5db2..b45a01f8 100644 --- a/app/src/main/res/layout/drawer_release_note.xml +++ b/app/src/main/res/layout/drawer_release_note.xml @@ -24,7 +24,7 @@ diff --git a/app/src/main/res/layout/drawer_status.xml b/app/src/main/res/layout/drawer_status.xml index d6fce74a..576eeef8 100644 --- a/app/src/main/res/layout/drawer_status.xml +++ b/app/src/main/res/layout/drawer_status.xml @@ -198,7 +198,7 @@ android:layout_gravity="center_vertical|end" android:layout_marginStart="6dp" android:layout_marginEnd="6dp" - android:tint="@color/cyanea_accent_reference" + android:tint="?colorAccent" android:visibility="gone" /> @@ -224,8 +224,7 @@ android:layout_marginEnd="6dp" android:text="@string/show_content" android:textAppearance="@style/TextAppearance.AppCompat.Body2" - android:textSize="16sp" - android:textColor="@color/cyanea_accent_dark_reference" /> + android:textSize="16sp" /> + app:iconTint="?colorAccent" + app:strokeColor="?colorAccent" /> @@ -362,7 +358,6 @@ android:id="@+id/card_title" android:layout_width="match_parent" android:layout_height="wrap_content" - android:textColor="@color/cyanea_accent_dark_reference" tools:text="Title" /> @@ -465,7 +459,7 @@ android:alpha="0.8" android:gravity="center_vertical" android:padding="6dp" - android:textColor="@color/cyanea_accent_dark_reference" + android:textColor="?colorAccent" android:visibility="gone" tools:text="Fedilab" tools:visibility="visible" /> diff --git a/app/src/main/res/layout/drawer_status_compose.xml b/app/src/main/res/layout/drawer_status_compose.xml index a59feb41..a998c5ea 100644 --- a/app/src/main/res/layout/drawer_status_compose.xml +++ b/app/src/main/res/layout/drawer_status_compose.xml @@ -107,7 +107,6 @@ android:minHeight="36dp" android:text="@string/toot_sensitive" android:visibility="gone" - app:buttonTint="@color/cyanea_accent_dark_reference" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0" app:layout_constraintStart_toStartOf="parent" @@ -177,7 +176,6 @@ android:layout_height="wrap_content" android:gravity="center" android:textAlignment="center" - android:textColor="@color/cyanea_accent_dark_reference" android:textSize="16sp" android:textStyle="bold" app:layout_constraintBottom_toBottomOf="@+id/button_visibility" @@ -200,7 +198,6 @@ tools:ignore="HardcodedText" /> diff --git a/app/src/main/res/layout/drawer_status_draft.xml b/app/src/main/res/layout/drawer_status_draft.xml index 3f73d7c2..5889a576 100644 --- a/app/src/main/res/layout/drawer_status_draft.xml +++ b/app/src/main/res/layout/drawer_status_draft.xml @@ -21,7 +21,6 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="12dp" - android:backgroundTint="@color/cyanea_primary_dark_reference" app:cardElevation="0dp"> + app:layout_constraintTop_toTopOf="parent" /> diff --git a/app/src/main/res/layout/drawer_suggestion.xml b/app/src/main/res/layout/drawer_suggestion.xml index e12a5c1b..b4b109a2 100644 --- a/app/src/main/res/layout/drawer_suggestion.xml +++ b/app/src/main/res/layout/drawer_suggestion.xml @@ -21,7 +21,6 @@ android:layout_height="wrap_content" android:layout_marginHorizontal="6dp" android:layout_marginTop="6dp" - android:backgroundTint="@color/cyanea_primary_dark_reference" app:cardElevation="0dp"> + app:layout_constraintTop_toBottomOf="@id/bio" /> + android:layout_height="wrap_content" /> diff --git a/app/src/main/res/layout/fragment_notification_container.xml b/app/src/main/res/layout/fragment_notification_container.xml index 748e890c..c83695ca 100644 --- a/app/src/main/res/layout/fragment_notification_container.xml +++ b/app/src/main/res/layout/fragment_notification_container.xml @@ -30,9 +30,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" - android:background="@color/cyanea_primary_dark_reference" app:tabGravity="fill" - app:tabIndicatorColor="@color/cyanea_accent_dark_reference" app:tabMaxWidth="0dp" /> diff --git a/app/src/main/res/layout/fragment_pagination.xml b/app/src/main/res/layout/fragment_pagination.xml index f26f23ce..293002c7 100644 --- a/app/src/main/res/layout/fragment_pagination.xml +++ b/app/src/main/res/layout/fragment_pagination.xml @@ -68,7 +68,6 @@ android:visibility="gone"> @@ -86,7 +85,6 @@ android:visibility="gone"> @@ -103,7 +101,6 @@ android:contentDescription="@string/create_domain_block" android:src="@drawable/ic_baseline_add_24" android:visibility="gone" - app:backgroundTint="@color/cyanea_accent_dark_reference" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" /> diff --git a/app/src/main/res/layout/fragment_profile_timelines.xml b/app/src/main/res/layout/fragment_profile_timelines.xml index 3506aaa9..225f4072 100644 --- a/app/src/main/res/layout/fragment_profile_timelines.xml +++ b/app/src/main/res/layout/fragment_profile_timelines.xml @@ -24,8 +24,6 @@ android:id="@+id/tabLayout" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@color/cyanea_primary_dark_reference" - app:tabIndicatorColor="@color/cyanea_accent_dark_reference" app:tabGravity="fill" app:tabMaxWidth="0dp" /> diff --git a/app/src/main/res/layout/fragment_scheduled.xml b/app/src/main/res/layout/fragment_scheduled.xml index a107407b..8c3abdf4 100644 --- a/app/src/main/res/layout/fragment_scheduled.xml +++ b/app/src/main/res/layout/fragment_scheduled.xml @@ -58,7 +58,6 @@ android:visibility="gone"> diff --git a/app/src/main/res/layout/fragment_slide_media.xml b/app/src/main/res/layout/fragment_slide_media.xml index 0fd28e16..19a05ac3 100644 --- a/app/src/main/res/layout/fragment_slide_media.xml +++ b/app/src/main/res/layout/fragment_slide_media.xml @@ -26,7 +26,6 @@ android:gravity="center"> @@ -83,16 +83,14 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" - android:text="@string/context_home_list" - app:buttonTint="@color/cyanea_accent_dark_reference" /> + android:text="@string/context_home_list" /> + android:text="@string/context_public" /> + android:text="@string/context_notification" /> + android:text="@string/context_conversation" /> + android:text="@string/profiles" /> @@ -144,7 +139,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/filter_action_explanations" - android:textColor="@color/cyanea_accent_dark_reference" + android:textColor="?colorAccent" android:textSize="12sp" /> + app:icon="@drawable/ic_baseline_add_24" /> diff --git a/app/src/main/res/layout/popup_contact.xml b/app/src/main/res/layout/popup_contact.xml index 2e01bb0c..b4440164 100644 --- a/app/src/main/res/layout/popup_contact.xml +++ b/app/src/main/res/layout/popup_contact.xml @@ -19,7 +19,6 @@ android:gravity="center"> diff --git a/app/src/main/res/layout/popup_links.xml b/app/src/main/res/layout/popup_links.xml index e6c5f789..b666231f 100644 --- a/app/src/main/res/layout/popup_links.xml +++ b/app/src/main/res/layout/popup_links.xml @@ -15,9 +15,9 @@ android:layout_marginBottom="10dp" android:drawableEnd="@drawable/ic_baseline_navigate_next_24" android:text="@string/display_full_link" - android:textColor="@color/cyanea_accent_reference" + android:textColor="?colorAccent" android:textSize="16sp" - app:drawableTint="@color/cyanea_accent_reference" /> + app:drawableTint="?colorAccent" /> + app:drawableTint="?colorAccent" /> + app:drawableTint="?colorAccent" /> + app:drawableTint="?colorAccent" /> + app:drawableTint="?colorAccent" /> diff --git a/app/src/main/res/layout/popup_manage_accounts_list.xml b/app/src/main/res/layout/popup_manage_accounts_list.xml index 0b25a38e..9610980a 100644 --- a/app/src/main/res/layout/popup_manage_accounts_list.xml +++ b/app/src/main/res/layout/popup_manage_accounts_list.xml @@ -32,7 +32,6 @@ android:gravity="center"> diff --git a/app/src/main/res/layout/popup_notification_settings.xml b/app/src/main/res/layout/popup_notification_settings.xml index 636f6fc0..3236022b 100644 --- a/app/src/main/res/layout/popup_notification_settings.xml +++ b/app/src/main/res/layout/popup_notification_settings.xml @@ -13,7 +13,7 @@ diff --git a/app/src/main/res/layout/popup_release_notes.xml b/app/src/main/res/layout/popup_release_notes.xml index 635615a1..bff3d88b 100644 --- a/app/src/main/res/layout/popup_release_notes.xml +++ b/app/src/main/res/layout/popup_release_notes.xml @@ -96,9 +96,7 @@ android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginTop="10dp" - android:text="@string/support_the_app_on_liberapay" - android:textColor="@color/cyanea_accent_dark_reference" - app:strokeColor="@color/cyanea_accent_dark_reference" /> + android:text="@string/support_the_app_on_liberapay" /> diff --git a/app/src/main/res/layout/popup_status_theme.xml b/app/src/main/res/layout/popup_status_theme.xml index 2d52bcfb..4d6f6e20 100644 --- a/app/src/main/res/layout/popup_status_theme.xml +++ b/app/src/main/res/layout/popup_status_theme.xml @@ -147,8 +147,7 @@ android:text="@string/display_toot_truncate" android:textAllCaps="false" android:textSize="14sp" - android:visibility="gone" - app:strokeColor="@color/cyanea_accent_dark_reference" /> + android:visibility="gone" /> diff --git a/app/src/main/res/layout/simple_bar.xml b/app/src/main/res/layout/simple_bar.xml index c96d1203..2af01a10 100644 --- a/app/src/main/res/layout/simple_bar.xml +++ b/app/src/main/res/layout/simple_bar.xml @@ -20,7 +20,6 @@ android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@color/cyanea_primary_reference" android:contentInsetStart="0dp" android:contentInsetLeft="0dp" android:contentInsetEnd="0dp" diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 23c398ee..363caea0 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -6,7 +6,7 @@ #d9d9d9 - + @color/mastodonC4 #FFEA00 #42A5F5 @@ -70,8 +70,6 @@ #EF5350 - #0288D1 - #2b90d9 #f3f3f3 diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index d012d1ad..11bf5ab8 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -5,47 +5,14 @@ - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - -