Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
972ba54
Impl search binding
mitohato14 Oct 10, 2019
7aedd3d
Add layout tag
mitohato14 Oct 10, 2019
8d704a0
Add binding var
mitohato14 Oct 10, 2019
a8ac342
Make changeable
mitohato14 Oct 10, 2019
af82586
Use binding
mitohato14 Oct 10, 2019
a677ad6
Add viewmodel variable
mitohato14 Oct 10, 2019
b2d6775
Set viewmodel and life owner
mitohato14 Oct 10, 2019
4158d13
Create search layout
mitohato14 Oct 10, 2019
506b75f
Add recycler view
mitohato14 Oct 10, 2019
4b01c38
Add layout for navigate register point
mitohato14 Oct 10, 2019
5aa8eea
Set top to bottom of register
mitohato14 Oct 10, 2019
7913798
Set height size
mitohato14 Oct 10, 2019
1c3f21b
Add image
mitohato14 Oct 10, 2019
780dfc8
Set text
mitohato14 Oct 10, 2019
f53e2eb
Add text
mitohato14 Oct 10, 2019
debd301
Remove unuse
mitohato14 Oct 10, 2019
e8efe85
Add base margin
mitohato14 Oct 12, 2019
e565b4c
Add history row xml
mitohato14 Oct 12, 2019
216571c
Set constraint
mitohato14 Oct 12, 2019
f93dc21
Add image
mitohato14 Oct 12, 2019
a2dd24c
Add history title
mitohato14 Oct 12, 2019
8f75a80
Set row size
mitohato14 Oct 12, 2019
d41f6fe
Add search item
mitohato14 Oct 12, 2019
fe79d68
Add title
mitohato14 Oct 12, 2019
7181696
Rename
mitohato14 Oct 12, 2019
e883ec7
Add variable
mitohato14 Oct 12, 2019
1a69a6d
Set text
mitohato14 Oct 12, 2019
3c1c473
Add line
mitohato14 Oct 12, 2019
436f517
Add bottom constraint
mitohato14 Oct 12, 2019
63a538a
Add new line to end of file
mitohato14 Oct 12, 2019
d14fbec
Merge pull request #118 from mitohato/search-layout
Oct 12, 2019
8f20146
Add search menu
mitohato14 Oct 12, 2019
2398d6b
Add collapseActionView
mitohato14 Oct 12, 2019
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,8 @@
package com.ict.mito.gootravel.spot.model

/**
* Created by mitohato14 on 2019-10-12.
*/
data class HistoryItem(
val title: String
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.databinding.DataBindingUtil
import androidx.fragment.app.Fragment
import androidx.navigation.fragment.findNavController
import com.ict.mito.gootravel.R
import com.ict.mito.gootravel.databinding.SearchFragmentBinding
import com.ict.mito.gootravel.disaster.manual.ui.ManualActivity
import com.ict.mito.gootravel.setting.activity.SettingActivity
import kotlinx.android.synthetic.main.activity_spot.*
Expand All @@ -16,6 +18,7 @@ import org.koin.androidx.viewmodel.ext.android.viewModel
class SearchFragment : Fragment() {

private val viewModel: SearchViewModel by viewModel()
private var binding: SearchFragmentBinding? = null

override fun onCreateView(
inflater: LayoutInflater,
Expand Down Expand Up @@ -57,10 +60,18 @@ class SearchFragment : Fragment() {
true
}
}
return inflater.inflate(
binding = DataBindingUtil.inflate(
inflater,
R.layout.search_fragment,
container,
false
)

binding?.let {
it.viewmodel = viewModel
it.lifecycleOwner = this
}

return binding?.root
}
}
40 changes: 40 additions & 0 deletions app/src/main/res/layout/history_row.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?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"
xmlns:tools="http://schemas.android.com/tools">

<data>

<variable
name="historyItem"
type="com.ict.mito.gootravel.spot.model.HistoryItem" />
</data>

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="100dp">

<ImageView
android:id="@+id/icon"
android:layout_width="@dimen/history_row_icon_size"
android:layout_height="@dimen/history_row_icon_size"
android:layout_margin="@dimen/base_margin"
android:contentDescription="@string/history_row_icon"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/history_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="@dimen/base_margin"
android:text="@{historyItem.title}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/icon"
app:layout_constraintTop_toTopOf="parent"
tools:text="history title" />

</androidx.constraintlayout.widget.ConstraintLayout>

</layout>
88 changes: 79 additions & 9 deletions app/src/main/res/layout/search_fragment.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,80 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".spot.select.search.ui.SearchFragment">

</androidx.constraintlayout.widget.ConstraintLayout>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">

<data>

<variable
name="viewmodel"
type="com.ict.mito.gootravel.spot.select.search.ui.SearchViewModel" />
</data>

<androidx.constraintlayout.widget.ConstraintLayout xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".spot.select.search.ui.SearchFragment">

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/register_point_button"
android:layout_width="0dp"
android:layout_height="@dimen/register_point_navigate_button_height"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<ImageView
android:id="@+id/register_icon"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_margin="@dimen/base_margin"
android:contentDescription="@string/register_spot_list_button"
android:src="@drawable/ic_location_on_black_36dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/register_point_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/base_margin"
android:text="@string/appbar_register_point_title"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/register_icon"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/register_point_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{'(' + ')'}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/register_point_text"
app:layout_constraintTop_toTopOf="parent" />

<ImageView
android:id="@+id/line"
android:layout_width="0dp"
android:layout_height="2dp"
android:layout_margin="@dimen/base_margin"
android:contentDescription="@string/line"
android:src="@color/gray"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/register_icon" />
</androidx.constraintlayout.widget.ConstraintLayout>

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/history_list"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_margin="@dimen/base_margin"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/register_point_button" />

</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
11 changes: 11 additions & 0 deletions app/src/main/res/menu/search_toolbar_menu.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_search"
android:icon="@drawable/ic_search_black_36dp"
android:title="@string/search"
app:actionViewClass="android.widget.SearchView"
app:showAsAction="always|collapseActionView" />

</menu>
2 changes: 2 additions & 0 deletions app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
<dimen name="base_margin">10dp</dimen>
<dimen name="between_view">60dp</dimen>
<dimen name="row_icon_size">30dp</dimen>
<dimen name="register_point_navigate_button_height">100dp</dimen>
<dimen name="history_row_icon_size">30dp</dimen>
</resources>
4 changes: 4 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,8 @@
<string name="appbar_refuge_title">Refuge</string>
<string name="register_point_icon">register point icon</string>
<string name="spot_icon">spot icon</string>
<string name="register_spot_list_button">Register Spot List Button</string>
<string name="history_row_icon">history row icon</string>
<string name="line">line</string>
<string name="search">Search</string>
</resources>