fix #399, add an option to always show incoming calls on fullscreen mode

This commit is contained in:
tibbi 2022-09-02 23:26:22 +02:00
parent a9c7ad004d
commit 115a1c00c2
5 changed files with 33 additions and 2 deletions

View File

@ -46,6 +46,7 @@ class SettingsActivity : SimpleActivity() {
setupShowCallConfirmation()
setupDisableProximitySensor()
setupDisableSwipeToAnswer()
setupAlwaysShowFullscreen()
updateTextColors(settings_holder)
arrayOf(
@ -258,4 +259,12 @@ class SettingsActivity : SimpleActivity() {
config.disableSwipeToAnswer = settings_disable_swipe_to_answer.isChecked
}
}
private fun setupAlwaysShowFullscreen() {
settings_always_show_fullscreen.isChecked = config.alwaysShowFullscreen
settings_always_show_fullscreen_holder.setOnClickListener {
settings_always_show_fullscreen.toggle()
config.alwaysShowFullscreen = settings_always_show_fullscreen.isChecked
}
}
}

View File

@ -79,4 +79,8 @@ class Config(context: Context) : BaseConfig(context) {
var dialpadBeeps: Boolean
get() = prefs.getBoolean(DIALPAD_BEEPS, true)
set(dialpadBeeps) = prefs.edit().putBoolean(DIALPAD_BEEPS, dialpadBeeps).apply()
var alwaysShowFullscreen: Boolean
get() = prefs.getBoolean(ALWAYS_SHOW_FULLSCREEN, false)
set(alwaysShowFullscreen) = prefs.edit().putBoolean(ALWAYS_SHOW_FULLSCREEN, alwaysShowFullscreen).apply()
}

View File

@ -17,6 +17,7 @@ const val FAVORITES_CUSTOM_ORDER_SELECTED = "favorites_custom_order_selected"
const val WAS_OVERLAY_SNACKBAR_CONFIRMED = "was_overlay_snackbar_confirmed"
const val DIALPAD_VIBRATION = "dialpad_vibration"
const val DIALPAD_BEEPS = "dialpad_beeps"
const val ALWAYS_SHOW_FULLSCREEN = "always_show_fullscreen"
const val ALL_TABS_MASK = TAB_CONTACTS or TAB_FAVORITES or TAB_CALL_HISTORY
val tabsList = arrayListOf(TAB_CONTACTS, TAB_FAVORITES, TAB_CALL_HISTORY)

View File

@ -6,6 +6,7 @@ import android.content.Context
import android.telecom.Call
import android.telecom.InCallService
import com.simplemobiletools.dialer.activities.CallActivity
import com.simplemobiletools.dialer.extensions.config
import com.simplemobiletools.dialer.extensions.isOutgoing
import com.simplemobiletools.dialer.extensions.powerManager
import com.simplemobiletools.dialer.helpers.CallManager
@ -31,7 +32,7 @@ class CallService : InCallService() {
call.registerCallback(callListener)
val isScreenLocked = (getSystemService(Context.KEYGUARD_SERVICE) as KeyguardManager).isDeviceLocked
if (!powerManager.isInteractive || call.isOutgoing() || isScreenLocked) {
if (!powerManager.isInteractive || call.isOutgoing() || isScreenLocked || config.alwaysShowFullscreen) {
try {
callNotificationManager.setupNotification(true)
startActivity(CallActivity.getStartIntent(this))

View File

@ -400,7 +400,7 @@
style="@style/SettingsHolderCheckboxStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ripple_bottom_corners">
android:background="@drawable/ripple_background">
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/settings_disable_swipe_to_answer"
@ -410,6 +410,22 @@
android:text="@string/disable_swipe_to_answer" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_always_show_fullscreen_holder"
style="@style/SettingsHolderCheckboxStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ripple_bottom_corners">
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/settings_always_show_fullscreen"
style="@style/SettingsCheckboxStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/show_incoming_calls_full_screen" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>