HoverProcessView

Github.com/hzw1199/Hov…

YouTube:

Features

  • Imitation wechat and Weibo hollow translucent circular progress

  • Support to turn animation on and off

  • The background supports rounded rectangles

  • layout

<com.wuadam.hoverprocess.HoverProcessView
    android:id="@+id/process"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:duration="1000"
    app:hoverColor="# 80000000"
    app:max="100"
    app:progress="30"
    app:radius="48dp"
    app:ringWidth="4dp"
    app:roundCornerRadius="8dp" />
Copy the code

Supported XML attributes

Attribute format describe default
hoverColor color Color of background and progress circles # 000000
radius dimension Radius of progress circle 50 px
ringWidth dimension Width of transparent ring between background and progress circle 5 px
max integer Maximum progress 100
progress integer The initial schedule 0
ringPadding dimension Transparent ring padding 0
duration integer The number of milliseconds it takes for a progress circle to complete a circle 400
roundCornerRadius dimension Background fillet radius 0
  • java
HoverProcessView process = findViewById(R.id.process);
Copy the code

The animation mode

process.setProgress(50.true);
Copy the code

No animation mode

process.setProgress(50.false);
Copy the code

Infinite mode

process.startInfiniteProgress();
process.stopInfiniteProgress();
Copy the code

onDestroy:

process.stop();
Copy the code