Improved layout

pull/178/head
M66B 5 years ago
parent c994fcb003
commit 69e0f2311d

@ -5187,8 +5187,10 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
final Uri uri = getArguments().getParcelable("uri");
final String title = getArguments().getString("title");
// Preload web view
Helper.customTabsWarmup(getContext());
// Process link
final Uri sanitized;
if (uri.isOpaque())
sanitized = uri;
@ -5213,23 +5215,30 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
final Uri uriTitle = Uri.parse(title == null ? "" : title);
View dview = LayoutInflater.from(getContext()).inflate(R.layout.dialog_open_link, null);
TextView tvTitle = dview.findViewById(R.id.tvTitle);
// Get views
final View dview = LayoutInflater.from(getContext()).inflate(R.layout.dialog_open_link, null);
final TextView tvTitle = dview.findViewById(R.id.tvTitle);
final ImageButton ibDifferent = dview.findViewById(R.id.ibDifferent);
final EditText etLink = dview.findViewById(R.id.etLink);
ImageButton ibShare = dview.findViewById(R.id.ibShare);
ImageButton ibCopy = dview.findViewById(R.id.ibCopy);
TextView tvDifferent = dview.findViewById(R.id.tvDifferent);
ImageButton ibDifferent = dview.findViewById(R.id.ibDifferent);
final ImageButton ibShare = dview.findViewById(R.id.ibShare);
final ImageButton ibCopy = dview.findViewById(R.id.ibCopy);
final CheckBox cbSecure = dview.findViewById(R.id.cbSecure);
CheckBox cbSanitize = dview.findViewById(R.id.cbSanitize);
final CheckBox cbSanitize = dview.findViewById(R.id.cbSanitize);
final Button btnOwner = dview.findViewById(R.id.btnOwner);
TextView tvOwnerRemark = dview.findViewById(R.id.tvOwnerRemark);
final TextView tvOwnerRemark = dview.findViewById(R.id.tvOwnerRemark);
final ContentLoadingProgressBar pbWait = dview.findViewById(R.id.pbWait);
final TextView tvHost = dview.findViewById(R.id.tvHost);
final TextView tvOwner = dview.findViewById(R.id.tvOwner);
final Group grpDifferent = dview.findViewById(R.id.grpDifferent);
final Group grpOwner = dview.findViewById(R.id.grpOwner);
ibDifferent.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
etLink.setText(uriTitle.toString());
}
});
etLink.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
@ -5287,13 +5296,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
}
});
ibDifferent.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
etLink.setText(uriTitle.toString());
}
});
cbSecure.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {

@ -28,10 +28,20 @@
android:text="Link title"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textStyle="italic"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintEnd_toStartOf="@+id/ibDifferent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvCaption" />
<ImageButton
android:id="@+id/ibDifferent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_clipboard_copy"
app:layout_constraintBottom_toBottomOf="@id/tvTitle"
app:layout_constraintEnd_toEndOf="parent"
app:srcCompat="@drawable/baseline_insert_link_24" />
<eu.faircode.email.EditTextPlain
android:id="@+id/etLink"
android:layout_width="0dp"
@ -68,28 +78,16 @@
<eu.faircode.email.FixedTextView
android:id="@+id/tvDifferent"
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:layout_marginEnd="12dp"
android:text="@string/title_different_link"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?attr/colorWarning"
android:textStyle="bold"
app:layout_constraintEnd_toStartOf="@+id/ibDifferent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ibCopy" />
<ImageButton
android:id="@+id/ibDifferent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_clipboard_copy"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/tvDifferent"
app:srcCompat="@drawable/baseline_insert_link_24" />
<CheckBox
android:id="@+id/cbSecure"
android:layout_width="wrap_content"
@ -99,7 +97,7 @@
android:textColor="?attr/colorWarning"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ibDifferent" />
app:layout_constraintTop_toBottomOf="@id/tvDifferent" />
<CheckBox
android:id="@+id/cbSanitize"

Loading…
Cancel
Save