question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android Automotive: Limit to eight entrys on any list

See original GitHub issue

I’ve noticed that AAOS only allows 8 rows in a list on any screen, dictated by the constraintManager. This means there are 3 filter settings missing and also only 8 filter profiles can be displayed.

The showcase demo app adds a “more”-button to the top right when a list contains more than 8 rows and pushes a new screen to display a new page. I understand that AAOS limits the top right Actions to two. Since those two slots are occupied by other actions it is not possible to add any actions to that area of the screen.

I would suggest to use one row int the EditFiltersScreen to go to a second page to make all filters accessible.

This would be my suggestion:

    private fun buildFiltersList(filters: List<FilterWithValue<out FilterValue>>): ItemList {
        var subtractor = 0
        var sub_filters = filters

        // check if list fits on screen
        if (filters.size - start_index > maxRows) {
            subtractor = 1
            sub_filters = filters.subList(start_index, start_index + maxRows - subractor - 1)
        }
        return ItemList.Builder().apply {
            if (subtractor > 0) {
                // if it does not fit, insert button for next page
                addItem(Row.Builder().apply {
                    setTitle("More Filters")
                    // Insert forward Icon here
                    setOnClickListener {
                        screenManager.push(EditFiltersScreen(getCarContext(), start_index + maxRows - subtractor) )
                    }
                })
            }
            sub_filters.forEach {
            //...

EditFiltersScreen would get a new argument to specify where to start if it is another page:

class EditFiltersScreen(ctx: CarContext, start_index: int = 0) : Screen(ctx) {

I can’t test the code myself currently so I don’t know if it works at all. Also I have next to no Kotlin experience. But it should show my train of tought.

Showing more than 8 filter profiles would propably be more complex as it is a selection list. Right now if you save a new profile others get pushed out. They are saved but not selectable and there is no info to the user about this happening.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
Ixam97commented, Oct 27, 2022

I see, I overlooked that. How about rearranging the filters in a way so that multiple choice filters are always on the first page? If I counted correctly there are currently four multiple choice filters (connector types, operators, providers and categorys). Those would fit on one page and there would be 3 more slots for possible future multiple choice filters.

And another idea: Since the search is going to be moved on the map screen you could move the delete button down one layer freeing up space for one more filter on the first page:

MapScreen -> FilterScreen (Actions: Delete, Edit) -> EditFiltersScreen (Actions: Save, More) -> MultipleChoiceFilterScreen
                                                                                             -> EditFilterScreen (without MultipleCoice)
          -> Settings ...
          -> Search ...

Edit: I completely overread that one paragraph where you essentially say exactly that … 🙈

0reactions
johan12345commented, Nov 14, 2022

Yep, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

CarUxRestrictions - Android Developers
This contains information on the set of UX restrictions that is in place due to the car's driving state. The restriction information is...
Read more >
Android for Cars App Library design guidelines
For templates with list and grid items, the maximum allowed number of items varies by vehicle and can be retrieved via the ConstraintManager...
Read more >
Using the Android for Cars App Library
For example, list templates have limits on the number of items that can be ... It serves as the entry point to display...
Read more >
Distribute Android apps for cars
Agreeing to the terms means that you want your app to be made available to Android Auto or Android Automotive OS users through...
Read more >
Notifications on Android Automotive OS
Notifications provide drivers with short, timely information about events from your app while it's not in use. Notifications can appear in ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found