• how to get button max position at recylcerView

    From Jakub@jak74@interia.pl to comp.mobile.android on Tue Jun 23 15:01:41 2026
    From Newsgroup: comp.mobile.android

    how to get button max position at recylcerView

    at java or kotlin
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From ram@ram@zedat.fu-berlin.de (Stefan Ram) to comp.mobile.android on Tue Jun 23 13:59:00 2026
    From Newsgroup: comp.mobile.android

    Jakub <jak74@interia.pl> wrote or quoted:
    how to get button max position at recylcerView
    at java or kotlin

    | Here is how to reword your question into clear, professional English:
    |
    | Option 1 (Direct and natural):
    |
    | "How do I find the maximum scroll position of a button inside a
    | RecyclerView using Java or Kotlin?"
    |
    | Option 2 (Short and technical):
    |
    | "How to get the maximum scroll position for a button in a RecyclerView
    | (Java/Kotlin)?"
    |
    | Quick Technical Solutions
    |
    | Depending on what you mean by "max position," here are the two most
    | common solutions:
    |
    | 1. Find the last visible item position
    |
    | If you want to know when the user scrolls to the very bottom where a
    | button might be hidden, use the layout manager.
    |
    | Kotlin:
    |
    | val layoutManager = recyclerView.layoutManager as
    | LinearLayoutManagerval maxPosition =
    | layoutManager.findLastVisibleItemPosition()
    |
    | Java:
    |
    | LinearLayoutManager layoutManager = (LinearLayoutManager)
    | recyclerView.getLayoutManager();int maxPosition =
    | layoutManager.findLastVisibleItemPosition();
    |
    | 2. Find the exact X/Y coordinates of a button
    |
    | If you need the visual pixel position of a specific button inside a
    | row, use getLocationOnScreen.
    |
    | Kotlin:
    |
    | val location = IntArray(2)
    |
    | myButton.getLocationOnScreen(location)val x = locationval y = location


    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From ram@ram@zedat.fu-berlin.de (Stefan Ram) to comp.mobile.android on Tue Jun 23 14:09:39 2026
    From Newsgroup: comp.mobile.android

    ram@zedat.fu-berlin.de (Stefan Ram) wrote or quoted:
    | Kotlin:
    |
    | val layoutManager = recyclerView.layoutManager as
    | LinearLayoutManagerval maxPosition =
    | layoutManager.findLastVisibleItemPosition()

    Sorry, the formatting of source text went wrong!

    The code parts were meant to read,

    | Kotlin:
    | val layoutManager = recyclerView.layoutManager as LinearLayoutManager
    | val maxPosition = layoutManager.findLastVisibleItemPosition()

    | Java:
    | LinearLayoutManager layoutManager = (LinearLayoutManager) recyclerView.getLayoutManager();
    | int maxPosition = layoutManager.findLastVisibleItemPosition();

    | Kotlin:
    | val location = IntArray(2)
    | myButton.getLocationOnScreen(location)
    | val x = location
    | val y = location

    . My formatting script actually is working fine. The Markdown I got
    from the chatbot already had joined source code lines into one line.


    --- Synchronet 3.22a-Linux NewsLink 1.2