翻翻git之---"有趣效果"的自定义View EasyArcLoading

转载请注明出处:王亟亟的大牛之路

早上写了一个关于MD的文章,下午给编译器调了个色,感觉要上天了,所以为了试颜色就出了这篇文章,让大家一起瞎一下

这里写图片描述


好了废话不说,这一片给大家介绍一个当做Dialog作用的自定义View

效果图:
这里写图片描述

How to use?

Gradle

dependencies {
    com.camnter.easyarcloading:easyarcloading:1.0
}

Eclipse:

把实现类和资源文件copy进去就好了

使用的话就直接XML加载,像这样

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="sample.wjj.easyarcloadingdemo.MainActivity">

    <com.camnter.easyarcloading.EasyArcLoading
        android:id="@+id/DialogDemo1"
        app:eastArcExternalColor="#ACA"
        app:eastArcInternalColor="#AC111A"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

    <com.camnter.easyarcloading.EasyArcLoading
        android:id="@+id/DialogDemo2"
        android:layout_below="@id/DialogDemo1"
        app:eastArcExternalColor="#BBA"
        app:eastArcInternalColor="#FFBB1A"
        app:eastArcInternalWidth="2dp"
        android:layout_width="80dp"
        android:layout_height="80dp" />

</RelativeLayout>

初始化的操作可以放在XML里也可以直接Java代码里一连串set 比较简单就不分开介绍了

这边再贴下自定义标签

<declare-styleable name="EasyArcLoading">
    <attr name="easyArcPadding" format="dimension" /> //Padding值
    <attr name="eastArcExternalColor" format="color" />//外圈颜色
    <attr name="eastArcInternalColor" format="color" />//内圈颜色
    <attr name="eastArcExternalWidth" format="dimension" />//外圈笔触大小
    <attr name="eastArcInternalWidth" format="dimension" />//内圈笔触大小
</declare-styleable>

实现这篇就不教讲了,之前有太多的自定义Dialog的内容,下次可以考虑把类似的都做到一个Git项目里。

项目git:https://github.com/ddwhan0123/EasyArcLoading

例子源码地址:https://github.com/ddwhan0123/EasyArcLoading

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值