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() { |     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> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user