滑动控件android,Android页面滑动控件 komi-slider

软件介绍

slider重在让特定的页面具备滑动功能操作。

slider在此版本只需通过简单的继承、xml布局或者直接将上面3种类型对象通过SliderUtils类即可具备滑动功能。

1681962af78c8463773173c6ac4eb087.gif

2462811bf3b9777c16cb8e3617505e04.gif

96c93959d9f9a44481b5b166ecaba2bc.gif

5a66c7eaac5cd05653b3ccf320cb3fe4.gif

使用方法

1.目前支持activity、fragment、dialogfragment、dialog、view的滑动

2.通过如下简单操作,即可让页面具备滑动功能。public class SampleActivity extends Activity

{

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_slider);

SliderUtils.attachActivity(this, mConfig);

}

}

亦或通过简单的继承:public class ExtendsActivity extends SliderActivity {

}

或者是直接通过xml布局,就可以让子View具备滑动功能

xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:tools="http://schemas.android.com/tools"

xmlns:slider="http://schemas.android.com/apk/res-auto"

android:id="@+id/xml_slider_layout"

android:layout_width="match_parent"

android:layout_height="match_parent"

slider:edgeOnly="false"

slider:position="all">

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_gravity="center"

android:text="I CAN SLIDE NOW!"

android:textSize="23sp" />

需要注意的是activity在manifest下配置theme需复写android:windowIsTranslucent,否则拉开的背景会全黑。

true

使用项目

在项目的build.gradle文件中添加库依赖dependencies{

compile 'com.komi.slider:slider:0.3.2'}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值