Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.mobile.android > #154286

Re: how to get button max position at recylcerView

From ram@zedat.fu-berlin.de (Stefan Ram)
Newsgroups comp.mobile.android
Subject Re: how to get button max position at recylcerView
Date 2026-06-23 13:59 +0000
Organization Stefan Ram
Message-ID <button-20260623145712@ram.dialup.fu-berlin.de> (permalink)
References <111e026$1dukm$1@paganini.bofh.team>

Show all headers | View raw


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

Back to comp.mobile.android | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

how to get button max position at recylcerView Jakub <jak74@interia.pl> - 2026-06-23 15:01 +0200
  Re: how to get button max position at recylcerView ram@zedat.fu-berlin.de (Stefan Ram) - 2026-06-23 13:59 +0000
    Re: how to get button max position at recylcerView ram@zedat.fu-berlin.de (Stefan Ram) - 2026-06-23 14:09 +0000

csiph-web