Skip to content

Commit ce84aae

Browse files
committed
style: RouteFragment UI 수정 1/2
1 parent a6e8086 commit ce84aae

File tree

11 files changed

+112
-106
lines changed

11 files changed

+112
-106
lines changed
Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
11
package com.stop.bindingadapter
22

33
import android.widget.TextView
4+
import androidx.core.content.ContextCompat
45
import androidx.databinding.BindingAdapter
6+
import com.stop.R
57
import com.stop.model.route.Place
68

7-
@BindingAdapter("set_place_name")
8-
fun TextView.setPlaceName(place: Place?) {
9-
if (place == null) return
9+
@BindingAdapter("set_place_name", "set_text")
10+
fun TextView.setPlaceName(place: Place?, newText: String) {
11+
if (place == null) {
12+
setTextColor(ContextCompat.getColor(context, R.color.main_light_grey))
13+
text = newText
14+
return
15+
}
16+
17+
setTextColor(ContextCompat.getColor(context, R.color.main_dark_grey))
1018

1119
if (place.name.isEmpty()) {
1220
text = place.roadAddress
1321
return
1422
}
23+
1524
text = place.name
1625
}

presentation/src/main/java/com/stop/ui/mission/MissionFragment.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class MissionFragment : Fragment(), MissionHandler {
108108
fun clickMissionOver() {
109109
Snackbar.make(requireActivity().findViewById(R.id.constraint_layout_container), "미션을 취소했습니다", Snackbar.LENGTH_SHORT).show()
110110
missionViewModel.isMissionOver.value = true
111-
findNavController().navigate(R.id.action_missionFragment_to_mapFragment)
111+
// findNavController().navigate(R.id.action_missionFragment_to_mapFragment)
112112
}
113113

114114
override fun alertTMapReady() {

presentation/src/main/java/com/stop/ui/route/RouteFragment.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,22 +85,22 @@ class RouteFragment : Fragment() {
8585
navController.setGraph(R.navigation.nav_graph)
8686
navController.navigate(R.id.action_global_placeSearchFragment)
8787
}
88+
8889
binding.textViewDestination.setOnClickListener {
8990
val navController = findNavController()
9091
navController.setGraph(R.navigation.nav_graph)
9192
navController.navigate(R.id.action_global_placeSearchFragment)
9293
}
94+
9395
binding.imageViewSwapOriginWithDestination.setOnClickListener {
9496
routeViewModel.changeOriginAndDestination()
9597
}
98+
9699
binding.imageViewExit.setOnClickListener {
97100
val navController = findNavController()
98101
navController.setGraph(R.navigation.nav_graph)
99102
navController.popBackStack(R.id.mapFragment, false)
100103
}
101-
binding.imageViewResearch.setOnClickListener {
102-
routeViewModel.getRoute()
103-
}
104104
}
105105

106106
private fun setRecyclerView() {

presentation/src/main/res/drawable/ic_baseline_close_24.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<vector android:height="24dp" android:tint="#000000"
1+
<vector android:height="24dp" android:tint="@color/main_dark_grey"
22
android:viewportHeight="24" android:viewportWidth="24"
33
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
44
<path android:fillColor="@android:color/white" android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>

presentation/src/main/res/drawable/ic_baseline_swap_vert_24.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<vector android:height="24dp" android:tint="#000000"
1+
<vector android:height="24dp" android:tint="@color/main_dark_grey"
22
android:viewportHeight="24" android:viewportWidth="24"
33
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
44
<path android:fillColor="@android:color/white" android:pathData="M16,17.01V10h-2v7.01h-3L15,21l4,-3.99h-3zM9,3L5,6.99h3V14h2V6.99h3L9,3z"/>

presentation/src/main/res/drawable/time_stick_border.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<shape xmlns:android="http://schemas.android.com/apk/res/android"
33
android:shape="rectangle">
44

5-
<corners android:radius="6dp" />
5+
<corners android:radius="15dp" />
66

77
<stroke
88
android:width="1dp"

presentation/src/main/res/layout/fragment_place_search.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
android:layout_width="match_parent"
6060
android:layout_height="wrap_content"
6161
android:hint="@string/search_hint"
62+
android:textColorHint="@color/main_light_grey"
6263
android:imeOptions="actionSearch"
6364
android:inputType="text"
6465
android:textSize="17sp"

presentation/src/main/res/layout/fragment_route.xml

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -15,65 +15,85 @@
1515
android:layout_height="match_parent"
1616
tools:context=".ui.route.RouteFragment">
1717

18-
<ImageView
19-
android:id="@+id/image_view_exit"
18+
<androidx.constraintlayout.widget.Guideline
19+
android:id="@+id/guideline_start"
2020
android:layout_width="wrap_content"
2121
android:layout_height="wrap_content"
22-
android:contentDescription="@string/image_view_exit_content_description"
23-
app:layout_constraintBottom_toBottomOf="@id/text_view_origin"
24-
app:layout_constraintEnd_toEndOf="parent"
25-
app:layout_constraintTop_toTopOf="@id/text_view_origin"
26-
app:srcCompat="@drawable/ic_baseline_close_24" />
22+
android:orientation="vertical"
23+
app:layout_constraintGuide_begin="15dp" />
2724

25+
<androidx.constraintlayout.widget.Guideline
26+
android:id="@+id/guideline_end"
27+
android:layout_width="wrap_content"
28+
android:layout_height="wrap_content"
29+
android:orientation="vertical"
30+
app:layout_constraintGuide_end="15dp" />
31+
32+
<androidx.constraintlayout.widget.Guideline
33+
android:id="@+id/guideline_top"
34+
android:layout_width="wrap_content"
35+
android:layout_height="wrap_content"
36+
android:orientation="horizontal"
37+
app:layout_constraintGuide_begin="50dp" />
2838

2939
<TextView
3040
android:id="@+id/text_view_origin"
3141
android:layout_width="0dp"
32-
android:layout_height="wrap_content"
33-
android:layout_marginStart="5dp"
34-
android:background="@drawable/square_border"
35-
android:padding="10dp"
42+
android:layout_height="47dp"
43+
android:layout_marginEnd="10dp"
44+
android:background="@drawable/background_alarm_panel"
45+
android:paddingStart="20dp"
46+
android:paddingEnd="20dp"
47+
android:textSize="15sp"
48+
android:ellipsize="end"
49+
android:maxLines="1"
50+
android:gravity="center_vertical"
3651
app:layout_constraintEnd_toStartOf="@id/image_view_exit"
37-
app:layout_constraintHorizontal_bias="0.0"
38-
app:layout_constraintStart_toEndOf="@id/image_view_swap_origin_with_destination"
39-
app:layout_constraintTop_toBottomOf="@id/guideline_start_horizontal"
52+
app:layout_constraintStart_toStartOf="@id/guideline_start"
53+
app:layout_constraintTop_toBottomOf="@id/guideline_top"
4054
app:set_place_name="@{viewModel.origin}"
55+
app:set_text="@{@string/start}"
4156
tools:text="이앤씨벤쳐드림타워3차" />
4257

43-
<ImageView
44-
android:id="@+id/image_view_swap_origin_with_destination"
45-
android:layout_width="wrap_content"
46-
android:layout_height="wrap_content"
47-
android:layout_marginStart="5dp"
48-
android:layout_marginEnd="50dp"
49-
android:contentDescription="@string/image_view_swap_origin_with_destination_content_description"
50-
app:layout_constraintBottom_toBottomOf="@id/text_view_destination"
51-
app:layout_constraintStart_toStartOf="parent"
52-
app:layout_constraintTop_toTopOf="@id/text_view_origin"
53-
app:srcCompat="@drawable/ic_baseline_swap_vert_24" />
54-
5558
<TextView
5659
android:id="@+id/text_view_destination"
5760
android:layout_width="0dp"
58-
android:layout_height="wrap_content"
61+
android:layout_height="47dp"
62+
android:layout_marginEnd="10dp"
5963
android:layout_marginTop="10dp"
60-
android:background="@drawable/square_border"
61-
android:padding="10dp"
62-
app:layout_constraintEnd_toStartOf="@id/image_view_research"
63-
app:layout_constraintStart_toStartOf="@id/text_view_origin"
64+
android:background="@drawable/background_alarm_panel"
65+
android:ellipsize="end"
66+
android:gravity="center_vertical"
67+
android:maxLines="1"
68+
android:paddingStart="20dp"
69+
android:paddingEnd="20dp"
70+
android:textSize="15sp"
71+
app:layout_constraintStart_toStartOf="@id/guideline_start"
72+
app:layout_constraintEnd_toStartOf="@id/image_view_swap_origin_with_destination"
6473
app:layout_constraintTop_toBottomOf="@id/text_view_origin"
6574
app:set_place_name="@{viewModel.destination}"
75+
app:set_text="@{@string/end}"
6676
tools:text="Naver1784" />
6777

6878
<ImageView
69-
android:id="@+id/image_view_research"
70-
android:layout_width="wrap_content"
71-
android:layout_height="wrap_content"
72-
android:contentDescription="@string/image_view_research_content_description"
79+
android:id="@+id/image_view_exit"
80+
android:layout_width="33dp"
81+
android:layout_height="33dp"
82+
android:contentDescription="@string/image_view_exit_content_description"
83+
app:layout_constraintBottom_toBottomOf="@id/text_view_origin"
84+
app:layout_constraintEnd_toEndOf="@id/guideline_end"
85+
app:layout_constraintTop_toTopOf="@id/text_view_origin"
86+
app:srcCompat="@drawable/ic_baseline_close_24" />
87+
88+
<ImageView
89+
android:id="@+id/image_view_swap_origin_with_destination"
90+
android:layout_width="33dp"
91+
android:layout_height="33dp"
92+
android:contentDescription="@string/image_view_swap_origin_with_destination_content_description"
7393
app:layout_constraintBottom_toBottomOf="@id/text_view_destination"
74-
app:layout_constraintEnd_toStartOf="@id/guideline_end_vertical"
94+
app:layout_constraintEnd_toEndOf="@id/guideline_end"
7595
app:layout_constraintTop_toTopOf="@id/text_view_destination"
76-
app:srcCompat="@drawable/ic_baseline_replay_24" />
96+
app:srcCompat="@drawable/ic_baseline_swap_vert_24" />
7797

7898
<androidx.recyclerview.widget.RecyclerView
7999
android:id="@+id/recyclerview_route"
@@ -82,30 +102,10 @@
82102
android:layout_marginTop="16dp"
83103
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
84104
app:layout_constraintBottom_toBottomOf="parent"
85-
app:layout_constraintEnd_toStartOf="@id/guideline_end_vertical"
86-
app:layout_constraintStart_toStartOf="@id/guideline_start_vertical"
105+
app:layout_constraintEnd_toStartOf="@id/guideline_end"
106+
app:layout_constraintStart_toStartOf="@id/guideline_start"
87107
app:layout_constraintTop_toBottomOf="@id/text_view_destination"
88108
tools:listitem="@layout/route_item" />
89109

90-
<androidx.constraintlayout.widget.Guideline
91-
android:id="@+id/guideline_start_vertical"
92-
android:layout_width="wrap_content"
93-
android:layout_height="wrap_content"
94-
android:orientation="vertical"
95-
app:layout_constraintGuide_begin="0dp" />
96-
97-
<androidx.constraintlayout.widget.Guideline
98-
android:id="@+id/guideline_start_horizontal"
99-
android:layout_width="wrap_content"
100-
android:layout_height="wrap_content"
101-
android:orientation="horizontal"
102-
app:layout_constraintGuide_begin="32dp" />
103-
104-
<androidx.constraintlayout.widget.Guideline
105-
android:id="@+id/guideline_end_vertical"
106-
android:layout_width="wrap_content"
107-
android:layout_height="wrap_content"
108-
android:orientation="vertical"
109-
app:layout_constraintGuide_end="0dp" />
110110
</androidx.constraintlayout.widget.ConstraintLayout>
111111
</layout>

presentation/src/main/res/layout/home_panel.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
android:layout_marginTop="20dp"
3535
android:layout_marginEnd="20dp"
3636
android:ellipsize="end"
37-
android:gravity="center_vertical"
3837
android:maxLines="1"
38+
android:gravity="center_vertical"
3939
android:text="@{placeSearchViewModel.geoLocation.title}"
4040
android:textColor="@color/white"
4141
android:textSize="22sp"

presentation/src/main/res/layout/route_item.xml

Lines changed: 31 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,82 +6,78 @@
66
<androidx.constraintlayout.widget.ConstraintLayout
77
android:layout_width="match_parent"
88
android:layout_height="wrap_content"
9-
android:background="@drawable/square_border">
9+
tools:theme="@style/Theme.Material3.Light.NoActionBar">
1010

1111
<TextView
1212
android:id="@+id/text_view_required_hour"
1313
android:layout_width="wrap_content"
1414
android:layout_height="wrap_content"
15-
android:textSize="24sp"
16-
app:layout_constraintEnd_toEndOf="parent"
17-
app:layout_constraintHorizontal_bias="0"
18-
app:layout_constraintStart_toStartOf="@id/guideline_start_vertical"
19-
app:layout_constraintTop_toTopOf="@id/guideline_start_horizontal"
20-
tools:text="1" />
15+
android:layout_marginTop="5dp"
16+
android:textSize="25sp"
17+
android:textColor="@color/main_dark_grey"
18+
app:layout_constraintStart_toStartOf="parent"
19+
app:layout_constraintTop_toTopOf="parent"
20+
tools:text="2" />
2121

2222
<TextView
2323
android:id="@+id/text_view_required_hour_text"
2424
android:layout_width="wrap_content"
2525
android:layout_height="wrap_content"
26+
android:layout_marginStart="3dp"
27+
app:layout_goneMarginStart="0dp"
28+
android:layout_marginBottom="3dp"
2629
android:text="@string/required_hour"
30+
android:textSize="17sp"
31+
android:textColor="@color/main_dark_grey"
2732
app:layout_constraintBottom_toBottomOf="@id/text_view_required_hour"
28-
app:layout_constraintEnd_toStartOf="@id/text_view_required_minute"
2933
app:layout_constraintStart_toEndOf="@id/text_view_required_hour" />
3034

3135
<TextView
3236
android:id="@+id/text_view_required_minute"
3337
android:layout_width="wrap_content"
3438
android:layout_height="wrap_content"
35-
android:textSize="24sp"
39+
android:layout_marginTop="5dp"
40+
android:textSize="25sp"
41+
android:textColor="@color/main_dark_grey"
3642
app:layout_constraintStart_toEndOf="@id/text_view_required_hour_text"
37-
app:layout_constraintTop_toTopOf="@id/guideline_start_horizontal"
38-
tools:text="30" />
43+
app:layout_constraintTop_toTopOf="parent"
44+
tools:text="31" />
3945

4046
<TextView
4147
android:id="@+id/text_view_required_minute_text"
4248
android:layout_width="wrap_content"
4349
android:layout_height="wrap_content"
50+
android:layout_marginStart="3dp"
51+
android:layout_marginBottom="3dp"
4452
android:text="@string/required_minute"
53+
android:textSize="17sp"
54+
android:textColor="@color/main_dark_grey"
4555
app:layout_constraintBottom_toBottomOf="@id/text_view_required_minute"
4656
app:layout_constraintStart_toEndOf="@id/text_view_required_minute" />
4757

4858
<com.stop.ui.route.TimeLineContainer
4959
android:id="@+id/time_line_container"
5060
android:layout_width="0dp"
5161
android:layout_height="wrap_content"
52-
app:layout_constraintEnd_toEndOf="@id/guideline_end_vertical"
53-
app:layout_constraintStart_toStartOf="@id/guideline_start_vertical"
62+
android:layout_marginTop="3dp"
63+
app:layout_constraintEnd_toEndOf="parent"
64+
app:layout_constraintStart_toStartOf="parent"
5465
app:layout_constraintTop_toBottomOf="@id/text_view_required_minute" />
5566

5667
<com.stop.ui.route.StationContainer
5768
android:id="@+id/station_container"
5869
android:layout_width="0dp"
5970
android:layout_height="wrap_content"
60-
app:layout_constraintBottom_toBottomOf="parent"
61-
app:layout_constraintEnd_toStartOf="@id/guideline_end_vertical"
71+
app:layout_constraintEnd_toEndOf="parent"
6272
app:layout_constraintStart_toStartOf="parent"
6373
app:layout_constraintTop_toBottomOf="@id/time_line_container" />
6474

65-
<androidx.constraintlayout.widget.Guideline
66-
android:id="@+id/guideline_start_vertical"
67-
android:layout_width="wrap_content"
68-
android:layout_height="wrap_content"
69-
android:orientation="vertical"
70-
app:layout_constraintGuide_begin="5dp" />
71-
72-
<androidx.constraintlayout.widget.Guideline
73-
android:id="@+id/guideline_start_horizontal"
74-
android:layout_width="wrap_content"
75-
android:layout_height="wrap_content"
76-
android:orientation="horizontal"
77-
app:layout_constraintGuide_begin="8dp" />
78-
79-
<androidx.constraintlayout.widget.Guideline
80-
android:id="@+id/guideline_end_vertical"
81-
android:layout_width="wrap_content"
82-
android:layout_height="wrap_content"
83-
android:orientation="vertical"
84-
app:layout_constraintGuide_end="5dp" />
75+
<com.google.android.material.divider.MaterialDivider
76+
android:layout_width="match_parent"
77+
android:layout_height="1dp"
78+
app:dividerColor="@color/main_lighter_grey"
79+
app:layout_constraintTop_toBottomOf="@id/station_container"
80+
app:layout_constraintBottom_toBottomOf="parent" />
8581

8682
</androidx.constraintlayout.widget.ConstraintLayout>
8783
</layout>

0 commit comments

Comments
 (0)