Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ dependencies {

// Compose - Material Design 3
implementation(libs.compose.material3)
implementation(libs.compose.material.icons.extended)

// Compose - Android Studio Preview support
implementation(libs.compose.ui.tooling.preview)
Expand Down
1 change: 0 additions & 1 deletion feature/permissions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ dependencies {

// Compose - Material Design 3
implementation(libs.compose.material3)
implementation(libs.compose.material.icons.extended)

// Compose - Android Studio Preview support
implementation(libs.compose.ui.tooling.preview)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ package com.google.jetpackcamera.permissions
import android.Manifest
import androidx.annotation.DrawableRes
import androidx.annotation.StringRes
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.CameraAlt
import androidx.compose.material.icons.outlined.CreateNewFolder
import androidx.compose.material.icons.outlined.Mic
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.graphics.vector.ImageVector
Expand Down Expand Up @@ -90,9 +86,9 @@ enum class PermissionEnum : PermissionInfoProvider {

override fun getTestTag(): String = CAMERA_PERMISSION_BUTTON

override fun getDrawableResId(): Int? = null
override fun getDrawableResId(): Int? = R.drawable.ic_camera_alt

override fun getImageVector(): ImageVector = Icons.Outlined.CameraAlt
override fun getImageVector(): ImageVector? = null

override fun getPermissionTitleResId(): Int = R.string.camera_permission_screen_title

Expand All @@ -113,9 +109,9 @@ enum class PermissionEnum : PermissionInfoProvider {

override fun getTestTag(): String = RECORD_AUDIO_PERMISSION_BUTTON

override fun getDrawableResId(): Int? = null
override fun getDrawableResId(): Int? = R.drawable.ic_mic

override fun getImageVector(): ImageVector = Icons.Outlined.Mic
override fun getImageVector(): ImageVector? = null

override fun getPermissionTitleResId(): Int = R.string.microphone_permission_screen_title

Expand All @@ -135,9 +131,9 @@ enum class PermissionEnum : PermissionInfoProvider {

override fun getTestTag(): String = WRITE_EXTERNAL_STORAGE_PERMISSION_BUTTON

override fun getDrawableResId(): Int? = null
override fun getDrawableResId(): Int? = R.drawable.ic_create_new_folder

override fun getImageVector(): ImageVector = Icons.Outlined.CreateNewFolder
override fun getImageVector(): ImageVector? = null

override fun getPermissionTitleResId(): Int = R.string.write_storage_permission_screen_title

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import androidx.compose.runtime.LaunchedEffect
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
Expand Down Expand Up @@ -85,7 +85,7 @@ fun PermissionTemplate(
permissionState.launchPermissionRequest()
}
},
imageVector = permissionEnum.getImageVector()!!,
painter = permissionEnum.getPainter(),
iconAccessibilityText = stringResource(permissionEnum.getIconAccessibilityTextResId()),
title = stringResource(permissionEnum.getPermissionTitleResId()),

Expand Down Expand Up @@ -113,7 +113,7 @@ fun PermissionTemplate(
modifier: Modifier = Modifier,
testTag: String,
onRequestPermission: () -> Unit,
imageVector: ImageVector,
painter: Painter,
iconAccessibilityText: String,
title: String,
bodyText: String,
Expand All @@ -129,7 +129,7 @@ fun PermissionTemplate(
.height(IntrinsicSize.Min)
.align(Alignment.CenterHorizontally)
.testTag(testTag),
imageVector = imageVector,
painter = painter,
accessibilityText = iconAccessibilityText
)
Spacer(modifier = Modifier.fillMaxHeight(.1f))
Expand Down Expand Up @@ -165,7 +165,7 @@ private fun Preview_Camera_Permission_Page() {
PermissionTemplate(
onRequestPermission = { /*TODO*/ },
testTag = "",
imageVector = PermissionEnum.CAMERA.getImageVector()!!,
painter = PermissionEnum.CAMERA.getPainter(),
iconAccessibilityText = "",
title = stringResource(id = PermissionEnum.CAMERA.getPermissionTitleResId()),
bodyText = stringResource(id = PermissionEnum.CAMERA.getPermissionBodyTextResId()),
Expand All @@ -179,7 +179,7 @@ private fun Preview_Audio_Permission_Page() {
PermissionTemplate(
onRequestPermission = { /*TODO*/ },
testTag = "",
imageVector = PermissionEnum.RECORD_AUDIO.getImageVector()!!,
painter = PermissionEnum.RECORD_AUDIO.getPainter(),
iconAccessibilityText = "",
title = stringResource(id = PermissionEnum.RECORD_AUDIO.getPermissionTitleResId()),
bodyText = stringResource(id = PermissionEnum.RECORD_AUDIO.getPermissionBodyTextResId()),
Expand All @@ -191,17 +191,13 @@ private fun Preview_Audio_Permission_Page() {
Permission UI Subcomponents
*/
@Composable
fun PermissionImage(
modifier: Modifier = Modifier,
imageVector: ImageVector,
accessibilityText: String
) {
fun PermissionImage(modifier: Modifier = Modifier, painter: Painter, accessibilityText: String) {
Box(modifier = modifier) {
Icon(
modifier = Modifier
.size(300.dp)
.align(Alignment.BottomCenter),
imageVector = imageVector,
painter = painter,
tint = MaterialTheme.colorScheme.onPrimary,
contentDescription = accessibilityText
)
Expand Down
26 changes: 26 additions & 0 deletions feature/permissions/src/main/res/drawable/ic_camera_alt.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2026 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M480,700Q555,700 607.5,647.5Q660,595 660,520Q660,445 607.5,392.5Q555,340 480,340Q405,340 352.5,392.5Q300,445 300,520Q300,595 352.5,647.5Q405,700 480,700ZM480,620Q438,620 409,591Q380,562 380,520Q380,478 409,449Q438,420 480,420Q522,420 551,449Q580,478 580,520Q580,562 551,591Q522,620 480,620ZM160,840Q127,840 103.5,816.5Q80,793 80,760L80,280Q80,247 103.5,223.5Q127,200 160,200L286,200L360,120L600,120L674,200L800,200Q833,200 856.5,223.5Q880,247 880,280L880,760Q880,793 856.5,816.5Q833,840 800,840L160,840ZM160,760L800,760Q800,760 800,760Q800,760 800,760L800,280Q800,280 800,280Q800,280 800,280L638,280L565,200L395,200L322,280L160,280Q160,280 160,280Q160,280 160,280L160,760Q160,760 160,760Q160,760 160,760ZM480,520Q480,520 480,520Q480,520 480,520L480,520Q480,520 480,520Q480,520 480,520L480,520L480,520L480,520L480,520L480,520Q480,520 480,520Q480,520 480,520L480,520Q480,520 480,520Q480,520 480,520Z"/>
</vector>
26 changes: 26 additions & 0 deletions feature/permissions/src/main/res/drawable/ic_create_new_folder.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2026 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M560,640L640,640L640,560L720,560L720,480L640,480L640,400L560,400L560,480L480,480L480,560L560,560L560,640ZM160,800Q127,800 103.5,776.5Q80,753 80,720L80,240Q80,207 103.5,183.5Q127,160 160,160L400,160L480,240L800,240Q833,240 856.5,263.5Q880,287 880,320L880,720Q880,753 856.5,776.5Q833,800 800,800L160,800ZM160,720L800,720Q800,720 800,720Q800,720 800,720L800,320Q800,320 800,320Q800,320 800,320L447,320L367,240L160,240Q160,240 160,240Q160,240 160,240L160,720Q160,720 160,720Q160,720 160,720ZM160,720Q160,720 160,720Q160,720 160,720L160,240Q160,240 160,240Q160,240 160,240L160,240L160,320L160,320Q160,320 160,320Q160,320 160,320L160,720Q160,720 160,720Q160,720 160,720Z"/>
</vector>
26 changes: 26 additions & 0 deletions feature/permissions/src/main/res/drawable/ic_mic.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2026 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M395,525Q360,490 360,440L360,200Q360,150 395,115Q430,80 480,80Q530,80 565,115Q600,150 600,200L600,440Q600,490 565,525Q530,560 480,560Q430,560 395,525ZM480,320Q480,320 480,320L480,320Q480,320 480,320Q480,320 480,320Q480,320 480,320Q480,320 480,320L480,320Q480,320 480,320Q480,320 480,320Q480,320 480,320ZM440,840L440,717Q336,703 268,624Q200,545 200,440L280,440Q280,523 338.5,581.5Q397,640 480,640Q563,640 621.5,581.5Q680,523 680,440L760,440Q760,545 692,624Q624,703 520,717L520,840L440,840ZM508.5,468.5Q520,457 520,440L520,200Q520,183 508.5,171.5Q497,160 480,160Q463,160 451.5,171.5Q440,183 440,200L440,440Q440,457 451.5,468.5Q463,480 480,480Q497,480 508.5,468.5Z"/>
</vector>
1 change: 0 additions & 1 deletion feature/postcapture/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ dependencies {

// Compose - Material Design 3
implementation(libs.compose.material3)
implementation(libs.compose.material.icons.extended)

// Compose - Android Studio Preview support
implementation(libs.compose.ui.tooling.preview)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ import androidx.annotation.OptIn
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Close
import androidx.compose.material.icons.filled.Delete
import androidx.compose.material.icons.filled.SaveAlt
import androidx.compose.material.icons.filled.Share
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
Expand All @@ -39,6 +34,7 @@ import androidx.compose.ui.draw.shadow
import androidx.compose.ui.graphics.asImageBitmap
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.media3.common.Player
Expand Down Expand Up @@ -121,7 +117,7 @@ fun ExitPostCaptureButton(onExitPostCapture: () -> Unit, modifier: Modifier = Mo
Icon(
modifier = it,

imageVector = Icons.Default.Close,
painter = painterResource(id = R.drawable.ic_close),
contentDescription = stringResource(R.string.button_exit_description)
)
}
Expand All @@ -143,7 +139,7 @@ fun ShareCurrentMediaButton(
Icon(
modifier = it,

imageVector = Icons.Default.Share,
painter = painterResource(id = R.drawable.ic_share),
contentDescription = stringResource(R.string.button_share_media_description),
tint = MaterialTheme.colorScheme.onSurface
)
Expand All @@ -166,7 +162,7 @@ fun SaveCurrentMediaButton(onClick: () -> Unit, modifier: Modifier = Modifier) {
Icon(
modifier = it,

imageVector = Icons.Default.SaveAlt,
painter = painterResource(id = R.drawable.ic_save),
contentDescription = stringResource(R.string.button_save_media_description)
)
}
Expand All @@ -185,7 +181,7 @@ fun DeleteCurrentMediaButton(
) {
Icon(
modifier = it,
imageVector = Icons.Default.Delete,
painter = painterResource(id = R.drawable.ic_delete),
contentDescription = stringResource(
R.string.button_delete_media_description
)
Expand Down
26 changes: 26 additions & 0 deletions feature/postcapture/src/main/res/drawable/ic_close.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2026 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="m256,760 -56,-56 224,-224 -224,-224 56,-56 224,224 224,-224 56,56 -224,224 224,224 -56,56 -224,-224 -224,224Z"/>
</vector>
26 changes: 26 additions & 0 deletions feature/postcapture/src/main/res/drawable/ic_delete.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2026 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M280,840q-33,0 -56.5,-23.5T200,760v-480h-40v-80h200v-40h240v40h200v80h-40v480q0,33 -23.5,56.5T680,840H280ZM280,280v480h400v-480H280ZM360,680h80v-320h-80v320ZM520,680h80v-320h-80v320Z"/>
</vector>
26 changes: 26 additions & 0 deletions feature/postcapture/src/main/res/drawable/ic_save.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2026 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M480,640L240,400l56,-56 144,144V80h80v408l144,-144 56,56 -240,240ZM160,880q-33,0 -56.5,-23.5T80,800v-160h80v160h640v-160h80v160q0,33 -23.5,56.5T800,880H160Z"/>
</vector>
26 changes: 26 additions & 0 deletions feature/postcapture/src/main/res/drawable/ic_share.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2026 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M720,880q-50,0 -85,-35t-35,-85q0,-7 1,-14.5t3,-13.5L322,544q-15,13 -34.5,21t-41.5,8q-50,0 -85,-35t-35,-85q0,-50 35,-85t85,-35q22,0 41.5,8t34.5,21L603,242q-2,-6 -3,-13.5t-1,-14.5q0,-50 35,-85t85,-35q50,0 85,35t35,85q0,50 -35,85t-85,35q-22,0 -41.5,-8t-34.5,-21L357,416q2,6 3,13.5t1,14.5q0,7 -1,14.5t-3,13.5L638,638q15,-13 34.5,-21t41.5,-8q50,0 85,35t35,85q0,50 -35,85t-85,35Z"/>
</vector>
1 change: 0 additions & 1 deletion feature/preview/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ dependencies {

// Compose - Material Design 3
implementation(libs.compose.material3)
implementation(libs.compose.material.icons.extended)

// Compose - Android Studio Preview support
implementation(libs.compose.ui.tooling.preview)
Expand Down
Loading
Loading