Upgrade several AndroidX libraries and Compose to latest stable versions.
This commit is contained in:
parent
0fe9df3023
commit
c3be92d365
10 changed files with 974 additions and 1618 deletions
|
@ -349,6 +349,7 @@ public class WebRtcCallActivity extends BaseActivity implements SafetyNumberChan
|
|||
|
||||
@Override
|
||||
protected void onUserLeaveHint() {
|
||||
super.onUserLeaveHint();
|
||||
enterPipModeIfPossible();
|
||||
}
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ class AppSettingsActivity : DSLSettingsActivity(), InAppPaymentComponent {
|
|||
}
|
||||
}
|
||||
|
||||
override fun onNewIntent(intent: Intent?) {
|
||||
override fun onNewIntent(intent: Intent) {
|
||||
super.onNewIntent(intent)
|
||||
finish()
|
||||
startActivity(intent)
|
||||
|
|
|
@ -181,12 +181,10 @@ class CallActivity : BaseActivity(), CallControlsCallback {
|
|||
}
|
||||
}
|
||||
|
||||
override fun onNewIntent(intent: Intent?) {
|
||||
override fun onNewIntent(intent: Intent) {
|
||||
super.onNewIntent(intent)
|
||||
if (intent != null) {
|
||||
viewModel.processCallIntent(CallIntent(intent))
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
Log.i(TAG, "onResume")
|
||||
|
@ -265,7 +263,7 @@ class CallActivity : BaseActivity(), CallControlsCallback {
|
|||
}
|
||||
|
||||
@SuppressLint("MissingSuperCall")
|
||||
override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<String?>, grantResults: IntArray) {
|
||||
override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<String>, grantResults: IntArray) {
|
||||
Permissions.onRequestPermissionsResult(this, requestCode, permissions, grantResults)
|
||||
}
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ import androidx.compose.runtime.getValue
|
|||
import androidx.compose.runtime.mutableIntStateOf
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.rememberCoroutineScope
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
|
@ -35,6 +36,7 @@ import androidx.compose.ui.platform.LocalDensity
|
|||
import androidx.compose.ui.unit.DpSize
|
||||
import androidx.compose.ui.unit.IntOffset
|
||||
import androidx.compose.ui.unit.dp
|
||||
import kotlinx.coroutines.launch
|
||||
import org.signal.core.ui.DarkPreview
|
||||
import org.signal.core.ui.Previews
|
||||
import kotlin.math.pow
|
||||
|
@ -63,6 +65,7 @@ fun PictureInPicture(
|
|||
val maxWidth = constraints.maxWidth
|
||||
val contentWidth = with(density) { contentSize.width.toPx().roundToInt() }
|
||||
val contentHeight = with(density) { contentSize.height.toPx().roundToInt() }
|
||||
val coroutineScope = rememberCoroutineScope()
|
||||
|
||||
var isDragging by remember {
|
||||
mutableStateOf(false)
|
||||
|
@ -114,6 +117,7 @@ fun PictureInPicture(
|
|||
IntOffset(offsetX, offsetY)
|
||||
}
|
||||
.draggable2D(
|
||||
enabled = !isAnimating,
|
||||
state = rememberDraggable2DState { offset ->
|
||||
offsetX += offset.x.roundToInt()
|
||||
offsetY += offset.y.roundToInt()
|
||||
|
@ -122,8 +126,8 @@ fun PictureInPicture(
|
|||
isDragging = true
|
||||
},
|
||||
onDragStopped = { velocity ->
|
||||
isAnimating = true
|
||||
isDragging = false
|
||||
isAnimating = true
|
||||
|
||||
val x = offsetX + project(velocity.x)
|
||||
val y = offsetY + project(velocity.y)
|
||||
|
@ -131,6 +135,7 @@ fun PictureInPicture(
|
|||
val projectedCoordinate = IntOffset(x.roundToInt(), y.roundToInt())
|
||||
val cornerCoordinate = getClosestCorner(projectedCoordinate, topLeft, topRight, bottomLeft, bottomRight)
|
||||
|
||||
coroutineScope.launch {
|
||||
animate(
|
||||
typeConverter = IntOffsetConverter,
|
||||
initialValue = IntOffset(offsetX, offsetY),
|
||||
|
@ -144,6 +149,7 @@ fun PictureInPicture(
|
|||
|
||||
isAnimating = false
|
||||
}
|
||||
}
|
||||
)
|
||||
) {
|
||||
content()
|
||||
|
|
|
@ -86,7 +86,7 @@ open class ConversationActivity : PassphraseRequiredActivity(), VoiceNoteMediaCo
|
|||
transitionDebouncer.clear()
|
||||
}
|
||||
|
||||
override fun onNewIntent(intent: Intent?) {
|
||||
override fun onNewIntent(intent: Intent) {
|
||||
super.onNewIntent(intent)
|
||||
|
||||
// Note: We utilize this instead of 'replaceFragment' because there seems to be a bug
|
||||
|
|
|
@ -148,7 +148,7 @@ private fun SafetyTipsContent(forGroup: Boolean = false, modifier: Modifier = Mo
|
|||
|
||||
HorizontalPager(
|
||||
state = pagerState,
|
||||
beyondBoundsPageCount = size,
|
||||
beyondViewportPageCount = size,
|
||||
modifier = Modifier.padding(top = 24.dp)
|
||||
) {
|
||||
SafetyTip(tips[it])
|
||||
|
|
|
@ -113,7 +113,7 @@ class StoryViewerActivity : PassphraseRequiredActivity(), VoiceNoteMediaControll
|
|||
}
|
||||
}
|
||||
|
||||
override fun onNewIntent(intent: Intent?) {
|
||||
override fun onNewIntent(intent: Intent) {
|
||||
super.onNewIntent(intent)
|
||||
setIntent(intent)
|
||||
replaceStoryViewerFragment()
|
||||
|
|
|
@ -12,10 +12,10 @@ import androidx.compose.foundation.layout.Box
|
|||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.selection.toggleable
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.material.ripple.rememberRipple
|
||||
import androidx.compose.material3.LocalContentColor
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.minimumInteractiveComponentSize
|
||||
import androidx.compose.material3.ripple
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.CompositionLocalProvider
|
||||
import androidx.compose.runtime.remember
|
||||
|
@ -88,7 +88,7 @@ object IconButtons {
|
|||
enabled = enabled,
|
||||
role = Role.Button,
|
||||
interactionSource = interactionSource,
|
||||
indication = rememberRipple(
|
||||
indication = ripple(
|
||||
bounded = false,
|
||||
radius = size / 2
|
||||
)
|
||||
|
@ -126,7 +126,7 @@ object IconButtons {
|
|||
enabled = enabled,
|
||||
role = Role.Checkbox,
|
||||
interactionSource = interactionSource,
|
||||
indication = androidx.compose.material.ripple.rememberRipple(
|
||||
indication = ripple(
|
||||
bounded = false,
|
||||
radius = size / 2
|
||||
)
|
||||
|
|
|
@ -5,13 +5,13 @@ dependencyResolutionManagement {
|
|||
versionCatalogs {
|
||||
create("libs") {
|
||||
version("androidx-appcompat", "1.6.1")
|
||||
version("androidx-activity", "1.8.2")
|
||||
version("androidx-activity", "1.9.2")
|
||||
version("androidx-camera", "1.3.4")
|
||||
version("androidx-fragment", "1.6.2")
|
||||
version("androidx-lifecycle", "2.8.4")
|
||||
version("androidx-fragment", "1.8.3")
|
||||
version("androidx-lifecycle", "2.8.5")
|
||||
version("androidx-media3", "1.3.1")
|
||||
version("androidx-navigation", "2.7.6")
|
||||
version("androidx-window", "1.2.0")
|
||||
version("androidx-navigation", "2.8.0")
|
||||
version("androidx-window", "1.3.0")
|
||||
version("exoplayer", "2.19.0")
|
||||
version("glide", "4.15.1")
|
||||
version("kotlin", "1.9.20")
|
||||
|
@ -26,8 +26,9 @@ dependencyResolutionManagement {
|
|||
library("android-application", "com.android.application", "com.android.application.gradle.plugin").versionRef("android-gradle-plugin")
|
||||
|
||||
// Compose
|
||||
library("androidx-compose-bom", "androidx.compose:compose-bom:2024.06.00")
|
||||
library("androidx-compose-bom", "androidx.compose:compose-bom:2024.09.00")
|
||||
library("androidx-compose-material3", "androidx.compose.material3", "material3").withoutVersion()
|
||||
library("androidx-compose-material-navigation", "androidx.compose.material", "material-navigation").withoutVersion()
|
||||
library("androidx-compose-ui-tooling-preview", "androidx.compose.ui", "ui-tooling-preview").withoutVersion()
|
||||
library("androidx-compose-ui-tooling-core", "androidx.compose.ui", "ui-tooling").withoutVersion()
|
||||
library("androidx-compose-ui-test-manifest", "androidx.compose.ui", "ui-test-manifest").withoutVersion()
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue