mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-03 19:34:15 +01:00
Indicate external links
This commit is contained in:
@@ -236,7 +236,7 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
|
||||
drawerLayout.closeDrawer(drawerContainer);
|
||||
onMenuFAQ();
|
||||
}
|
||||
}));
|
||||
}).setExternal(true));
|
||||
|
||||
menus.add(new NavMenuItem(R.drawable.baseline_account_box_24, R.string.menu_privacy, new Runnable() {
|
||||
@Override
|
||||
|
||||
@@ -308,7 +308,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
||||
drawerLayout.closeDrawer(drawerContainer);
|
||||
onDebugInfo();
|
||||
}
|
||||
}));
|
||||
}).setExternal(true));
|
||||
|
||||
if (Helper.getIntentIssue(this).resolveActivity(pm) != null)
|
||||
extra.add(new NavMenuItem(R.drawable.baseline_feedback_24, R.string.menu_issue, new Runnable() {
|
||||
@@ -317,7 +317,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
||||
drawerLayout.closeDrawer(drawerContainer);
|
||||
onMenuIssue();
|
||||
}
|
||||
}));
|
||||
}).setExternal(true));
|
||||
|
||||
extra.add(new NavMenuItem(R.drawable.baseline_account_box_24, R.string.menu_privacy, new Runnable() {
|
||||
@Override
|
||||
@@ -357,7 +357,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
||||
drawerLayout.closeDrawer(drawerContainer);
|
||||
onMenuInvite();
|
||||
}
|
||||
}));
|
||||
}).setExternal(true));
|
||||
|
||||
if (getIntentRate(this).resolveActivity(pm) != null)
|
||||
extra.add(new NavMenuItem(R.drawable.baseline_star_24, R.string.menu_rate, new Runnable() {
|
||||
@@ -366,7 +366,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
||||
drawerLayout.closeDrawer(drawerContainer);
|
||||
onMenuRate();
|
||||
}
|
||||
}));
|
||||
}).setExternal(true));
|
||||
|
||||
if (getIntentOtherApps().resolveActivity(pm) != null)
|
||||
extra.add(new NavMenuItem(R.drawable.baseline_get_app_24, R.string.menu_other, new Runnable() {
|
||||
@@ -375,7 +375,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
||||
drawerLayout.closeDrawer(drawerContainer);
|
||||
onMenuOtherApps();
|
||||
}
|
||||
}));
|
||||
}).setExternal(true));
|
||||
|
||||
eadapter.set(extra);
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@ public class AdapterNavAccount extends RecyclerView.Adapter<AdapterNavAccount.Vi
|
||||
private ImageView ivItem;
|
||||
private TextView tvItem;
|
||||
private TextView tvItemExtra;
|
||||
private ImageView ivExternal;
|
||||
private ImageView ivWarning;
|
||||
|
||||
ViewHolder(View itemView) {
|
||||
@@ -66,6 +67,7 @@ public class AdapterNavAccount extends RecyclerView.Adapter<AdapterNavAccount.Vi
|
||||
ivItem = itemView.findViewById(R.id.ivItem);
|
||||
tvItem = itemView.findViewById(R.id.tvItem);
|
||||
tvItemExtra = itemView.findViewById(R.id.tvItemExtra);
|
||||
ivExternal = itemView.findViewById(R.id.ivExternal);
|
||||
ivWarning = itemView.findViewById(R.id.ivWarning);
|
||||
}
|
||||
|
||||
@@ -98,6 +100,7 @@ public class AdapterNavAccount extends RecyclerView.Adapter<AdapterNavAccount.Vi
|
||||
|
||||
tvItemExtra.setText(account.last_connected == null ? null : DTF.format(account.last_connected));
|
||||
|
||||
ivExternal.setVisibility(View.GONE);
|
||||
ivWarning.setVisibility(account.error == null ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
|
||||
|
||||
@@ -61,6 +61,7 @@ public class AdapterNavFolder extends RecyclerView.Adapter<AdapterNavFolder.View
|
||||
private ImageView ivItem;
|
||||
private TextView tvItem;
|
||||
private TextView tvItemExtra;
|
||||
private ImageView ivExternal;
|
||||
private ImageView ivWarning;
|
||||
|
||||
ViewHolder(View itemView) {
|
||||
@@ -70,6 +71,7 @@ public class AdapterNavFolder extends RecyclerView.Adapter<AdapterNavFolder.View
|
||||
ivItem = itemView.findViewById(R.id.ivItem);
|
||||
tvItem = itemView.findViewById(R.id.tvItem);
|
||||
tvItemExtra = itemView.findViewById(R.id.tvItemExtra);
|
||||
ivExternal = itemView.findViewById(R.id.ivExternal);
|
||||
ivWarning = itemView.findViewById(R.id.ivWarning);
|
||||
}
|
||||
|
||||
@@ -121,6 +123,7 @@ public class AdapterNavFolder extends RecyclerView.Adapter<AdapterNavFolder.View
|
||||
tvItemExtra.setText(folder.last_sync == null ? null : DTF.format(folder.last_sync));
|
||||
tvItemExtra.setVisibility(debug ? View.VISIBLE : View.GONE);
|
||||
|
||||
ivExternal.setVisibility(View.GONE);
|
||||
ivWarning.setVisibility(folder.error == null ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ public class AdapterNavMenu extends RecyclerView.Adapter<AdapterNavMenu.ViewHold
|
||||
private ImageView ivItem;
|
||||
private TextView tvItem;
|
||||
private TextView tvItemExtra;
|
||||
private ImageView ivExternal;
|
||||
private ImageView ivWarning;
|
||||
|
||||
ViewHolder(View itemView) {
|
||||
@@ -60,6 +61,7 @@ public class AdapterNavMenu extends RecyclerView.Adapter<AdapterNavMenu.ViewHold
|
||||
ivItem = itemView.findViewById(R.id.ivItem);
|
||||
tvItem = itemView.findViewById(R.id.tvItem);
|
||||
tvItemExtra = itemView.findViewById(R.id.tvItemExtra);
|
||||
ivExternal = itemView.findViewById(R.id.ivExternal);
|
||||
ivWarning = itemView.findViewById(R.id.ivWarning);
|
||||
}
|
||||
|
||||
@@ -87,6 +89,7 @@ public class AdapterNavMenu extends RecyclerView.Adapter<AdapterNavMenu.ViewHold
|
||||
|
||||
tvItemExtra.setVisibility(View.GONE);
|
||||
|
||||
ivExternal.setVisibility(menu.isExternal() ? View.VISIBLE : View.GONE);
|
||||
ivWarning.setVisibility(menu.hasWarning() ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ public class AdapterNavUnified extends RecyclerView.Adapter<AdapterNavUnified.Vi
|
||||
private ImageView ivItem;
|
||||
private TextView tvItem;
|
||||
private TextView tvItemExtra;
|
||||
private ImageView ivExternal;
|
||||
private ImageView ivWarning;
|
||||
|
||||
ViewHolder(View itemView) {
|
||||
@@ -63,6 +64,7 @@ public class AdapterNavUnified extends RecyclerView.Adapter<AdapterNavUnified.Vi
|
||||
ivItem = itemView.findViewById(R.id.ivItem);
|
||||
tvItem = itemView.findViewById(R.id.tvItem);
|
||||
tvItemExtra = itemView.findViewById(R.id.tvItemExtra);
|
||||
ivExternal = itemView.findViewById(R.id.ivExternal);
|
||||
ivWarning = itemView.findViewById(R.id.ivWarning);
|
||||
}
|
||||
|
||||
@@ -87,6 +89,7 @@ public class AdapterNavUnified extends RecyclerView.Adapter<AdapterNavUnified.Vi
|
||||
folder.unseen == 0 ? android.R.attr.textColorSecondary : R.attr.colorUnread));
|
||||
|
||||
tvItemExtra.setVisibility(View.GONE);
|
||||
ivExternal.setVisibility(View.GONE);
|
||||
ivWarning.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ public class NavMenuItem {
|
||||
private int icon;
|
||||
private int title;
|
||||
private Integer count = null;
|
||||
private boolean external = false;
|
||||
private boolean warning = false;
|
||||
private boolean separated = false;
|
||||
private Runnable click;
|
||||
@@ -47,6 +48,11 @@ public class NavMenuItem {
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
NavMenuItem setExternal(boolean external) {
|
||||
this.external = external;
|
||||
return this;
|
||||
}
|
||||
|
||||
void setWarning(boolean warning) {
|
||||
this.warning = warning;
|
||||
}
|
||||
@@ -72,6 +78,10 @@ public class NavMenuItem {
|
||||
return this.separated;
|
||||
}
|
||||
|
||||
boolean isExternal() {
|
||||
return this.external;
|
||||
}
|
||||
|
||||
boolean hasWarning() {
|
||||
return this.warning;
|
||||
}
|
||||
|
||||
10
app/src/main/res/drawable/baseline_open_in_new_24.xml
Normal file
10
app/src/main/res/drawable/baseline_open_in_new_24.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M19,19H5V5h7V3H5c-1.11,0 -2,0.9 -2,2v14c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2v-7h-2v7zM14,3v2h3.59l-9.83,9.83 1.41,1.41L19,6.41V10h2V3h-7z"/>
|
||||
</vector>
|
||||
@@ -50,6 +50,16 @@
|
||||
android:text="Extra"
|
||||
android:textAppearance="@style/Base.TextAppearance.AppCompat.Small"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/ivExternal"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivExternal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:src="@drawable/baseline_open_in_new_24"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/ivWarning"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user