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 8103189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:28:14+00:00 2026-06-05T23:28:14+00:00

Looking for a control that allows to select one text value at a time

  • 0

Looking for a control that allows to select one text value at a time for android with 2 arrows on each side. Not sure what the control is called but here is an example image:

enter image description here

  • 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-05T23:28:17+00:00Added an answer on June 5, 2026 at 11:28 pm

    Created my own, which works great for me. The Galley control helped a lot. Feel free to point out any issues though.

    import android.content.Context;
    import android.graphics.Color;
    import android.util.AttributeSet;
    import android.view.Gravity;
    import android.view.View;
    import android.view.ViewGroup;
    import android.widget.*;
    import nz.co.nuffie.android.crichq.R;
    
    import java.util.ArrayList;
    import java.util.List;
    
    public class ScrollWheelControl extends LinearLayout{
        private final ArrayList<String> textList = new ArrayList<String>();
        private ArrayAdapter optionAdapter = null;
        private AdapterView.OnItemSelectedListener itemSelectedListener = null;
    
        public ScrollWheelControl(Context context){
            super(context);
        }
    
        public ScrollWheelControl(Context context, AttributeSet attrs){
            super(context, attrs);
            initView(context);
        }
    
        public ScrollWheelControl(Context context, AttributeSet attrs, int defStyle){
            super(context, attrs, defStyle);
            initView(context);
        }
    
        public void initView(Context context) {
            View.inflate(context, R.layout.scroll_wheel_control, this);
    
            optionAdapter = new ArrayAdapter<String>(context, android.R.layout.simple_gallery_item, textList )
            {
                @Override
                public View getView(int position, View convertView, ViewGroup parent) {
                    View v = super.getView(position,convertView,parent);
                    if(v instanceof TextView){//Just in case.
                        TextView txt = (TextView)v;
                        Gallery.LayoutParams glp = new Gallery.LayoutParams(Gallery.LayoutParams.FILL_PARENT, Gallery.LayoutParams.FILL_PARENT);
                        txt.setGravity(Gravity.CENTER);
                        txt.setLayoutParams(glp);
                    }
                    return v;
                }
            };
    
    
            optionAdapter.notifyDataSetChanged();
    
            final Gallery g = (Gallery) findViewById(R.id.gOptionSelect);
            g.setAdapter(optionAdapter);
    
            final Button btnLeft = (Button) findViewById(R.id.btnLeft);
            final Button btnRight = (Button) findViewById(R.id.btnRight);
            g.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
                @Override
                public void onItemSelected(AdapterView<?> list, View view, int position, long id) {
                    if(position >= textList.size()-1){
                        btnRight.setTextColor(Color.GRAY);
                    }else
                        btnRight.setTextColor(Color.WHITE);
    
                    if(position == 0){
                        btnLeft.setTextColor(Color.GRAY);
                    }else
                        btnLeft.setTextColor(Color.WHITE);
    
                    if(itemSelectedListener != null){
                        itemSelectedListener.onItemSelected(list,view,position,id);
                    }
                }
    
                @Override
                public void onNothingSelected(AdapterView<?> parent) {
                }
            });
            btnLeft.setOnClickListener(new OnClickListener(){
                @Override
                public void onClick(View view){
                    g.onFling(null, null, 2000, 0);
                }
            });
            btnRight.setOnClickListener(new OnClickListener(){
                @Override
                public void onClick(View view){
                    g.onFling(null, null, -2000, 0);
                }
            });
        }
    
        public void setOnItemListener(AdapterView.OnItemSelectedListener setItemSelectedListener){
            itemSelectedListener = setItemSelectedListener;
        }
    
        public void addTextItems(List<String> list){
            textList.addAll(list);
            if(optionAdapter != null){
                optionAdapter.notifyDataSetChanged();
            }
        }
    }
    

    XML code:

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="horizontal"
        android:padding="5dp">
    
        <Button
            android:id="@+id/btnLeft"
            style="?android:attr/buttonStyleSmall"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="\u003C"
            android:background="@android:color/transparent"
            android:textColor="@android:color/white"
            android:shadowColor="@android:color/black"
            android:shadowDx="1"
            android:shadowDy="1"
            android:shadowRadius="2"
            android:textStyle="bold"
            android:minWidth="15dp"
                />
    
        <Gallery
            android:layout_marginLeft="5dp"
            android:layout_marginRight="5dp"
            android:id="@+id/gOptionSelect"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:gravity="center_vertical"
            android:spacing="0dp">
        </Gallery>
    
        <Button
            android:id="@+id/btnRight"
            style="?android:attr/buttonStyleSmall"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@android:color/transparent"
            android:text="\u003E" 
            android:textColor="@android:color/white"
            android:shadowColor="@android:color/black"
            android:shadowDx="1"
            android:shadowDy="1"
            android:shadowRadius="2"
            android:textStyle="bold"
            android:minWidth="15dp"
                />
    
    </LinearLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking for a control that allows me to choose a single option from
I'm looking for a datepicker control (HTML + JavaScript / Flex) that allows selecting
I'm looking for a control that allows me to swipe through a list of
I am looking for a .net control that allows for the editing of images.
I am looking for a .net control that allows the users of my webapp
Basically I'm looking for a control that allows for grouping in a DataGridView control
I am looking for a nice control that allows me to have a shopping
I'm looking to find a decent calendar control for an ASP.Net application that allows
I'm looking for some software that allows me to control a server based application,
I am looking for a tool that will allow me to monitor and control

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.