Loading build.gradle +1 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ buildscript { propMinSdkVersion = 16 propTargetSdkVersion = propCompileSdkVersion propVersionCode = 1 propVersionName = '3.1.4' propVersionName = '3.2.6' kotlin_version = '1.2.0' support_libs = '27.0.2' } Loading commons/build.gradle +2 −2 Original line number Diff line number Diff line Loading @@ -30,14 +30,14 @@ android { dependencies { compile "com.android.support:design:$support_libs" compile "com.android.support:appcompat-v7:$support_libs" compile 'com.github.bumptech.glide:glide:4.3.1' compile 'com.github.bumptech.glide:glide:4.4.0' compile 'com.booking:rtlviewpager:1.0.1' compile 'com.andrognito.patternlockview:patternlockview:1.0.0' compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' compile 'com.github.ajalt.reprint:core:3.2.0@aar' kapt 'com.github.bumptech.glide:compiler:4.3.1' kapt 'com.github.bumptech.glide:compiler:4.4.0' } apply from: '../bintray-upload.gradle' commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/FilePickerDialog.kt +5 −5 Original line number Diff line number Diff line Loading @@ -8,10 +8,7 @@ import android.view.KeyEvent import com.simplemobiletools.commons.R import com.simplemobiletools.commons.activities.BaseSimpleActivity import com.simplemobiletools.commons.adapters.FilepickerItemsAdapter import com.simplemobiletools.commons.extensions.beVisible import com.simplemobiletools.commons.extensions.getFilenameFromPath import com.simplemobiletools.commons.extensions.internalStoragePath import com.simplemobiletools.commons.extensions.setupDialogStuff import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.models.FileDirItem import com.simplemobiletools.commons.views.Breadcrumbs import kotlinx.android.synthetic.main.dialog_filepicker.view.* Loading Loading @@ -126,7 +123,10 @@ class FilePickerDialog(val activity: BaseSimpleActivity, mDialogView.apply { filepicker_list.adapter = adapter filepicker_breadcrumbs.setBreadcrumb(currPath) filepicker_fastscroller.setViews(filepicker_list) filepicker_fastscroller.allowBubbleDisplay = context.baseConfig.showInfoBubble filepicker_fastscroller.setViews(filepicker_list) { filepicker_fastscroller.updateBubbleText(items[it].getBubbleText()) } } layoutManager.onRestoreInstanceState(mScrollStates[currPath.trimEnd('/')]) Loading commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Activity-themes.kt +1 −1 Original line number Diff line number Diff line Loading @@ -194,5 +194,5 @@ fun Activity.getThemeId(color: Int = baseConfig.primaryColor) = when (color) { -13154481 -> R.style.AppTheme_Blue_Grey_800 -14273992 -> R.style.AppTheme_Blue_Grey_900 else -> throw RuntimeException("Unknown theme id $color") else -> R.style.AppTheme_Orange_700 } commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Activity.kt +21 −6 Original line number Diff line number Diff line Loading @@ -15,7 +15,10 @@ import android.provider.DocumentsContract import android.provider.MediaStore import android.support.v4.provider.DocumentFile import android.support.v7.app.AlertDialog import android.view.* import android.view.View import android.view.ViewGroup import android.view.Window import android.view.WindowManager import android.view.inputmethod.InputMethodManager import android.widget.EditText import android.widget.TextView Loading @@ -38,24 +41,36 @@ import java.util.* fun Activity.toast(id: Int, length: Int = Toast.LENGTH_SHORT) { if (isOnMainThread()) { Toast.makeText(this, id, length).show() showToast(this, id, length) } else { runOnUiThread { Toast.makeText(this, id, length).show() showToast(this, id, length) } } } fun Activity.toast(msg: String, length: Int = Toast.LENGTH_SHORT) { if (isOnMainThread()) { Toast.makeText(this, msg, length).show() showToast(this, msg, length) } else { runOnUiThread { Toast.makeText(this, msg, length).show() showToast(this, msg, length) } } } private fun showToast(activity: Activity, messageId: Int, length: Int) { if (!activity.isActivityDestroyed()) { Toast.makeText(activity, messageId, length).show() } } private fun showToast(activity: Activity, message: String, length: Int) { if (!activity.isActivityDestroyed()) { Toast.makeText(activity, message, length).show() } } fun Activity.showErrorToast(msg: String, length: Int = Toast.LENGTH_LONG) { toast(String.format(getString(R.string.an_error_occurred), msg), length) } Loading Loading @@ -621,7 +636,7 @@ fun Activity.setupDialogStuff(view: View, dialog: AlertDialog, titleId: Int = 0, var title: TextView? = null if (titleId != 0) { title = LayoutInflater.from(this).inflate(R.layout.dialog_title, null) as TextView title = layoutInflater.inflate(R.layout.dialog_title, null) as TextView title.dialog_title_textview.apply { setText(titleId) setTextColor(baseConfig.textColor) Loading Loading
build.gradle +1 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ buildscript { propMinSdkVersion = 16 propTargetSdkVersion = propCompileSdkVersion propVersionCode = 1 propVersionName = '3.1.4' propVersionName = '3.2.6' kotlin_version = '1.2.0' support_libs = '27.0.2' } Loading
commons/build.gradle +2 −2 Original line number Diff line number Diff line Loading @@ -30,14 +30,14 @@ android { dependencies { compile "com.android.support:design:$support_libs" compile "com.android.support:appcompat-v7:$support_libs" compile 'com.github.bumptech.glide:glide:4.3.1' compile 'com.github.bumptech.glide:glide:4.4.0' compile 'com.booking:rtlviewpager:1.0.1' compile 'com.andrognito.patternlockview:patternlockview:1.0.0' compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' compile 'com.github.ajalt.reprint:core:3.2.0@aar' kapt 'com.github.bumptech.glide:compiler:4.3.1' kapt 'com.github.bumptech.glide:compiler:4.4.0' } apply from: '../bintray-upload.gradle'
commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/FilePickerDialog.kt +5 −5 Original line number Diff line number Diff line Loading @@ -8,10 +8,7 @@ import android.view.KeyEvent import com.simplemobiletools.commons.R import com.simplemobiletools.commons.activities.BaseSimpleActivity import com.simplemobiletools.commons.adapters.FilepickerItemsAdapter import com.simplemobiletools.commons.extensions.beVisible import com.simplemobiletools.commons.extensions.getFilenameFromPath import com.simplemobiletools.commons.extensions.internalStoragePath import com.simplemobiletools.commons.extensions.setupDialogStuff import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.models.FileDirItem import com.simplemobiletools.commons.views.Breadcrumbs import kotlinx.android.synthetic.main.dialog_filepicker.view.* Loading Loading @@ -126,7 +123,10 @@ class FilePickerDialog(val activity: BaseSimpleActivity, mDialogView.apply { filepicker_list.adapter = adapter filepicker_breadcrumbs.setBreadcrumb(currPath) filepicker_fastscroller.setViews(filepicker_list) filepicker_fastscroller.allowBubbleDisplay = context.baseConfig.showInfoBubble filepicker_fastscroller.setViews(filepicker_list) { filepicker_fastscroller.updateBubbleText(items[it].getBubbleText()) } } layoutManager.onRestoreInstanceState(mScrollStates[currPath.trimEnd('/')]) Loading
commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Activity-themes.kt +1 −1 Original line number Diff line number Diff line Loading @@ -194,5 +194,5 @@ fun Activity.getThemeId(color: Int = baseConfig.primaryColor) = when (color) { -13154481 -> R.style.AppTheme_Blue_Grey_800 -14273992 -> R.style.AppTheme_Blue_Grey_900 else -> throw RuntimeException("Unknown theme id $color") else -> R.style.AppTheme_Orange_700 }
commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Activity.kt +21 −6 Original line number Diff line number Diff line Loading @@ -15,7 +15,10 @@ import android.provider.DocumentsContract import android.provider.MediaStore import android.support.v4.provider.DocumentFile import android.support.v7.app.AlertDialog import android.view.* import android.view.View import android.view.ViewGroup import android.view.Window import android.view.WindowManager import android.view.inputmethod.InputMethodManager import android.widget.EditText import android.widget.TextView Loading @@ -38,24 +41,36 @@ import java.util.* fun Activity.toast(id: Int, length: Int = Toast.LENGTH_SHORT) { if (isOnMainThread()) { Toast.makeText(this, id, length).show() showToast(this, id, length) } else { runOnUiThread { Toast.makeText(this, id, length).show() showToast(this, id, length) } } } fun Activity.toast(msg: String, length: Int = Toast.LENGTH_SHORT) { if (isOnMainThread()) { Toast.makeText(this, msg, length).show() showToast(this, msg, length) } else { runOnUiThread { Toast.makeText(this, msg, length).show() showToast(this, msg, length) } } } private fun showToast(activity: Activity, messageId: Int, length: Int) { if (!activity.isActivityDestroyed()) { Toast.makeText(activity, messageId, length).show() } } private fun showToast(activity: Activity, message: String, length: Int) { if (!activity.isActivityDestroyed()) { Toast.makeText(activity, message, length).show() } } fun Activity.showErrorToast(msg: String, length: Int = Toast.LENGTH_LONG) { toast(String.format(getString(R.string.an_error_occurred), msg), length) } Loading Loading @@ -621,7 +636,7 @@ fun Activity.setupDialogStuff(view: View, dialog: AlertDialog, titleId: Int = 0, var title: TextView? = null if (titleId != 0) { title = LayoutInflater.from(this).inflate(R.layout.dialog_title, null) as TextView title = layoutInflater.inflate(R.layout.dialog_title, null) as TextView title.dialog_title_textview.apply { setText(titleId) setTextColor(baseConfig.textColor) Loading