Add the ability to timed-mute from profiles
This commit is contained in:
parent
3f8f15256d
commit
fa760ba959
|
@ -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);
|
||||
|
|
|
@ -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 -> {
|
||||
|
|
|
@ -21,6 +21,11 @@
|
|||
android:icon="@drawable/ic_baseline_volume_mute_24"
|
||||
android:title="@string/more_action_1"
|
||||
app:showAsAction="never" />
|
||||
<item
|
||||
android:id="@+id/action_timed_mute"
|
||||
android:icon="@drawable/ic_baseline_volume_mute_24"
|
||||
android:title="@string/more_action_8"
|
||||
app:showAsAction="never" />
|
||||
<item
|
||||
android:id="@+id/action_block"
|
||||
android:icon="@drawable/ic_baseline_block_24"
|
||||
|
|
Loading…
Reference in New Issue