-
Notifications
You must be signed in to change notification settings - Fork 0
[wanna-do] やりたいことリストの追加ダイアログのベースを作った! #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| package com.techcafe.wantum.wannado | ||
|
|
||
| import android.app.Dialog | ||
| import android.os.Bundle | ||
| import android.view.LayoutInflater | ||
| import android.view.View | ||
| import android.view.ViewGroup | ||
| import android.view.Window | ||
| import androidx.fragment.app.DialogFragment | ||
|
|
||
| internal class WannaDoDialogFragment : DialogFragment() { | ||
|
|
||
| override fun onCreateView( | ||
| inflater: LayoutInflater, | ||
| container: ViewGroup?, | ||
| savedInstanceState: Bundle? | ||
| ): View? { | ||
| return inflater.inflate(R.layout.dialog_wannado_add_item, container, false) | ||
| } | ||
|
|
||
| override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | ||
| val dialog = super.onCreateDialog(savedInstanceState) | ||
| dialog.requestWindowFeature(Window.FEATURE_NO_TITLE) | ||
|
|
||
| return dialog | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -31,17 +31,22 @@ class WannadoFragment : Fragment(R.layout.fragment_wannado) { | |||
| binding = FragmentWannadoBinding.bind(view) | ||||
|
|
||||
| val wishListDataBindingViewController = WannadoDataBindingViewController(object : | ||||
| WannadoDataBindingViewController.ClickListener { | ||||
| override fun onClicked(item: String) { | ||||
| val action = WannadoFragmentDirections.actionWannadoToWannadoDetail(item) | ||||
| findNavController().navigate(action) | ||||
| } | ||||
| }) | ||||
| WannadoDataBindingViewController.ClickListener { | ||||
| override fun onClicked(item: String) { | ||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||
| val action = WannadoFragmentDirections.actionWannadoToWannadoDetail(item) | ||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||
| findNavController().navigate(action) | ||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||
| } | ||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||
| }) | ||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||
|
|
||||
| binding.recyclerViewWannado.apply { | ||||
| adapter = wishListDataBindingViewController.adapter | ||||
| layoutManager = LinearLayoutManager(context).apply { | ||||
| orientation = LinearLayoutManager.VERTICAL | ||||
| with(binding){ | ||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||
| recyclerViewWannado.apply { | ||||
| adapter = wishListDataBindingViewController.adapter | ||||
| layoutManager = LinearLayoutManager(context).apply { | ||||
| orientation = LinearLayoutManager.VERTICAL | ||||
| } | ||||
| } | ||||
| fabWannado.setOnClickListener { | ||||
| WannaDoDialogFragment().show(requireActivity().supportFragmentManager, "wannado_dialog") | ||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||
| } | ||||
| } | ||||
|
|
||||
|
|
||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| <?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"> | ||
|
|
||
| <androidx.constraintlayout.widget.ConstraintLayout | ||
| android:layout_width="match_parent" | ||
| android:layout_height="wrap_content"> | ||
|
|
||
| <TextView | ||
| android:id="@+id/title_wannado" | ||
| android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" | ||
| android:layout_marginHorizontal="16dp" | ||
| android:layout_marginTop="16dp" | ||
| android:text="なにがやりたいんすか?" | ||
Izacchi16 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| app:layout_constraintStart_toStartOf="parent" | ||
| app:layout_constraintTop_toTopOf="parent" /> | ||
|
|
||
| <EditText | ||
| android:id="@+id/input_title_wannado" | ||
| android:layout_width="0dp" | ||
| android:layout_height="wrap_content" | ||
| android:layout_marginHorizontal="16dp" | ||
| android:layout_marginTop="8dp" | ||
| android:layout_marginBottom="16dp" | ||
| app:layout_constraintEnd_toEndOf="parent" | ||
| app:layout_constraintStart_toStartOf="parent" | ||
| app:layout_constraintTop_toBottomOf="@id/title_wannado" /> | ||
| </androidx.constraintlayout.widget.ConstraintLayout> | ||
| </layout> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.