Skip to content

Commit f7f0893

Browse files
committed
fix keyboard showing at app startup
1 parent e264bad commit f7f0893

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

app/src/main/kotlin/com/simplemobiletools/notes/fragments/NoteFragment.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package com.simplemobiletools.notes.fragments
33
import android.annotation.SuppressLint
44
import android.graphics.Typeface
55
import android.os.Bundle
6-
import androidx.fragment.app.Fragment
76
import android.text.Editable
87
import android.text.Selection
98
import android.text.TextWatcher
@@ -89,6 +88,11 @@ class NoteFragment : androidx.fragment.app.Fragment() {
8988
setText(fileContents)
9089
}
9190
skipTextUpdating = false
91+
92+
if (config.showKeyboard) {
93+
requestFocus()
94+
}
95+
9296
setSelection(if (config.placeCursorToEnd) text.length else 0)
9397
}
9498
}

app/src/main/res/layout/dialog_new_note.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
android:layout_height="match_parent"
77
android:orientation="vertical"
88
android:paddingLeft="@dimen/activity_margin"
9-
android:paddingRight="@dimen/activity_margin"
10-
android:paddingTop="@dimen/activity_margin">
9+
android:paddingTop="@dimen/activity_margin"
10+
android:paddingRight="@dimen/activity_margin">
1111

1212
<com.simplemobiletools.commons.views.MyEditText
1313
android:id="@+id/note_name"
@@ -17,4 +17,5 @@
1717
android:inputType="textCapSentences"
1818
android:textCursorDrawable="@null"
1919
android:textSize="@dimen/normal_text_size"/>
20+
2021
</LinearLayout>

0 commit comments

Comments
 (0)