diff --git a/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeActivity.kt b/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeActivity.kt index 954fb34a..5ad4b2fa 100644 --- a/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeActivity.kt +++ b/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeActivity.kt @@ -852,4 +852,11 @@ class ComposeActivity : QkThemedActivity(), ComposeView { override fun onBackPressed() = backPressedIntent.onNext(Unit) + override fun focusMessage() { + runOnUiThread { + val message = findViewById(R.id.message) + if (message !== null) message.requestFocus() + } + } + } diff --git a/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeView.kt b/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeView.kt index df615bc3..2e8b7a9c 100644 --- a/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeView.kt +++ b/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeView.kt @@ -112,5 +112,6 @@ interface ComposeView : QkView { fun showDeleteDialog( messages: List) fun showClearCurrentMessageDialog() fun startSpeechRecognition() + fun focusMessage() } \ No newline at end of file diff --git a/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeViewModel.kt b/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeViewModel.kt index 9b27f5b5..5948c5ec 100644 --- a/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeViewModel.kt +++ b/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeViewModel.kt @@ -1101,7 +1101,7 @@ class ComposeViewModel @Inject constructor( ) } .autoDisposable(view.scope()) - .subscribe() + .subscribe{view.focusMessage()} // View QKSMS+ view.viewQksmsPlusIntent diff --git a/presentation/src/main/java/com/moez/QKSMS/feature/main/MainActivity.kt b/presentation/src/main/java/com/moez/QKSMS/feature/main/MainActivity.kt index a1601152..e6bc97cf 100644 --- a/presentation/src/main/java/com/moez/QKSMS/feature/main/MainActivity.kt +++ b/presentation/src/main/java/com/moez/QKSMS/feature/main/MainActivity.kt @@ -30,6 +30,7 @@ import android.view.Menu import android.view.MenuItem import android.view.View import android.view.ViewStub +import android.widget.LinearLayout import androidx.appcompat.app.ActionBarDrawerToggle import androidx.core.app.ActivityCompat import androidx.core.view.GravityCompat @@ -89,8 +90,11 @@ class MainActivity : QkThemedActivity(), MainView { override val composeIntent by lazy { compose.clicks() } override val drawerOpenIntent: Observable by lazy { drawerLayout - .drawerOpen(Gravity.START) - .doOnNext { dismissKeyboard() } + .drawerOpen(Gravity.START) + .doOnNext { + dismissKeyboard() + inbox.requestFocus(); + } } override val homeIntent: Subject = PublishSubject.create() override val navigationIntent: Observable by lazy { diff --git a/presentation/src/main/res/layout/compose_activity.xml b/presentation/src/main/res/layout/compose_activity.xml index a76f9ea0..0fb27f70 100644 --- a/presentation/src/main/res/layout/compose_activity.xml +++ b/presentation/src/main/res/layout/compose_activity.xml @@ -286,7 +286,10 @@ android:textColorHint="?android:attr/textColorTertiary" app:layout_constraintBottom_toBottomOf="@id/messageBackground" app:layout_constraintEnd_toStartOf="@id/sim" - app:layout_constraintStart_toStartOf="@id/messageBackground" /> + app:layout_constraintStart_toStartOf="@id/messageBackground"> + + + + android:paddingBottom="8dp" + android:nextFocusRight="@+id/compose"> + tools:textSize="16sp" + android:focusable="true" + android:focusableInTouchMode="true" + android:nextFocusRight="@+id/compose" />