Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Expand Up @@ -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 {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Unexpected indentation (12) (should be 16)

override fun onClicked(item: String) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Unexpected indentation (12) (should be 16)

val action = WannadoFragmentDirections.actionWannadoToWannadoDetail(item)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Unexpected indentation (16) (should be 20)

findNavController().navigate(action)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Unexpected indentation (16) (should be 20)

}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Unexpected indentation (12) (should be 16)

})
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Unexpected indentation (8) (should be 12)


binding.recyclerViewWannado.apply {
adapter = wishListDataBindingViewController.adapter
layoutManager = LinearLayoutManager(context).apply {
orientation = LinearLayoutManager.VERTICAL
with(binding){
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Missing spacing before “{“

recyclerViewWannado.apply {
adapter = wishListDataBindingViewController.adapter
layoutManager = LinearLayoutManager(context).apply {
orientation = LinearLayoutManager.VERTICAL
}
}
fabWannado.setOnClickListener {
WannaDoDialogFragment().show(requireActivity().supportFragmentManager, "wannado_dialog")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Exceeded max line length (100) (cannot be auto-corrected)

}
}

Expand Down
30 changes: 30 additions & 0 deletions features/wannado/src/main/res/layout/dialog_wannado_add_item.xml
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="なにがやりたいんすか?"
Comment thread
Izacchi16 marked this conversation as 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>