Added extra button

pull/207/head
M66B 3 years ago
parent ce5499e91f
commit c31ef322a0

@ -116,6 +116,7 @@ public class FragmentSetup extends FragmentBase {
private CardView cardExtra;
private Button btnApp;
private Button btnNotification;
private Button btnDelete;
private Button btnMore;
private Button btnSupport;
@ -190,6 +191,7 @@ public class FragmentSetup extends FragmentBase {
cardExtra = view.findViewById(R.id.cardExtra);
btnApp = view.findViewById(R.id.btnApp);
btnNotification = view.findViewById(R.id.btnNotification);
btnDelete = view.findViewById(R.id.btnDelete);
btnMore = view.findViewById(R.id.btnMore);
btnSupport = view.findViewById(R.id.btnSupport);
@ -619,6 +621,18 @@ public class FragmentSetup extends FragmentBase {
}
});
final Intent channelService = new Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS)
.putExtra(Settings.EXTRA_APP_PACKAGE, getContext().getPackageName())
.putExtra(Settings.EXTRA_CHANNEL_ID, "service");
btnNotification.setEnabled(channelService.resolveActivity(pm) != null); // system whitelisted
btnNotification.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(channelService);
}
});
btnMore.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

@ -909,6 +909,18 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvExtra" />
<Button
android:id="@+id/btnNotification"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:drawableEnd="@drawable/twotone_compare_arrows_24"
android:drawablePadding="6dp"
android:text="@string/title_advanced_notifications_service"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnApp" />
<Button
android:id="@+id/btnDelete"
style="?android:attr/buttonStyleSmall"
@ -919,7 +931,7 @@
android:drawablePadding="6dp"
android:text="@string/title_delete_account"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnApp" />
app:layout_constraintTop_toBottomOf="@id/btnNotification" />
<Button
android:id="@+id/btnMore"
@ -989,7 +1001,7 @@
android:id="@+id/grpExtra"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="btnApp,btnDelete,btnMore" />
app:constraint_referenced_ids="btnApp,btnNotification,btnDelete,btnMore" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</androidx.constraintlayout.widget.ConstraintLayout>

Loading…
Cancel
Save