diff options
author | Thomas <tschneider.ac@gmail.com> | 2022-11-28 11:46:48 +0100 |
---|---|---|
committer | Thomas <tschneider.ac@gmail.com> | 2022-11-28 11:46:48 +0100 |
commit | 4ea542c1f87247addb512ef858c5750ba0428c4c (patch) | |
tree | fd437a85eebed73f8f72bd74f2ba03971688ce1f | |
parent | ccf7ac5cffebd25cbbde921a14aa3b51a474845c (diff) |
Some changes
35 files changed, 181 insertions, 126 deletions
diff --git a/app/build.gradle b/app/build.gradle index 2b854be5e..6d17f37fb 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -116,7 +116,7 @@ dependencies { implementation "ch.acra:acra-mail:5.9.6" implementation "ch.acra:acra-limiter:5.9.3" implementation "ch.acra:acra-dialog:5.9.6" - + implementation 'com.github.Dhaval2404:ColorPicker:2.3' implementation "com.madgag.spongycastle:bctls-jdk15on:1.58.0.0" implementation 'com.github.UnifiedPush:android-connector:2.0.1' // implementation 'com.github.UnifiedPush:android-foss_embedded_fcm_distributor:1.0.0-beta1' 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 78df3fe85..24c3319bd 100644 --- a/app/src/main/java/app/fedilab/android/activities/AboutActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/AboutActivity.java @@ -80,7 +80,7 @@ public class AboutActivity extends BaseActivity { } else { binding.aboutSupportPaypal.setVisibility(View.GONE); } - binding.accountFollow.setImageResource(R.drawable.ic_baseline_person_add_24); + binding.accountFollow.setIconResource(R.drawable.ic_baseline_person_add_24); binding.aboutWebsite.setOnClickListener(v -> Helper.openBrowser(AboutActivity.this, "https://fedilab.app")); CrossActionHelper.fetchRemoteAccount(AboutActivity.this, "@apps@toot.fedilab.app", new CrossActionHelper.Callback() { @Override 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 3d7955b03..52a3de4c4 100644 --- a/app/src/main/java/app/fedilab/android/activities/PartnerShipActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/PartnerShipActivity.java @@ -64,7 +64,7 @@ public class PartnerShipActivity extends BaseActivity { }); binding.accountFollow.setBackgroundTintList(ThemeHelper.getButtonActionColorStateList(PartnerShipActivity.this)); setTitle(R.string.action_partnership); - binding.accountFollow.setImageResource(R.drawable.ic_baseline_person_add_24); + binding.accountFollow.setIconResource(R.drawable.ic_baseline_person_add_24); CrossActionHelper.fetchRemoteAccount(PartnerShipActivity.this, "@mastohost@mastodon.social", new CrossActionHelper.Callback() { @Override public void federatedStatus(Status status) { 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 3cfa1a245..2328bb297 100644 --- a/app/src/main/java/app/fedilab/android/activities/ProfileActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/ProfileActivity.java @@ -527,7 +527,7 @@ public class ProfileActivity extends BaseActivity { //Visibility depending of the relationship if (relationship != null) { if (relationship.blocked_by) { - binding.accountFollow.setImageResource(R.drawable.ic_baseline_person_add_24); + binding.accountFollow.setIconResource(R.drawable.ic_baseline_person_add_24); binding.accountFollow.setVisibility(View.VISIBLE); binding.accountFollow.setEnabled(false); binding.accountFollow.setContentDescription(getString(R.string.action_disabled)); @@ -535,7 +535,7 @@ public class ProfileActivity extends BaseActivity { if (relationship.requested) { binding.accountFollowRequest.setVisibility(View.VISIBLE); - binding.accountFollow.setImageResource(R.drawable.ic_baseline_hourglass_full_24); + binding.accountFollow.setIconResource(R.drawable.ic_baseline_hourglass_full_24); binding.accountFollow.setVisibility(View.VISIBLE); binding.accountFollow.setContentDescription(getString(R.string.follow_request)); doAction = action.UNFOLLOW; @@ -546,19 +546,19 @@ public class ProfileActivity extends BaseActivity { binding.accountFollowedBy.setVisibility(View.GONE); } if (relationship.following) { - binding.accountFollow.setImageResource(R.drawable.ic_baseline_person_remove_24); + binding.accountFollow.setIconResource(R.drawable.ic_baseline_person_remove_24); binding.accountFollow.setBackgroundTintList(ColorStateList.valueOf(ContextCompat.getColor(ProfileActivity.this, R.color.red_1))); doAction = action.UNFOLLOW; binding.accountFollow.setContentDescription(getString(R.string.action_unfollow)); binding.accountFollow.setVisibility(View.VISIBLE); } else if (relationship.blocking) { binding.accountFollow.setBackgroundTintList(ColorStateList.valueOf(ContextCompat.getColor(ProfileActivity.this, R.color.red_1))); - binding.accountFollow.setImageResource(R.drawable.ic_baseline_lock_open_24); + binding.accountFollow.setIconResource(R.drawable.ic_baseline_lock_open_24); doAction = action.UNBLOCK; binding.accountFollow.setVisibility(View.VISIBLE); binding.accountFollow.setContentDescription(getString(R.string.action_unblock)); } else { - binding.accountFollow.setImageResource(R.drawable.ic_baseline_person_add_24); + binding.accountFollow.setIconResource(R.drawable.ic_baseline_person_add_24); doAction = action.FOLLOW; binding.accountFollow.setVisibility(View.VISIBLE); binding.accountFollow.setContentDescription(getString(R.string.action_follow)); @@ -577,9 +577,9 @@ public class ProfileActivity extends BaseActivity { binding.accountNotification.setVisibility(View.VISIBLE); } if (relationship.notifying) { - binding.accountNotification.setImageResource(R.drawable.ic_baseline_notifications_active_24); + binding.accountNotification.setIconResource(R.drawable.ic_baseline_notifications_active_24); } else { - binding.accountNotification.setImageResource(R.drawable.ic_baseline_notifications_off_24); + binding.accountNotification.setIconResource(R.drawable.ic_baseline_notifications_off_24); } binding.accountNotification.setOnClickListener(v -> { if (relationship != null && relationship.following) { diff --git a/app/src/main/java/app/fedilab/android/activities/ThemeSettingsActivity.java b/app/src/main/java/app/fedilab/android/activities/ThemeSettingsActivity.java new file mode 100644 index 000000000..6e885c3df --- /dev/null +++ b/app/src/main/java/app/fedilab/android/activities/ThemeSettingsActivity.java @@ -0,0 +1,53 @@ +package app.fedilab.android.activities; +/* Copyright 2022 Thomas Schneider + * + * This file is a part of Fedilab + * + * This program is free software; you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation; either version 3 of the + * License, or (at your option) any later version. + * + * Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even + * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + * Public License for more details. + * + * You should have received a copy of the GNU General Public License along with Fedilab; if not, + * see <http://www.gnu.org/licenses>. */ + + +import android.os.Bundle; +import android.view.MenuItem; + +import app.fedilab.android.databinding.ActivityAboutBinding; + + +public class ThemeSettingsActivity extends BaseActivity { + + + private ActivityAboutBinding binding; + + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + binding = ActivityAboutBinding.inflate(getLayoutInflater()); + setContentView(binding.getRoot()); + + if (getSupportActionBar() != null) { + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + } + + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + if (item.getItemId() == android.R.id.home) { + finish(); + return true; + } + return super.onOptionsItemSelected(item); + } + + +} diff --git a/app/src/main/res/layout/account_field_item.xml b/app/src/main/res/layout/account_field_item.xml index a7a46760a..ce360d85f 100644 --- a/app/src/main/res/layout/account_field_item.xml +++ b/app/src/main/res/layout/account_field_item.xml @@ -39,7 +39,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/remove" - style="@style/Widget.MaterialComponents.Button.OutlinedButton" + style="@style/Widget.Material3.Button.OutlinedButton" android:layout_width="36dp" android:layout_height="36dp" android:layout_margin="6dp" diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml index cee4597aa..19874f8e5 100644 --- a/app/src/main/res/layout/activity_about.xml +++ b/app/src/main/res/layout/activity_about.xml @@ -98,9 +98,9 @@ </androidx.appcompat.widget.LinearLayoutCompat> - <androidx.appcompat.widget.AppCompatImageButton + <com.google.android.material.button.MaterialButton android:id="@+id/account_follow" - style="@style/Widget.AppCompat.Button.Colored" + style="@style/Widget.Material3.Button.Icon" android:layout_width="48dp" android:layout_height="48dp" android:layout_margin="10dp" @@ -110,7 +110,7 @@ android:visibility="gone" app:layout_constraintStart_toEndOf="@id/avatar_container" app:layout_constraintTop_toBottomOf="@id/banner_container" - tools:src="@drawable/ic_baseline_person_add_24" + tools:icon="@drawable/ic_baseline_person_add_24" tools:visibility="visible" /> </androidx.appcompat.widget.LinearLayoutCompat> @@ -126,7 +126,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/about_support" - style="@style/Widget.MaterialComponents.Button.OutlinedButton" + style="@style/Widget.Material3.Button.OutlinedButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" @@ -136,7 +136,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/about_support_paypal" - style="@style/Widget.MaterialComponents.Button.OutlinedButton" + style="@style/Widget.Material3.Button.OutlinedButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" diff --git a/app/src/main/res/layout/activity_actions.xml b/app/src/main/res/layout/activity_actions.xml index d97c478c6..a1c7c1438 100644 --- a/app/src/main/res/layout/activity_actions.xml +++ b/app/src/main/res/layout/activity_actions.xml @@ -14,7 +14,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/muted" - style="@style/Widget.MaterialComponents.Button.OutlinedButton" + style="@style/Widget.Material3.Button.OutlinedButton" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingVertical="12dp" @@ -28,7 +28,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/blocked" - style="@style/Widget.MaterialComponents.Button.OutlinedButton" + style="@style/Widget.Material3.Button.OutlinedButton" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="24dp" @@ -43,7 +43,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/bookmarks" - style="@style/Widget.MaterialComponents.Button.OutlinedButton" + style="@style/Widget.Material3.Button.OutlinedButton" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="24dp" @@ -58,7 +58,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/favourites" - style="@style/Widget.MaterialComponents.Button.OutlinedButton" + style="@style/Widget.Material3.Button.OutlinedButton" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="24dp" @@ -74,7 +74,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/domain_block" - style="@style/Widget.MaterialComponents.Button.OutlinedButton" + style="@style/Widget.Material3.Button.OutlinedButton" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="24dp" diff --git a/app/src/main/res/layout/activity_admin_account.xml b/app/src/main/res/layout/activity_admin_account.xml index d0eba40ed..974846b20 100644 --- a/app/src/main/res/layout/activity_admin_account.xml +++ b/app/src/main/res/layout/activity_admin_account.xml @@ -388,7 +388,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/approve_action" - style="@style/Widget.MaterialComponents.Button.OutlinedButton" + style="@style/Widget.Material3.Button.OutlinedButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="5dp" @@ -416,7 +416,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/disable_action" - style="@style/Widget.MaterialComponents.Button.OutlinedButton" + style="@style/Widget.Material3.Button.OutlinedButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="5dp" @@ -444,7 +444,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/silence_action" - style="@style/Widget.MaterialComponents.Button.OutlinedButton" + style="@style/Widget.Material3.Button.OutlinedButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="5dp" @@ -472,7 +472,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/suspend_action" - style="@style/Widget.MaterialComponents.Button.OutlinedButton" + style="@style/Widget.Material3.Button.OutlinedButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="5dp" diff --git a/app/src/main/res/layout/activity_admin_actions.xml b/app/src/main/res/layout/activity_admin_actions.xml index 9f352c4bf..516e22ba3 100644 --- a/app/src/main/res/layout/activity_admin_actions.xml +++ b/app/src/main/res/layout/activity_admin_actions.xml @@ -14,7 +14,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/reports" - style="@style/Widget.MaterialComponents.Button.OutlinedButton" + style="@style/Widget.Material3.Button.OutlinedButton" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingVertical="12dp" @@ -25,7 +25,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/accounts" - style="@style/Widget.MaterialComponents.Button.OutlinedButton" + style="@style/Widget.Material3.Button.OutlinedButton" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="24dp" @@ -37,7 +37,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/domains" - style="@style/Widget.MaterialComponents.Button.OutlinedButton" + style="@style/Widget.Material3.Button.OutlinedButton" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="24dp" diff --git a/app/src/main/res/layout/activity_admin_domainblock.xml b/app/src/main/res/layout/activity_admin_domainblock.xml index 4c84c2f09..407541f8e 100644 --- a/app/src/main/res/layout/activity_admin_domainblock.xml +++ b/app/src/main/res/layout/activity_admin_domainblock.xml @@ -142,7 +142,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/save_changes" - style="@style/Widget.MaterialComponents.Button.OutlinedButton" + style="@style/Widget.Material3.Button.OutlinedButton" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="end" diff --git a/app/src/main/res/layout/activity_admin_report.xml b/app/src/main/res/layout/activity_admin_report.xml index bee3888cd..69d2d2f01 100644 --- a/app/src/main/res/layout/activity_admin_report.xml +++ b/app/src/main/res/layout/activity_admin_report.xml @@ -27,7 +27,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/assign" - style="@style/Widget.MaterialComponents.Button.OutlinedButton" + style="@style/Widget.Material3.Button.OutlinedButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="5dp" @@ -37,7 +37,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/status" - style="@style/Widget.MaterialComponents.Button.OutlinedButton" + style="@style/Widget.Material3.Button.OutlinedButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="5dp" @@ -211,7 +211,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/reject" - style="@style/Widget.MaterialComponents.Button.OutlinedButton" + style="@style/Widget.Material3.Button.OutlinedButton" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginStart="5dp" @@ -223,7 +223,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/allow" - style="@style/Widget.MaterialComponents.Button.OutlinedButton" + style="@style/Widget.Material3.Button.OutlinedButton" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginStart="5dp" @@ -249,7 +249,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/warn" - style="@style/Widget.MaterialComponents.Button.OutlinedButton" + style="@style/Widget.Material3.Button.OutlinedButton" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginStart="5dp" @@ -261,7 +261,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/disable" - style="@style/Widget.MaterialComponents.Button.OutlinedButton" + style="@style/Widget.Material3.Button.OutlinedButton" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginStart="5dp" @@ -281,7 +281,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/silence" - style="@style/Widget.MaterialComponents.Button.OutlinedButton" + style="@style/Widget.Material3.Button.OutlinedButton" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginStart="5dp" @@ -293,7 +293,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/suspend" - style="@style/Widget.MaterialComponents.Button.OutlinedButton" + style="@style/Widget.Material3.Button.OutlinedButton" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginStart="5dp" diff --git a/app/src/main/res/layout/activity_edit_profile.xml b/app/src/main/res/layout/activity_edit_profile.xml index a0e42f0d2..06c914e90 100644 --- a/app/src/main/res/layout/activity_edit_profile.xml +++ b/app/src/main/res/layout/activity_edit_profile.xml @@ -63,7 +63,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/header_select" - style="@style/Widget.MaterialComponents.Button.OutlinedButton" + style="@style/Widget.Material3.Button.OutlinedButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/select" @@ -113,7 +113,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/avatar_select" - style="@style/Widget.MaterialComponents.Button.OutlinedButton" + style="@style/Widget.Material3.Button.OutlinedButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="6dp" @@ -176,7 +176,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/add_field" - style="@style/Widget.MaterialComponents.Button.OutlinedButton" + style="@style/Widget.Material3.Button.OutlinedButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="end" @@ -193,7 +193,7 @@ android:layout_marginHorizontal="12dp" android:layout_marginTop="12dp" android:text="@string/toots_visibility_title" - android:textAppearance="@style/TextAppearance.MaterialComponents.Body1" + android:textAppearance="@style/TextAppearance.Material3.BodyMedium" app:layout_constraintTop_toBottomOf="@id/fields" /> <com.google.android.material.button.MaterialButtonToggleGroup @@ -278,7 +278,7 @@ android:layout_marginHorizontal="12dp" android:layout_marginTop="12dp" android:text="@string/set_lock_account" - android:textAppearance="@style/TextAppearance.MaterialComponents.Body1" + android:textAppearance="@style/TextAppearance.Material3.BodyMedium" app:layout_constraintTop_toBottomOf="@id/discoverable" /> <com.google.android.material.button.MaterialButtonToggleGroup diff --git a/app/src/main/res/layout/activity_instance.xml b/app/src/main/res/layout/activity_instance.xml index 72076e864..62002d4f2 100644 --- a/app/src/main/res/layout/activity_instance.xml +++ b/app/src/main/res/layout/activity_instance.xml @@ -167,7 +167,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/close" - style="@style/Widget.MaterialComponents.Button.OutlinedButton" + style="@style/Widget.Material3.Button.OutlinedButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="10dp" diff --git a/app/src/main/res/layout/activity_partnership.xml b/app/src/main/res/layout/activity_partnership.xml index fd31f1c04..6665a910c 100644 --- a/app/src/main/res/layout/activity_partnership.xml +++ b/app/src/main/res/layout/activity_partnership.xml @@ -89,9 +89,9 @@ </androidx.appcompat.widget.LinearLayoutCompat> - <androidx.appcompat.widget.AppCompatImageButton + <com.google.android.material.button.MaterialButton android:id="@+id/account_follow" - style="@style/Widget.AppCompat.Button.Colored" + style="@style/Widget.Material3.Button.Icon" android:layout_width="48dp" android:layout_height="48dp" android:layout_margin="10dp" @@ -101,7 +101,7 @@ android:visibility="gone" app:layout_constraintStart_toEndOf="@id/avatar_container" app:layout_constraintTop_toBottomOf="@id/banner_container" - tools:src="@drawable/ic_baseline_person_add_24" + tools:icon="@drawable/ic_baseline_person_add_24" tools:visibility="visible" /> </androidx.appcompat.widget.LinearLayoutCompat> diff --git a/app/src/main/res/layout/activity_profile.xml b/app/src/main/res/layout/activity_profile.xml index 2f3ef9ee6..88d37276a 100644 --- a/app/src/main/res/layout/activity_profile.xml +++ b/app/src/main/res/layout/activity_profile.xml @@ -86,9 +86,9 @@ </com.google.android.material.card.MaterialCardView> - <androidx.appcompat.widget.AppCompatImageButton + <com.google.android.material.button.MaterialButton android:id="@+id/account_follow" - style="@style/Widget.AppCompat.Button.Colored" + style="@style/Widget.Material3.Button.Icon" android:layout_width="48dp" android:layout_height="48dp" android:layout_marginStart="6dp" @@ -98,34 +98,34 @@ android:visibility="gone" app:layout_constraintStart_toEndOf="@id/avatar_container" app:layout_constraintTop_toBottomOf="@id/banner_container" - tools:src="@drawable/ic_baseline_person_add_24" + tools:icon="@drawable/ic_baseline_person_add_24" tools:visibility="visible" /> - <androidx.appcompat.widget.AppCompatImageButton + <com.google.android.material.button.MaterialButton android:id="@+id/account_notification" - style="@style/Widget.AppCompat.Button.Borderless.Colored" + style="@style/Widget.Material3.Button.Icon" android:layout_width="48dp" android:layout_height="48dp" android:layout_marginTop="6dp" android:layout_marginEnd="6dp" android:contentDescription="@string/set_notify" android:scaleType="fitCenter" |