-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 이미지 선택 다이얼로그 추가
- Loading branch information
Showing
6 changed files
with
111 additions
and
4 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
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
50 changes: 50 additions & 0 deletions
50
app/src/main/java/com/moyerun/moyeorun_android/profile/ProfileImageSelectDialogFragment.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,50 @@ | ||
package com.moyerun.moyeorun_android.profile | ||
|
||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import com.moyerun.moyeorun_android.common.dialog.RoundDialogFragment | ||
import com.moyerun.moyeorun_android.common.extension.setOnDebounceClickListener | ||
import com.moyerun.moyeorun_android.databinding.DialogProfileImageSelectBinding | ||
|
||
class ProfileImageSelectDialogFragment : RoundDialogFragment() { | ||
|
||
private var onGalleryClick: () -> Unit = {} | ||
private var onDefaultImagesClick: () -> Unit = {} | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, | ||
container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View { | ||
return DialogProfileImageSelectBinding.inflate(inflater, container, false).root | ||
} | ||
|
||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
super.onViewCreated(view, savedInstanceState) | ||
val binding = DialogProfileImageSelectBinding.bind(view) | ||
|
||
binding.buttonImageSelectGallery.setOnDebounceClickListener { | ||
onGalleryClick.invoke() | ||
dismissAllowingStateLoss() | ||
} | ||
|
||
binding.buttonImageSelectDefault.setOnDebounceClickListener { | ||
onDefaultImagesClick.invoke() | ||
dismissAllowingStateLoss() | ||
} | ||
} | ||
|
||
companion object { | ||
fun getInstance( | ||
onGalleryClick: () -> Unit, | ||
onDefaultImagesClick: () -> Unit | ||
): ProfileImageSelectDialogFragment { | ||
return ProfileImageSelectDialogFragment().apply { | ||
this.onGalleryClick = onGalleryClick | ||
this.onDefaultImagesClick = onDefaultImagesClick | ||
} | ||
} | ||
} | ||
} |
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,38 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<LinearLayout | ||
style="@style/Dialog.Background" | ||
android:orientation="vertical"> | ||
|
||
<TextView | ||
style="@style/Dialog.Title" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginVertical="22dp" | ||
android:text="프로필 사진" /> | ||
|
||
<View style="@style/Dialog.Divider" /> | ||
|
||
<androidx.appcompat.widget.AppCompatButton | ||
android:id="@+id/button_image_select_gallery" | ||
style="@style/Dialog.Button.VerticalLinear" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="@string/profile_button_image_select_gallery" /> | ||
|
||
<View style="@style/Dialog.Divider" /> | ||
|
||
<androidx.appcompat.widget.AppCompatButton | ||
android:id="@+id/button_image_select_default" | ||
style="@style/Dialog.Button.VerticalLinear" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="@string/profile_button_image_select_default" /> | ||
|
||
</LinearLayout> | ||
|
||
</FrameLayout> |
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
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