-
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
8 changed files
with
146 additions
and
12 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
51 changes: 51 additions & 0 deletions
51
app/src/main/java/com/sopetit/softie/ui/addroutine/list/MakerHelpDialogFragment.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,51 @@ | ||
package com.sopetit.softie.ui.addroutine.list | ||
|
||
import android.app.Dialog | ||
import android.os.Bundle | ||
import android.view.Gravity | ||
import android.view.View | ||
import android.view.WindowManager | ||
import androidx.fragment.app.DialogFragment | ||
import com.sopetit.softie.R | ||
import com.sopetit.softie.databinding.DialogMakerHelpBinding | ||
|
||
class MakerHelpDialogFragment : DialogFragment() { | ||
|
||
private var _binding: DialogMakerHelpBinding? = null | ||
private val binding get() = _binding | ||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | ||
val dialog = super.onCreateDialog(savedInstanceState) | ||
dialog.window?.setBackgroundDrawableResource(android.R.color.transparent) | ||
dialog.setContentView(R.layout.dialog_maker_help) | ||
|
||
_binding = | ||
DialogMakerHelpBinding.bind(dialog.findViewById<View>(R.id.cl_maker_help_dialog_border)) | ||
return dialog | ||
} | ||
|
||
override fun onStart() { | ||
super.onStart() | ||
dialog?.window?.attributes?.let { | ||
it.dimAmount = 0.72f | ||
dialog?.window?.addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND) | ||
} | ||
|
||
dialog?.window?.setGravity(Gravity.TOP or Gravity.END) | ||
val params: WindowManager.LayoutParams? = dialog?.window?.attributes | ||
|
||
params?.x = | ||
requireContext().resources.getDimensionPixelSize(R.dimen.maker_help_dialog_end_margin) | ||
params?.y = | ||
requireContext().resources.getDimensionPixelSize(R.dimen.maker_help_dialog_top_margin) | ||
dialog?.window?.attributes = params | ||
|
||
binding?.ivMakerHelpDialogExit?.setOnClickListener { | ||
dismiss() | ||
} | ||
} | ||
|
||
override fun onDestroyView() { | ||
super.onDestroyView() | ||
_binding = null | ||
} | ||
} |
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,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="18dp" | ||
android:height="18dp" | ||
android:viewportWidth="18" | ||
android:viewportHeight="18"> | ||
<path | ||
android:pathData="M14.069,5.532C14.281,5.32 14.4,5.032 14.4,4.732C14.4,4.432 14.281,4.144 14.069,3.932C13.856,3.719 13.568,3.6 13.268,3.6C12.968,3.6 12.68,3.719 12.468,3.932L9,7.4L5.532,3.932C5.32,3.719 5.032,3.6 4.732,3.6C4.432,3.6 4.144,3.719 3.932,3.932C3.719,4.144 3.6,4.432 3.6,4.732C3.6,5.032 3.719,5.32 3.932,5.532L7.4,9L3.932,12.468C3.719,12.68 3.6,12.968 3.6,13.268C3.6,13.568 3.719,13.856 3.932,14.069C4.144,14.281 4.432,14.4 4.732,14.4C5.032,14.4 5.32,14.281 5.532,14.069L9,10.601L12.468,14.069C12.68,14.281 12.968,14.4 13.268,14.4C13.568,14.4 13.856,14.281 14.069,14.069C14.281,13.856 14.4,13.568 14.4,13.268C14.4,12.968 14.281,12.68 14.069,12.468L10.601,9L14.069,5.532Z" | ||
android:fillColor="#9FA4A9"/> | ||
</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,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:shape="rectangle"> | ||
|
||
<solid android:color="@color/gray0" /> | ||
<corners android:radius="10dp" /> | ||
</shape> |
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,54 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto"> | ||
|
||
<data> | ||
|
||
</data> | ||
|
||
<androidx.constraintlayout.widget.ConstraintLayout | ||
android:id="@+id/cl_maker_help_dialog_border" | ||
android:layout_width="272dp" | ||
android:layout_height="wrap_content" | ||
android:background="@drawable/shape_gray0_fill_10_rect"> | ||
|
||
<TextView | ||
android:id="@+id/tv_maker_help_dialog_title" | ||
style="@style/head4" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="16dp" | ||
android:layout_marginTop="16dp" | ||
android:text="@string/maker_help_dialog_title" | ||
android:textColor="@color/gray700" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<ImageView | ||
android:id="@+id/iv_maker_help_dialog_exit" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="12dp" | ||
android:layout_marginEnd="12dp" | ||
android:src="@drawable/ic_exit" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<TextView | ||
android:id="@+id/tv_maker_help_dialog_content" | ||
style="@style/caption1" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:layout_marginHorizontal="16dp" | ||
android:layout_marginTop="6dp" | ||
android:layout_marginBottom="16dp" | ||
android:text="@string/maker_help_dialog_content" | ||
android:textColor="@color/gray650" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@id/tv_maker_help_dialog_title" /> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
</layout> | ||
|
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
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