mirror of
				https://github.com/SimpleMobileTools/Simple-File-Manager.git
				synced 2025-06-05 22:09:15 +02:00 
			
		
		
		
	use an editable EditText at file editor
This commit is contained in:
		@@ -26,10 +26,12 @@ class ReadTextActivity : SimpleActivity() {
 | 
			
		||||
    private fun checkIntent() {
 | 
			
		||||
        read_text_view.setTextColor(config.textColor)
 | 
			
		||||
        val uri = intent.data
 | 
			
		||||
        if (uri.scheme == "file") {
 | 
			
		||||
            read_text_view.text = File(uri.path).readText()
 | 
			
		||||
        val text = if (uri.scheme == "file") {
 | 
			
		||||
            File(uri.path).readText()
 | 
			
		||||
        } 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_height="wrap_content">
 | 
			
		||||
 | 
			
		||||
    <com.simplemobiletools.commons.views.MyTextView
 | 
			
		||||
    <com.simplemobiletools.commons.views.MyEditText
 | 
			
		||||
        android:id="@+id/read_text_view"
 | 
			
		||||
        android:layout_width="match_parent"
 | 
			
		||||
        android:layout_height="wrap_content"
 | 
			
		||||
        android:background="@null"
 | 
			
		||||
        android:padding="@dimen/medium_margin"
 | 
			
		||||
        android:textCursorDrawable="@null"
 | 
			
		||||
        android:textSize="@dimen/smaller_text_size"/>
 | 
			
		||||
 | 
			
		||||
</ScrollView>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user