-
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.
feature/#9-home-ui : 업로드 에러 다이얼로그 UI 구현
- Loading branch information
Showing
7 changed files
with
175 additions
and
2 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
48 changes: 48 additions & 0 deletions
48
presentation/src/main/java/com/depromeet/presentation/home/UploadErrorDialog.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.depromeet.presentation.home | ||
|
||
import android.graphics.Color | ||
import android.graphics.drawable.ColorDrawable | ||
import android.os.Bundle | ||
import android.view.View | ||
import android.view.WindowManager | ||
import androidx.fragment.app.DialogFragment | ||
import com.depromeet.core.base.BindingDialogFragment | ||
import com.depromeet.presentation.R | ||
import com.depromeet.presentation.databinding.FragmentUploadErrorDialogBinding | ||
import dagger.hilt.android.AndroidEntryPoint | ||
|
||
@AndroidEntryPoint | ||
class UploadErrorDialog( | ||
private val description: String, | ||
private val discipline: String, | ||
) : BindingDialogFragment<FragmentUploadErrorDialogBinding>( | ||
layoutResId = R.layout.fragment_upload_error_dialog, | ||
bindingInflater = FragmentUploadErrorDialogBinding::inflate | ||
) { | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setStyle(DialogFragment.STYLE_NORMAL, R.style.TransparentDialogFragment) | ||
|
||
} | ||
|
||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
super.onViewCreated(view, savedInstanceState) | ||
|
||
dialog?.window?.apply { | ||
setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT)) | ||
val params = attributes | ||
params.width = WindowManager.LayoutParams.MATCH_PARENT | ||
params.height = WindowManager.LayoutParams.WRAP_CONTENT | ||
attributes = params | ||
} | ||
with(binding) { | ||
tvErrorDescription.text = description | ||
tvErrorDiscipline.text = discipline | ||
btErrorCheck.setOnClickListener { | ||
dismiss() | ||
} | ||
} | ||
|
||
} | ||
} |
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,10 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="32dp" | ||
android:height="32dp" | ||
android:viewportWidth="32" | ||
android:viewportHeight="32"> | ||
<path | ||
android:pathData="M16,0C7.163,0 0,7.163 0,16C0,24.837 7.163,32 16,32C24.837,32 32,24.837 32,16C32,7.163 24.837,0 16,0ZM17.455,10.182C17.455,9.378 16.803,8.727 16,8.727C15.197,8.727 14.545,9.378 14.545,10.182V16C14.545,16.803 15.197,17.455 16,17.455C16.803,17.455 17.455,16.803 17.455,16V10.182ZM16,20.364C15.197,20.364 14.545,21.015 14.545,21.818C14.545,22.622 15.197,23.273 16,23.273H16.014C16.818,23.273 17.469,22.622 17.469,21.818C17.469,21.015 16.818,20.364 16.014,20.364H16Z" | ||
android:fillColor="#AFAFAF" | ||
android:fillType="evenOdd"/> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:shape="rectangle"> | ||
<corners android:radius="8dp" /> | ||
<solid android:color="@color/gray900" /> | ||
</shape> |
77 changes: 77 additions & 0 deletions
77
presentation/src/main/res/layout/fragment_upload_error_dialog.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,77 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
style="@style/TransparentDialogFragment"> | ||
|
||
<androidx.constraintlayout.widget.ConstraintLayout | ||
android:id="@+id/cl_error" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
android:layout_marginHorizontal="35dp" | ||
android:background="@drawable/rect_white_fill_12" | ||
android:padding="20dp"> | ||
|
||
<ImageView | ||
android:id="@+id/iv_error_caution" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:src="@drawable/ic_solid" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<TextView | ||
android:id="@+id/tv_error_description" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="16dp" | ||
android:gravity="center" | ||
android:text="@string/upload_error_capacity_description" | ||
android:textColor="@color/gray900" | ||
android:textSize="20sp" | ||
android:textStyle="bold" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@id/iv_error_caution" /> | ||
|
||
<TextView | ||
android:id="@+id/tv_error_discipline" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="8dp" | ||
android:textColor="@color/gray700" | ||
android:textSize="14sp" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@id/tv_error_description" | ||
tools:text="5MB에 맞게 다시 선택해주세요" /> | ||
|
||
<androidx.appcompat.widget.AppCompatButton | ||
android:id="@+id/bt_error_check" | ||
android:layout_width="0dp" | ||
android:layout_height="50dp" | ||
android:layout_marginTop="24dp" | ||
android:background="@drawable/rect_gray900_fill_8" | ||
android:gravity="center" | ||
android:text="@string/upload_error_check" | ||
android:textColor="@color/white" | ||
android:textSize="16sp" | ||
android:textStyle="bold" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@id/tv_error_discipline" /> | ||
|
||
|
||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
|
||
|
||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |
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