From fb4c4aa6f34e69a2a90db6ec4ddb2a06f6ea0827 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 10 Nov 2017 23:15:12 +0100 Subject: [PATCH] some updates here and there --- app/src/main/AndroidManifest.xml | 31 ++++-- .../applauncher/activities/AboutActivity.kt | 105 ------------------ .../applauncher/activities/LicenseActivity.kt | 22 ---- .../applauncher/activities/MainActivity.kt | 50 ++++----- .../activities/SettingsActivity.kt | 19 ---- .../applauncher/activities/SimpleActivity.kt | 24 +--- .../applauncher/activities/SplashActivity.kt | 13 +++ .../applauncher/adapters/RecyclerAdapter.kt | 14 +-- .../adapters/RecyclerDialogAdapter.kt | 13 +-- .../applauncher/databases/DbHelper.kt | 28 ++--- .../applauncher/extensions/Context.kt | 6 + .../applauncher/extensions/context.kt | 10 -- .../applauncher/extensions/preferences.kt | 33 ------ .../applauncher/extensions/view.kt | 11 -- .../applauncher/helpers/Config.kt | 10 ++ .../applauncher/models/AppLauncher.kt | 2 +- app/src/main/res/layout/activity_about.xml | 105 ------------------ app/src/main/res/layout/activity_license.xml | 50 --------- app/src/main/res/layout/activity_settings.xml | 27 +---- 19 files changed, 99 insertions(+), 474 deletions(-) delete mode 100644 app/src/main/kotlin/com/simplemobiletools/applauncher/activities/AboutActivity.kt delete mode 100644 app/src/main/kotlin/com/simplemobiletools/applauncher/activities/LicenseActivity.kt create mode 100644 app/src/main/kotlin/com/simplemobiletools/applauncher/activities/SplashActivity.kt create mode 100644 app/src/main/kotlin/com/simplemobiletools/applauncher/extensions/Context.kt delete mode 100644 app/src/main/kotlin/com/simplemobiletools/applauncher/extensions/context.kt delete mode 100644 app/src/main/kotlin/com/simplemobiletools/applauncher/extensions/preferences.kt delete mode 100644 app/src/main/kotlin/com/simplemobiletools/applauncher/extensions/view.kt create mode 100644 app/src/main/kotlin/com/simplemobiletools/applauncher/helpers/Config.kt delete mode 100644 app/src/main/res/layout/activity_about.xml delete mode 100644 app/src/main/res/layout/activity_license.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 7bcbc04..8739fea 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -15,7 +15,10 @@ android:label="@string/app_launcher_name" android:supportsRtl="true" android:theme="@style/AppTheme"> - + + @@ -23,19 +26,27 @@ - - - + + + + + + + + diff --git a/app/src/main/kotlin/com/simplemobiletools/applauncher/activities/AboutActivity.kt b/app/src/main/kotlin/com/simplemobiletools/applauncher/activities/AboutActivity.kt deleted file mode 100644 index 7c51def..0000000 --- a/app/src/main/kotlin/com/simplemobiletools/applauncher/activities/AboutActivity.kt +++ /dev/null @@ -1,105 +0,0 @@ -package com.simplemobiletools.applauncher.activities - -import android.content.ActivityNotFoundException -import android.content.Intent -import android.os.Bundle -import android.text.Html -import android.text.method.LinkMovementMethod -import android.view.View -import com.simplemobiletools.applauncher.BuildConfig -import com.simplemobiletools.applauncher.R -import com.simplemobiletools.applauncher.extensions.isFirstRun -import com.simplemobiletools.applauncher.extensions.preferences -import com.simplemobiletools.applauncher.extensions.viewIntent -import kotlinx.android.synthetic.main.activity_about.* -import java.util.* - -class AboutActivity : SimpleActivity() { - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setContentView(R.layout.activity_about) - - setupEmail() - setupInvite() - setupRateUs() - setupLicense() - setupSocial() - setupCopyright() - } - - private fun setupEmail() { - val email = getString(R.string.email) - val appName = getString(R.string.app_name) - val href = "$email" - about_email.text = Html.fromHtml(href) - about_email.movementMethod = LinkMovementMethod.getInstance() - } - - private fun setupInvite() { - val intent = Intent() - val text = String.format(getString(R.string.share_text), getString(R.string.app_name), getStoreUrl()) - intent.action = Intent.ACTION_SEND - intent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.app_name)) - intent.putExtra(Intent.EXTRA_TEXT, text) - intent.type = "text/plain" - - about_invite.setOnClickListener { - startActivity(Intent.createChooser(intent, getString(R.string.invite_via))) - } - } - - private fun setupRateUs() { - if (preferences.isFirstRun) { - about_rate_us.visibility = View.GONE - } - - about_rate_us.setOnClickListener { - startActivity(viewIntent(getRateUsUrl())) - } - } - - private fun setupLicense() { - about_license.setOnClickListener { - startActivity(Intent(applicationContext, LicenseActivity::class.java)) - } - } - - private fun setupSocial() { - about_facebook.setOnClickListener { - startActivity(viewIntent(getFacebookUrl())) - } - - about_gplus.setOnClickListener { - val link = "https://plus.google.com/communities/104880861558693868382" - startActivity(viewIntent(link)) - } - } - - private fun setupCopyright() { - val versionName = BuildConfig.VERSION_NAME - val year = Calendar.getInstance().get(Calendar.YEAR) - about_copyright.text = String.format(getString(R.string.copyright), versionName, year) - } - - private fun getFacebookUrl(): String { - try { - packageManager.getPackageInfo("com.facebook.katana", 0) - return "fb://page/150270895341774" - } catch (ignored: Exception) { - return "https://www.facebook.com/simplemobiletools" - } - } - - private fun getRateUsUrl(): String { - try { - return "market://details?id=" + packageName - } catch (ignored: ActivityNotFoundException) { - return getStoreUrl() - } - } - - private fun getStoreUrl(): String { - return "https://play.google.com/store/apps/details?id=" + packageName - } -} diff --git a/app/src/main/kotlin/com/simplemobiletools/applauncher/activities/LicenseActivity.kt b/app/src/main/kotlin/com/simplemobiletools/applauncher/activities/LicenseActivity.kt deleted file mode 100644 index 8260a5c..0000000 --- a/app/src/main/kotlin/com/simplemobiletools/applauncher/activities/LicenseActivity.kt +++ /dev/null @@ -1,22 +0,0 @@ -package com.simplemobiletools.applauncher.activities - -import android.os.Bundle -import com.simplemobiletools.applauncher.R -import com.simplemobiletools.applauncher.extensions.viewIntent -import kotlinx.android.synthetic.main.activity_license.* - -class LicenseActivity : SimpleActivity() { - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setContentView(R.layout.activity_license) - - license_kotlin_title.setOnClickListener { - startActivity(viewIntent(getString(R.string.kotlin_url))) - } - - license_multiselect_title.setOnClickListener { - startActivity(viewIntent(getString(R.string.multiselect_url))) - } - } -} diff --git a/app/src/main/kotlin/com/simplemobiletools/applauncher/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/applauncher/activities/MainActivity.kt index e56902f..a3a8238 100644 --- a/app/src/main/kotlin/com/simplemobiletools/applauncher/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/applauncher/activities/MainActivity.kt @@ -2,21 +2,21 @@ package com.simplemobiletools.applauncher.activities import android.content.Intent import android.content.pm.PackageManager +import android.net.Uri import android.os.Bundle import android.view.Menu import android.view.MenuItem -import android.view.View +import android.widget.ImageView +import com.simplemobiletools.applauncher.BuildConfig import com.simplemobiletools.applauncher.R import com.simplemobiletools.applauncher.adapters.RecyclerAdapter import com.simplemobiletools.applauncher.databases.DbHelper import com.simplemobiletools.applauncher.dialogs.AddAppDialog -import com.simplemobiletools.applauncher.extensions.isFirstRun -import com.simplemobiletools.applauncher.extensions.preferences -import com.simplemobiletools.applauncher.extensions.viewIntent import com.simplemobiletools.applauncher.models.AppLauncher +import com.simplemobiletools.commons.extensions.beInvisible +import com.simplemobiletools.commons.helpers.LICENSE_KOTLIN import kotlinx.android.synthetic.main.activity_main.* import java.util.* -import kotlin.comparisons.compareBy class MainActivity : SimpleActivity(), AddAppDialog.AddLaunchersInterface, RecyclerAdapter.RecyclerInterface { lateinit var dbHelper: DbHelper @@ -39,18 +39,21 @@ class MainActivity : SimpleActivity(), AddAppDialog.AddLaunchersInterface, Recyc return true } - override fun onOptionsItemSelected(item: MenuItem?): Boolean { - when (item?.itemId) { - R.id.settings -> { - startActivity(Intent(applicationContext, SettingsActivity::class.java)) - return true - } - R.id.about -> { - startActivity(Intent(applicationContext, AboutActivity::class.java)) - return true - } + override fun onOptionsItemSelected(item: MenuItem): Boolean { + when (item.itemId) { + R.id.settings -> launchSettings() + R.id.about -> launchAbout() + else -> return super.onOptionsItemSelected(item) } - return super.onOptionsItemSelected(item) + return true + } + + private fun launchSettings() { + startActivity(Intent(applicationContext, SettingsActivity::class.java)) + } + + private fun launchAbout() { + startAboutActivity(R.string.app_name, LICENSE_KOTLIN, BuildConfig.VERSION_NAME) } private fun setupLaunchers() { @@ -62,7 +65,9 @@ class MainActivity : SimpleActivity(), AddAppDialog.AddLaunchersInterface, Recyc startActivity(launchIntent) finish() } else { - startActivity(viewIntent("https://play.google.com/store/apps/details?id=" + it.pkgName)) + val url = "https://play.google.com/store/apps/details?id=${it.pkgName}" + val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url)) + startActivity(intent) } } @@ -125,19 +130,14 @@ class MainActivity : SimpleActivity(), AddAppDialog.AddLaunchersInterface, Recyc refreshLaunchers() } - fun refreshLaunchers() { + private fun refreshLaunchers() { (launchers_holder.adapter as RecyclerAdapter).finishActionMode() setupLaunchers() } override fun refreshLauncherIcons() { - for (pos in 0..launchers_holder.childCount - 1) { - launchers_holder.getChildAt(pos).findViewById(R.id.launcher_check).visibility = View.INVISIBLE + for (pos in 0 until launchers_holder.childCount) { + launchers_holder.getChildAt(pos).findViewById(R.id.launcher_check).beInvisible() } } - - override fun onDestroy() { - super.onDestroy() - preferences.isFirstRun = false - } } diff --git a/app/src/main/kotlin/com/simplemobiletools/applauncher/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/applauncher/activities/SettingsActivity.kt index 1db1530..a444fd5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/applauncher/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/applauncher/activities/SettingsActivity.kt @@ -1,31 +1,12 @@ package com.simplemobiletools.applauncher.activities import android.os.Bundle -import android.support.v4.app.TaskStackBuilder import com.simplemobiletools.applauncher.R -import com.simplemobiletools.applauncher.extensions.isDarkTheme -import com.simplemobiletools.applauncher.extensions.preferences -import kotlinx.android.synthetic.main.activity_settings.* class SettingsActivity : SimpleActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_settings) - setupDarkTheme() - } - - private fun setupDarkTheme() { - settings_dark_theme.isChecked = preferences.isDarkTheme - - settings_dark_theme_holder.setOnClickListener { - settings_dark_theme.toggle() - preferences.isDarkTheme = settings_dark_theme.isChecked - restartActivity() - } - } - - private fun restartActivity() { - TaskStackBuilder.create(applicationContext).addNextIntentWithParentStack(intent).startActivities() } } diff --git a/app/src/main/kotlin/com/simplemobiletools/applauncher/activities/SimpleActivity.kt b/app/src/main/kotlin/com/simplemobiletools/applauncher/activities/SimpleActivity.kt index 59831a7..884d77c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/applauncher/activities/SimpleActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/applauncher/activities/SimpleActivity.kt @@ -1,25 +1,5 @@ package com.simplemobiletools.applauncher.activities -import android.os.Bundle -import android.support.v7.app.AppCompatActivity -import android.view.MenuItem -import com.simplemobiletools.applauncher.R -import com.simplemobiletools.applauncher.extensions.isDarkTheme -import com.simplemobiletools.applauncher.extensions.preferences +import com.simplemobiletools.commons.activities.BaseSimpleActivity -open class SimpleActivity : AppCompatActivity() { - override fun onCreate(savedInstanceState: Bundle?) { - setTheme(if (preferences.isDarkTheme) R.style.AppTheme_Dark else R.style.AppTheme) - super.onCreate(savedInstanceState) - } - - override fun onOptionsItemSelected(item: MenuItem?): Boolean { - when (item?.itemId) { - android.R.id.home -> { - finish() - return true - } - } - return super.onOptionsItemSelected(item) - } -} +open class SimpleActivity : BaseSimpleActivity() diff --git a/app/src/main/kotlin/com/simplemobiletools/applauncher/activities/SplashActivity.kt b/app/src/main/kotlin/com/simplemobiletools/applauncher/activities/SplashActivity.kt new file mode 100644 index 0000000..fadd1e8 --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/applauncher/activities/SplashActivity.kt @@ -0,0 +1,13 @@ +package com.simplemobiletools.applauncher.activities + +import android.content.Intent +import android.os.Bundle +import android.support.v7.app.AppCompatActivity + +class SplashActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + startActivity(Intent(this, MainActivity::class.java)) + finish() + } +} diff --git a/app/src/main/kotlin/com/simplemobiletools/applauncher/adapters/RecyclerAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/applauncher/adapters/RecyclerAdapter.kt index e5a1a92..8920dc9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/applauncher/adapters/RecyclerAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/applauncher/adapters/RecyclerAdapter.kt @@ -12,10 +12,10 @@ import com.bignerdranch.android.multiselector.MultiSelector import com.bignerdranch.android.multiselector.SwappingHolder import com.simplemobiletools.applauncher.R import com.simplemobiletools.applauncher.databases.DbHelper -import com.simplemobiletools.applauncher.extensions.hide -import com.simplemobiletools.applauncher.extensions.show -import com.simplemobiletools.applauncher.extensions.toast import com.simplemobiletools.applauncher.models.AppLauncher +import com.simplemobiletools.commons.extensions.beInvisibleIf +import com.simplemobiletools.commons.extensions.beVisible +import com.simplemobiletools.commons.extensions.toast import kotlinx.android.synthetic.main.app_launcher_item.view.* import kotlinx.android.synthetic.main.edit_launcher.view.* import java.util.* @@ -152,7 +152,7 @@ class RecyclerAdapter(val act: Activity, val launchers: List, val i (act as AppCompatActivity).startSupportActionMode(multiSelectorCallback) multiSelector.setSelected(viewHolder, true) actMode?.title = multiSelector.selectedPositions.size.toString() - itemView.launcher_check.show() + itemView.launcher_check.beVisible() } true } @@ -171,11 +171,7 @@ class RecyclerAdapter(val act: Activity, val launchers: List, val i if (multiSelector.isSelectable) { val isSelected = multiSelector.selectedPositions.contains(viewHolder.layoutPosition) multiSelector.setSelected(viewHolder, !isSelected) - if (isSelected) { - itemView.launcher_check.hide() - } else { - itemView.launcher_check.show() - } + itemView.launcher_check.beInvisibleIf(isSelected) val selectedCnt = multiSelector.selectedPositions.size if (selectedCnt == 0) { diff --git a/app/src/main/kotlin/com/simplemobiletools/applauncher/adapters/RecyclerDialogAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/applauncher/adapters/RecyclerDialogAdapter.kt index f2dda9f..aedda43 100644 --- a/app/src/main/kotlin/com/simplemobiletools/applauncher/adapters/RecyclerDialogAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/applauncher/adapters/RecyclerDialogAdapter.kt @@ -6,9 +6,8 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import com.simplemobiletools.applauncher.R -import com.simplemobiletools.applauncher.extensions.hide -import com.simplemobiletools.applauncher.extensions.show import com.simplemobiletools.applauncher.models.AppLauncher +import com.simplemobiletools.commons.extensions.beInvisibleIf import kotlinx.android.synthetic.main.app_launcher_item.view.* class RecyclerDialogAdapter(val cxt: Context, val launchers: List) : RecyclerView.Adapter() { @@ -22,9 +21,7 @@ class RecyclerDialogAdapter(val cxt: Context, val launchers: List) return ViewHolder(view) } - override fun getItemCount(): Int { - return launchers.count() - } + override fun getItemCount() = launchers.count() class ViewHolder(view: View) : RecyclerView.ViewHolder(view) { fun bindView(context: Context, launcher: AppLauncher) { @@ -47,11 +44,7 @@ class RecyclerDialogAdapter(val cxt: Context, val launchers: List) } fun handleCheck(check: View, launcher: AppLauncher) { - if (launcher.isChecked) { - check.show() - } else { - check.hide() - } + check.beInvisibleIf(!launcher.isChecked) } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/applauncher/databases/DbHelper.kt b/app/src/main/kotlin/com/simplemobiletools/applauncher/databases/DbHelper.kt index 6769cad..f21a2b1 100644 --- a/app/src/main/kotlin/com/simplemobiletools/applauncher/databases/DbHelper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/applauncher/databases/DbHelper.kt @@ -28,7 +28,16 @@ class DbHelper(context: Context) : SQLiteOpenHelper(context, "launchers.db", nul val POSITION: String = "position" } - fun addInitialLaunchers(db: SQLiteDatabase) { + + override fun onCreate(db: SQLiteDatabase) { + db.execSQL(CREATE_DB) + addInitialLaunchers(db) + } + + override fun onUpgrade(db: SQLiteDatabase?, oldVersion: Int, newVersion: Int) { + } + + private fun addInitialLaunchers(db: SQLiteDatabase) { addLauncher(string(R.string.calculator), "com.simplemobiletools.calculator", R.mipmap.calculator, db) addLauncher(string(R.string.calendar), "com.simplemobiletools.calendar", R.mipmap.calendar, db) addLauncher(string(R.string.camera), "com.simplemobiletools.camera", R.mipmap.camera, db) @@ -64,7 +73,7 @@ class DbHelper(context: Context) : SQLiteOpenHelper(context, "launchers.db", nul fun getLaunchers(): ArrayList { val launchers = ArrayList() val cursor = readableDatabase.query(TABLE, arrayOf(ID, NAME, PKG_NAME, ICON_ID), null, null, null, null, NAME) - try { + cursor.use { while (cursor.moveToNext()) { val id = cursor.getInt(cursor.getColumnIndex(DbHelper.ID)) val name = cursor.getString(cursor.getColumnIndex(DbHelper.NAME)) @@ -72,22 +81,9 @@ class DbHelper(context: Context) : SQLiteOpenHelper(context, "launchers.db", nul val icon = cursor.getInt(cursor.getColumnIndex(DbHelper.ICON_ID)) launchers.add(AppLauncher(id, name, pkgName, icon)) } - } finally { - cursor.close() } return launchers } - override fun onCreate(db: SQLiteDatabase) { - db.execSQL(CREATE_DB) - addInitialLaunchers(db) - } - - override fun onUpgrade(db: SQLiteDatabase?, oldVersion: Int, newVersion: Int) { - - } - - private fun string(id: Int): String { - return resources.getString(id) - } + private fun string(id: Int) = resources.getString(id) } diff --git a/app/src/main/kotlin/com/simplemobiletools/applauncher/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/applauncher/extensions/Context.kt new file mode 100644 index 0000000..acfcf81 --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/applauncher/extensions/Context.kt @@ -0,0 +1,6 @@ +package com.simplemobiletools.applauncher.extensions + +import android.content.Context +import com.simplemobiletools.applauncher.helpers.Config + +val Context.config: Config get() = Config.newInstance(applicationContext) diff --git a/app/src/main/kotlin/com/simplemobiletools/applauncher/extensions/context.kt b/app/src/main/kotlin/com/simplemobiletools/applauncher/extensions/context.kt deleted file mode 100644 index 3b86b22..0000000 --- a/app/src/main/kotlin/com/simplemobiletools/applauncher/extensions/context.kt +++ /dev/null @@ -1,10 +0,0 @@ -package com.simplemobiletools.applauncher.extensions - -import android.content.Context -import android.content.Intent -import android.net.Uri -import android.widget.Toast - -fun Context.viewIntent(url: String): Intent = Intent(Intent.ACTION_VIEW, Uri.parse(url)) - -fun Context.toast(msgId: Int, duration: Int = Toast.LENGTH_SHORT) = Toast.makeText(this, resources.getString(msgId), duration).show() diff --git a/app/src/main/kotlin/com/simplemobiletools/applauncher/extensions/preferences.kt b/app/src/main/kotlin/com/simplemobiletools/applauncher/extensions/preferences.kt deleted file mode 100644 index 58c1e7f..0000000 --- a/app/src/main/kotlin/com/simplemobiletools/applauncher/extensions/preferences.kt +++ /dev/null @@ -1,33 +0,0 @@ -package com.simplemobiletools.applauncher.extensions - -import android.content.Context -import android.content.SharedPreferences - -val PREFS_KEY = "App Launcher" -val IS_FIRST_RUN = "is_first_run" -val IS_DARK_THEME = "is_dark_theme" - -private val defaultInit: Any.() -> Unit = {} - -val Context.preferences: SharedPreferences get() = preferences() -fun Context.preferences(init: SharedPreferences.() -> Unit = defaultInit): SharedPreferences { - val defaultPreferences = getSharedPreferences(PREFS_KEY, Context.MODE_PRIVATE) - defaultPreferences.init() - return defaultPreferences -} - -var SharedPreferences.isFirstRun: Boolean - set(isFirstRun: Boolean) { - edit().putBoolean(IS_FIRST_RUN, isFirstRun).apply() - } - get() { - return getBoolean(IS_FIRST_RUN, true) - } - -var SharedPreferences.isDarkTheme: Boolean - set(isDarkTheme: Boolean) { - edit().putBoolean(IS_DARK_THEME, isDarkTheme).apply() - } - get() { - return getBoolean(IS_DARK_THEME, false) - } diff --git a/app/src/main/kotlin/com/simplemobiletools/applauncher/extensions/view.kt b/app/src/main/kotlin/com/simplemobiletools/applauncher/extensions/view.kt deleted file mode 100644 index cee54b4..0000000 --- a/app/src/main/kotlin/com/simplemobiletools/applauncher/extensions/view.kt +++ /dev/null @@ -1,11 +0,0 @@ -package com.simplemobiletools.applauncher.extensions - -import android.view.View - -fun View.hide() { - visibility = View.INVISIBLE -} - -fun View.show() { - visibility = View.VISIBLE -} diff --git a/app/src/main/kotlin/com/simplemobiletools/applauncher/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/applauncher/helpers/Config.kt new file mode 100644 index 0000000..30f8733 --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/applauncher/helpers/Config.kt @@ -0,0 +1,10 @@ +package com.simplemobiletools.applauncher.helpers + +import android.content.Context +import com.simplemobiletools.commons.helpers.BaseConfig + +class Config(context: Context) : BaseConfig(context) { + companion object { + fun newInstance(context: Context) = Config(context) + } +} diff --git a/app/src/main/kotlin/com/simplemobiletools/applauncher/models/AppLauncher.kt b/app/src/main/kotlin/com/simplemobiletools/applauncher/models/AppLauncher.kt index 0978faa..87f72b1 100644 --- a/app/src/main/kotlin/com/simplemobiletools/applauncher/models/AppLauncher.kt +++ b/app/src/main/kotlin/com/simplemobiletools/applauncher/models/AppLauncher.kt @@ -2,6 +2,6 @@ package com.simplemobiletools.applauncher.models data class AppLauncher(val id: Int, var name: String, val pkgName: String, val iconId: Int, var isChecked: Boolean = false) { override fun equals(other: Any?): Boolean { - return pkgName.equals((other as AppLauncher).pkgName) + return pkgName.equals((other as AppLauncher).pkgName, true) } } diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml deleted file mode 100644 index f43c95d..0000000 --- a/app/src/main/res/layout/activity_about.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/activity_license.xml b/app/src/main/res/layout/activity_license.xml deleted file mode 100644 index 9eaa5a3..0000000 --- a/app/src/main/res/layout/activity_license.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 7c4901f..2b0f81b 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -1,7 +1,7 @@ @@ -11,30 +11,5 @@ android:layout_height="wrap_content" android:orientation="vertical"> - - - - - - -