java+封装库+带ui_基本UI组件的封装库(三)——basicUI

前言

我在之前BasicUI项目一共包括了:1、Recycleview的封装,支持单布局和多布局,支持添加头部和底部,还包括了悬浮列表的基本封装。2、dialog的封装。支持从底部弹出,并可设置动画,是否宽度全屏等样式。3、NavigationBar的封装,可以在activity中动态设置添加头部。4、PopupWindow的封装 5、editText的封装,自带清除按钮,并设置按钮的颜色和按钮的资源 6、TextView的封装、支持设置背景颜色和背景的圆角大小,以及支持设置文字上下左右的图标居中,7、流式布局的封装(支持刷新数据)、8、仿今日头条的TableLayout、9、花束加载loading效果、10、仿58同城多条目菜单删选封装

这次新增内容有:loading三个:视察动画,仿钉钉的loading,仿老版58同城加载的loading,自定义支付密码键盘,九宫格解锁

修复了navigationbar使用的时候只支持垂直的linearlayout的问题

如果大家有什么问题,欢迎您在下方留言或者在BasicUI中留下的问题

Gradle依赖

Step 1. Add the JitPack repository to your build file

Add it in your root build.gradle at the end of repositories:

allprojects {

repositories {

...

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

}

}

Step 2. Add the dependency

dependencies {

implementation 'com.github.Peakmain:BasicUI:0.0.4'

}

使用

loading效果

f15a2300f4fa

loading的效果.gif

视察动画的loading,布局中直接使用

android:id="@+id/inspect_loading_view"

android:layout_width="match_parent"

android:layout_height="match_parent" />

activity中需要调用show方法来显示

mInspectLoadingView.show();

隐藏只需要调用hide方法

mInspectLoadingView.hide();

仿钉钉的loading

android:id="@+id/rotating_loading_view"

android:onClick="click"

android:layout_width="match_parent"

android:layout_height="match_parent"/>

默认设置的是全屏展示,如果想以loading的方式显示,可以调用show方法

RotatingLoadingView rotatingLoadingView = new RotatingLoadingView(this);

rotatingLoadingView.show();

隐藏还是hide方法

mLoadingView.hide();

仿58同城加载loading

android:id="@+id/shape_loading_view"

android:onClick="click"

android:layout_width="match_parent"

android:layout_height="match_parent"/>

默认也是全屏,如果想以loading显示,可以使用show方法

ShapeLoadingView shapeLoadingView = new ShapeLoadingView(this);

shapeLoadingView.show();

自定义支付密码键盘

android:layout_width="match_parent"

android:layout_height="match_parent"

android:id="@+id/view_root"

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

android:orientation="vertical">

android:id="@+id/password_edit_text"

android:layout_width="match_parent"

android:layout_marginTop="@dimen/space_20"

android:layout_marginLeft="@dimen/space_50"

android:layout_marginRight="@dimen/space_50"

android:layout_height="30dp" />

android:id="@+id/custom_key_board"

android:layout_width="match_parent"

android:layout_alignParentBottom="true"

android:layout_height="wrap_content" />

PasswordEditText的相关方法:

setPasswordCompleteListener表示设置完成

addPasswordNumber表示添加号码

deletePassWord表示删除号码

CustomerKeyboard

CustomerKeyboardClickListener设置监听事件

mCustomerKeyboard.setOnCustomerKeyboardClickListener(new CustomerKeyboard.CustomerKeyboardClickListener() {

@Override

public void click(String number) {

mEditText.addPasswordNumber(number);

}

@Override

public void delete() {

mEditText.deletePassWord();

}

});

mEditText.setPasswordCompleteListener(ToastUtils::showShort);

f15a2300f4fa

自定义支付密码键盘.gif

九宫格解锁

android:id="@+id/lock_pattern"

android:layout_width="match_parent"

android:layout_height="match_parent" />

LockScreenView中有个setOnLockSuccessListener方法其中有两个方法,getLockResult表示返回你想判断的结果的字符串,onLockSuccess表示密码正确后的回掉

f15a2300f4fa

九宫格解锁.gif

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值