Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

PaperView 是一个自定义的View,它就像一张纸折叠和展开

NotificationsYou must be signed in to change notification settings

goyourfly/PaperView

Repository files navigation

PaperView 是一个自定义的View,它就像一张纸折叠和展开

Demo

1.在普通的布局中使用

2.在RecyclerView中使用

Compile

Download

compile'com.goyourfly:paperview:latestVersion'

Usage

1.在布局中声明
<com.goyourfly.library.paper_view.PaperViewandroid:id="@+id/paperView"android:layout_width="match_parent"android:layout_height="wrap_content"android:padding="16dp"app:paper_bg_color="#fff"app:paper_duration="1000"><!--展开的布局-->    <includelayout="@layout/item_large" /><!--收起的布局-->    <includelayout="@layout/item_small" /></com.goyourfly.library.paper_view.PaperView>
参数类型说明默认值
paper_durationinteger动画总时长2000
paper_bg_colorcolor纸片背景色#FFF
2.在代码中设置
2.1 展开和折叠
// 折叠卡片paperView.fold(animator:Boolean,changed:Boolean)// 展开卡片paperView.unfold(animator:Boolean,changed:Boolean)
2.2 监听状态变化
paperView.setStateChangedListener(object:PaperView.OnFoldStateChangeListener{// 折叠overridefunonFold() {}// 展开overridefunonUnfold() {}})

License

Copyright2017-present,GaoYufeiLicensedundertheApacheLicense,Version2.0 (the "License");youmaynotusethisfileexceptincompliancewiththeLicense.YoumayobtainacopyoftheLicenseathttp://www.apache.org/licenses/LICENSE-2.0Unlessrequiredbyapplicablelaworagreedtoinwriting,softwaredistributedundertheLicenseisdistributedonan"AS IS"BASIS,WITHOUTWARRANTIESORCONDITIONSOFANYKIND,eitherexpressorimplied.SeetheLicenseforthespecificlanguagegoverningpermissionsandlimitationsundertheLicense.

About

PaperView 是一个自定义的View,它就像一张纸折叠和展开

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp