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

  • SEARCH
  • Home
  • 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 8498879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:31:20+00:00 2026-06-11T00:31:20+00:00

I have 8 buttons I would like the app to detect the buttons by

  • 0

I have 8 buttons I would like the app to detect the buttons by just scrolling on the screen and not by touching? like the accessibility feature in Jelly bean? I am not sure how to call that feature as? Gesture? Motion sense?

Is this possible? What should I look for?

Thanks!

  • 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-11T00:31:21+00:00Added an answer on June 11, 2026 at 12:31 am

    By default the UI elements in Android are focusable by scrollballs, arrow keys, etc… The Views have an View.setOnFocusChangedListener callback. You can also set focus on elements programmatically.

    Some example code I quickly wrote and did not test.

    float initialX = 0;
    float initialY = 0;
    int currentFocusedChild = 0;
    List<View> children;
    
    public void walkElements() {
        final LinearLayout mainLayout = (LinearLayout) findViewById(R.id.main_layout);
        children = mainLayout.getFocusables(View.FOCUS_FORWARD);
        mainLayout.setOnTouchListener(new OnTouchListener() {
    
            @Override
            public boolean onTouch(View v, MotionEvent event) {
                switch(event.getAction()) {
                    case MotionEvent.ACTION_DOWN:
                        initialX = event.getX();
                        initialY = event.getY();                        
                        break;
                    case MotionEvent.ACTION_MOVE:
                        float diffX = event.getX() - initialX;
                        float diffY = event.getY() - initialY;
    
                        if(diffY > 0) {
                            if (currentFocusedChild < children.size() - 1) {
                                currentFocusedChild++;
                            }
                        } else {
                            if (currentFocusedChild > 0) {
                                currentFocusedChild--;
                            }
                        }
                        children.get(currentFocusedChild).setSelected(true);
    
                        //Sleep for a period of time so the selection is slow enough for the user.
                        Thread.sleep(300);
                        break;
                    case MotionEvent.ACTION_UP:
                        children.get(currentFocusedChild).performClick();
                        break;
                }
                return false;
            }
        });
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app filled with custom buttons for Android. I would like to
I have a screen where I have some buttons. I would like to know
I would like to have a window with a simple form (radio buttons and
In main.xml I would like to have a spinner1 with two radio buttons and
I have an app with an action bar that looks like this: I would
Hi I have added active_admin to my rails app. I would like to create
I have a a CollapsiblePanelExtender with the usual extend and collapse buttons....I would like
I have a lot of buttons that i would like to give a title
Hello I have a Problem with some Buttons I would like to create a
I would like to have an expandable/collapsible listview in my app, similar to how

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.