GearLoadingProject
Tags:
齿轮-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
Use one of the three prepared layouts (One Gear, Two Gears, Three Gears)
Use GearDialogBuilder to create you loading dialog, with lot functionality
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
- Fast create loading dialog
- Enable Blur Effect (Thanks This Stack Overflow Resource)
- Support modes : Dialog, Snackbar
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)