Skip to content

Commit b2434fb

Browse files
committed
use an editable EditText at file editor
1 parent 5d13b65 commit b2434fb

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

app/src/main/kotlin/com/simplemobiletools/filemanager/activities/ReadTextActivity.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@ class ReadTextActivity : SimpleActivity() {
2626
private fun checkIntent() {
2727
read_text_view.setTextColor(config.textColor)
2828
val uri = intent.data
29-
if (uri.scheme == "file") {
30-
read_text_view.text = File(uri.path).readText()
29+
val text = if (uri.scheme == "file") {
30+
File(uri.path).readText()
3131
} else {
32-
read_text_view.text = contentResolver.openInputStream(uri).bufferedReader().use { it.readText() }
32+
contentResolver.openInputStream(uri).bufferedReader().use { it.readText() }
3333
}
34+
35+
read_text_view.setText(text)
3436
}
3537
}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
android:layout_width="match_parent"
66
android:layout_height="wrap_content">
77

8-
<com.simplemobiletools.commons.views.MyTextView
8+
<com.simplemobiletools.commons.views.MyEditText
99
android:id="@+id/read_text_view"
1010
android:layout_width="match_parent"
1111
android:layout_height="wrap_content"
12+
android:background="@null"
1213
android:padding="@dimen/medium_margin"
14+
android:textCursorDrawable="@null"
1315
android:textSize="@dimen/smaller_text_size"/>
1416

1517
</ScrollView>

0 commit comments

Comments
 (0)