GBSlideBar

by edanel

edanel / GBSlideBar

类似uber/滴滴等app的滑动选择工具条

124 Stars 42 Forks Last release: almost 5 years ago (0.5) Apache License 2.0 15 Commits 5 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

GBSlideBar 滑动选择控件

[项目不再维护,有需要的可自行根据需求对源码进行修改] 类似uber的滑动选择工具条

效果图

animation

使用

    

    private GBSlideBar gbSlideBar;
    private SlideAdapter mAdapter;
       gbSlideBar = (GBSlideBar) findViewById(R.id.gbslidebar);

    Resources resources = getResources();
    mAdapter = new SlideAdapter(resources, new int[]{
            R.drawable.btn_tag_selector,
            R.drawable.btn_more_selector,
            R.drawable.btn_reject_selector});

    mAdapter.setTextColor(new int[]{
            Color.GREEN,
            Color.BLUE,
            Color.RED
    });

    gbSlideBar.setAdapter(mAdapter);
    gbSlideBar.setPosition(2);
    gbSlideBar.setOnGbSlideBarListener(new GBSlideBarListener() {
        @Override
        public void onPositionSelected(int position) {
            Log.d("edanelx","selected "+position);
        }
    });

引用

    allprojects {
        repositories {
            ...
            maven { url "https://jitpack.io" }
        }
    }
    dependencies {
            compile 'com.github.edanel:GBSlideBar:0.5'
    }

其他

参考:android-phased-seek-bar

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.