-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[FEAT] Compose 커스텀 갤러리 구현
- Loading branch information
Showing
11 changed files
with
543 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
core/designsystem/src/main/res/drawable/ic_image_selected.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:aapt="http://schemas.android.com/aapt" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24"> | ||
<path | ||
android:pathData="M12,0C5.373,0 0,5.373 0,12C0,18.627 5.373,24 12,24C18.627,24 24,18.627 24,12C24,5.373 18.627,0 12,0ZM18.297,9.039C18.612,8.611 18.571,8.005 18.178,7.624L18.066,7.529C17.638,7.214 17.031,7.255 16.651,7.648L10.445,14.046L7.202,10.702L7.093,10.604C6.674,10.275 6.067,10.298 5.674,10.679C5.246,11.094 5.236,11.778 5.651,12.206L9.67,16.351L9.782,16.452C10.209,16.786 10.832,16.753 11.221,16.351L18.202,9.151L18.297,9.039Z" | ||
android:fillType="evenOdd"> | ||
<aapt:attr name="android:fillColor"> | ||
<gradient | ||
android:startX="3.333" | ||
android:startY="1.989" | ||
android:endX="10.354" | ||
android:endY="29.192" | ||
android:type="linear"> | ||
<item android:offset="0" android:color="#FF2CD7A6"/> | ||
<item android:offset="0.77" android:color="#FF5DD281"/> | ||
</gradient> | ||
</aapt:attr> | ||
</path> | ||
<path | ||
android:pathData="M18.178,7.627C18.571,8.007 18.612,8.614 18.297,9.042L18.202,9.154L11.221,16.354C10.832,16.755 10.21,16.789 9.782,16.454L9.67,16.354L5.651,12.209C5.236,11.781 5.246,11.097 5.675,10.682C6.067,10.301 6.674,10.278 7.093,10.607L7.202,10.705L10.446,14.049L16.651,7.65C17.032,7.258 17.638,7.216 18.066,7.532L18.178,7.627Z" | ||
android:fillColor="#ffffff"/> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
presentation/src/main/java/com/dpm/presentation/gallery/GalleryActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.dpm.presentation.gallery | ||
|
||
import android.app.Activity | ||
import android.content.Intent | ||
import android.os.Bundle | ||
import androidx.compose.material.MaterialTheme | ||
import com.depromeet.presentation.databinding.ActivityGalleryBinding | ||
import com.dpm.core.base.BaseActivity | ||
import com.dpm.presentation.home.dialog.ProfileImageUploadDialog.Companion.SELECTED_IMAGE | ||
import com.dpm.presentation.seatreview.dialog.main.ImageUploadDialog.Companion.SELECTED_IMAGES | ||
import com.dpm.presentation.util.ScreenType | ||
import dagger.hilt.android.AndroidEntryPoint | ||
|
||
@AndroidEntryPoint | ||
class GalleryActivity : BaseActivity<ActivityGalleryBinding>( | ||
ActivityGalleryBinding::inflate | ||
) { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
|
||
initView() | ||
} | ||
|
||
private fun initView() { | ||
val screenType = intent.getStringExtra("screenType") ?: ScreenType.REVIEW.name | ||
binding.cvGallery.setContent { | ||
MaterialTheme { | ||
GalleryScreen( | ||
screenType = screenType, | ||
onImagesSelected = { | ||
if (screenType == ScreenType.REVIEW.name) { | ||
setResult(Activity.RESULT_OK, Intent().apply { | ||
putStringArrayListExtra(SELECTED_IMAGES, ArrayList(it.map { uri -> uri.toString() })) | ||
}) | ||
finish() | ||
} else { | ||
setResult(Activity.RESULT_OK, Intent().apply { | ||
putExtra(SELECTED_IMAGE, it[0].toString()) | ||
}) | ||
finish() | ||
} | ||
}, | ||
onBackPressed = { finish() } | ||
) | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.