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 a307495c..4c5e37ad 100644 --- a/app/src/main/java/app/fedilab/android/activities/ProfileActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/ProfileActivity.java @@ -646,6 +646,7 @@ public class ProfileActivity extends BaseActivity { menu.findItem(R.id.action_block).setVisible(false); menu.findItem(R.id.action_report).setVisible(false); menu.findItem(R.id.action_mute).setVisible(false); + menu.findItem(R.id.action_timed_mute).setVisible(false); menu.findItem(R.id.action_mention).setVisible(false); menu.findItem(R.id.action_follow_instance).setVisible(false); menu.findItem(R.id.action_block_instance).setVisible(false); @@ -656,6 +657,7 @@ public class ProfileActivity extends BaseActivity { } else { menu.findItem(R.id.action_block).setVisible(true); menu.findItem(R.id.action_mute).setVisible(true); + menu.findItem(R.id.action_timed_mute).setVisible(true); menu.findItem(R.id.action_mention).setVisible(true); } //Update menu title depending of relationship @@ -933,6 +935,12 @@ public class ProfileActivity extends BaseActivity { doActionAccount = action.NOTHING; } + } else if (itemId == R.id.action_timed_mute) { + MastodonHelper.scheduleBoost(ProfileActivity.this, MastodonHelper.ScheduleType.TIMED_MUTED, null, account, rs -> { + this.relationship = rs; + updateAccount(); + }); + return true; } else if (itemId == R.id.action_report) { builderInner = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle()); builderInner.setTitle(R.string.report_account); 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 a769e91f..59f81791 100644 --- a/app/src/main/java/app/fedilab/android/helper/MastodonHelper.java +++ b/app/src/main/java/app/fedilab/android/helper/MastodonHelper.java @@ -358,6 +358,9 @@ public class MastodonHelper { dialogBuilder.setView(binding.getRoot()); final AlertDialog alertDialogBoost = dialogBuilder.create(); binding.timePicker.setIs24HourView(true); + binding.dateTimeNext.setBackgroundTintList(ThemeHelper.getButtonActionColorStateList(context)); + binding.dateTimePrevious.setBackgroundTintList(ThemeHelper.getButtonActionColorStateList(context)); + binding.dateTimeSet.setBackgroundTintList(ThemeHelper.getButtonActionColorStateList(context)); //Buttons management binding.dateTimeCancel.setOnClickListener(v -> alertDialogBoost.dismiss()); binding.dateTimeNext.setOnClickListener(v -> { diff --git a/app/src/main/res/menu/activity_profile.xml b/app/src/main/res/menu/activity_profile.xml index 0b1275d6..d34cfd13 100644 --- a/app/src/main/res/menu/activity_profile.xml +++ b/app/src/main/res/menu/activity_profile.xml @@ -21,6 +21,11 @@ android:icon="@drawable/ic_baseline_volume_mute_24" android:title="@string/more_action_1" app:showAsAction="never" /> +