Minor UI tweaks for dialog_insert_link.

This commit is contained in:
Alex Ning 2021-01-18 22:35:57 +08:00
parent d2749d15d5
commit f13d4576e1
2 changed files with 44 additions and 21 deletions

View File

@ -12,9 +12,10 @@ import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.slider.Slider; import com.google.android.material.slider.Slider;
import com.google.android.material.textfield.TextInputEditText;
import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper;
import ml.docilealligator.infinityforreddit.R; import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper;
public class MarkdownBottomBarRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { public class MarkdownBottomBarRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
@ -125,8 +126,8 @@ public class MarkdownBottomBarRecyclerViewAdapter extends RecyclerView.Adapter<R
} }
case MarkdownBottomBarRecyclerViewAdapter.LINK: { case MarkdownBottomBarRecyclerViewAdapter.LINK: {
View dialogView = activity.getLayoutInflater().inflate(R.layout.dialog_insert_link, null); View dialogView = activity.getLayoutInflater().inflate(R.layout.dialog_insert_link, null);
EditText textEditText = dialogView.findViewById(R.id.edit_text_insert_link_dialog); TextInputEditText textEditText = dialogView.findViewById(R.id.edit_text_insert_link_dialog);
EditText linkEditText = dialogView.findViewById(R.id.edit_link_insert_link_dialog); TextInputEditText linkEditText = dialogView.findViewById(R.id.edit_link_insert_link_dialog);
int start = Math.max(commentEditText.getSelectionStart(), 0); int start = Math.max(commentEditText.getSelectionStart(), 0);
int end = Math.max(commentEditText.getSelectionEnd(), 0); int end = Math.max(commentEditText.getSelectionEnd(), 0);

View File

@ -1,30 +1,52 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"> android:orientation="vertical">
<EditText <com.google.android.material.textfield.TextInputLayout
android:id="@+id/edit_text_insert_link_dialog"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="24dp" android:paddingStart="16dp"
android:background="#00000000" android:paddingTop="8dp"
android:hint="@string/text_hint" android:paddingEnd="16dp"
android:textColor="?attr/primaryTextColor" android:paddingBottom="8dp"
android:textSize="?attr/font_default" app:boxStrokeColor="?attr/primaryTextColor"
android:fontFamily="?attr/font_family" /> app:hintTextColor="?attr/primaryTextColor"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<EditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/edit_link_insert_link_dialog" android:id="@+id/edit_text_insert_link_dialog"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/text_hint"
android:textColor="?attr/primaryTextColor"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="24dp" android:paddingStart="16dp"
android:background="#00000000" android:paddingTop="8dp"
android:hint="@string/link_hint" android:paddingEnd="16dp"
android:textColor="?attr/primaryTextColor" android:paddingBottom="8dp"
android:textSize="?attr/font_default" app:boxStrokeColor="?attr/primaryTextColor"
android:fontFamily="?attr/font_family" /> app:hintTextColor="?attr/primaryTextColor"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edit_link_insert_link_dialog"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/link_hint"
android:textColor="?attr/primaryTextColor"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout> </LinearLayout>