Git Product home page Git Product logo

horizontalscrollselectedview's Introduction

HorizontalScrollSelectedView

横向滚动的,可以支持大量文本选择的 自定义View ,简单易用 , 无OOM情况

效果图

效果图

博客介绍

  CSDN:http://blog.csdn.net/iamdingruihaha/article/details/71422269

Download

    allprojects {
	    repositories {
		    ...
		    maven { url 'https://jitpack.io' }
	    }
	}

    dependencies {
       compile 'com.github.385841539:HorizontalScrollSelectedView:1.0.0'
	}

Usage

基本使用:

        <com.example.horizontalselectedviewlibrary.HorizontalselectedView
            android:id="@+id/hd_main"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_gravity="center_vertical"
            android:layout_weight="30"
            app:HorizontalselectedViewSeesize="5"
            app:HorizontalselectedViewSelectedTextColor="@color/black"
            app:HorizontalselectedViewSelectedTextSize="60"
            app:HorizontalselectedViewTextColor="@color/gray"
            app:HorizontalselectedViewTextSize="40" />

自定义属性(均设有默认值,可不使用):

属性          参数           说明
HorizontalselectedViewSeesize int y 可见文本数,默认为5
HorizontalselectedViewSelectedTextSize float y       被选中文字大小
HorizontalselectedViewSelectedTextColor Color color   被选中文字颜色
HorizontalselectedViewTextSize float y 未被选中文字大小
 HorizontalselectedViewTextColor Color color 未被选中文字颜色

用到的动态方法

    hsMain.setData(strings);//设置数据源
   
    hsMain.setAnLeftOffset();//向左移动一个单元
    
    hsMain.setAnRightOffset();//向右移动一个单元
    
    hsMain.getSelectedString();//获得被选中的文本
    
    

Tips

 很简单的使用方法,不熟悉自定义View的小伙伴可以跟着敲一遍,巩固自定义View。

horizontalscrollselectedview's People

Contributors

385841539 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.