Skip to content

Commit

Permalink
feat: propagate row clicks to child
Browse files Browse the repository at this point in the history
  • Loading branch information
FineFindus committed Apr 2, 2024
1 parent e6501ad commit fe96ee5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ protected void addRow(@DrawableRes int icon, CharSequence text, View view) {
}

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);
lp.gravity=Gravity.CENTER;
lp.weight=1f;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public MuteAccountConfirmationSheet(@NonNull Context context, Account user, Atom
m3Switch.setClickable(true);
m3Switch.setChecked(muteNotifications.get());
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);

// add mute duration (Moshidon)
Expand Down

0 comments on commit fe96ee5

Please sign in to comment.