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