Skip to content

Commit

Permalink
✨ 마이페이지 수정 - 카메라로 사진 촬영해서 프로필 이미지 수정 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-j0y committed Jul 9, 2024
1 parent 045245b commit 2633f96
Show file tree
Hide file tree
Showing 7 changed files with 265 additions and 45 deletions.
12 changes: 12 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
<uses-permission android:name="android.permission.CAMERA"/>
<uses-feature android:name="android.hardware.camera.any"/>

<application
android:name=".WalkieApplication"
Expand Down Expand Up @@ -33,6 +35,16 @@
android:name="androidx.work.impl.foreground.SystemForegroundService"
android:foregroundServiceType="location"
tools:node="merge" />

<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/path_provider" />
</provider>
</application>

</manifest>
4 changes: 4 additions & 0 deletions app/src/main/res/xml/path_provider.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<paths>
<external-cache-path name="my_images" path="/"/>
</paths>
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.whyranoid.presentation.component.button

import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import com.whyranoid.presentation.theme.WalkieTypography

@Composable
fun WalkieBottomSheetButton(
modifier: Modifier = Modifier,
buttonText: String,
onClick: () -> Unit = {}
) {
Box(
modifier = modifier
.fillMaxWidth()
.clip(shape = RoundedCornerShape(10.dp))
.border(width = 1.dp, color = Color(0xFFE4E4E4), shape = RoundedCornerShape(10.dp))
.clickable { onClick() }
) {
Text(
textAlign = TextAlign.Center,
text = buttonText,
style = WalkieTypography.Body1_Normal,
modifier = Modifier
.align(Alignment.Center)
.padding(vertical = 6.dp)
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package com.whyranoid.presentation.component.button

import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material3.Icon
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp

@Composable
fun CircularIconButton(
onClick: () -> Unit,
modifier: Modifier = Modifier,
contentDescription: String? = null,
icon: ImageVector,
tint: Color = Color.White,
backgroundColor: Color = Color.Gray,
iconSize: Dp = 24.dp,
buttonSize: Dp = 48.dp,
) {
Box(
modifier = modifier
.size(buttonSize)
.clip(CircleShape)
.background(backgroundColor)
.clickable(onClick = onClick),
contentAlignment = Alignment.Center,
) {
Icon(
imageVector = icon,
contentDescription = contentDescription,
tint = tint,
modifier = Modifier.size(iconSize),
)
}
}
Loading

0 comments on commit 2633f96

Please sign in to comment.