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

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From ram@zedat.fu-berlin.de (Stefan Ram)
Newsgroups comp.mobile.android
Subject Re: how to get button max position at recylcerView
Date 23 Jun 2026 13:59:00 GMT
Organization Stefan Ram
Lines 50
Expires 1 Jun 2027 11:59:58 GMT
Message-ID <button-20260623145712@ram.dialup.fu-berlin.de> (permalink)
References <111e026$1dukm$1@paganini.bofh.team>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
X-Trace news.uni-berlin.de XA4ftfzFZb0k+EG/CY7sSAd69qU7U/xylXmqXwgWG7u5qo
Cancel-Lock sha1:RNTI7cmQBS9cVN/q+pRpuKx73vM= sha256:drps2DokCISAwkRzMl1HQm6/ITStUL2GmI6wLx9ZyaY=
X-Copyright (C) Copyright 2026 Stefan Ram. All rights reserved. Distribution through any means other than regular usenet channels is forbidden. It is forbidden to publish this article in the Web, to change URIs of this article into links, and to transfer the body without this notice, but quotations of parts in other Usenet posts are allowed.
X-No-Archive Yes
Archive no
X-No-Archive-Readme "X-No-Archive" is set, because this prevents some services to mirror the article in the web. But the article may be kept on a Usenet archive server with only NNTP access.
X-No-Html yes
Content-Language en
Xref csiph.com comp.mobile.android:154286

Show key headers only | 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