add About and License activities

This commit is contained in:
tibbi 2017-01-07 20:33:28 +01:00
parent 1cc6df5e42
commit e3842109fa
4 changed files with 23 additions and 25 deletions

View file

@ -38,14 +38,19 @@
</activity>
<activity
android:name=".activities.AboutActivity"
android:name="com.simplemobiletools.commons.activities.AboutActivity"
android:label="@string/about"
android:parentActivityName=".activities.MainActivity"/>
<activity
android:name=".activities.LicenseActivity"
android:name="com.simplemobiletools.commons.activities.CustomizationActivity"
android:label="@string/customize_colors"
android:parentActivityName=".activities.SettingsActivity"/>
<activity
android:name="com.simplemobiletools.commons.activities.LicenseActivity"
android:label="@string/third_party_licences"
android:parentActivityName=".activities.AboutActivity"/>
android:parentActivityName="com.simplemobiletools.commons.activities.AboutActivity"/>
<activity
android:name=".activities.SettingsActivity"

View file

@ -1,10 +0,0 @@
package com.simplemobiletools.musicplayer.activities
import android.os.Bundle
class AboutActivity : SimpleActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
}
}

View file

@ -1,10 +0,0 @@
package com.simplemobiletools.musicplayer.activities
import android.os.Bundle
class LicenseActivity : SimpleActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
}
}

View file

@ -13,7 +13,12 @@ import android.view.View
import android.widget.SeekBar
import com.simplemobiletools.commons.extensions.hasStoragePermission
import com.simplemobiletools.commons.extensions.toast
import com.simplemobiletools.commons.helpers.LICENSE_AMBILWARNA
import com.simplemobiletools.commons.helpers.LICENSE_KOTLIN
import com.simplemobiletools.commons.helpers.LICENSE_MULTISELECT
import com.simplemobiletools.commons.helpers.LICENSE_OTTO
import com.simplemobiletools.commons.views.RecyclerViewDivider
import com.simplemobiletools.musicplayer.BuildConfig
import com.simplemobiletools.musicplayer.R
import com.simplemobiletools.musicplayer.adapters.SongAdapter
import com.simplemobiletools.musicplayer.dialogs.ChangeSortingDialog
@ -92,11 +97,11 @@ class MainActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListener {
true
}
R.id.settings -> {
startActivity(Intent(applicationContext, SettingsActivity::class.java))
launchSettings()
true
}
R.id.about -> {
startActivity(Intent(applicationContext, AboutActivity::class.java))
launchAbout()
true
}
else -> super.onOptionsItemSelected(item)
@ -115,6 +120,14 @@ class MainActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListener {
}
}
private fun launchSettings() {
startActivity(Intent(applicationContext, SettingsActivity::class.java))
}
private fun launchAbout() {
startAboutActivity(R.string.app_name, LICENSE_KOTLIN or LICENSE_AMBILWARNA or LICENSE_OTTO or LICENSE_MULTISELECT, BuildConfig.VERSION_NAME)
}
private fun showSortingDialog() {
ChangeSortingDialog(this) {
sendIntent(REFRESH_LIST)