show a dialog warning about calling functionality moved into Simple Dialer

This commit is contained in:
tibbi 2020-05-23 20:14:06 +02:00
parent c0bfe21032
commit 4ae0cb3ba5
9 changed files with 80 additions and 5 deletions

View File

@ -27,15 +27,15 @@ import com.simplemobiletools.contacts.pro.BuildConfig
import com.simplemobiletools.contacts.pro.R
import com.simplemobiletools.contacts.pro.adapters.ViewPagerAdapter
import com.simplemobiletools.contacts.pro.databases.ContactsDatabase
import com.simplemobiletools.contacts.pro.dialogs.ChangeSortingDialog
import com.simplemobiletools.contacts.pro.dialogs.ExportContactsDialog
import com.simplemobiletools.contacts.pro.dialogs.FilterContactSourcesDialog
import com.simplemobiletools.contacts.pro.dialogs.ImportContactsDialog
import com.simplemobiletools.contacts.pro.dialogs.*
import com.simplemobiletools.contacts.pro.extensions.config
import com.simplemobiletools.contacts.pro.extensions.getTempFile
import com.simplemobiletools.contacts.pro.extensions.handleGenericContactClick
import com.simplemobiletools.contacts.pro.fragments.MyViewPagerFragment
import com.simplemobiletools.contacts.pro.helpers.*
import com.simplemobiletools.contacts.pro.helpers.ALL_TABS_MASK
import com.simplemobiletools.contacts.pro.helpers.ContactsHelper
import com.simplemobiletools.contacts.pro.helpers.VcfExporter
import com.simplemobiletools.contacts.pro.helpers.tabsList
import com.simplemobiletools.contacts.pro.interfaces.RefreshContactsListener
import com.simplemobiletools.contacts.pro.models.Contact
import kotlinx.android.synthetic.main.activity_main.*
@ -76,6 +76,7 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
checkContactPermissions()
storeStateVariables()
checkWhatsNewDialog()
checkDialerMigrationDialog()
}
private fun checkContactPermissions() {
@ -613,6 +614,17 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
private fun getAllFragments() = arrayListOf(contacts_fragment, favorites_fragment, groups_fragment)
private fun checkDialerMigrationDialog() {
if (config.appRunCount < 3) {
config.wasDialerMigrationShown = true
}
if (!config.wasDialerMigrationShown) {
config.wasDialerMigrationShown = true
DialerMovedDialog(this)
}
}
private fun checkWhatsNewDialog() {
arrayListOf<Release>().apply {
add(Release(10, R.string.release_10))

View File

@ -0,0 +1,30 @@
package com.simplemobiletools.contacts.pro.dialogs
import android.text.Html
import android.text.method.LinkMovementMethod
import androidx.appcompat.app.AlertDialog
import com.simplemobiletools.commons.activities.BaseSimpleActivity
import com.simplemobiletools.commons.extensions.launchViewIntent
import com.simplemobiletools.commons.extensions.setupDialogStuff
import com.simplemobiletools.contacts.pro.R
import kotlinx.android.synthetic.main.dialog_dialer_moved.view.*
class DialerMovedDialog(val activity: BaseSimpleActivity) {
init {
val view = activity.layoutInflater.inflate(R.layout.dialog_dialer_moved, null).apply {
dialer_moved.text = Html.fromHtml(activity.getString(R.string.dialer_moved))
dialer_moved.movementMethod = LinkMovementMethod.getInstance()
dialer_moved_icon.setOnClickListener {
activity.launchViewIntent("https://play.google.com/store/apps/details?id=com.simplemobiletools.dialer")
}
}
AlertDialog.Builder(activity)
.setPositiveButton(R.string.download) { dialog, which -> }
.setNegativeButton(R.string.cancel, null)
.create().apply {
activity.setupDialogStuff(view, this)
}
}
}

View File

@ -96,4 +96,8 @@ class Config(context: Context) : BaseConfig(context) {
return speedDialValues
}
var wasDialerMigrationShown: Boolean
get() = prefs.getBoolean(WAS_DIALER_MIGRATION_SHOWN, false)
set(wasDialerMigrationShown) = prefs.edit().putBoolean(WAS_DIALER_MIGRATION_SHOWN, wasDialerMigrationShown).apply()
}

View File

@ -25,6 +25,7 @@ const val LAST_EXPORT_PATH = "last_export_path"
const val WAS_LOCAL_ACCOUNT_INITIALIZED = "was_local_account_initialized"
const val REMEMBER_SIM_PREFIX = "remember_sim_"
const val SHOW_PRIVATE_CONTACTS = "show_private_contacts"
const val WAS_DIALER_MIGRATION_SHOWN = "was_dialer_migration_shown"
const val CONTACT_ID = "contact_id"
const val SMT_PRIVATE = "smt_private" // used at the contact source of local contacts hidden from other apps

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/dialer_moved"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:lineSpacingExtra="3dp"
android:paddingLeft="@dimen/bigger_margin"
android:paddingTop="@dimen/bigger_margin"
android:paddingRight="@dimen/bigger_margin"
android:paddingBottom="@dimen/normal_margin"
android:text="@string/dialer_moved"
android:textSize="@dimen/bigger_text_size" />
<ImageView
android:id="@+id/dialer_moved_icon"
android:layout_width="@dimen/min_row_height"
android:layout_height="@dimen/min_row_height"
android:layout_below="@+id/dialer_moved"
android:layout_centerHorizontal="true"
android:layout_margin="@dimen/medium_margin"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_launcher_dialer" />
</RelativeLayout>