项目作者: Ajian-studio

项目描述 :
Bezier storm(贝塞尔风暴)
高级语言: Java
项目地址: git://github.com/Ajian-studio/GABottleLoading.git
创建时间: 2017-01-04T08:09:02Z
项目社区:https://github.com/Ajian-studio/GABottleLoading

开源协议:

下载


GABottleLoading

中文文档

1 Creative prototype:

The effect is shown below:

Through the code to achieve the effect is as follows:

Note:

  • 1.The project does not use any image resources, colors of bottle and water can be changed by custom attributes;

  • 2.LoadingView will automatically adjust the width and height;

2 How to Use:

2.1 How To Obtain Project Resources

step 1. In the project build.gradle add the following code:

  1. allprojects {
  2. repositories {
  3. ...
  4. // add the follow code
  5. maven { url 'https://jitpack.io' }
  6. }
  7. }

step 2. In the module’s build.gradle add the following code:

  1. dependencies {
  2. compile 'com.github.Ajian-studio:GABottleLoading:1.0.1'
  3. }

2.2 Add GABottleLoadingView To The Layout File

  1. <com.gastudio.gabottleloading.library.GABottleLoadingView
  2. android:id="@+id/ga_bottle_loading_view"
  3. android:layout_width="match_parent"
  4. android:layout_height="match_parent"
  5. android:background="#ff191f26"
  6. ></com.gastudio.gabottleloading.library.GABottleLoadingView>

Note

  • By setting the background of the View to #ff191f26, you can achieve the best visual effect.

    2.3 Find The View In The Activity

    1. ((GABottleLoadingView) findViewById(R.id.ga_bottle_loading_view)).performAnimation();

3 Core Interface And Customize Properties

3.1 Core Interface

  • perfromAnimation(): Start the animation;
  • cancel(): Release resources
  • setDebug(): can see the how it work

3.2 Custom Properties

3.2.1 Add a custom property namespace:

  1. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  2. xmlns:gastudio="http://schemas.android.com/apk/res-auto"
  3. ... ...
  4. ></RelativeLayout>

3.2.2 Add some custom properties

  1. <com.gastudio.gabottleloading.library.GABottleLoadingView
  2. android:id="@+id/ga_downloading"
  3. android:layout_width="match_parent"
  4. android:layout_height="match_parent"
  5. android:background="#ff191f26"
  6. gastudio:bottle_color="@android:color/white"
  7. gastudio:water_color="@android:color/holo_blue_light" ></com.gastudio.gabottleloading.library.GABottleLoadingView>

Finally, if you feel pretty good, please click the Star!

Welcome to join the GAStudio exchange qq group: 277582728.

License

  1. Copyright 2017 GAStudio
  2. Licensed under the Apache License, Version 2.0 (the "License");
  3. you may not use this file except in compliance with the License.
  4. You may obtain a copy of the License at
  5. http://www.apache.org/licenses/LICENSE-2.0
  6. Unless required by applicable law or agreed to in writing, software
  7. distributed under the License is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. See the License for the specific language governing permissions and
  10. limitations under the License.