Skip to content

Commit

Permalink
feat: Add deselect all to PIDs list dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
tzebrowski committed Sep 4, 2023
1 parent 5e4ccd3 commit a4d8c4f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,15 @@ class PIDsListPreferenceDialog(private val key: String, private val source: Stri
}
}

root.findViewById<Button>(R.id.pid_list_deselect_all).apply {
setOnClickListener {
adapter.data.forEach {
it.checked = false
}
adapter.notifyDataSetChanged()
}
}

return root
}

Expand Down
13 changes: 13 additions & 0 deletions app/src/main/res/layout/dialog_pids.xml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,16 @@
android:textSize="12sp"
style="?android:attr/buttonBarButtonStyle" />

<Button
android:id="@+id/pid_list_deselect_all"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:backgroundTint="@color/rainbow_indigo"
android:text="@string/dialog_deselect_all_action"
android:textSize="12sp"
style="?android:attr/buttonBarButtonStyle" />

<Button
android:id="@+id/pid_list_close_window"
android:layout_width="wrap_content"
Expand All @@ -149,5 +159,8 @@
android:text="@string/dialog_save_action"
android:textSize="12sp" />
</LinearLayout>



</RelativeLayout>

9 changes: 5 additions & 4 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,10 @@
<string name="trip_vehicle_profile">Profile</string>
<string name="trip_action">Action</string>
<string name="trip_action_delete">Del</string>
<string name="dialog_select_all_action">Select all</string>
<string name="dialog_close_window_action">Close window</string>
<string name="dialog_select_all_action">Select\nAll</string>
<string name="dialog_deselect_all_action">Deselect\nAll</string>

<string name="dialog_close_window_action">Close\n </string>
<string name="trip_dialog_delete_all_trips">Delete all</string>
<string name="trip_delete_dialog_ask_question">Are you sure you want to Delete?</string>
<string name="trip_delete_dialog_ask_question_yes">Yes</string>
Expand Down Expand Up @@ -301,11 +303,10 @@
<string name="virtual_screen_6">6</string>
<string name="virtual_screen_7">7</string>
<string name="virtual_screen_8">8</string>
<string name="dialog_save_action">Save</string>
<string name="dialog_save_action">Save\n </string>
<string name="pids_supported">Supported</string>
<string name="pref_search_view_title">Search</string>


<string-array name="pref.numbers_1_20">
<item name="0">0</item>
<item name="1">1</item>
Expand Down

0 comments on commit a4d8c4f

Please sign in to comment.