mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-02-18 12:50:35 +01:00
use an editable EditText at file editor
This commit is contained in:
parent
5d13b65b03
commit
b2434fb6f2
@ -26,10 +26,12 @@ class ReadTextActivity : SimpleActivity() {
|
|||||||
private fun checkIntent() {
|
private fun checkIntent() {
|
||||||
read_text_view.setTextColor(config.textColor)
|
read_text_view.setTextColor(config.textColor)
|
||||||
val uri = intent.data
|
val uri = intent.data
|
||||||
if (uri.scheme == "file") {
|
val text = if (uri.scheme == "file") {
|
||||||
read_text_view.text = File(uri.path).readText()
|
File(uri.path).readText()
|
||||||
} else {
|
} else {
|
||||||
read_text_view.text = contentResolver.openInputStream(uri).bufferedReader().use { it.readText() }
|
contentResolver.openInputStream(uri).bufferedReader().use { it.readText() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
read_text_view.setText(text)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,11 +5,13 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
<com.simplemobiletools.commons.views.MyEditText
|
||||||
android:id="@+id/read_text_view"
|
android:id="@+id/read_text_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@null"
|
||||||
android:padding="@dimen/medium_margin"
|
android:padding="@dimen/medium_margin"
|
||||||
|
android:textCursorDrawable="@null"
|
||||||
android:textSize="@dimen/smaller_text_size"/>
|
android:textSize="@dimen/smaller_text_size"/>
|
||||||
|
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user