Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9176825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:11:46+00:00 2026-06-17T17:11:46+00:00

I have a 2 pane layout. On the left is a ListView , on

  • 0

I have a 2 pane layout. On the left is a ListView, on the rights some content linked with the list. The content is scrollable.
If content moves forward, I want the list to go forward only if this item is not yet displayed. This prevents that the list has to update on every content change. I also want the list to go ahead one full page.
Is there something like

listView.isThisElementCurrentlyShown(int nr)

and

listView.moveAheadOnePage(int direction)

?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T17:11:48+00:00Added an answer on June 17, 2026 at 5:11 pm

    Here is an example of isThisElementCurrentlyShown(Element e):

        public boolean isThisElementCurrentlyShown(Element e){
                    ListView lv = getListView();
                    int start = lv.getFirstVisiblePosition();
                    for(int i=start, j=lv.getLastVisiblePosition();i<=j;i++){
                        if(e==lv.getItemAtPosition(i)){
                            return true;
                        }
                    }
                    return false;
    }
    

    This will tell you whether the element is visible or not.

    For the moveAheadOnePage you should be able to use listview’s built in functions getFirstVisiblePosition() and getLastVisiblePosition() to calculate the number of rows visible on that device, then advance the listview ahead that many positions. Something like this pseudocode (you will have to write this one):

    public void moveAheadOnePage(int direction){//direction: 0-up, 1-down
        int numVisibleRows = getLastVisiblePosition() - getFirstVisiblePosition();
        this.setSelected(currentSelection + numVisibleRows) // +/- depending on direction
    }
    

    Mind you these are both expensive calls to make while scrolling through a listview, so you will definitely have to implement wisely~

    EDIT: Updated code to include return false

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my application I have a dual-pane layout with a list on the left
I have a layout with a header, a navigation pane on the left, and
I have the following rendered HTML: <div id=ordersBrowseForm:ordersBrowseWestPane class=ui-layout-west ui-widget-content ui-corner-all ui-layout-pane ui-layout-pane-west data-combinedposition=west
I have a menu-bar and a tabbed pane in a frame, and i want
I have a fiddle here - http://jsfiddle.net/hhimanshu/SDr3F/2/ The left pane is already available I
I have a dojo layout with two content panes, each at 50% height, one
I want to have layout, which is similar by structure to Thunderbird classic view
I have two panes(left side list and right side details) in my android tablet
I've added an accordion layout container with a tree in its first content pane
Hello I have a main layout made in this way: | | Main pane

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.