Android 公共库HuicentCoreLibrary Api文档

[托管仓库]

maven中央仓库

[引用地址]

implementation "com.redapplenet:HuicentCoreLibrary:${version_name}"

[最新版本]

version_name=1.0.5-rc3

[使用说明]

一、AVLoadingIndicatorView - 特效加载动画
AVLoadingIndicatorView.java

//xml
<com.huicent.library.loadwidget.AVLoadingIndicatorView
                android:id="@+id/av2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginBottom="10dp"
                app:indicatorColor="@color/colorAccent"
                app:indicatorName="BallClipRotatePulseIndicator" />

//java
//开始动画
mAv1.show(); //smoothToShow();
//结束动画
mAv1.hide(); //smoothToHide();

效果图:


app:indicatorName 上图效果依次:


BallPulseIndicator
BallClipRotatePulseIndicator
BallScaleMultipleIndicator
BallSpinFadeLoaderIndicator
BallTrianglePathIndicator
BallZigZagIndicator
LineScaleIndicator
LineScalePartyIndicator
LineSpinFadeLoaderIndicator
PacmanIndicator

二、FlippableStackView - 手势切换层叠卡片
先上个动图


如何调用?

//xml
<com.huicent.library.flipperstackview.FlippableStackView
     android:id="@+id/flipper_view"
     android:layout_width="match_parent"
     android:layout_height="match_parent">
</com.huicent.library.flipperstackview.FlippableStackView>
// java
// init stack
mFlipperView = (FlippableStackView) findViewById(R.id.flipper_view);
mFlipperView.initStack(3); // 一屏显示3+1个层叠
// or full init
// mFlipperView.initStack(3, StackPageTransformer.Orientation.VERTICAL,
//     0.8f, 0.65f, 0.4f, StackPageTransformer.Gravity.CENTER);
// set adapter to flippterView
mFlipperView.setAdapter(mPageAdapter);
// mPagerAdapter can simply be FragmentPagerAdapter or pagerAdapter like this
private class ColorFragmentAdapter extends FragmentPagerAdapter {
        private List<Fragment> fragments;

        public ColorFragmentAdapter(FragmentManager fm, List<Fragment> fragments) {
            super(fm);
            this.fragments = fragments;
        }

        @Override
        public Fragment getItem(int position) {
            return this.fragments.get(position);
        }

        @Override
        public int getCount() {
            return this.fragments.size();
        }
    }
三、AnimTextView - 自带显示隐藏动画的TextView
效果动图



如何调用?

//xml
<com.huicent.library.widgets.AnimTextView
    android:id="@+id/anim_text"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:padding="8dp"
    app:inDirection="right"
    app:outDirection="left"
    android:text="这是展示的文字"
    android:visibility="gone"/>
//java
mAnimText = (AnimTextView) findViewById(R.id.anim_text);
//显示、隐藏方法不变
mAnimText.setVisibility(View.VISIBLE);
mAnimText.setVisibility(View.GONE);

四、带状态的Toast——Toasty

效果图


初始化

Toasty.Config.getInstance()
    .setErrorColor(@ColorInt int errorColor) // optional
    .setInfoColor(@ColorInt int infoColor) // optional
    .setSuccessColor(@ColorInt int successColor) // optional
    .setWarningColor(@ColorInt int warningColor) // optional
    .setTextColor(@ColorInt int textColor) // optional
    .tintIcon(boolean tintIcon) // optional (apply textColor also to the icon)
    .setToastTypeface(@NonNull Typeface typeface) // optional
    .setTextSize(int sizeInSp) // optional
    .apply(); // required

便捷使用

Toasty.normal("普通提示语").show(); // 普通
Toasty.success("操作成功啦").show(); // 完成
Toasty.error("网络连接失败,请稍后重试").show(); // 错误
Toasty.info("请输入正确的号码", Toast.LENGTH_LONG).show(); // 提示
Toasty.warning("请稍后再试").show(); // 警告


[更新日志]

1.0.5-rc3

1、新增带状态的Toast——Toasty

1.0.4-rc3

1、新增FlipperStackView,层叠卡片,支持手势上下切换

1.0.4-rc2

1、新增AnimTextView,自带入场、出场动画的TextView

1.0.4-rc1

1、新增LoadingWidget特效加载动画。

1.0.3-rc3

1、优化BaseFragmentActivity,新增接受传参的对外方法initBundle,调用在初始化第一位。

2、优化Glide工具类,增加一个静态方法destoryInstance,调用销毁实例和上下文。

1.0.3-rc2

1、新增OkGo网络框架二次封装工具类——OkgoUtils。

2、新增Glide图片框架二次封装工具类——GlideUtils。

1.0.3-rc1

1、优化ImageUtils工具,新增方法getResIdByResName。

2、新增EventBus工具类——EventBusUtils,以及基础事件Event<T>。

3、删除okhttp3相关。



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值