Skip to content

Commit 1ada38c

Browse files
committed
Implement requested changes
1 parent 8a4a803 commit 1ada38c

File tree

5 files changed

+145
-117
lines changed

5 files changed

+145
-117
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
tools:ignore="LockedOrientationActivity" />
6161
<activity
6262
android:name=".ui.section.VisitedPollingStationsActivity"
63+
android:parentActivityName=".ui.main.MainActivity"
6364
android:label="@string/title_visited_stations"
6465
android:screenOrientation="portrait"
6566
android:launchMode="singleTop"

app/src/main/java/ro/code4/monitorizarevot/ui/section/VisitedPollingStationsActivity.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ class VisitedPollingStationsActivity : BaseActivity<VisitedPollingStationsViewMo
3030
override fun onCreate(savedInstanceState: Bundle?) {
3131
super.onCreate(savedInstanceState)
3232
setSupportActionBar(toolbar)
33+
supportActionBar?.setDisplayHomeAsUpEnabled(true)
34+
supportActionBar?.setHomeAsUpIndicator(R.drawable.ic_minimalist_arrow)
3335

3436
visitedStationsAdapter = VisitedStationsAdapter(this) { station ->
3537
if (callingActivity?.className == PollingStationActivity::class.java.name) {
@@ -55,7 +57,7 @@ class VisitedPollingStationsActivity : BaseActivity<VisitedPollingStationsViewMo
5557
addItemDecoration(
5658
HorizontalDividerItemDecoration.Builder(this@VisitedPollingStationsActivity)
5759
.color(Color.TRANSPARENT)
58-
.sizeResId(R.dimen.small_margin).build()
60+
.sizeResId(R.dimen.medium_margin).build()
5961
)
6062
}
6163
syncButton.setOnClickListener {
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:width="24dp"
4+
android:height="24dp"
5+
android:viewportWidth="24"
6+
android:viewportHeight="24">
7+
8+
<path
9+
android:pathData="M18,4 L10,12 L18,20"
10+
android:strokeWidth="2"
11+
android:strokeColor="#000000" />
12+
</vector>
Lines changed: 127 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
44
xmlns:tools="http://schemas.android.com/tools"
55
android:layout_width="match_parent"
6-
android:layout_height="match_parent">
6+
android:layout_height="match_parent"
7+
android:orientation="vertical">
78

89
<com.google.android.material.appbar.AppBarLayout
910
android:id="@+id/appBar"
@@ -31,119 +32,129 @@
3132
app:layout_constraintStart_toStartOf="parent"
3233
app:layout_constraintTop_toBottomOf="@id/appBar" />
3334

34-
<androidx.recyclerview.widget.RecyclerView
35-
android:id="@+id/visitedStations"
35+
<androidx.core.widget.NestedScrollView
3636
android:layout_width="match_parent"
37-
android:layout_height="wrap_content"
38-
android:layout_marginStart="@dimen/margin"
39-
android:layout_marginTop="@dimen/big_margin"
40-
android:layout_marginEnd="@dimen/margin"
41-
android:layout_marginBottom="@dimen/big_margin"
42-
android:overScrollMode="never"
43-
android:scrollbars="none"
44-
app:layout_constraintTop_toBottomOf="@id/appBar"
45-
tools:itemCount="3"
46-
tools:listitem="@layout/item_visited_section" />
47-
48-
<androidx.constraintlayout.widget.ConstraintLayout
49-
android:id="@+id/syncInfoDisplay"
50-
android:layout_width="0dp"
51-
android:layout_height="wrap_content"
52-
android:layout_marginStart="@dimen/margin"
53-
android:layout_marginTop="@dimen/big_margin"
54-
android:layout_marginEnd="@dimen/margin"
55-
android:layout_marginBottom="@dimen/big_margin"
56-
app:layout_constraintBottom_toBottomOf="parent"
57-
app:layout_constraintEnd_toEndOf="parent"
58-
app:layout_constraintStart_toStartOf="parent"
59-
app:layout_constraintTop_toBottomOf="@id/visitedStations"
60-
app:layout_constraintVertical_bias="1.0">
61-
62-
<ImageView
63-
android:id="@+id/syncIcon"
64-
android:layout_width="@dimen/medium_icon_size"
65-
android:layout_height="@dimen/medium_icon_size"
66-
android:layout_marginEnd="@dimen/small_margin"
67-
android:contentDescription="@null"
68-
app:layout_constraintBottom_toBottomOf="@id/syncInfo"
69-
app:layout_constraintEnd_toStartOf="@id/syncInfo"
70-
app:layout_constraintHorizontal_chainStyle="packed"
71-
app:layout_constraintStart_toStartOf="parent"
72-
app:layout_constraintTop_toTopOf="@id/syncInfo"
73-
app:layout_constraintVertical_bias="0"
74-
app:srcCompat="@drawable/ic_sync_label_icon" />
75-
76-
<TextView
77-
android:id="@+id/syncInfo"
78-
style="@style/Text.Label"
79-
android:layout_width="0dp"
80-
android:layout_height="wrap_content"
81-
android:layout_marginTop="@dimen/big_margin"
82-
android:paddingStart="@dimen/small_margin"
83-
android:paddingEnd="@dimen/small_margin"
84-
android:text="@string/sync_info"
85-
app:layout_constraintBottom_toTopOf="@id/syncButton"
86-
app:layout_constraintEnd_toEndOf="parent"
87-
app:layout_constraintHorizontal_chainStyle="packed"
88-
app:layout_constraintStart_toEndOf="@id/syncIcon"
89-
app:layout_constraintTop_toTopOf="parent" />
90-
91-
<Button
92-
android:id="@+id/syncButton"
93-
style="@style/Button"
37+
android:layout_height="match_parent"
38+
android:fillViewport="true">
39+
40+
<androidx.constraintlayout.widget.ConstraintLayout
9441
android:layout_width="match_parent"
95-
android:layout_height="wrap_content"
96-
android:layout_marginTop="@dimen/small_margin"
97-
android:text="@string/sync_manual"
98-
app:layout_constraintBottom_toBottomOf="parent"
99-
app:layout_constraintTop_toBottomOf="@id/syncInfo" />
100-
101-
<androidx.constraintlayout.widget.Group
102-
android:id="@+id/syncGroup"
103-
android:layout_width="0dp"
104-
android:layout_height="0dp"
105-
android:visibility="gone"
106-
app:constraint_referenced_ids="syncButton,syncIcon,syncInfo"
107-
tools:layout_editor_absoluteX="16dp"
108-
tools:layout_editor_absoluteY="24dp"
109-
tools:visibility="gone" />
110-
111-
<ImageView
112-
android:id="@+id/syncIconSuccess"
113-
android:layout_width="@dimen/medium_icon_size"
114-
android:layout_height="@dimen/medium_icon_size"
115-
android:layout_marginEnd="@dimen/small_margin"
116-
android:contentDescription="@null"
117-
app:layout_constraintBottom_toBottomOf="@id/syncInfoSuccess"
118-
app:layout_constraintEnd_toStartOf="@id/syncInfoSuccess"
119-
app:layout_constraintHorizontal_chainStyle="packed"
120-
app:layout_constraintStart_toStartOf="parent"
121-
app:layout_constraintTop_toTopOf="@id/syncInfoSuccess"
122-
app:srcCompat="@drawable/ic_synced" />
123-
124-
<TextView
125-
android:id="@+id/syncInfoSuccess"
126-
style="@style/Text.Label"
127-
android:layout_width="0dp"
128-
android:layout_height="wrap_content"
129-
android:layout_marginTop="@dimen/big_margin"
130-
android:layout_marginBottom="@dimen/big_margin"
131-
android:paddingStart="@dimen/small_margin"
132-
android:paddingEnd="@dimen/small_margin"
133-
android:text="@string/sync_info_success"
134-
app:layout_constraintBottom_toBottomOf="parent"
135-
app:layout_constraintEnd_toEndOf="parent"
136-
app:layout_constraintHorizontal_chainStyle="packed"
137-
app:layout_constraintStart_toEndOf="@id/syncIconSuccess"
138-
app:layout_constraintTop_toTopOf="parent" />
139-
140-
<androidx.constraintlayout.widget.Group
141-
android:id="@+id/syncSuccessGroup"
142-
android:layout_width="0dp"
143-
android:layout_height="0dp"
144-
145-
app:constraint_referenced_ids="syncIconSuccess,syncInfoSuccess"
146-
/>
147-
148-
</androidx.constraintlayout.widget.ConstraintLayout>
149-
</androidx.constraintlayout.widget.ConstraintLayout>
42+
android:layout_height="wrap_content">
43+
44+
<androidx.recyclerview.widget.RecyclerView
45+
android:id="@+id/visitedStations"
46+
android:layout_width="match_parent"
47+
android:layout_height="wrap_content"
48+
android:layout_marginStart="@dimen/margin"
49+
android:layout_marginTop="@dimen/big_margin"
50+
android:layout_marginEnd="@dimen/margin"
51+
android:layout_marginBottom="@dimen/big_margin"
52+
android:paddingBottom="@dimen/small_margin"
53+
android:overScrollMode="never"
54+
android:scrollbars="none"
55+
app:layout_constraintTop_toTopOf="parent"
56+
tools:itemCount="3"
57+
tools:listitem="@layout/item_visited_section" />
58+
59+
<androidx.constraintlayout.widget.ConstraintLayout
60+
android:id="@+id/syncInfoDisplay"
61+
android:layout_width="0dp"
62+
android:layout_height="wrap_content"
63+
android:layout_marginStart="@dimen/margin"
64+
android:layout_marginTop="@dimen/big_margin"
65+
android:layout_marginEnd="@dimen/margin"
66+
android:layout_marginBottom="@dimen/big_margin"
67+
app:layout_constraintBottom_toBottomOf="parent"
68+
app:layout_constraintEnd_toEndOf="parent"
69+
app:layout_constraintStart_toStartOf="parent"
70+
app:layout_constraintTop_toBottomOf="@id/visitedStations"
71+
app:layout_constraintVertical_bias="1.0">
72+
73+
<ImageView
74+
android:id="@+id/syncIcon"
75+
android:layout_width="@dimen/medium_icon_size"
76+
android:layout_height="@dimen/medium_icon_size"
77+
android:layout_marginEnd="@dimen/small_margin"
78+
android:contentDescription="@null"
79+
app:layout_constraintBottom_toBottomOf="@id/syncInfo"
80+
app:layout_constraintEnd_toStartOf="@id/syncInfo"
81+
app:layout_constraintHorizontal_chainStyle="packed"
82+
app:layout_constraintStart_toStartOf="parent"
83+
app:layout_constraintTop_toTopOf="@id/syncInfo"
84+
app:layout_constraintVertical_bias="0"
85+
app:srcCompat="@drawable/ic_sync_label_icon" />
86+
87+
<TextView
88+
android:id="@+id/syncInfo"
89+
style="@style/Text.Label"
90+
android:layout_width="0dp"
91+
android:layout_height="wrap_content"
92+
android:layout_marginTop="@dimen/big_margin"
93+
android:paddingStart="@dimen/small_margin"
94+
android:paddingEnd="@dimen/small_margin"
95+
android:text="@string/sync_info"
96+
app:layout_constraintBottom_toTopOf="@id/syncButton"
97+
app:layout_constraintEnd_toEndOf="parent"
98+
app:layout_constraintHorizontal_chainStyle="packed"
99+
app:layout_constraintStart_toEndOf="@id/syncIcon"
100+
app:layout_constraintTop_toTopOf="parent" />
101+
102+
<Button
103+
android:id="@+id/syncButton"
104+
style="@style/Button"
105+
android:layout_width="match_parent"
106+
android:layout_height="wrap_content"
107+
android:layout_marginTop="@dimen/small_margin"
108+
android:text="@string/sync_manual"
109+
app:layout_constraintBottom_toBottomOf="parent"
110+
app:layout_constraintTop_toBottomOf="@id/syncInfo" />
111+
112+
<androidx.constraintlayout.widget.Group
113+
android:id="@+id/syncGroup"
114+
android:layout_width="0dp"
115+
android:layout_height="0dp"
116+
android:visibility="gone"
117+
app:constraint_referenced_ids="syncButton,syncIcon,syncInfo"
118+
tools:layout_editor_absoluteX="16dp"
119+
tools:layout_editor_absoluteY="24dp"
120+
tools:visibility="gone" />
121+
122+
<ImageView
123+
android:id="@+id/syncIconSuccess"
124+
android:layout_width="@dimen/medium_icon_size"
125+
android:layout_height="@dimen/medium_icon_size"
126+
android:layout_marginEnd="@dimen/small_margin"
127+
android:contentDescription="@null"
128+
app:layout_constraintBottom_toBottomOf="@id/syncInfoSuccess"
129+
app:layout_constraintEnd_toStartOf="@id/syncInfoSuccess"
130+
app:layout_constraintHorizontal_chainStyle="packed"
131+
app:layout_constraintStart_toStartOf="parent"
132+
app:layout_constraintTop_toTopOf="@id/syncInfoSuccess"
133+
app:srcCompat="@drawable/ic_synced" />
134+
135+
<TextView
136+
android:id="@+id/syncInfoSuccess"
137+
style="@style/Text.Label"
138+
android:layout_width="0dp"
139+
android:layout_height="wrap_content"
140+
android:layout_marginTop="@dimen/big_margin"
141+
android:layout_marginBottom="@dimen/big_margin"
142+
android:paddingStart="@dimen/small_margin"
143+
android:paddingEnd="@dimen/small_margin"
144+
android:text="@string/sync_info_success"
145+
app:layout_constraintBottom_toBottomOf="parent"
146+
app:layout_constraintEnd_toEndOf="parent"
147+
app:layout_constraintHorizontal_chainStyle="packed"
148+
app:layout_constraintStart_toEndOf="@id/syncIconSuccess"
149+
app:layout_constraintTop_toTopOf="parent" />
150+
151+
<androidx.constraintlayout.widget.Group
152+
android:id="@+id/syncSuccessGroup"
153+
android:layout_width="0dp"
154+
android:layout_height="0dp"
155+
app:constraint_referenced_ids="syncIconSuccess,syncInfoSuccess" />
156+
157+
</androidx.constraintlayout.widget.ConstraintLayout>
158+
</androidx.constraintlayout.widget.ConstraintLayout>
159+
</androidx.core.widget.NestedScrollView>
160+
</LinearLayout>

app/src/main/res/layout/item_visited_section.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:tools="http://schemas.android.com/tools"
4+
xmlns:app="http://schemas.android.com/apk/res-auto"
5+
app:cardUseCompatPadding="true"
46
style="@style/MaterialCardView"
57
android:layout_width="match_parent"
68
android:layout_height="wrap_content">

0 commit comments

Comments
 (0)