A WedgesView based on android.View, nicely rotation、easy to use.
The actual running effect will be better
Supported functions:
-
Optionally configure the colors of each wedge
-
Manually stop and start the wedge rotation
-
Configurable rotation speed
-
Support the padding Settings
Support will be forthcoming:
-
Manual rotation
-
Refresh header view is supported
-
More...
To get a Git project into your build:
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.fairytale110:WedgesView:1.0.1'
}
<tech.nicesky.libwedgesview.WedgesView
android:id="@+id/wedgesView"
android:layout_width="222dp"
android:layout_height="222dp"
app:wv_background="@android:color/white"
app:wv_rotate_speed="0.5"
app:wv_wedge_alpha="0.8"
app:wv_wedge_diameter="@dimen/dp_222"
android:padding="@dimen/dp_20"
/>
or
int[] colors = new int[4];
colors[0] = Color.parseColor("#C2DFD7");
colors[1] = Color.parseColor("#FFE6F5");
colors[2] = Color.parseColor("#FE718D");
colors[3] = Color.parseColor("#E90C59");
WedgesView wedgesView = new WedgesView(this);
wedgesView.setBackgroundColor(Color.WHITE);//Set View's background color
wedgesView.setColors(colors);//set wedges's color
wedgesView.setRotateSpeed(0.5F);//set wedges's fastest speed
wedgesView.setWedgeAlpha(0.8F);//set wedges's alpha
//set wedges diameter
wedgesView.setWedgeDiameter((int) getResources().getDimension(R.dimen.dp_200));
wedgesView.reStart();//begin anim
//wedgesView.stop();// stop anim
Copyright 2018 fairytale110
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.