Layout improvement

pull/162/head
M66B 5 years ago
parent fdd8b10a22
commit 5741228213

@ -23,6 +23,7 @@ import android.app.Dialog;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.graphics.Rect;
import android.net.Uri;
import android.os.Bundle;
import android.text.Spanned;
@ -30,6 +31,7 @@ import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.ImageButton;
@ -93,6 +95,17 @@ public class FragmentAnswer extends FragmentBase {
pbWait = view.findViewById(R.id.pbWait);
grpReady = view.findViewById(R.id.grpReady);
int height = getContext().getResources().getDisplayMetrics().heightPixels;
View decor = getActivity().getWindow().getDecorView();
decor.getViewTreeObserver()
.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
public void onGlobalLayout() {
Rect rect = new Rect();
decor.getWindowVisibleDisplayFrame(rect);
view.setPadding(0, 0, 0, height - rect.bottom);
}
});
etText.setSelectionListener(new EditTextCompose.ISelection() {
@Override
public void onSelected(boolean selection) {

@ -52,9 +52,7 @@
android:hint="@string/title_answer_text"
android:imeOptions="actionDone"
android:inputType="textCapSentences|textMultiLine|textAutoCorrect"
android:isScrollContainer="true"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:windowSoftInputMode="adjustPan"
app:layout_constraintBottom_toTopOf="@+id/style_bar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@ -111,4 +109,4 @@
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="etName,vSeparator,etText,bottom_navigation" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

Loading…
Cancel
Save