add a Save menu button
This commit is contained in:
parent
b2434fb6f2
commit
cb4b63a836
3 changed files with 29 additions and 1 deletions
|
@ -37,7 +37,7 @@ android {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
compile 'com.simplemobiletools:commons:2.30.14'
|
||||
compile 'com.simplemobiletools:commons:2.31.0'
|
||||
compile 'com.bignerdranch.android:recyclerview-multiselect:0.2'
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package com.simplemobiletools.filemanager.activities
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import com.simplemobiletools.commons.extensions.toast
|
||||
import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE
|
||||
import com.simplemobiletools.filemanager.R
|
||||
|
@ -23,6 +25,23 @@ class ReadTextActivity : SimpleActivity() {
|
|||
}
|
||||
}
|
||||
|
||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
||||
menuInflater.inflate(R.menu.menu_editor, menu)
|
||||
return true
|
||||
}
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
when (item.itemId) {
|
||||
R.id.menu_save -> saveText()
|
||||
else -> return super.onOptionsItemSelected(item)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
private fun saveText() {
|
||||
|
||||
}
|
||||
|
||||
private fun checkIntent() {
|
||||
read_text_view.setTextColor(config.textColor)
|
||||
val uri = intent.data
|
||||
|
|
9
app/src/main/res/menu/menu_editor.xml
Normal file
9
app/src/main/res/menu/menu_editor.xml
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item
|
||||
android:id="@+id/menu_save"
|
||||
android:icon="@drawable/ic_save"
|
||||
android:title="@string/save_as"
|
||||
app:showAsAction="ifRoom"/>
|
||||
</menu>
|
Loading…
Reference in a new issue