srctree

Robin Linden parent 7091b155 cf731b6d
Create a correct backstack when opening a call via a notification

inlinesplit
atox/build.gradle.kts added: 13, removed: 15, total 0
@@ -64,8 +64,8 @@ dependencies {
implementation(KotlinX.Coroutines.core)
implementation(KotlinX.Coroutines.android)
 
implementation(AndroidX.Navigation.fragmentKtx)
implementation(AndroidX.Navigation.uiKtx)
implementation(AndroidX.Navigation.fragment)
implementation(AndroidX.Navigation.ui)
 
implementation(AndroidX.preference)
 
 
atox/src/main/kotlin/ui/NotificationHelper.kt added: 13, removed: 15, total 0
@@ -198,8 +198,8 @@ class NotificationHelper @Inject constructor(
.setContentIntent(
NavDeepLinkBuilder(context)
.setGraph(R.navigation.nav_graph)
.setDestination(R.id.callFragment)
.setArguments(bundleOf(CONTACT_PUBLIC_KEY to contact.publicKey))
.addDestination(R.id.chatFragment, bundleOf(CONTACT_PUBLIC_KEY to contact.publicKey))
.addDestination(R.id.callFragment, bundleOf(CONTACT_PUBLIC_KEY to contact.publicKey))
.createPendingIntent()
)
.setOngoing(true)
 
atox/src/main/kotlin/ui/call/CallFragment.kt added: 13, removed: 15, total 0
@@ -11,7 +11,6 @@ import android.util.TypedValue
import android.view.View
import android.widget.Toast
import androidx.activity.result.contract.ActivityResultContracts
import androidx.core.os.bundleOf
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.updatePadding
@@ -48,14 +47,13 @@ class CallFragment : BaseFragment<FragmentCallBinding>(FragmentCallBinding::infl
}
 
override fun onViewCreated(view: View, savedInstanceState: Bundle?) = binding.run {
val pk = requireStringArg(CONTACT_PUBLIC_KEY)
ViewCompat.setOnApplyWindowInsetsListener(view) { _, compat ->
val insets = compat.getInsets(WindowInsetsCompat.Type.systemBars())
controlContainer.updatePadding(bottom = insets.bottom + dpToPx(16f, resources))
compat
}
 
vm.setActiveContact(PublicKey(pk))
vm.setActiveContact(PublicKey(requireStringArg(CONTACT_PUBLIC_KEY)))
vm.contact.observe(viewLifecycleOwner) {
setAvatarFromContact(callBackground, it)
}
@@ -86,7 +84,7 @@ class CallFragment : BaseFragment<FragmentCallBinding>(FragmentCallBinding::infl
}
 
backToChat.setOnClickListener {
findNavController().navigate(R.id.chatFragment, bundleOf(CONTACT_PUBLIC_KEY to pk))
findNavController().popBackStack()
}
 
if (vm.inCall.value is CallState.InCall) {
 
buildSrc/src/main/kotlin/Dependencies.kt added: 13, removed: 15, total 0
@@ -56,9 +56,9 @@ object AndroidX {
const val fragment = "androidx.fragment:fragment:1.3.5"
 
object Navigation {
private const val version = "2.3.5"
const val fragmentKtx = "androidx.navigation:navigation-fragment-ktx:$version"
const val uiKtx = "androidx.navigation:navigation-ui-ktx:$version"
private const val version = "2.4.0-alpha06"
const val fragment = "androidx.navigation:navigation-fragment:$version"
const val ui = "androidx.navigation:navigation-ui:$version"
}
 
object Lifecycle {