diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 9755890d..37b3fdb0 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -8,6 +8,9 @@
+
= Build.VERSION_CODES.M) {
+ intent = newChooseAccountIntent(
+ null,
+ null,
+ new String[] {provider.type},
+ null,
+ null,
+ null,
+ null
+ );
+ } else {
+ intent = newChooseAccountIntent(
+ null,
+ null,
+ new String[]{provider.type},
+ false,
+ null,
+ null,
+ null,
+ null
+ );
+ }
+ PackageManager pm = getContext().getPackageManager();
+ if (intent.resolveActivity(pm) == null) { // system whitelisted
+ throw new IllegalArgumentException(getString(R.string.title_no_viewer, intent));
+ }
+ startActivityForResult(intent, ActivitySetup.REQUEST_CHOOSE_ACCOUNT);
}
}
@@ -1112,7 +1158,7 @@ public class FragmentAccount extends FragmentEx {
Log.i(
Helper.TAG,
"Activity result request=" + requestCode + " result=" + resultCode + " data=" + data);
- if (resultCode == Activity.RESULT_OK) {
+ if (resultCode == RESULT_OK) {
if (requestCode == ActivitySetup.REQUEST_CHOOSE_ACCOUNT) {
String name = data.getStringExtra(AccountManager.KEY_ACCOUNT_NAME);
String type = data.getStringExtra(AccountManager.KEY_ACCOUNT_TYPE);
@@ -1157,15 +1203,6 @@ public class FragmentAccount extends FragmentEx {
}
}
- private void setColor(int color) {
- FragmentAccount.this.color = color;
-
- GradientDrawable border = new GradientDrawable();
- border.setColor(color);
- border.setStroke(5, Helper.resolveColor(getContext(), R.attr.colorSeparator));
- vwColor.setBackground(border);
- }
-
private void setFolders(List folders) {
final Collator collator = Collator.getInstance(Locale.getDefault());
collator.setStrength(Collator.SECONDARY); // Case insensitive, process accents etc
diff --git a/app/src/main/res/layout/fragment_account.xml b/app/src/main/res/layout/fragment_account.xml
index a7455d1c..45fdaf13 100644
--- a/app/src/main/res/layout/fragment_account.xml
+++ b/app/src/main/res/layout/fragment_account.xml
@@ -220,48 +220,41 @@
android:inputType="textPassword" />
-
+
+
-
-
+ android:tag="disable" />
-
+ android:textAppearance="@style/TextAppearance.AppCompat.Small" />
-
+ android:layout_gravity="right"
+ android:src="@drawable/baseline_close_24"
+ android:visibility="invisible" />
+
+ app:layout_constraintTop_toBottomOf="@id/colorContainer" />