update commons to 3.12.15
This commit is contained in:
parent
74140b1665
commit
42eb8e4609
|
@ -45,7 +45,7 @@ ext {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.simplemobiletools:commons:3.11.5'
|
||||
implementation 'com.simplemobiletools:commons:3.12.15'
|
||||
implementation 'joda-time:joda-time:2.9.9'
|
||||
implementation 'com.facebook.stetho:stetho:1.5.0'
|
||||
implementation 'com.google.code.gson:gson:2.8.2'
|
||||
|
|
|
@ -172,6 +172,11 @@
|
|||
android:label="@string/customize_colors"
|
||||
android:parentActivityName=".activities.SettingsActivity"/>
|
||||
|
||||
<activity
|
||||
android:name="com.simplemobiletools.commons.activities.FAQActivity"
|
||||
android:label="@string/frequently_asked_questions"
|
||||
android:parentActivityName="com.simplemobiletools.commons.activities.AboutActivity"/>
|
||||
|
||||
<provider
|
||||
android:name="android.support.v4.content.FileProvider"
|
||||
android:authorities="${applicationId}.provider"
|
||||
|
|
|
@ -14,6 +14,7 @@ import android.view.MenuItem
|
|||
import com.simplemobiletools.commons.dialogs.FilePickerDialog
|
||||
import com.simplemobiletools.commons.extensions.*
|
||||
import com.simplemobiletools.commons.helpers.*
|
||||
import com.simplemobiletools.commons.models.FAQItem
|
||||
import com.simplemobiletools.commons.models.Release
|
||||
import com.simplemobiletools.contacts.BuildConfig
|
||||
import com.simplemobiletools.contacts.R
|
||||
|
@ -374,8 +375,9 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
|
|||
}
|
||||
|
||||
private fun launchAbout() {
|
||||
val faqItems = arrayListOf(FAQItem(R.string.faq_2_title_commons, R.string.faq_2_text_commons))
|
||||
startAboutActivity(R.string.app_name, LICENSE_KOTLIN or LICENSE_MULTISELECT or LICENSE_JODA or LICENSE_GLIDE or LICENSE_GSON or LICENSE_STETHO,
|
||||
BuildConfig.VERSION_NAME)
|
||||
BuildConfig.VERSION_NAME, faqItems)
|
||||
}
|
||||
|
||||
override fun refreshContacts() {
|
||||
|
|
|
@ -4,8 +4,7 @@ import android.content.Intent
|
|||
import android.net.Uri
|
||||
import com.simplemobiletools.commons.activities.BaseSimpleActivity
|
||||
import com.simplemobiletools.commons.dialogs.RadioGroupDialog
|
||||
import com.simplemobiletools.commons.extensions.getFilePublicUri
|
||||
import com.simplemobiletools.commons.extensions.shareUri
|
||||
import com.simplemobiletools.commons.extensions.sharePathIntent
|
||||
import com.simplemobiletools.commons.extensions.toast
|
||||
import com.simplemobiletools.commons.helpers.PERMISSION_CALL_PHONE
|
||||
import com.simplemobiletools.commons.models.RadioItem
|
||||
|
@ -93,8 +92,7 @@ fun BaseSimpleActivity.shareContacts(contacts: ArrayList<Contact>) {
|
|||
|
||||
VcfExporter().exportContacts(this, file, contacts) {
|
||||
if (it == VcfExporter.ExportResult.EXPORT_OK) {
|
||||
val uri = getFilePublicUri(file, BuildConfig.APPLICATION_ID)
|
||||
shareUri(uri, BuildConfig.APPLICATION_ID)
|
||||
sharePathIntent(file.absolutePath, BuildConfig.APPLICATION_ID)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,18 +2,12 @@ package com.simplemobiletools.contacts.helpers
|
|||
|
||||
import android.content.Context
|
||||
import com.simplemobiletools.commons.helpers.BaseConfig
|
||||
import com.simplemobiletools.commons.helpers.SORTING
|
||||
import com.simplemobiletools.commons.helpers.SORT_BY_FIRST_NAME
|
||||
|
||||
class Config(context: Context) : BaseConfig(context) {
|
||||
companion object {
|
||||
fun newInstance(context: Context) = Config(context)
|
||||
}
|
||||
|
||||
var sorting: Int
|
||||
get() = prefs.getInt(SORTING, SORT_BY_FIRST_NAME)
|
||||
set(sorting) = prefs.edit().putInt(SORTING, sorting).apply()
|
||||
|
||||
var displayContactSources: Set<String>
|
||||
get() = prefs.getStringSet(DISPLAY_CONTACT_SOURCES, hashSetOf("-1"))
|
||||
set(displayContactSources) = prefs.edit().remove(DISPLAY_CONTACT_SOURCES).putStringSet(DISPLAY_CONTACT_SOURCES, displayContactSources).apply()
|
||||
|
|
|
@ -8,6 +8,7 @@ import android.util.Base64
|
|||
import com.simplemobiletools.commons.activities.BaseSimpleActivity
|
||||
import com.simplemobiletools.commons.extensions.getFileOutputStream
|
||||
import com.simplemobiletools.commons.extensions.showErrorToast
|
||||
import com.simplemobiletools.commons.extensions.toFileDirItem
|
||||
import com.simplemobiletools.commons.extensions.writeLn
|
||||
import com.simplemobiletools.contacts.helpers.VcfExporter.ExportResult.*
|
||||
import com.simplemobiletools.contacts.models.Contact
|
||||
|
@ -27,7 +28,7 @@ class VcfExporter {
|
|||
|
||||
fun exportContacts(activity: BaseSimpleActivity, file: File, contacts: ArrayList<Contact>, callback: (result: ExportResult) -> Unit) {
|
||||
try {
|
||||
activity.getFileOutputStream(file) {
|
||||
activity.getFileOutputStream(file.toFileDirItem(activity)) {
|
||||
if (it == null) {
|
||||
callback(EXPORT_FAIL)
|
||||
return@getFileOutputStream
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
<resources>
|
||||
<integer name="default_sorting">128</integer>
|
||||
</resources>
|
Loading…
Reference in New Issue