update commons to 3.17.24

This commit is contained in:
tibbi 2018-04-04 15:25:33 +02:00
parent 962801a3ed
commit eca9af3a3e
8 changed files with 40 additions and 49 deletions

View File

@ -42,9 +42,9 @@ android {
}
dependencies {
implementation 'com.simplemobiletools:commons:3.8.1'
implementation 'com.simplemobiletools:commons:3.17.24'
implementation 'com.facebook.stetho:stetho:1.5.0'
implementation 'com.android.support:multidex:1.0.2'
implementation 'com.android.support:multidex:1.0.3'
}
Properties props = new Properties()

View File

@ -15,9 +15,7 @@ import com.simplemobiletools.applauncher.extensions.isAPredefinedApp
import com.simplemobiletools.applauncher.models.AppLauncher
import com.simplemobiletools.commons.extensions.appLaunched
import com.simplemobiletools.commons.extensions.checkWhatsNew
import com.simplemobiletools.commons.extensions.restartActivity
import com.simplemobiletools.commons.extensions.updateTextColors
import com.simplemobiletools.commons.helpers.LICENSE_KOTLIN
import com.simplemobiletools.commons.helpers.LICENSE_MULTISELECT
import com.simplemobiletools.commons.helpers.LICENSE_STETHO
import com.simplemobiletools.commons.interfaces.RefreshRecyclerViewListener
@ -29,7 +27,6 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
private var launchers = ArrayList<AppLauncher>()
private var mStoredPrimaryColor = 0
private var mStoredTextColor = 0
private var mStoredUseEnglish = false
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
@ -48,17 +45,15 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
override fun onResume() {
super.onResume()
if (mStoredUseEnglish != config.useEnglish) {
restartActivity()
return
}
if (mStoredTextColor != config.textColor) {
getGridAdapter()?.updateTextColor(config.textColor)
}
if (mStoredPrimaryColor != config.primaryColor) {
getGridAdapter()?.updatePrimaryColor(config.primaryColor)
getGridAdapter()?.apply {
updatePrimaryColor(config.primaryColor)
notifyDataSetChanged()
}
}
updateTextColors(coordinator_layout)
@ -88,7 +83,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
}
private fun launchAbout() {
startAboutActivity(R.string.app_name, LICENSE_KOTLIN or LICENSE_MULTISELECT or LICENSE_STETHO, BuildConfig.VERSION_NAME)
startAboutActivity(R.string.app_name, LICENSE_MULTISELECT or LICENSE_STETHO, BuildConfig.VERSION_NAME)
}
private fun getGridAdapter() = launchers_grid.adapter as? LaunchersAdapter
@ -107,7 +102,6 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
startActivity(intent)
}
}
adapter.setupDragListener(true)
launchers_grid.adapter = adapter
}
@ -127,7 +121,6 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
config.apply {
mStoredPrimaryColor = primaryColor
mStoredTextColor = textColor
mStoredUseEnglish = useEnglish
}
}

View File

@ -5,7 +5,6 @@ import com.simplemobiletools.applauncher.R
import com.simplemobiletools.applauncher.extensions.config
import com.simplemobiletools.commons.extensions.beVisibleIf
import com.simplemobiletools.commons.extensions.updateTextColors
import com.simplemobiletools.commons.extensions.useEnglishToggled
import kotlinx.android.synthetic.main.activity_settings.*
import java.util.*
@ -36,7 +35,7 @@ class SettingsActivity : SimpleActivity() {
settings_use_english_holder.setOnClickListener {
settings_use_english.toggle()
config.useEnglish = settings_use_english.isChecked
useEnglishToggled()
System.exit(0)
}
}
}

View File

@ -20,6 +20,10 @@ import java.util.*
class LaunchersAdapter(activity: SimpleActivity, val launchers: MutableList<AppLauncher>, val listener: RefreshRecyclerViewListener?,
recyclerView: MyRecyclerView, itemClick: (Any) -> Unit) : MyRecyclerViewAdapter(activity, recyclerView, null, itemClick) {
init {
setupDragListener(true)
}
override fun getActionMenuId() = R.menu.cab
override fun prepareItemSelection(view: View) {
@ -30,7 +34,7 @@ class LaunchersAdapter(activity: SimpleActivity, val launchers: MutableList<AppL
view?.launcher_check?.beVisibleIf(select)
}
override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int) = createViewHolder(R.layout.app_launcher_item, parent)
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = createViewHolder(R.layout.app_launcher_item, parent)
override fun onBindViewHolder(holder: MyRecyclerViewAdapter.ViewHolder, position: Int) {
val launcher = launchers[position]
@ -84,11 +88,6 @@ class LaunchersAdapter(activity: SimpleActivity, val launchers: MutableList<AppL
removeSelectedItems()
}
fun updatePrimaryColor(primaryColor: Int) {
this.primaryColor = primaryColor
notifyDataSetChanged()
}
private fun setupView(view: View, launcher: AppLauncher) {
view.apply {
launcher_label.text = launcher.name

View File

@ -59,8 +59,8 @@ class LaunchersDialogAdapter(activity: Activity, val launchers: ArrayList<AppLau
toggleItemSelection(selectedPositions.contains(position), position)
}
override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): ViewHolder {
val view = LayoutInflater.from(parent?.context).inflate(R.layout.app_launcher_item, parent, false)
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val view = LayoutInflater.from(parent.context).inflate(R.layout.app_launcher_item, parent, false)
return ViewHolder(view, adapterListener)
}

View File

@ -3,11 +3,11 @@ package com.simplemobiletools.applauncher.dialogs
import android.app.Activity
import android.support.v7.app.AlertDialog
import android.view.ViewGroup
import android.view.WindowManager
import com.simplemobiletools.applauncher.R
import com.simplemobiletools.applauncher.extensions.dbHelper
import com.simplemobiletools.applauncher.models.AppLauncher
import com.simplemobiletools.commons.extensions.setupDialogStuff
import com.simplemobiletools.commons.extensions.showKeyboard
import com.simplemobiletools.commons.extensions.toast
import com.simplemobiletools.commons.extensions.value
import kotlinx.android.synthetic.main.dialog_edit_launcher.view.*
@ -23,8 +23,8 @@ class EditDialog(val activity: Activity, val appLauncher: AppLauncher, val callb
.setPositiveButton(R.string.ok, null)
.setNegativeButton(R.string.cancel, null)
.create().apply {
window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE)
activity.setupDialogStuff(view, this, R.string.rename) {
showKeyboard(view.edit_launcher_edittext)
getButton(android.app.AlertDialog.BUTTON_POSITIVE).setOnClickListener {
val newName = view.edit_launcher_edittext.value
if (!newName.isEmpty()) {

View File

@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.2.20'
ext.kotlin_version = '1.2.31'
repositories {
jcenter()
@ -9,7 +9,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.android.tools.build:gradle:3.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong