require Simple Thank You for color customization

This commit is contained in:
tibbi
2020-12-31 09:56:16 +01:00
parent e5ee3832b4
commit 8f4933b7a9
7 changed files with 38 additions and 11 deletions

View File

@ -56,6 +56,6 @@ android {
} }
dependencies { dependencies {
implementation 'com.simplemobiletools:commons:5.32.6' implementation 'com.simplemobiletools:commons:5.32.16'
implementation 'com.github.tibbi:IndicatorFastScroll:08f512858a' implementation 'com.github.tibbi:IndicatorFastScroll:08f512858a'
} }

View File

@ -44,7 +44,7 @@ class DialpadActivity : SimpleActivity() {
} }
speedDialValues = config.getSpeedDialValues() speedDialValues = config.getSpeedDialValues()
privateCursor = getMyContactsCursor().loadInBackground() privateCursor = getMyContactsCursor()?.loadInBackground()
dialpad_0_holder.setOnClickListener { dialpadPressed('0', it) } dialpad_0_holder.setOnClickListener { dialpadPressed('0', it) }
dialpad_1.setOnClickListener { dialpadPressed('1', it) } dialpad_1.setOnClickListener { dialpadPressed('1', it) }

View File

@ -8,10 +8,7 @@ import android.view.Menu
import com.simplemobiletools.commons.activities.ManageBlockedNumbersActivity import com.simplemobiletools.commons.activities.ManageBlockedNumbersActivity
import com.simplemobiletools.commons.dialogs.ChangeDateTimeFormatDialog import com.simplemobiletools.commons.dialogs.ChangeDateTimeFormatDialog
import com.simplemobiletools.commons.dialogs.RadioGroupDialog import com.simplemobiletools.commons.dialogs.RadioGroupDialog
import com.simplemobiletools.commons.extensions.baseConfig import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.extensions.beVisibleIf
import com.simplemobiletools.commons.extensions.getFontSizeText
import com.simplemobiletools.commons.extensions.updateTextColors
import com.simplemobiletools.commons.helpers.* import com.simplemobiletools.commons.helpers.*
import com.simplemobiletools.commons.models.RadioItem import com.simplemobiletools.commons.models.RadioItem
import com.simplemobiletools.dialer.R import com.simplemobiletools.dialer.R
@ -28,6 +25,7 @@ class SettingsActivity : SimpleActivity() {
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
setupPurchaseThankYou()
setupCustomizeColors() setupCustomizeColors()
setupUseEnglish() setupUseEnglish()
setupManageBlockedNumbers() setupManageBlockedNumbers()
@ -46,9 +44,17 @@ class SettingsActivity : SimpleActivity() {
return super.onCreateOptionsMenu(menu) return super.onCreateOptionsMenu(menu)
} }
private fun setupPurchaseThankYou() {
settings_purchase_thank_you_holder.beGoneIf(isOrWasThankYouInstalled())
settings_purchase_thank_you_holder.setOnClickListener {
launchPurchaseThankYouIntent()
}
}
private fun setupCustomizeColors() { private fun setupCustomizeColors() {
settings_customize_colors_label.text = getCustomizeColorsString()
settings_customize_colors_holder.setOnClickListener { settings_customize_colors_holder.setOnClickListener {
startCustomizationActivity() handleCustomizeColorsClick()
} }
} }

View File

@ -75,7 +75,7 @@ class CallManager {
callback(callContact) callback(callContact)
} else { } else {
Handler(Looper.getMainLooper()).post { Handler(Looper.getMainLooper()).post {
val privateCursor = context.getMyContactsCursor().loadInBackground() val privateCursor = context.getMyContactsCursor()?.loadInBackground()
ensureBackgroundThread { ensureBackgroundThread {
val privateContacts = MyContactsContentProvider.getSimpleContacts(context, privateCursor) val privateContacts = MyContactsContentProvider.getSimpleContacts(context, privateCursor)
val privateContact = privateContacts.firstOrNull { it.doesContainPhoneNumber(callContact.number) } val privateContact = privateContacts.firstOrNull { it.doesContainPhoneNumber(callContact.number) }

View File

@ -15,7 +15,7 @@ class RecentsHelper(private val context: Context) {
@SuppressLint("MissingPermission") @SuppressLint("MissingPermission")
fun getRecentCalls(callback: (ArrayList<RecentCall>) -> Unit) { fun getRecentCalls(callback: (ArrayList<RecentCall>) -> Unit) {
val privateCursor = context.getMyContactsCursor().loadInBackground() val privateCursor = context.getMyContactsCursor()?.loadInBackground()
ensureBackgroundThread { ensureBackgroundThread {
if (!context.hasPermission(PERMISSION_READ_CALL_LOG)) { if (!context.hasPermission(PERMISSION_READ_CALL_LOG)) {
callback(ArrayList()) callback(ArrayList())

View File

@ -11,6 +11,27 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<RelativeLayout
android:id="@+id/settings_purchase_thank_you_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:paddingLeft="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin"
android:paddingRight="@dimen/normal_margin"
android:paddingBottom="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/settings_purchase_thank_you"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingStart="@dimen/medium_margin"
android:text="@string/purchase_simple_thank_you" />
</RelativeLayout>
<RelativeLayout <RelativeLayout
android:id="@+id/settings_customize_colors_holder" android:id="@+id/settings_customize_colors_holder"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -23,7 +44,7 @@
android:paddingBottom="@dimen/activity_margin"> android:paddingBottom="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MyTextView <com.simplemobiletools.commons.views.MyTextView
android:id="@+id/settings_customize_colors" android:id="@+id/settings_customize_colors_label"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true" android:layout_centerVertical="true"

View File

@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules. // Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript { buildscript {
ext.kotlin_version = '1.4.20' ext.kotlin_version = '1.4.21'
repositories { repositories {
google() google()
jcenter() jcenter()