头部可缩放的布局 | ScalingLayout

名称 ScalingLayout
语言 Android
平台 GitHub
作者 iammert
链接 点此进入
备注 更多精彩开源库推荐请访问明灯小站

该布局支持布局头部可缩放,在一些资讯类的APP会经常用到。
效果图

效果图

使用方法

  1. 添加依赖
maven { url 'https://jitpack.io' }

dependencies {
  compile 'com.github.iammert:ScalingLayout:1.1'
}
  1. 在xml布局添加控件
<iammert.com.view.scalinglib.ScalingLayout
        android:id="@+id/scalingLayout"
        android:layout_width="300dp"
        android:layout_height="48dp"
        app:radiusFactor="1">
        
        <!-- Your content here -->
        
</iammert.com.view.scalinglib.ScalingLayout>
  1. Java代码设置
scalingLayout.expand(); //use this if you want to expand all
scalingLayout.collapse(); //user this if you want to collapse view to initial state.
scalingLayout.setProgress(float progress); //1 is fully expanded, 0 is initial state.

scalingLayout.setListener(new ScalingLayoutListener() {
    @Override
    public void onCollapsed() {}

    @Override
    public void onExpanded() {}

    @Override
    public void onProgress(float progress) {}
});

更多使用方法请参考其GitHub。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容