Code Monkey home page Code Monkey logo

gearloadingproject's Introduction

GearLoadingLayout

Description

GearLoadingLayout widget for android that can be used as a progress bar, snack bar or yourself to create your own arrangements for their needs.

Short Description

GearView


Samples

In Xml

<lj_3d.gearloadinglayout.gearViews.GearView 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    gear:mainDiameter="150dp"
    gear:secondDiameter="120dp"
    gear:innerDiameter="30dp"
    gear:enableCutCenter="true"
    gear:teethWidth="20dp"
    gear:mainColor="#3F51B5"
    gear:innerColor="#FF4081"
    gear:rotateAngle="10"/>                                        

In Code

 GearView gearView = new GearView(mContext);
       gearView.setMainDiameter(300);
       gearView.setSecondDiameter(240);
       gearView.setInnerDiameter(80);
       gearView.setTeethWidth(40);
       gearView.setRotateOffset(20);
       gearView.setColor(Color.BLUE);
       gearView.setInnerColor(Color.RED);
       gearView.enableCuttedCenter(true); // boolean param == true (center of GearView will be cutted)
       gearView.startSpinning(false); // start spinning animation, boolean param == true (rotate to the left side) | param == false (rotate to the right side)

 (and don`t forget add to your root view)

On Android Device


Cutted Center | Filled Center
:-------------------------:|:-------------------------: |

GearLayout

Features

  • Already preset layout
  • Small feature as CutOut Layout
  • Flexible functionality

Samples

In Xml

  • Three Gears

                <lj_3d.gearloadinglayout.gearViews.ThreeGearsLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        gear:layoutAlpha="0.5"
                        gear:gearLayoutCutAlpha="0.5"
                        gear:cutLayoutVisibility="true"
                        gear:firstGearColor="@color/colorAccent"
                        gear:secondGearColor="@color/colorAccent"
                        gear:thirdGearColor="@color/colorAccent"
                        gear:firstGearCuttedCenter="false"
                        gear:secondGearCuttedCenter="false"
                        gear:thirdGearCuttedCenter="false"
                        gear:gearLayoutCutColor="@color/colorPrimaryDark"
                        gear:gearLayoutCutRadius="40dp"
                        gear:firstInnerGearColor="@color/colorPrimary"
                        gear:secondInnerGearColor="@color/colorPrimary"
                        gear:thirdInnerGearColor="@color/colorPrimary"/>  
    
  • Two Gears

                 <lj_3d.gearloadinglayout.gearViews.TwoGearsLayout
                         android:layout_width="match_parent"
                         android:layout_height="match_parent"
                         gear:layoutAlpha="0.5"
                         gear:gearLayoutCutAlpha="0.5"
                         gear:cutLayoutVisibility="true"
                         gear:firstGearColor="@color/colorAccent"
                         gear:secondGearColor="@color/colorAccent"
                         gear:firstGearCuttedCenter="false"
                         gear:secondGearCuttedCenter="false"
                         gear:gearLayoutCutColor="@color/colorPrimaryDark"
                         gear:gearLayoutCutRadius="40dp"
                         gear:firstInnerGearColor="@color/colorPrimary"
                         gear:secondInnerGearColor="@color/colorPrimary"/>
    
  • One Gear

                 <lj_3d.gearloadinglayout.gearViews.OneGearLayout
                         android:layout_width="match_parent"
                         android:layout_height="match_parent"
                         gear:layoutAlpha="0.5"
                         gear:gearLayoutCutAlpha="0.5"
                         gear:cutLayoutVisibility="true"
                         gear:firstGearColor="@color/colorAccent"
                         gear:firstGearCuttedCenter="false"
                         gear:gearLayoutCutColor="@color/colorPrimaryDark"
                         gear:gearLayoutCutRadius="40dp"
                         gear:firstInnerGearColor="@color/colorPrimary"/>                            
    

In Code

  • One Gear

         OneGearLayout threeGearsLayout = new OneGearLayout(this);
             threeGearsLayout.setFirstGearColor(Color.WHITE);
             threeGearsLayout.setDialogBackgroundColor(Color.GREEN);
             threeGearsLayout.setDialogBackgroundAlpha(0.3f);
             threeGearsLayout.blurBackground(true);
             threeGearsLayout.enableCutLayout(false);
             threeGearsLayout.setCutRadius(80);
             threeGearsLayout.start();
    
  • Two Gears

        TwoGearsLayout threeGearsLayout = new TwoGearsLayout(this);
                threeGearsLayout.setFirstGearColor(Color.WHITE);
                threeGearsLayout.setSecondGearColor(Color.RED);
                threeGearsLayout.setDialogBackgroundColor(Color.GREEN);
                threeGearsLayout.setDialogBackgroundAlpha(0.3f);
                threeGearsLayout.blurBackground(true);
                threeGearsLayout.enableCutLayout(false);
                threeGearsLayout.setCutRadius(80);
                threeGearsLayout.start();
    
  • Three Gears

        ThreeGearsLayout threeGearsLayout = new ThreeGearsLayout(this);
                threeGearsLayout.setFirstGearColor(Color.WHITE);
                threeGearsLayout.setSecondGearColor(Color.RED);
                threeGearsLayout.setThirdGearColor(Color.CYAN);
                threeGearsLayout.setDialogBackgroundColor(Color.GREEN);
                threeGearsLayout.setDialogBackgroundAlpha(0.3f);
                threeGearsLayout.blurBackground(true);
                threeGearsLayout.enableCutLayout(false);
                threeGearsLayout.setCutRadius(80);
                threeGearsLayout.start();
    

On Android Device

|With CutLayout | One Gear | Two Gears | Three Gears | :-------------------------:|:-------------------------:|:-------------------------:|:-------------------------: |||

GearDialogBuilder

Features

Sample

GearDialogBuilder.getInstance(MainActivity.this)
                    .setType(ThreeGearsLayout.class)
                    .setShowDialogDuration(200)
                    .setShowMode(showMode)
                    .setDuration(3000)
                    .blurBackground(blur)
                    .enableCutLayout(false)
                    .setDialogBackgroundAlpha(0.5f)
                    .setDialogBackgroundColor(mResources.getColor(R.color.colorAccent))
                    .setFirstGearColor(mResources.getColor(R.color.colorPrimaryDark))
                    .setSecondGearColor(mResources.getColor(R.color.dialog_stroke_color))
                    .setThirdGearColor(mResources.getColor(R.color.colorPrimary))
                    .show();

On Android Device

Android SDK Version

Min SDK Version == 11.

License

Apache 2.0. See LICENSE file for details.

Author

Liubomyr Miller (lj-3d)

gearloadingproject's People

Stargazers

Piyush Malaviya avatar Mohit Gandhi avatar trietbui85 avatar Barış Cirit avatar Masoud Mohammadi avatar Michał Pawlik avatar Ritesh Chandnani avatar Nadeem Iqbal avatar  avatar Shishram Karwal avatar  avatar  avatar  avatar  avatar i dewa made awidiya avatar Dishita avatar  avatar Adeel Tariq avatar  avatar MAY3AM avatar Igor Morais avatar  avatar The Lusina avatar TaTa avatar  avatar Wade avatar crazyflysheep avatar Pranav Lathigara avatar  avatar alphaDroid89 avatar Raymond Seger avatar Ojabo John Heart avatar Tom Orth avatar Vladislav Bauer avatar  avatar Babatunde Adeyemi avatar Khalid O. Lamptey avatar xwhy avatar Jungle avatar Stefan Popa avatar ping avatar Juner avatar  avatar Jing Lu avatar CHEN TAO avatar Adithya Jayasankar avatar Victor Pavluchynskyi avatar

Watchers

trietbui85 avatar James Cloos avatar xwhy avatar  avatar  avatar

gearloadingproject's Issues

Two Launching icon problem

Sir, it gives some nice animation but it causes some problems. My app is installed twice whenever I add this library into my project. I think there might be a launcher in your manifest which causes the problem, I am not sure though. I really want to use this library in my project, so please sir, have a look at this problem. Thank you.

Doesnt work in API 19

Hi its facing crash in API 19 below is the logcat,
Process: lj_3d.gearloadingproject, PID: 19716
java.lang.RuntimeException: Unable to start activity ComponentInfo{lj_3d.gearloadingproject/lj_3d.gearloadingproject.PullToRefreshActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2413)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2471)
at android.app.ActivityThread.access$900(ActivityThread.java:175)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5602)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at android.animation.PropertyValuesHolder.setupSetterAndGetter(PropertyValuesHolder.java:505)
at android.animation.ObjectAnimator.initAnimation(ObjectAnimator.java:487)
at android.animation.ValueAnimator.setCurrentPlayTime(ValueAnimator.java:517)
at android.animation.ValueAnimator.start(ValueAnimator.java:936)
at android.animation.ValueAnimator.start(ValueAnimator.java:946)
at android.animation.ObjectAnimator.start(ObjectAnimator.java:465)
at lj_3d.gearloadinglayout.gearViews.GearView.startSpinning(GearView.java:125)
at lj_3d.gearloadinglayout.gearViews.TwoGearsLayout.start(TwoGearsLayout.java:52)
at lj_3d.gearloadingproject.PullToRefreshActivity.onCreate(PullToRefreshActivity.java:20)
at android.app.Activity.performCreate(Activity.java:5451)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2377)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2471) 
at android.app.ActivityThread.access$900(ActivityThread.java:175) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:146) 
at android.app.ActivityThread.main(ActivityThread.java:5602) 
at java.lang.reflect.Method.invokeNative(Native Method) 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.