Layout improvement

pull/12/merge
M66B 6 years ago
parent 959bfdf9df
commit 84ad94b510

@ -46,18 +46,19 @@ public class FragmentSetup extends FragmentEx {
private Button btnAccount;
private ProgressBar pbAccount;
private TextView tvAccountDone;
private Button btnAccountManage;
private Button btnIdentity;
private ProgressBar pbIdentity;
private TextView tvIdentityDone;
private Button btnIdentityManage;
private Button btnPermissions;
private TextView tvPermissionsDone;
private CheckBox cbDarkTheme;
private Button btnAccountManage;
private Button btnIdentityManage;
private ExecutorService executor = Executors.newCachedThreadPool();
private static final String[] permissions = new String[]{
@ -75,18 +76,19 @@ public class FragmentSetup extends FragmentEx {
btnAccount = view.findViewById(R.id.btnAccount);
pbAccount = view.findViewById(R.id.pbAccount);
tvAccountDone = view.findViewById(R.id.tvAccountDone);
btnAccountManage = view.findViewById(R.id.btnAccountManage);
btnIdentity = view.findViewById(R.id.btnIdentity);
pbIdentity = view.findViewById(R.id.pbIdentity);
tvIdentityDone = view.findViewById(R.id.tvIdentityDone);
btnIdentityManage = view.findViewById(R.id.btnIdentityManage);
btnPermissions = view.findViewById(R.id.btnPermissions);
tvPermissionsDone = view.findViewById(R.id.tvPermissionsDone);
cbDarkTheme = view.findViewById(R.id.cbDarkTheme);
btnAccountManage = view.findViewById(R.id.btnAccountManage);
btnIdentityManage = view.findViewById(R.id.btnIdentityManage);
// Wire controls
btnAccount.setOnClickListener(new View.OnClickListener() {
@ -123,16 +125,6 @@ public class FragmentSetup extends FragmentEx {
}
});
btnAccountManage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//getFragmentManager().popBackStack();
FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.content_frame, new FragmentAccounts()).addToBackStack("accounts");
fragmentTransaction.commit();
}
});
btnIdentity.setOnClickListener(new View.OnClickListener() {
private boolean once;
@ -166,20 +158,30 @@ public class FragmentSetup extends FragmentEx {
}
});
btnIdentityManage.setOnClickListener(new View.OnClickListener() {
btnPermissions.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
requestPermissions(permissions, 1);
}
});
btnAccountManage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//getFragmentManager().popBackStack();
FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.content_frame, new FragmentIdentities()).addToBackStack("identities");
fragmentTransaction.replace(R.id.content_frame, new FragmentAccounts()).addToBackStack("accounts");
fragmentTransaction.commit();
}
});
btnPermissions.setOnClickListener(new View.OnClickListener() {
btnIdentityManage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
requestPermissions(permissions, 1);
//getFragmentManager().popBackStack();
FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.content_frame, new FragmentIdentities()).addToBackStack("identities");
fragmentTransaction.commit();
}
});

@ -55,19 +55,6 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvAccount" />
<Button
android:id="@+id/btnAccountManage"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minHeight="0dp"
android:minWidth="0dp"
android:text="@string/title_setup_account_manage"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvAccountDone" />
<!-- identity -->
<Button
@ -79,7 +66,7 @@
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnAccountManage" />
app:layout_constraintTop_toBottomOf="@id/tvAccountDone" />
<ProgressBar
android:id="@+id/pbIdentity"
@ -112,19 +99,6 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvIdentity" />
<Button
android:id="@+id/btnIdentityManage"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minHeight="0dp"
android:minWidth="0dp"
android:text="@string/title_setup_identity_manage"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvIdentityDone" />
<!-- permissions -->
<Button
@ -137,7 +111,7 @@
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnIdentityManage" />
app:layout_constraintTop_toBottomOf="@id/tvIdentityDone" />
<TextView
android:id="@+id/tvPermissions"
@ -171,5 +145,33 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvPermissionsDone" />
<Button
android:id="@+id/btnAccountManage"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:minHeight="0dp"
android:minWidth="0dp"
android:text="@string/title_setup_account_manage"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbDarkTheme" />
<Button
android:id="@+id/btnIdentityManage"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:minHeight="0dp"
android:minWidth="0dp"
android:text="@string/title_setup_identity_manage"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnAccountManage" />
</android.support.constraint.ConstraintLayout>
</ScrollView>
Loading…
Cancel
Save