mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Fixed sliding pane layout width on mobiles + pause ringtone player when leaving settings
This commit is contained in:
parent
429e8d2704
commit
d0f052177e
5 changed files with 34 additions and 16 deletions
|
|
@ -9,6 +9,7 @@ import android.widget.ArrayAdapter
|
|||
import androidx.annotation.UiThread
|
||||
import androidx.appcompat.app.AppCompatDelegate
|
||||
import androidx.navigation.navGraphViewModels
|
||||
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||
import org.linphone.R
|
||||
import org.linphone.core.tools.Log
|
||||
import org.linphone.databinding.SettingsFragmentBinding
|
||||
|
|
@ -117,4 +118,12 @@ class SettingsFragment : GenericFragment() {
|
|||
|
||||
startPostponedEnterTransition()
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
|
||||
coreContext.postOnCoreThread {
|
||||
viewModel.stopRingtonePlayer()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,7 +112,10 @@ class SettingsViewModel @UiThread constructor() : ViewModel() {
|
|||
autoRecordCalls.postValue(corePreferences.automaticallyStartCallRecording)
|
||||
|
||||
useWifiOnly.postValue(core.isWifiOnlyEnabled)
|
||||
selectedRingtone.postValue(core.ring.orEmpty())
|
||||
|
||||
val ringtone = core.ring.orEmpty()
|
||||
Log.i("Currently configured ringtone in Core is [$ringtone]")
|
||||
selectedRingtone.postValue(ringtone)
|
||||
|
||||
theme.postValue(corePreferences.darkMode)
|
||||
}
|
||||
|
|
@ -184,6 +187,7 @@ class SettingsViewModel @UiThread constructor() : ViewModel() {
|
|||
fun setRingtone(ringtone: String) {
|
||||
coreContext.postOnCoreThread { core ->
|
||||
core.ring = ringtone
|
||||
selectedRingtone.postValue(ringtone)
|
||||
|
||||
if (::ringtonePlayer.isInitialized) {
|
||||
if (ringtonePlayer.state == Player.State.Playing) {
|
||||
|
|
@ -268,6 +272,17 @@ class SettingsViewModel @UiThread constructor() : ViewModel() {
|
|||
corePreferences.darkMode = theme
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
fun stopRingtonePlayer() {
|
||||
if (::ringtonePlayer.isInitialized && ringtonePlayer.state != Player.State.Closed) {
|
||||
Log.i("$TAG Stopping ringtone player")
|
||||
ringtonePlayer.pause()
|
||||
ringtonePlayer.seek(0)
|
||||
ringtonePlayer.close()
|
||||
isRingtonePlaying.postValue(false)
|
||||
}
|
||||
}
|
||||
|
||||
@UiThread
|
||||
private fun computeAvailableRingtones() {
|
||||
availableRingtonesNames.add(
|
||||
|
|
@ -288,15 +303,4 @@ class SettingsViewModel @UiThread constructor() : ViewModel() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
private fun stopRingtonePlayer() {
|
||||
if (::ringtonePlayer.isInitialized && ringtonePlayer.state != Player.State.Closed) {
|
||||
Log.i("$TAG Stopping ringtone player")
|
||||
ringtonePlayer.pause()
|
||||
ringtonePlayer.seek(0)
|
||||
ringtonePlayer.close()
|
||||
isRingtonePlaying.postValue(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,4 +3,9 @@
|
|||
<dimen name="call_main_actions_menu_height">110dp</dimen>
|
||||
<dimen name="call_extra_actions_menu_height">125dp</dimen>
|
||||
<dimen name="call_all_actions_menu_height">235dp</dimen> <!-- sum of above two -->
|
||||
|
||||
<dimen name="landscape_nav_bar_width">75dp</dimen>
|
||||
<dimen name="sliding_pane_left_fragment_width">325dp</dimen>
|
||||
<!-- This value is the result of the above two added together -->
|
||||
<dimen name="sliding_pane_left_fragment_with_nav_width">400dp</dimen>
|
||||
</resources>
|
||||
|
|
@ -5,9 +5,9 @@
|
|||
<dimen name="screen_bottom_margin">32dp</dimen>
|
||||
|
||||
<dimen name="landscape_nav_bar_width">75dp</dimen>
|
||||
<dimen name="sliding_pane_left_fragment_width">400dp</dimen>
|
||||
<dimen name="sliding_pane_left_fragment_width">280dp</dimen>
|
||||
<!-- This value is the result of the above two added together -->
|
||||
<dimen name="sliding_pane_left_fragment_with_nav_width">475dp</dimen>
|
||||
<dimen name="sliding_pane_left_fragment_with_nav_width">355dp</dimen>
|
||||
<dimen name="sliding_pane_right_fragment_width">300dp</dimen>
|
||||
|
||||
<dimen name="icon_size">24dp</dimen>
|
||||
|
|
|
|||
|
|
@ -51,9 +51,9 @@
|
|||
<string name="welcome_page_subtitle">in Linphone</string>
|
||||
<string name="welcome_page_1_message">Une application de communication <b>sécurisée</b>, <b>open source</b> et <b>française</b>.</string>
|
||||
<string name="welcome_page_2_title">Sécurisé</string>
|
||||
<string name="welcome_page_2_message">Vos communications sont en sécurité grâce au <b>chiffrement de bout en bout.</b></string>
|
||||
<string name="welcome_page_2_message">Vos communications sont en sécurité grâce au <b>chiffrement de bout en bout</b>.</string>
|
||||
<string name="welcome_page_3_title">Open source</string>
|
||||
<string name="welcome_page_3_message">Une application open source et un <b>service gratuit</b> depuis <b>2001</b></string>
|
||||
<string name="welcome_page_3_message">Une application open source et un <b>service gratuit</b> depuis <b>2001</b>.</string>
|
||||
|
||||
<string name="bottom_navigation_contacts_label">Contacts</string>
|
||||
<string name="bottom_navigation_calls_label">Calls</string>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue