use the extension function for launching About activity
This commit is contained in:
parent
710afc12fd
commit
612bb269e3
|
@ -20,10 +20,11 @@ import android.widget.EditText
|
|||
import android.widget.RadioGroup
|
||||
import android.widget.SeekBar
|
||||
import android.widget.Toast
|
||||
import com.simplemobiletools.commons.activities.AboutActivity
|
||||
import com.simplemobiletools.commons.dialogs.ColorPickerDialog
|
||||
import com.simplemobiletools.commons.extensions.beVisibleIf
|
||||
import com.simplemobiletools.commons.extensions.toast
|
||||
import com.simplemobiletools.commons.helpers.LICENSE_KOTLIN
|
||||
import com.simplemobiletools.draw.BuildConfig
|
||||
import com.simplemobiletools.draw.MyCanvas
|
||||
import com.simplemobiletools.draw.R
|
||||
import com.simplemobiletools.draw.Svg
|
||||
|
@ -116,7 +117,7 @@ class MainActivity : SimpleActivity(), MyCanvas.PathsChangedListener {
|
|||
return true
|
||||
}
|
||||
R.id.about -> {
|
||||
startActivity(Intent(applicationContext, AboutActivity::class.java))
|
||||
launchAbout()
|
||||
return true
|
||||
}
|
||||
else -> return super.onOptionsItemSelected(item)
|
||||
|
@ -135,6 +136,10 @@ class MainActivity : SimpleActivity(), MyCanvas.PathsChangedListener {
|
|||
}
|
||||
}
|
||||
|
||||
private fun launchAbout() {
|
||||
startAboutActivity(R.string.app_name, LICENSE_KOTLIN, BuildConfig.VERSION_NAME)
|
||||
}
|
||||
|
||||
private fun saveImage() {
|
||||
if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
|
||||
ActivityCompat.requestPermissions(this, arrayOf(Manifest.permission.READ_EXTERNAL_STORAGE), STORAGE_PERMISSION)
|
||||
|
|
Loading…
Reference in New Issue