mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 04:35:57 +00:00
Answer layout improvement
This commit is contained in:
parent
6b78f119e1
commit
ad07bda9d6
2 changed files with 34 additions and 31 deletions
|
@ -22,12 +22,15 @@ package eu.faircode.email;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.text.Spanned;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
import android.widget.ImageButton;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
@ -40,6 +43,7 @@ public class FragmentAnswer extends FragmentBase {
|
||||||
private EditText etName;
|
private EditText etName;
|
||||||
private CheckBox cbHide;
|
private CheckBox cbHide;
|
||||||
private EditText etText;
|
private EditText etText;
|
||||||
|
private ImageButton ibInfo;
|
||||||
private BottomNavigationView bottom_navigation;
|
private BottomNavigationView bottom_navigation;
|
||||||
private ContentLoadingProgressBar pbWait;
|
private ContentLoadingProgressBar pbWait;
|
||||||
private Group grpReady;
|
private Group grpReady;
|
||||||
|
@ -66,10 +70,31 @@ public class FragmentAnswer extends FragmentBase {
|
||||||
etName = view.findViewById(R.id.etName);
|
etName = view.findViewById(R.id.etName);
|
||||||
cbHide = view.findViewById(R.id.cbHide);
|
cbHide = view.findViewById(R.id.cbHide);
|
||||||
etText = view.findViewById(R.id.etText);
|
etText = view.findViewById(R.id.etText);
|
||||||
|
ibInfo = view.findViewById(R.id.ibInfo);
|
||||||
bottom_navigation = view.findViewById(R.id.bottom_navigation);
|
bottom_navigation = view.findViewById(R.id.bottom_navigation);
|
||||||
pbWait = view.findViewById(R.id.pbWait);
|
pbWait = view.findViewById(R.id.pbWait);
|
||||||
grpReady = view.findViewById(R.id.grpReady);
|
grpReady = view.findViewById(R.id.grpReady);
|
||||||
|
|
||||||
|
ibInfo.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
Spanned spanned = HtmlHelper.fromHtml("<p>" +
|
||||||
|
getString(R.string.title_answer_template_name) +
|
||||||
|
"<br>" +
|
||||||
|
getString(R.string.title_answer_template_email) +
|
||||||
|
"</p>");
|
||||||
|
|
||||||
|
View dview = LayoutInflater.from(getContext()).inflate(R.layout.dialog_message, null);
|
||||||
|
TextView tvMessage = dview.findViewById(R.id.tvMessage);
|
||||||
|
|
||||||
|
tvMessage.setText(spanned);
|
||||||
|
|
||||||
|
new DialogBuilderLifecycle(getContext(), getViewLifecycleOwner())
|
||||||
|
.setView(dview)
|
||||||
|
.show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
bottom_navigation.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
|
bottom_navigation.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) {
|
public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) {
|
||||||
|
|
|
@ -50,43 +50,21 @@
|
||||||
android:hint="@string/title_answer_text"
|
android:hint="@string/title_answer_text"
|
||||||
android:imeOptions="actionDone"
|
android:imeOptions="actionDone"
|
||||||
android:inputType="textCapSentences|textMultiLine|textAutoCorrect"
|
android:inputType="textCapSentences|textMultiLine|textAutoCorrect"
|
||||||
|
android:isScrollContainer="true"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/vSeparatorHints"
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/bottom_navigation"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/vSeparator" />
|
app:layout_constraintTop_toBottomOf="@id/vSeparator" />
|
||||||
|
|
||||||
<View
|
<ImageButton
|
||||||
android:id="@+id/vSeparatorHints"
|
android:id="@+id/ibInfo"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_marginTop="6dp"
|
|
||||||
android:layout_marginBottom="6dp"
|
|
||||||
android:background="?attr/colorSeparator"
|
|
||||||
app:layout_constraintBottom_toTopOf="@+id/tvTemplateName"
|
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tvTemplateName"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="6dp"
|
android:contentDescription="@string/title_setup_help"
|
||||||
android:layout_marginEnd="6dp"
|
android:src="@drawable/baseline_info_24"
|
||||||
android:text="@string/title_answer_template_name"
|
app:layout_constraintBottom_toBottomOf="@id/etText"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
app:layout_constraintEnd_toEndOf="@id/etText" />
|
||||||
app:layout_constraintBottom_toTopOf="@+id/tvTemplateEmail"
|
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tvTemplateEmail"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="6dp"
|
|
||||||
android:layout_marginEnd="6dp"
|
|
||||||
android:layout_marginBottom="6dp"
|
|
||||||
android:text="@string/title_answer_template_email"
|
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
|
||||||
app:layout_constraintBottom_toTopOf="@+id/bottom_navigation"
|
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
|
||||||
|
|
||||||
<com.google.android.material.bottomnavigation.BottomNavigationView
|
<com.google.android.material.bottomnavigation.BottomNavigationView
|
||||||
android:id="@+id/bottom_navigation"
|
android:id="@+id/bottom_navigation"
|
||||||
|
|
Loading…
Reference in a new issue