mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-27 12:05:22 +00:00
Restore New Message > Scan permission style
This commit is contained in:
parent
248c332a36
commit
49127d5fcb
@ -18,6 +18,7 @@ import androidx.compose.foundation.layout.Spacer
|
|||||||
import androidx.compose.foundation.layout.aspectRatio
|
import androidx.compose.foundation.layout.aspectRatio
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.size
|
import androidx.compose.foundation.layout.size
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
@ -59,6 +60,7 @@ import org.session.libsignal.utilities.Log
|
|||||||
import org.thoughtcrime.securesms.ui.LocalDimensions
|
import org.thoughtcrime.securesms.ui.LocalDimensions
|
||||||
import org.thoughtcrime.securesms.ui.color.LocalColors
|
import org.thoughtcrime.securesms.ui.color.LocalColors
|
||||||
import org.thoughtcrime.securesms.ui.base
|
import org.thoughtcrime.securesms.ui.base
|
||||||
|
import org.thoughtcrime.securesms.ui.xl
|
||||||
import java.util.concurrent.Executors
|
import java.util.concurrent.Executors
|
||||||
|
|
||||||
private const val TAG = "NewMessageFragment"
|
private const val TAG = "NewMessageFragment"
|
||||||
@ -75,7 +77,8 @@ fun MaybeScanQrCode(
|
|||||||
onScan: (String) -> Unit
|
onScan: (String) -> Unit
|
||||||
) {
|
) {
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier.fillMaxSize()
|
modifier = Modifier
|
||||||
|
.fillMaxSize()
|
||||||
.background(LocalColors.current.background)
|
.background(LocalColors.current.background)
|
||||||
) {
|
) {
|
||||||
LocalSoftwareKeyboardController.current?.hide()
|
LocalSoftwareKeyboardController.current?.hide()
|
||||||
@ -103,14 +106,22 @@ fun MaybeScanQrCode(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Box(modifier = Modifier.fillMaxSize().padding(LocalDimensions.current.largeMargin)) {
|
Column(
|
||||||
SlimOutlineButton(
|
modifier = Modifier
|
||||||
|
.background(color = LocalColors.current.backgroundSecondary)
|
||||||
|
.fillMaxSize()
|
||||||
|
.padding(LocalDimensions.current.largeMargin),
|
||||||
|
horizontalAlignment = Alignment.CenterHorizontally
|
||||||
|
) {
|
||||||
|
Spacer(modifier = Modifier.weight(1f))
|
||||||
|
Text(stringResource(R.string.fragment_scan_qr_code_camera_access_explanation), style = xl, textAlign = TextAlign.Center)
|
||||||
|
Spacer(modifier = Modifier.height(LocalDimensions.current.itemSpacing))
|
||||||
|
PrimaryOutlineButton(
|
||||||
stringResource(R.string.cameraGrantAccess),
|
stringResource(R.string.cameraGrantAccess),
|
||||||
modifier = Modifier
|
modifier = Modifier.fillMaxWidth(),
|
||||||
.align(Alignment.Center)
|
|
||||||
.fillMaxWidth(),
|
|
||||||
onClick = { cameraPermissionState.run { launchPermissionRequest() } }
|
onClick = { cameraPermissionState.run { launchPermissionRequest() } }
|
||||||
)
|
)
|
||||||
|
Spacer(modifier = Modifier.weight(1f))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user