Page Menu
Home
GitPull.it
Search
Configure Global Search
Log In
Files
F15164318
D129.1794955347.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
D129.1794955347.diff
View Options
diff --git a/app/src/main/java/it/reyboz/bustorino/fragments/LinesGridShowingFragment.kt b/app/src/main/java/it/reyboz/bustorino/fragments/LinesGridShowingFragment.kt
--- a/app/src/main/java/it/reyboz/bustorino/fragments/LinesGridShowingFragment.kt
+++ b/app/src/main/java/it/reyboz/bustorino/fragments/LinesGridShowingFragment.kt
@@ -119,29 +119,32 @@
//onClicks
urbanLinesTitle.setOnClickListener {
- if(openRecyclerView!=""&& openRecyclerView!= AG_URBAN){
- openCloseRecyclerView(openRecyclerView)
- openCloseRecyclerView(AG_URBAN)
- }
+ openLinesAndCloseOthersIfNeeded(AG_URBAN)
}
extrurbanLinesTitle.setOnClickListener {
- if(openRecyclerView!=""&& openRecyclerView!= AG_EXTRAURB){
- openCloseRecyclerView(openRecyclerView)
- openCloseRecyclerView(AG_EXTRAURB)
-
- }
+ openLinesAndCloseOthersIfNeeded(AG_EXTRAURB)
}
touristLinesTitle.setOnClickListener {
- if(openRecyclerView!="" && openRecyclerView!= AG_TOUR) {
- openCloseRecyclerView(openRecyclerView)
- openCloseRecyclerView(AG_TOUR)
- }
+ openLinesAndCloseOthersIfNeeded(AG_TOUR)
+ }
+ //arrows onClicks
+ for(k in arrows.keys){
+ //k is either AG_TOUR, AG_EXTRAURBAN, AG_URBAN
+ arrows[k]?.setOnClickListener { openLinesAndCloseOthersIfNeeded(k) }
}
return rootView
}
- private fun openCloseRecyclerView(agency: String){
+ private fun openLinesAndCloseOthersIfNeeded(agency: String){
+ if(openRecyclerView!="" && openRecyclerView!= agency) {
+ switchRecyclerViewStatus(openRecyclerView)
+
+ }
+ switchRecyclerViewStatus(agency)
+ }
+
+ private fun switchRecyclerViewStatus(agency: String){
val recyclerView = when(agency){
AG_TOUR -> touristRecyclerView
AG_EXTRAURB -> extraurbanRecyclerView
diff --git a/app/src/main/res/layout/fragment_lines_grid.xml b/app/src/main/res/layout/fragment_lines_grid.xml
--- a/app/src/main/res/layout/fragment_lines_grid.xml
+++ b/app/src/main/res/layout/fragment_lines_grid.xml
@@ -39,7 +39,7 @@
app:layout_constraintBottom_toTopOf="@id/urbanLinesRecyclerView"
android:layout_marginLeft="6dp"
app:layout_constraintVertical_bias="0.0"
- app:layout_constraintVertical_chainStyle="spread"/>
+ app:layout_constraintVertical_chainStyle="packed"/>
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="0dp"
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 17, 22:42 (22 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2263256
Default Alt Text
D129.1794955347.diff (2 KB)
Attached To
Mode
D129: Allow closing of one of the three type of lines in LinesGridShowingFragment
Attached
Detach File
Event Timeline