From db79756667ade0061f5ddb9d5ecf4162ae741d62 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 9 Apr 2017 09:46:44 +0200 Subject: [PATCH] add a menu button for opening files --- .../com/simplemobiletools/draw/activities/MainActivity.kt | 8 ++++++++ app/src/main/res/menu/menu.xml | 4 ++++ app/src/main/res/values-de/strings.xml | 1 + app/src/main/res/values-es/strings.xml | 1 + app/src/main/res/values-fr/strings.xml | 1 + app/src/main/res/values-it/strings.xml | 1 + app/src/main/res/values-ja/strings.xml | 1 + app/src/main/res/values-pt/strings.xml | 1 + app/src/main/res/values-sv/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 10 files changed, 20 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/draw/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/draw/activities/MainActivity.kt index c0b47c0..ef4fa25 100644 --- a/app/src/main/kotlin/com/simplemobiletools/draw/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/draw/activities/MainActivity.kt @@ -14,6 +14,7 @@ import android.view.Menu import android.view.MenuItem import android.widget.SeekBar import com.simplemobiletools.commons.dialogs.ColorPickerDialog +import com.simplemobiletools.commons.dialogs.FilePickerDialog import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.helpers.LICENSE_KOTLIN import com.simplemobiletools.draw.BuildConfig @@ -76,6 +77,7 @@ class MainActivity : SimpleActivity(), MyCanvas.PathsChangedListener { R.id.menu_save -> trySaveImage() R.id.menu_share -> shareImage() R.id.clear -> my_canvas.clearCanvas() + R.id.open_file -> openFile() R.id.change_background -> changeBackgroundClicked() R.id.settings -> launchSettings() R.id.about -> launchAbout() @@ -104,6 +106,12 @@ class MainActivity : SimpleActivity(), MyCanvas.PathsChangedListener { startAboutActivity(R.string.app_name, LICENSE_KOTLIN, BuildConfig.VERSION_NAME) } + private fun openFile() { + FilePickerDialog(this, curPath) { + + } + } + private fun changeBackgroundClicked() { val oldColor = (my_canvas.background as ColorDrawable).color ColorPickerDialog(this, oldColor) { diff --git a/app/src/main/res/menu/menu.xml b/app/src/main/res/menu/menu.xml index 7bfc02c..48e2a86 100644 --- a/app/src/main/res/menu/menu.xml +++ b/app/src/main/res/menu/menu.xml @@ -16,6 +16,10 @@ android:icon="@drawable/ic_share" android:title="@string/share" app:showAsAction="ifRoom"/> + Schlichter Zeichenblock Zeichenblock + Open file Show brush size tool diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index ad31efe..9f806d5 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -1,6 +1,7 @@ Simple Draw Draw + Open file Show brush size tool diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 924924c..5785419 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -1,6 +1,7 @@ Dessin simple Dessiner + Open file Show brush size tool diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 29a6898..e57a5f9 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -1,6 +1,7 @@ Simple Draw Draw + Open file Show brush size tool diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 01323f4..354e86c 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -1,6 +1,7 @@  シンプル ドロー ドロー + Open file Show brush size tool diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index d1feddc..74f7a1e 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -1,6 +1,7 @@ Simple Draw Desenho + Open file Mostrar ferramenta Tamanho do pincel diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 29a6898..e57a5f9 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -1,6 +1,7 @@ Simple Draw Draw + Open file Show brush size tool diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 29a6898..e57a5f9 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,6 +1,7 @@ Simple Draw Draw + Open file Show brush size tool