mirror of
https://github.com/SimpleMobileTools/Simple-Draw.git
synced 2025-01-28 23:59:18 +01:00
formatting some code, no real change
This commit is contained in:
parent
d3f8b59490
commit
bb797c4670
@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
package="com.simplemobiletools.draw.pro"
|
package="com.simplemobiletools.draw.pro"
|
||||||
android:installLocation="auto">
|
android:installLocation="auto">
|
||||||
@ -10,11 +9,11 @@
|
|||||||
android:maxSdkVersion="28" />
|
android:maxSdkVersion="28" />
|
||||||
<uses-permission
|
<uses-permission
|
||||||
android:name="android.permission.USE_FINGERPRINT"
|
android:name="android.permission.USE_FINGERPRINT"
|
||||||
tools:node="remove"/>
|
tools:node="remove" />
|
||||||
|
|
||||||
<uses-feature
|
<uses-feature
|
||||||
android:name="android.hardware.faketouch"
|
android:name="android.hardware.faketouch"
|
||||||
android:required="false"/>
|
android:required="false" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:name=".App"
|
android:name=".App"
|
||||||
@ -26,69 +25,69 @@
|
|||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.SplashActivity"
|
android:name=".activities.SplashActivity"
|
||||||
android:theme="@style/SplashTheme"/>
|
android:theme="@style/SplashTheme" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.MainActivity"
|
android:name=".activities.MainActivity"
|
||||||
android:configChanges="orientation">
|
android:configChanges="orientation">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.VIEW"/>
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
<category android:name="android.intent.category.BROWSABLE"/>
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
<category android:name="android.intent.category.DEFAULT"/>
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
|
||||||
<data android:mimeType="image/*"/>
|
<data android:mimeType="image/*" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.SEND"/>
|
<action android:name="android.intent.action.SEND" />
|
||||||
<category android:name="android.intent.category.DEFAULT"/>
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
<data android:mimeType="image/*"/>
|
<data android:mimeType="image/*" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.SEND_MULTIPLE"/>
|
<action android:name="android.intent.action.SEND_MULTIPLE" />
|
||||||
<category android:name="android.intent.category.DEFAULT"/>
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
<data android:mimeType="image/*"/>
|
<data android:mimeType="image/*" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.media.action.IMAGE_CAPTURE"/>
|
<action android:name="android.media.action.IMAGE_CAPTURE" />
|
||||||
<category android:name="android.intent.category.DEFAULT"/>
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.EDIT"/>
|
<action android:name="android.intent.action.EDIT" />
|
||||||
<category android:name="android.intent.category.DEFAULT"/>
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
<data android:mimeType="image/*"/>
|
<data android:mimeType="image/*" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.SettingsActivity"
|
android:name=".activities.SettingsActivity"
|
||||||
android:label="@string/settings"
|
android:label="@string/settings"
|
||||||
android:parentActivityName=".activities.MainActivity"/>
|
android:parentActivityName=".activities.MainActivity" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.simplemobiletools.commons.activities.AboutActivity"
|
android:name="com.simplemobiletools.commons.activities.AboutActivity"
|
||||||
android:label="@string/about"
|
android:label="@string/about"
|
||||||
android:parentActivityName=".activities.MainActivity"/>
|
android:parentActivityName=".activities.MainActivity" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.simplemobiletools.commons.activities.LicenseActivity"
|
android:name="com.simplemobiletools.commons.activities.LicenseActivity"
|
||||||
android:label="@string/third_party_licences"
|
android:label="@string/third_party_licences"
|
||||||
android:parentActivityName="com.simplemobiletools.commons.activities.AboutActivity"/>
|
android:parentActivityName="com.simplemobiletools.commons.activities.AboutActivity" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.simplemobiletools.commons.activities.CustomizationActivity"
|
android:name="com.simplemobiletools.commons.activities.CustomizationActivity"
|
||||||
android:label="@string/customize_colors"
|
android:label="@string/customize_colors"
|
||||||
android:parentActivityName=".activities.SettingsActivity"/>
|
android:parentActivityName=".activities.SettingsActivity" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.simplemobiletools.commons.activities.FAQActivity"
|
android:name="com.simplemobiletools.commons.activities.FAQActivity"
|
||||||
android:label="@string/frequently_asked_questions"
|
android:label="@string/frequently_asked_questions"
|
||||||
android:parentActivityName="com.simplemobiletools.commons.activities.AboutActivity"/>
|
android:parentActivityName="com.simplemobiletools.commons.activities.AboutActivity" />
|
||||||
|
|
||||||
<provider
|
<provider
|
||||||
android:name="androidx.core.content.FileProvider"
|
android:name="androidx.core.content.FileProvider"
|
||||||
@ -97,7 +96,7 @@
|
|||||||
android:grantUriPermissions="true">
|
android:grantUriPermissions="true">
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||||
android:resource="@xml/provider_paths"/>
|
android:resource="@xml/provider_paths" />
|
||||||
</provider>
|
</provider>
|
||||||
|
|
||||||
<activity-alias
|
<activity-alias
|
||||||
@ -108,8 +107,8 @@
|
|||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity-alias>
|
</activity-alias>
|
||||||
|
|
||||||
@ -121,8 +120,8 @@
|
|||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity-alias>
|
</activity-alias>
|
||||||
|
|
||||||
@ -134,8 +133,8 @@
|
|||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity-alias>
|
</activity-alias>
|
||||||
|
|
||||||
@ -147,8 +146,8 @@
|
|||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity-alias>
|
</activity-alias>
|
||||||
|
|
||||||
@ -160,8 +159,8 @@
|
|||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity-alias>
|
</activity-alias>
|
||||||
|
|
||||||
@ -173,8 +172,8 @@
|
|||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity-alias>
|
</activity-alias>
|
||||||
|
|
||||||
@ -186,8 +185,8 @@
|
|||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity-alias>
|
</activity-alias>
|
||||||
|
|
||||||
@ -199,8 +198,8 @@
|
|||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity-alias>
|
</activity-alias>
|
||||||
|
|
||||||
@ -212,8 +211,8 @@
|
|||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity-alias>
|
</activity-alias>
|
||||||
|
|
||||||
@ -225,8 +224,8 @@
|
|||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity-alias>
|
</activity-alias>
|
||||||
|
|
||||||
@ -238,8 +237,8 @@
|
|||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity-alias>
|
</activity-alias>
|
||||||
|
|
||||||
@ -251,8 +250,8 @@
|
|||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity-alias>
|
</activity-alias>
|
||||||
|
|
||||||
@ -264,8 +263,8 @@
|
|||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity-alias>
|
</activity-alias>
|
||||||
|
|
||||||
@ -277,8 +276,8 @@
|
|||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity-alias>
|
</activity-alias>
|
||||||
|
|
||||||
@ -289,8 +288,8 @@
|
|||||||
android:roundIcon="@mipmap/ic_launcher"
|
android:roundIcon="@mipmap/ic_launcher"
|
||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity-alias>
|
</activity-alias>
|
||||||
|
|
||||||
@ -302,8 +301,8 @@
|
|||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity-alias>
|
</activity-alias>
|
||||||
|
|
||||||
@ -315,8 +314,8 @@
|
|||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity-alias>
|
</activity-alias>
|
||||||
|
|
||||||
@ -328,8 +327,8 @@
|
|||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity-alias>
|
</activity-alias>
|
||||||
|
|
||||||
@ -341,8 +340,8 @@
|
|||||||
android:targetActivity=".activities.SplashActivity">
|
android:targetActivity=".activities.SplashActivity">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity-alias>
|
</activity-alias>
|
||||||
</application>
|
</application>
|
||||||
|
@ -177,9 +177,9 @@ class MainActivity : SimpleActivity(), CanvasListener {
|
|||||||
val licenses = LICENSE_GLIDE
|
val licenses = LICENSE_GLIDE
|
||||||
|
|
||||||
val faqItems = arrayListOf(
|
val faqItems = arrayListOf(
|
||||||
FAQItem(R.string.faq_2_title_commons, R.string.faq_2_text_commons),
|
FAQItem(R.string.faq_2_title_commons, R.string.faq_2_text_commons),
|
||||||
FAQItem(R.string.faq_6_title_commons, R.string.faq_6_text_commons),
|
FAQItem(R.string.faq_6_title_commons, R.string.faq_6_text_commons),
|
||||||
FAQItem(R.string.faq_7_title_commons, R.string.faq_7_text_commons))
|
FAQItem(R.string.faq_7_title_commons, R.string.faq_7_text_commons))
|
||||||
|
|
||||||
startAboutActivity(R.string.app_name, licenses, BuildConfig.VERSION_NAME, faqItems, false)
|
startAboutActivity(R.string.app_name, licenses, BuildConfig.VERSION_NAME, faqItems, false)
|
||||||
}
|
}
|
||||||
|
@ -5,25 +5,25 @@ import com.simplemobiletools.draw.pro.R
|
|||||||
|
|
||||||
open class SimpleActivity : BaseSimpleActivity() {
|
open class SimpleActivity : BaseSimpleActivity() {
|
||||||
override fun getAppIconIDs() = arrayListOf(
|
override fun getAppIconIDs() = arrayListOf(
|
||||||
R.mipmap.ic_launcher_red,
|
R.mipmap.ic_launcher_red,
|
||||||
R.mipmap.ic_launcher_pink,
|
R.mipmap.ic_launcher_pink,
|
||||||
R.mipmap.ic_launcher_purple,
|
R.mipmap.ic_launcher_purple,
|
||||||
R.mipmap.ic_launcher_deep_purple,
|
R.mipmap.ic_launcher_deep_purple,
|
||||||
R.mipmap.ic_launcher_indigo,
|
R.mipmap.ic_launcher_indigo,
|
||||||
R.mipmap.ic_launcher_blue,
|
R.mipmap.ic_launcher_blue,
|
||||||
R.mipmap.ic_launcher_light_blue,
|
R.mipmap.ic_launcher_light_blue,
|
||||||
R.mipmap.ic_launcher_cyan,
|
R.mipmap.ic_launcher_cyan,
|
||||||
R.mipmap.ic_launcher_teal,
|
R.mipmap.ic_launcher_teal,
|
||||||
R.mipmap.ic_launcher_green,
|
R.mipmap.ic_launcher_green,
|
||||||
R.mipmap.ic_launcher_light_green,
|
R.mipmap.ic_launcher_light_green,
|
||||||
R.mipmap.ic_launcher_lime,
|
R.mipmap.ic_launcher_lime,
|
||||||
R.mipmap.ic_launcher_yellow,
|
R.mipmap.ic_launcher_yellow,
|
||||||
R.mipmap.ic_launcher_amber,
|
R.mipmap.ic_launcher_amber,
|
||||||
R.mipmap.ic_launcher,
|
R.mipmap.ic_launcher,
|
||||||
R.mipmap.ic_launcher_deep_orange,
|
R.mipmap.ic_launcher_deep_orange,
|
||||||
R.mipmap.ic_launcher_brown,
|
R.mipmap.ic_launcher_brown,
|
||||||
R.mipmap.ic_launcher_blue_grey,
|
R.mipmap.ic_launcher_blue_grey,
|
||||||
R.mipmap.ic_launcher_grey_black
|
R.mipmap.ic_launcher_grey_black
|
||||||
)
|
)
|
||||||
|
|
||||||
override fun getAppLauncherName() = getString(R.string.app_launcher_name)
|
override fun getAppLauncherName() = getString(R.string.app_launcher_name)
|
||||||
|
@ -42,43 +42,43 @@ class SaveImageDialog(val activity: SimpleActivity, val defaultPath: String, val
|
|||||||
}
|
}
|
||||||
|
|
||||||
AlertDialog.Builder(activity)
|
AlertDialog.Builder(activity)
|
||||||
.setPositiveButton(R.string.ok, null)
|
.setPositiveButton(R.string.ok, null)
|
||||||
.setNegativeButton(R.string.cancel, null)
|
.setNegativeButton(R.string.cancel, null)
|
||||||
.create().apply {
|
.create().apply {
|
||||||
activity.setupDialogStuff(view, this, R.string.save_as) {
|
activity.setupDialogStuff(view, this, R.string.save_as) {
|
||||||
showKeyboard(view.save_image_filename)
|
showKeyboard(view.save_image_filename)
|
||||||
getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener {
|
getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener {
|
||||||
val filename = view.save_image_filename.value
|
val filename = view.save_image_filename.value
|
||||||
if (filename.isEmpty()) {
|
if (filename.isEmpty()) {
|
||||||
activity.toast(R.string.filename_cannot_be_empty)
|
activity.toast(R.string.filename_cannot_be_empty)
|
||||||
return@setOnClickListener
|
return@setOnClickListener
|
||||||
}
|
}
|
||||||
|
|
||||||
val extension = when (view.save_image_radio_group.checkedRadioButtonId) {
|
val extension = when (view.save_image_radio_group.checkedRadioButtonId) {
|
||||||
R.id.save_image_radio_png -> PNG
|
R.id.save_image_radio_png -> PNG
|
||||||
R.id.save_image_radio_svg -> SVG
|
R.id.save_image_radio_svg -> SVG
|
||||||
else -> JPG
|
else -> JPG
|
||||||
}
|
}
|
||||||
|
|
||||||
val newPath = "${folder.trimEnd('/')}/$filename.$extension"
|
val newPath = "${folder.trimEnd('/')}/$filename.$extension"
|
||||||
if (!newPath.getFilenameFromPath().isAValidFilename()) {
|
if (!newPath.getFilenameFromPath().isAValidFilename()) {
|
||||||
activity.toast(R.string.filename_invalid_characters)
|
activity.toast(R.string.filename_invalid_characters)
|
||||||
return@setOnClickListener
|
return@setOnClickListener
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hidePath && File(newPath).exists()) {
|
if (!hidePath && File(newPath).exists()) {
|
||||||
val title = String.format(activity.getString(R.string.file_already_exists_overwrite), newPath.getFilenameFromPath())
|
val title = String.format(activity.getString(R.string.file_already_exists_overwrite), newPath.getFilenameFromPath())
|
||||||
ConfirmationDialog(activity, title) {
|
ConfirmationDialog(activity, title) {
|
||||||
callback(newPath, filename, extension)
|
|
||||||
dismiss()
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
callback(newPath, filename, extension)
|
callback(newPath, filename, extension)
|
||||||
dismiss()
|
dismiss()
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
callback(newPath, filename, extension)
|
||||||
|
dismiss()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getInitialFilename(): String {
|
private fun getInitialFilename(): String {
|
||||||
|
@ -28,8 +28,8 @@ class MyCanvas(context: Context, attrs: AttributeSet) : View(context, attrs) {
|
|||||||
var mListener: CanvasListener? = null
|
var mListener: CanvasListener? = null
|
||||||
|
|
||||||
private var mLastPaths = LinkedHashMap<MyPath, PaintOptions>()
|
private var mLastPaths = LinkedHashMap<MyPath, PaintOptions>()
|
||||||
private var mLastBackgroundBitmap: Bitmap? = null
|
|
||||||
private var mUndonePaths = LinkedHashMap<MyPath, PaintOptions>()
|
private var mUndonePaths = LinkedHashMap<MyPath, PaintOptions>()
|
||||||
|
private var mLastBackgroundBitmap: Bitmap? = null
|
||||||
|
|
||||||
private var mPaint = Paint()
|
private var mPaint = Paint()
|
||||||
private var mPath = MyPath()
|
private var mPath = MyPath()
|
||||||
@ -142,16 +142,16 @@ class MyCanvas(context: Context, attrs: AttributeSet) : View(context, attrs) {
|
|||||||
val size = Point()
|
val size = Point()
|
||||||
activity.windowManager.defaultDisplay.getSize(size)
|
activity.windowManager.defaultDisplay.getSize(size)
|
||||||
val options = RequestOptions()
|
val options = RequestOptions()
|
||||||
.format(DecodeFormat.PREFER_ARGB_8888)
|
.format(DecodeFormat.PREFER_ARGB_8888)
|
||||||
.disallowHardwareConfig()
|
.disallowHardwareConfig()
|
||||||
.fitCenter()
|
.fitCenter()
|
||||||
|
|
||||||
try {
|
try {
|
||||||
val builder = Glide.with(context)
|
val builder = Glide.with(context)
|
||||||
.asBitmap()
|
.asBitmap()
|
||||||
.load(path)
|
.load(path)
|
||||||
.apply(options)
|
.apply(options)
|
||||||
.into(size.x, size.y)
|
.into(size.x, size.y)
|
||||||
|
|
||||||
mBackgroundBitmap = builder.get()
|
mBackgroundBitmap = builder.get()
|
||||||
activity.runOnUiThread {
|
activity.runOnUiThread {
|
||||||
|
@ -1,13 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<shape
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:shape="oval">
|
android:shape="oval">
|
||||||
|
|
||||||
<solid
|
<solid android:color="@color/color_primary" />
|
||||||
android:color="@color/color_primary"/>
|
|
||||||
|
|
||||||
<stroke
|
<stroke
|
||||||
android:width="@dimen/preview_dot_stroke_size"
|
android:width="@dimen/preview_dot_stroke_size"
|
||||||
android:color="@color/white"/>
|
android:color="@android:color/white" />
|
||||||
|
|
||||||
</shape>
|
</shape>
|
||||||
|
@ -17,9 +17,9 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/medium_margin"
|
android:layout_marginTop="@dimen/medium_margin"
|
||||||
android:background="?attr/selectableItemBackground"
|
android:background="?attr/selectableItemBackground"
|
||||||
android:paddingLeft="@dimen/normal_margin"
|
android:paddingStart="@dimen/normal_margin"
|
||||||
android:paddingTop="@dimen/activity_margin"
|
android:paddingTop="@dimen/activity_margin"
|
||||||
android:paddingRight="@dimen/normal_margin"
|
android:paddingEnd="@dimen/normal_margin"
|
||||||
android:paddingBottom="@dimen/activity_margin">
|
android:paddingBottom="@dimen/activity_margin">
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
@ -28,7 +28,6 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:paddingStart="@dimen/medium_margin"
|
android:paddingStart="@dimen/medium_margin"
|
||||||
android:paddingLeft="@dimen/medium_margin"
|
|
||||||
android:text="@string/customize_colors" />
|
android:text="@string/customize_colors" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
@ -39,9 +38,9 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/medium_margin"
|
android:layout_marginTop="@dimen/medium_margin"
|
||||||
android:background="?attr/selectableItemBackground"
|
android:background="?attr/selectableItemBackground"
|
||||||
android:paddingLeft="@dimen/normal_margin"
|
android:paddingStart="@dimen/normal_margin"
|
||||||
android:paddingTop="@dimen/activity_margin"
|
android:paddingTop="@dimen/activity_margin"
|
||||||
android:paddingRight="@dimen/normal_margin"
|
android:paddingEnd="@dimen/normal_margin"
|
||||||
android:paddingBottom="@dimen/activity_margin">
|
android:paddingBottom="@dimen/activity_margin">
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MySwitchCompat
|
<com.simplemobiletools.commons.views.MySwitchCompat
|
||||||
@ -51,7 +50,6 @@
|
|||||||
android:background="@null"
|
android:background="@null"
|
||||||
android:clickable="false"
|
android:clickable="false"
|
||||||
android:paddingStart="@dimen/medium_margin"
|
android:paddingStart="@dimen/medium_margin"
|
||||||
android:paddingLeft="@dimen/medium_margin"
|
|
||||||
android:text="@string/use_english_language"
|
android:text="@string/use_english_language"
|
||||||
app:switchPadding="@dimen/medium_margin" />
|
app:switchPadding="@dimen/medium_margin" />
|
||||||
|
|
||||||
@ -63,9 +61,9 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/medium_margin"
|
android:layout_marginTop="@dimen/medium_margin"
|
||||||
android:background="?attr/selectableItemBackground"
|
android:background="?attr/selectableItemBackground"
|
||||||
android:paddingLeft="@dimen/normal_margin"
|
android:paddingStart="@dimen/normal_margin"
|
||||||
android:paddingTop="@dimen/activity_margin"
|
android:paddingTop="@dimen/activity_margin"
|
||||||
android:paddingRight="@dimen/normal_margin"
|
android:paddingEnd="@dimen/normal_margin"
|
||||||
android:paddingBottom="@dimen/activity_margin">
|
android:paddingBottom="@dimen/activity_margin">
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MySwitchCompat
|
<com.simplemobiletools.commons.views.MySwitchCompat
|
||||||
@ -75,7 +73,6 @@
|
|||||||
android:background="@null"
|
android:background="@null"
|
||||||
android:clickable="false"
|
android:clickable="false"
|
||||||
android:paddingStart="@dimen/medium_margin"
|
android:paddingStart="@dimen/medium_margin"
|
||||||
android:paddingLeft="@dimen/medium_margin"
|
|
||||||
android:text="@string/prevent_phone_from_sleeping"
|
android:text="@string/prevent_phone_from_sleeping"
|
||||||
app:switchPadding="@dimen/medium_margin" />
|
app:switchPadding="@dimen/medium_margin" />
|
||||||
|
|
||||||
@ -87,9 +84,9 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/medium_margin"
|
android:layout_marginTop="@dimen/medium_margin"
|
||||||
android:background="?attr/selectableItemBackground"
|
android:background="?attr/selectableItemBackground"
|
||||||
android:paddingLeft="@dimen/normal_margin"
|
android:paddingStart="@dimen/normal_margin"
|
||||||
android:paddingTop="@dimen/activity_margin"
|
android:paddingTop="@dimen/activity_margin"
|
||||||
android:paddingRight="@dimen/normal_margin"
|
android:paddingEnd="@dimen/normal_margin"
|
||||||
android:paddingBottom="@dimen/activity_margin">
|
android:paddingBottom="@dimen/activity_margin">
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MySwitchCompat
|
<com.simplemobiletools.commons.views.MySwitchCompat
|
||||||
@ -99,7 +96,6 @@
|
|||||||
android:background="@null"
|
android:background="@null"
|
||||||
android:clickable="false"
|
android:clickable="false"
|
||||||
android:paddingStart="@dimen/medium_margin"
|
android:paddingStart="@dimen/medium_margin"
|
||||||
android:paddingLeft="@dimen/medium_margin"
|
|
||||||
android:text="@string/show_brush_size"
|
android:text="@string/show_brush_size"
|
||||||
app:switchPadding="@dimen/medium_margin" />
|
app:switchPadding="@dimen/medium_margin" />
|
||||||
|
|
||||||
@ -111,9 +107,9 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/medium_margin"
|
android:layout_marginTop="@dimen/medium_margin"
|
||||||
android:background="?attr/selectableItemBackground"
|
android:background="?attr/selectableItemBackground"
|
||||||
android:paddingLeft="@dimen/normal_margin"
|
android:paddingStart="@dimen/normal_margin"
|
||||||
android:paddingTop="@dimen/activity_margin"
|
android:paddingTop="@dimen/activity_margin"
|
||||||
android:paddingRight="@dimen/normal_margin"
|
android:paddingEnd="@dimen/normal_margin"
|
||||||
android:paddingBottom="@dimen/activity_margin">
|
android:paddingBottom="@dimen/activity_margin">
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MySwitchCompat
|
<com.simplemobiletools.commons.views.MySwitchCompat
|
||||||
@ -123,7 +119,6 @@
|
|||||||
android:background="@null"
|
android:background="@null"
|
||||||
android:clickable="false"
|
android:clickable="false"
|
||||||
android:paddingStart="@dimen/medium_margin"
|
android:paddingStart="@dimen/medium_margin"
|
||||||
android:paddingLeft="@dimen/medium_margin"
|
|
||||||
android:text="@string/allow_zooming_canvas"
|
android:text="@string/allow_zooming_canvas"
|
||||||
app:switchPadding="@dimen/medium_margin" />
|
app:switchPadding="@dimen/medium_margin" />
|
||||||
|
|
||||||
@ -135,9 +130,9 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/medium_margin"
|
android:layout_marginTop="@dimen/medium_margin"
|
||||||
android:background="?attr/selectableItemBackground"
|
android:background="?attr/selectableItemBackground"
|
||||||
android:paddingLeft="@dimen/normal_margin"
|
android:paddingStart="@dimen/normal_margin"
|
||||||
android:paddingTop="@dimen/activity_margin"
|
android:paddingTop="@dimen/activity_margin"
|
||||||
android:paddingRight="@dimen/normal_margin"
|
android:paddingEnd="@dimen/normal_margin"
|
||||||
android:paddingBottom="@dimen/activity_margin">
|
android:paddingBottom="@dimen/activity_margin">
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MySwitchCompat
|
<com.simplemobiletools.commons.views.MySwitchCompat
|
||||||
@ -147,7 +142,6 @@
|
|||||||
android:background="@null"
|
android:background="@null"
|
||||||
android:clickable="false"
|
android:clickable="false"
|
||||||
android:paddingStart="@dimen/medium_margin"
|
android:paddingStart="@dimen/medium_margin"
|
||||||
android:paddingLeft="@dimen/medium_margin"
|
|
||||||
android:text="@string/force_portrait_mode"
|
android:text="@string/force_portrait_mode"
|
||||||
app:switchPadding="@dimen/medium_margin" />
|
app:switchPadding="@dimen/medium_margin" />
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user