Browse Source

fix: focus body on reply message

main
Distopico Vegan 6 years ago
parent
commit
4b6e230c2b
3 changed files with 20 additions and 8 deletions
  1. +6
    -1
      app/src/main/java/org/dystopia/email/FragmentCompose.java
  2. +11
    -7
      app/src/main/res/layout/fragment_compose.xml
  3. +3
    -0
      app/src/main/res/values/dimens.xml

+ 6
- 1
app/src/main/java/org/dystopia/email/FragmentCompose.java View File

@ -1443,7 +1443,12 @@ public class FragmentCompose extends FragmentEx {
new Runnable() { new Runnable() {
@Override @Override
public void run() { public void run() {
etTo.requestFocus();
String etToText = etTo.getText().toString();
if (etToText != null && etToText.length() > 0) {
etBody.requestFocus();
} else {
etTo.requestFocus();
}
} }
}); });
} }


+ 11
- 7
app/src/main/res/layout/fragment_compose.xml View File

@ -7,6 +7,7 @@
<ScrollView xmlns:app="http://schemas.android.com/apk/res-auto" <ScrollView xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:id="@+id/sw"
app:layout_constraintBottom_toTopOf="@+id/bottom_navigation" app:layout_constraintBottom_toTopOf="@+id/bottom_navigation"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent">
@ -19,7 +20,9 @@
android:id="@+id/spFrom" android:id="@+id/spFrom"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:layout_marginTop="@dimen/content_margin"
android:layout_marginHorizontal="@dimen/content_margin"
android:minHeight="@dimen/input_height"
app:layout_constraintEnd_toStartOf="@+id/ivIdentityAdd" app:layout_constraintEnd_toStartOf="@+id/ivIdentityAdd"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
@ -137,9 +140,9 @@
android:id="@+id/rvAttachment" android:id="@+id/rvAttachment"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginTop="3dp"
android:layout_marginEnd="6dp"
android:layout_marginHorizontal="@dimen/content_margin"
android:layout_marginTop="@dimen/content_margin"
android:padding="@dimen/compose_padding"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/vSeparatorAttachments" /> app:layout_constraintTop_toBottomOf="@+id/vSeparatorAttachments" />
@ -148,7 +151,7 @@
android:id="@+id/vSeparator" android:id="@+id/vSeparator"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:layout_marginTop="6dp"
android:layout_marginTop="@dimen/content_margin"
android:background="?attr/colorSeparator" android:background="?attr/colorSeparator"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/rvAttachment" /> app:layout_constraintTop_toBottomOf="@+id/rvAttachment" />
@ -157,8 +160,9 @@
android:id="@+id/etBody" android:id="@+id/etBody"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginEnd="6dp"
android:layout_marginHorizontal="@dimen/content_margin"
android:layout_marginVertical="@dimen/content_margin"
android:padding="@dimen/compose_padding"
android:background="@null" android:background="@null"
android:fontFamily="monospace" android:fontFamily="monospace"
android:gravity="top" android:gravity="top"


+ 3
- 0
app/src/main/res/values/dimens.xml View File

@ -2,4 +2,7 @@
<resources> <resources>
<dimen name="layout_margin">12dp</dimen> <dimen name="layout_margin">12dp</dimen>
<dimen name="widget_padding">6dp</dimen> <dimen name="widget_padding">6dp</dimen>
<dimen name="content_margin">6dp</dimen>
<dimen name="compose_padding">6dp</dimen>
<dimen name="input_height">40dp</dimen>
</resources> </resources>

Loading…
Cancel
Save