Added extra reorder accounts button

This commit is contained in:
M66B 2022-07-02 13:28:43 +02:00
parent 38799fe4a3
commit 3dccc7bfd9
4 changed files with 29 additions and 3 deletions

View File

@ -162,6 +162,7 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
static final String ACTION_MANAGE_LOCAL_CONTACTS = BuildConfig.APPLICATION_ID + ".MANAGE_LOCAL_CONTACTS";
static final String ACTION_MANAGE_CERTIFICATES = BuildConfig.APPLICATION_ID + ".MANAGE_CERTIFICATES";
static final String ACTION_IMPORT_CERTIFICATE = BuildConfig.APPLICATION_ID + ".IMPORT_CERTIFICATE";
static final String ACTION_SETUP_REORDER = BuildConfig.APPLICATION_ID + ".SETUP_REORDER";
static final String ACTION_SETUP_MORE = BuildConfig.APPLICATION_ID + ".SETUP_MORE";
@Override
@ -414,6 +415,7 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
iff.addAction(ACTION_MANAGE_LOCAL_CONTACTS);
iff.addAction(ACTION_MANAGE_CERTIFICATES);
iff.addAction(ACTION_IMPORT_CERTIFICATE);
iff.addAction(ACTION_SETUP_REORDER);
iff.addAction(ACTION_SETUP_MORE);
lbm.registerReceiver(receiver, iff);
}
@ -2000,6 +2002,8 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
onManageCertificates(intent);
else if (ACTION_IMPORT_CERTIFICATE.equals(action))
onImportCertificate(intent);
else if (ACTION_SETUP_REORDER.equals(action))
onMenuOrder(R.string.title_setup_reorder_accounts, EntityAccount.class);
else if (ACTION_SETUP_MORE.equals(action))
onSetupMore(intent);
}

View File

@ -146,7 +146,7 @@ public class FragmentOrder extends FragmentBase {
}
}.execute(this, new Bundle(), "order:folders");
else
throw new IllegalArgumentException();
throw new IllegalArgumentException("Unknown class=" + clazz);
}
@Override

View File

@ -120,6 +120,7 @@ public class FragmentSetup extends FragmentBase {
private CardView cardExtra;
private TextView tvExtra;
private Button btnNotification;
private Button btnReorder;
private Button btnDelete;
private Button btnApp;
private Button btnMore;
@ -198,6 +199,7 @@ public class FragmentSetup extends FragmentBase {
cardExtra = view.findViewById(R.id.cardExtra);
tvExtra = view.findViewById(R.id.tvExtra);
btnNotification = view.findViewById(R.id.btnNotification);
btnReorder = view.findViewById(R.id.btnReorder);
btnDelete = view.findViewById(R.id.btnDelete);
btnApp = view.findViewById(R.id.btnApp);
btnMore = view.findViewById(R.id.btnMore);
@ -626,6 +628,14 @@ public class FragmentSetup extends FragmentBase {
}
});
btnReorder.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(getContext());
lbm.sendBroadcast(new Intent(ActivitySetup.ACTION_SETUP_REORDER));
}
});
btnDelete.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

View File

@ -937,6 +937,18 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnNotification" />
<Button
android:id="@+id/btnReorder"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:drawableEnd="@drawable/twotone_reorder_24"
android:drawablePadding="6dp"
android:text="@string/title_setup_reorder_accounts"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvNotificationHint" />
<Button
android:id="@+id/btnDelete"
style="?android:attr/buttonStyleSmall"
@ -947,7 +959,7 @@
android:drawablePadding="6dp"
android:text="@string/title_delete_account"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvNotificationHint" />
app:layout_constraintTop_toBottomOf="@id/btnReorder" />
<TextView
android:id="@+id/tvDeleteHint"
@ -1041,7 +1053,7 @@
android:id="@+id/grpExtra"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="btnNotification,tvNotificationHint,btnDelete,tvDeleteHint,btnApp,btnMore" />
app:constraint_referenced_ids="btnNotification,tvNotificationHint,btnReorder,btnDelete,tvDeleteHint,btnApp,btnMore" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</androidx.constraintlayout.widget.ConstraintLayout>