Show original link

This commit is contained in:
M66B 2021-04-04 15:33:09 +02:00
parent a91fbf515b
commit 45314498b0
2 changed files with 17 additions and 0 deletions

View File

@ -123,6 +123,7 @@ public class FragmentDialogOpenLink extends FragmentDialogBase {
final TextView tvTitle = dview.findViewById(R.id.tvTitle); final TextView tvTitle = dview.findViewById(R.id.tvTitle);
final ImageButton ibDifferent = dview.findViewById(R.id.ibDifferent); final ImageButton ibDifferent = dview.findViewById(R.id.ibDifferent);
final EditText etLink = dview.findViewById(R.id.etLink); final EditText etLink = dview.findViewById(R.id.etLink);
final TextView tvLink = dview.findViewById(R.id.tvLink);
final TextView tvSuspicious = dview.findViewById(R.id.tvSuspicious); final TextView tvSuspicious = dview.findViewById(R.id.tvSuspicious);
final TextView tvDisconnect = dview.findViewById(R.id.tvDisconnect); final TextView tvDisconnect = dview.findViewById(R.id.tvDisconnect);
final TextView tvDisconnectCategories = dview.findViewById(R.id.tvDisconnectCategories); final TextView tvDisconnectCategories = dview.findViewById(R.id.tvDisconnectCategories);
@ -320,9 +321,11 @@ public class FragmentDialogOpenLink extends FragmentDialogBase {
if (host != null && !host.equals(puny)) { if (host != null && !host.equals(puny)) {
etLink.setText(uri.buildUpon().encodedAuthority(puny).build().toString()); etLink.setText(uri.buildUpon().encodedAuthority(puny).build().toString());
tvLink.setText(uri.toString());
tvSuspicious.setVisibility(View.VISIBLE); tvSuspicious.setVisibility(View.VISIBLE);
} else { } else {
etLink.setText(uri.toString()); etLink.setText(uri.toString());
tvLink.setText(null);
tvSuspicious.setVisibility(Helper.isSingleScript(host) ? View.GONE : View.VISIBLE); tvSuspicious.setVisibility(Helper.isSingleScript(host) ? View.GONE : View.VISIBLE);
} }

View File

@ -56,6 +56,20 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvTitle" /> app:layout_constraintTop_toBottomOf="@id/tvTitle" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvLink"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="3dp"
android:layout_marginEnd="12dp"
android:ellipsize="end"
android:singleLine="true"
android:text="Original link"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toStartOf="@+id/ibShare"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/etLink" />
<ImageButton <ImageButton
android:id="@+id/ibShare" android:id="@+id/ibShare"
android:layout_width="wrap_content" android:layout_width="wrap_content"