feat: propagate row clicks to child

This commit is contained in:
FineFindus
2024-04-02 20:04:40 +02:00
parent e6501ad8a3
commit fe96ee5f2a
2 changed files with 4 additions and 0 deletions

View File

@@ -85,6 +85,9 @@ public abstract class AccountRestrictionConfirmationSheet extends BottomSheet{
} }
AutoOrientationLinearLayout layout = new AutoOrientationLinearLayout(getContext()); AutoOrientationLinearLayout layout = new AutoOrientationLinearLayout(getContext());
// allow complete row to trigger child click listener
if(view.hasOnClickListeners())
layout.setOnClickListener(v -> view.performClick());
LinearLayout.LayoutParams lp=new LinearLayout.LayoutParams(0,ViewGroup.LayoutParams.WRAP_CONTENT); LinearLayout.LayoutParams lp=new LinearLayout.LayoutParams(0,ViewGroup.LayoutParams.WRAP_CONTENT);
lp.gravity=Gravity.CENTER; lp.gravity=Gravity.CENTER;
lp.weight=1f; lp.weight=1f;

View File

@@ -34,6 +34,7 @@ public class MuteAccountConfirmationSheet extends AccountRestrictionConfirmation
m3Switch.setClickable(true); m3Switch.setClickable(true);
m3Switch.setChecked(muteNotifications.get()); m3Switch.setChecked(muteNotifications.get());
m3Switch.setOnCheckedChangeListener((compoundButton, b) -> muteNotifications.set(b)); m3Switch.setOnCheckedChangeListener((compoundButton, b) -> muteNotifications.set(b));
m3Switch.setOnClickListener(view -> muteNotifications.set(m3Switch.isSelected()));
addRow(R.drawable.ic_fluent_alert_off_24_regular, R.string.mo_mute_notifications, m3Switch); addRow(R.drawable.ic_fluent_alert_off_24_regular, R.string.mo_mute_notifications, m3Switch);
// add mute duration (Moshidon) // add mute duration (Moshidon)