AndBible / and-bible

AndBible: Bible Study
https://andbible.org
GNU General Public License v3.0
599 stars 198 forks source link

Proposal for a generic filter option for any list #1620

Closed agrogers closed 2 years ago

agrogers commented 3 years ago

My lists are starting to get very long. I am usually scrolling for seconds to get to the item I want. This applies to Study Pads, Labels, Dictionary entries, bookmarks, label settings etc

What I was originally thinking of was a simple alphabetical chooser. It shows 'A B C D E F etc' in a row at the top which would filter my lists by first letter. This would get me to most of the things i want with one click and no scrolling. But I have no idea how to implement that for other languages. And it is somewhat wasteful to have, say, X and Z in the list which are rarely used.

The proposal below would work for all languages and be easily customisable:

image

Dleemuse commented 3 years ago

Love, love, love this idea! I have so many bookmarks, etc., this would be a time saver.

Debra

dbell154 commented 3 years ago

If you are just talking about scrolling, why not use the fast scroll setting in android. You can drag the scrollbar thumb thing to the bottom of the list with one stroke. I like the search option also. On a similar note, I think it would be nice to have a way to assign labels to different label groups.

agrogers commented 3 years ago

How would label groups work?

timbze commented 3 years ago

Something like #1025 may be what @dbell154 is asking for

agrogers commented 3 years ago

Ah, i get it.


www.TenOutOfTen.org https://www.TenOutOfTen.org @.*** (+61) 0477 174 193 (Australia) (+95) 09 250018669 (Myanmar)

On Mon, 8 Nov 2021 at 20:28, Timmy Braun @.***> wrote:

Something like #1025 https://github.com/AndBible/and-bible/issues/1025 may be what @dbell154 https://github.com/dbell154 is asking for

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AndBible/and-bible/issues/1620#issuecomment-963013255, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADKGTJXLTD3M42DYZJZI5KDUK6Q4RANCNFSM5CUGMAVQ .

dbell154 commented 3 years ago

What about fast scrolling like what is in the Contacts screen (mine anyway)? Letters are shown on the right and when you fast scroll the letter for at the current position is displayed. Similar to the exercise at http://androidopentutorials.com/android-listview-fastscroll/.

agrogers commented 2 years ago

Letters on the right would also be helpful. Although I would also like to be able to filter by any part of a label. I need to try and do something soon though. I spend a lot of time scrolling through my ever increasing label list :)

dbell154 commented 2 years ago

One way to do this would be to use phases.

  1. Enable fast scroll on the listview. This can be done in xml or code. Very easy to do.
  2. Add a setting that lets users choose to enable fast scroll, and enable in code based on the setting.
  3. The letters on the side would be a cool enhancement, though the filter (next) may be more useful.
  4. Add a filter option for the list instead of search. There's a javascript function I used in one of my web pages that would filter the page on a by table row basis. (http://www.tylerhosting.com/voltax/taxslayer/index.html). As you type, the list limits what is displayed. Shouldn't be too hard to implement with the database. Select label where label like % (entry) %.
  5. Add a table to record searches as you illustrated, although I worry that a list of past searches might get too unwieldy pretty quick. I've been trying to figure out the "scroll with letters" implementation but with limited Kotlin knowledge and some distractions I haven't gotten very far.
agrogers commented 2 years ago

I have mostly implemented this now and got a draft PR here https://github.com/AndBible/and-bible/pull/2058

  1. Need to look into fast scrolling. It can take a long time for me now.
  2. Letters down the side could be good too. Although i find I have too little width for some long labels so i think the top would be better for me
  3. The filter option has been added now - filters while you type
  4. There is save option to save the filter. I implemented this mainly because I didn't know how to create a list of filter buttons for every language we have available. I am hoping this approach allows people to create their own language specific list. Not sure how the right to left languages will go though.
  5. The search uses standard regex
  6. The same saved lists apply to all lists
  7. Additional suggestions are welcome
  8. Oh, it also always shows the selected labels regardless of filter. This seems right to me.

image

dbell154 commented 2 years ago

Looks good. I started working on this but it didn't take long before I was over my head. The one thing that I did do was add fast scrolling which only consists of two lines under ListView in the xml file manage_labels.xml.

    android:fastScrollAlwaysVisible="true"
    android:fastScrollEnabled="true"

I use fast scroll in my word study app. The touch area for fast scroll is a little wider than I like so I have an overlay at the left edge and users must enable it in settings. I don't think that would be necessary in this case.

With the buttons at the top and fast scroll enabled I don't think the side letters would be necessary.

agrogers commented 2 years ago

Cool. I will check it out.

On Thu, 20 Jan 2022, 7:41 am Dana Bell, @.***> wrote:

Looks good. I started working on this but it didn't take long before I was over my head. The one thing that I did do was add fast scrolling which only consists of two lines under ListView in the xml file manage_labels.xml.

android:fastScrollAlwaysVisible="true" android:fastScrollEnabled="true"

I use fast scroll in my word study app. The touch area for fast scroll is a little wider than I like so I have an overlay at the left edge and users must enable it in settings. I don't think that would be necessary in this case.

With the buttons at the top and fast scroll enabled I don't think the side letters would be necessary.

— Reply to this email directly, view it on GitHub https://github.com/AndBible/and-bible/issues/1620#issuecomment-1016892335, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADKGTJTGER5LIV3PRHRQ2WLUW4VXLANCNFSM5CUGMAVQ . You are receiving this because you authored the thread.Message ID: @.***>

agrogers commented 2 years ago

I have added the fast scroll in now Dana. Can't seem to get the thumb image thing popping up.

I have also added some code so that it recognises text like 'A-C' as all the labels between A and C.

And I fixed a bug so that it is possible to enter any valid REGEX. So "^(?!God)G" what find all G words excluding those that start with 'God'

image