Allow cancelling notice

pull/209/head
M66B 2 years ago
parent edacd3c68c
commit 4c1eff1bea

@ -264,8 +264,9 @@ public class FragmentMessages extends FragmentBase
private SwipeRefreshLayoutEx swipeRefresh; private SwipeRefreshLayoutEx swipeRefresh;
private TextView tvAirplane; private TextView tvAirplane;
private TextView tvNotifications; private TextView tvNotifications;
private TextView tvSupport;
private TextView tvCancelled; private TextView tvCancelled;
private ImageButton ibCancelled;
private TextView tvSupport;
private ImageButton ibHintSupport; private ImageButton ibHintSupport;
private ImageButton ibHintSwipe; private ImageButton ibHintSwipe;
private ImageButton ibHintSelect; private ImageButton ibHintSelect;
@ -288,6 +289,7 @@ public class FragmentMessages extends FragmentBase
private ContentLoadingProgressBar pbWait; private ContentLoadingProgressBar pbWait;
private Group grpAirplane; private Group grpAirplane;
private Group grpNotifications; private Group grpNotifications;
private Group grpCancelled;
private Group grpSupport; private Group grpSupport;
private Group grpHintSupport; private Group grpHintSupport;
private Group grpHintSwipe; private Group grpHintSwipe;
@ -551,8 +553,9 @@ public class FragmentMessages extends FragmentBase
swipeRefresh = view.findViewById(R.id.swipeRefresh); swipeRefresh = view.findViewById(R.id.swipeRefresh);
tvAirplane = view.findViewById(R.id.tvAirplane); tvAirplane = view.findViewById(R.id.tvAirplane);
tvNotifications = view.findViewById(R.id.tvNotifications); tvNotifications = view.findViewById(R.id.tvNotifications);
tvSupport = view.findViewById(R.id.tvSupport);
tvCancelled = view.findViewById(R.id.tvCancelled); tvCancelled = view.findViewById(R.id.tvCancelled);
ibCancelled = view.findViewById(R.id.ibCancelled);
tvSupport = view.findViewById(R.id.tvSupport);
ibHintSupport = view.findViewById(R.id.ibHintSupport); ibHintSupport = view.findViewById(R.id.ibHintSupport);
ibHintSwipe = view.findViewById(R.id.ibHintSwipe); ibHintSwipe = view.findViewById(R.id.ibHintSwipe);
ibHintSelect = view.findViewById(R.id.ibHintSelect); ibHintSelect = view.findViewById(R.id.ibHintSelect);
@ -576,6 +579,7 @@ public class FragmentMessages extends FragmentBase
pbWait = view.findViewById(R.id.pbWait); pbWait = view.findViewById(R.id.pbWait);
grpAirplane = view.findViewById(R.id.grpAirplane); grpAirplane = view.findViewById(R.id.grpAirplane);
grpNotifications = view.findViewById(R.id.grpNotifications); grpNotifications = view.findViewById(R.id.grpNotifications);
grpCancelled = view.findViewById(R.id.grpCancelled);
grpSupport = view.findViewById(R.id.grpSupport); grpSupport = view.findViewById(R.id.grpSupport);
grpHintSupport = view.findViewById(R.id.grpHintSupport); grpHintSupport = view.findViewById(R.id.grpHintSupport);
grpHintSwipe = view.findViewById(R.id.grpHintSwipe); grpHintSwipe = view.findViewById(R.id.grpHintSwipe);
@ -648,9 +652,16 @@ public class FragmentMessages extends FragmentBase
} }
}); });
//tvCancelled.setVisibility(BuildConfig.DEBUG ? View.GONE : View.VISIBLE);
tvCancelled.setMovementMethod(LinkMovementMethod.getInstance()); tvCancelled.setMovementMethod(LinkMovementMethod.getInstance());
ibCancelled.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
prefs.edit().putBoolean("app_cancelled", true).apply();
grpCancelled.setVisibility(View.GONE);
}
});
ibHintSupport.setOnClickListener(new View.OnClickListener() { ibHintSupport.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
@ -4392,12 +4403,14 @@ public class FragmentMessages extends FragmentBase
boolean junk = EntityFolder.JUNK.equals(type); boolean junk = EntityFolder.JUNK.equals(type);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
boolean app_cancelled = prefs.getBoolean("app_cancelled", false);
boolean app_support = prefs.getBoolean("app_support", false); boolean app_support = prefs.getBoolean("app_support", false);
boolean message_swipe = prefs.getBoolean("message_swipe", false); boolean message_swipe = prefs.getBoolean("message_swipe", false);
boolean message_select = prefs.getBoolean("message_select", false); boolean message_select = prefs.getBoolean("message_select", false);
boolean message_junk = prefs.getBoolean("message_junk", false); boolean message_junk = prefs.getBoolean("message_junk", false);
boolean send_pending = prefs.getBoolean("send_pending", true); boolean send_pending = prefs.getBoolean("send_pending", true);
grpCancelled.setVisibility(app_cancelled || !hints || junk ? View.GONE : View.VISIBLE);
grpHintSupport.setVisibility(app_support || !hints || junk ? View.GONE : View.VISIBLE); grpHintSupport.setVisibility(app_support || !hints || junk ? View.GONE : View.VISIBLE);
grpHintSwipe.setVisibility(message_swipe || !hints || junk ? View.GONE : View.VISIBLE); grpHintSwipe.setVisibility(message_swipe || !hints || junk ? View.GONE : View.VISIBLE);
grpHintSelect.setVisibility(message_select || !hints || junk ? View.GONE : View.VISIBLE); grpHintSelect.setVisibility(message_select || !hints || junk ? View.GONE : View.VISIBLE);

@ -243,7 +243,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
}; };
private final static String[] RESET_QUESTIONS = new String[]{ private final static String[] RESET_QUESTIONS = new String[]{
"first", "app_support", "notify_archive", "first", "app_cancelled", "app_support", "notify_archive",
"message_swipe", "message_select", "message_junk", "message_swipe", "message_select", "message_junk",
"folder_actions", "folder_sync", "folder_actions", "folder_sync",
"crash_reports_asked", "review_asked", "review_later", "why", "crash_reports_asked", "review_asked", "review_later", "why",

@ -88,16 +88,28 @@
<TextView <TextView
android:id="@+id/tvCancelled" android:id="@+id/tvCancelled"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:padding="6dp" android:padding="6dp"
android:text="@string/app_cancelled" android:text="@string/app_cancelled"
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toStartOf="@+id/ibCancelled"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/vSeparatorSupport" /> app:layout_constraintTop_toBottomOf="@+id/vSeparatorSupport" />
<ImageButton
android:id="@+id/ibCancelled"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_legend_close_hint"
android:padding="9dp"
app:layout_constraintBottom_toBottomOf="@id/tvCancelled"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/tvCancelled"
app:srcCompat="@drawable/twotone_close_24" />
<View <View
android:id="@+id/vSeparatorCancelled" android:id="@+id/vSeparatorCancelled"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -488,6 +500,12 @@
android:layout_height="0dp" android:layout_height="0dp"
app:constraint_referenced_ids="tvSupport,vSeparatorSupport" /> app:constraint_referenced_ids="tvSupport,vSeparatorSupport" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpCancelled"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="tvCancelled,ibCancelled,vSeparatorCancelled" />
<androidx.constraintlayout.widget.Group <androidx.constraintlayout.widget.Group
android:id="@+id/grpHintSupport" android:id="@+id/grpHintSupport"
android:layout_width="0dp" android:layout_width="0dp"

Loading…
Cancel
Save