Skip to content

Commit a3d8c03

Browse files
committed
changed attributes
1 parent 889e79d commit a3d8c03

File tree

4 files changed

+37
-41
lines changed

4 files changed

+37
-41
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ compile 'com.agrawalsuneet.androidlibs:fourfoldloader:0.4'
2525
android:layout_height="wrap_content"
2626
android:layout_centerVertical="true"
2727
app:fourfold_disappearAnimDuration="100"
28-
app:loader_animDuration="500"
29-
app:loader_firstSquareColor="@color/pink"
30-
app:loader_forthSquareColor="@color/indigo"
31-
app:loader_secondSquareColor="@color/blue"
32-
app:loader_squareLength="60dp"
33-
app:loader_startLoadingDefault="true"
34-
app:loader_thirdSquareColor="@color/purple" />
28+
app:fourfold_animDuration="500"
29+
app:fourfold_firstSquareColor="@color/pink"
30+
app:fourfold_forthSquareColor="@color/indigo"
31+
app:fourfold_secondSquareColor="@color/blue"
32+
app:fourfold_squareLength="60dp"
33+
app:fourfold_startLoadingDefault="true"
34+
app:fourfold_thirdSquareColor="@color/purple" />
3535
```
3636
##### Through Code
3737
* Kotlin
@@ -76,7 +76,7 @@ compile 'com.agrawalsuneet.androidlibs:fourfoldloader:0.4'
7676
duration to disappear the flap once folded.
7777
5. `overridePadding (boolean)(defaultValue = false)`
7878
in order to show proper overlay while flapping,
79-
a minimum padding of half of square length is added on all the sides of Loader,
79+
a minimum padding of 0.8 times of square length is added on all the sides of Loader,
8080
if you want to override the padding,
8181
please set this attribute as true and set the required padding.
8282
6. `startLoadingDefault (boolean) (defaultValue = false)`

app/src/main/res/layout/activity_main.xml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,27 @@
1313
android:layout_centerVertical="true"
1414
android:layout_margin="16dp"
1515
app:fourfold_disappearAnimDuration="100"
16-
app:loader_animDuration="700"
17-
app:loader_firstSquareColor="@color/red"
18-
app:loader_forthSquareColor="@color/grey"
19-
app:loader_secondSquareColor="@color/green"
20-
app:loader_squareLength="50dp"
21-
app:loader_startLoadingDefault="true"
22-
app:loader_thirdSquareColor="@color/blue" />
16+
app:fourfold_animDuration="700"
17+
app:fourfold_firstSquareColor="@color/red"
18+
app:fourfold_forthSquareColor="@color/grey"
19+
app:fourfold_secondSquareColor="@color/green"
20+
app:fourfold_squareLength="50dp"
21+
app:fourfold_startLoadingDefault="true"
22+
app:fourfold_thirdSquareColor="@color/blue" />
2323

2424
<com.agrawalsuneet.fourfoldloader.loaders.FourFoldLoader
2525
android:id="@+id/main_fourfoldloader"
2626
android:layout_width="wrap_content"
2727
android:layout_height="wrap_content"
2828
android:layout_centerVertical="true"
2929
app:fourfold_disappearAnimDuration="100"
30-
app:loader_animDuration="1000"
31-
app:loader_firstSquareColor="@color/pink"
32-
app:loader_forthSquareColor="@color/indigo"
33-
app:loader_secondSquareColor="@color/blue"
34-
app:loader_squareLength="80dp"
35-
app:loader_startLoadingDefault="true"
36-
app:loader_thirdSquareColor="@color/purple" />
30+
app:fourfold_animDuration="1000"
31+
app:fourfold_firstSquareColor="@color/pink"
32+
app:fourfold_forthSquareColor="@color/indigo"
33+
app:fourfold_secondSquareColor="@color/blue"
34+
app:fourfold_squareLength="80dp"
35+
app:fourfold_startLoadingDefault="true"
36+
app:fourfold_thirdSquareColor="@color/purple" />
3737

3838
<!--<Button-->
3939
<!--android:id="@+id/button"-->

fourfoldloader/src/main/java/com/agrawalsuneet/fourfoldloader/basicviews/FourSquaresBaseLayout.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,25 +71,25 @@ abstract class FourSquaresBaseLayout : LinearLayout, LoaderContract {
7171

7272
override fun initAttributes(attrs: AttributeSet) {
7373

74-
val typedArray = context.obtainStyledAttributes(attrs, R.styleable.FourSquaresBaseLayout, 0, 0)
74+
val typedArray = context.obtainStyledAttributes(attrs, R.styleable.FourFoldLoader, 0, 0)
7575

76-
squareLenght = typedArray.getDimensionPixelSize(R.styleable.FourSquaresBaseLayout_loader_squareLength, 100)
76+
squareLenght = typedArray.getDimensionPixelSize(R.styleable.FourFoldLoader_fourfold_squareLength, 100)
7777

78-
firstSquareColor = typedArray.getColor(R.styleable.FourSquaresBaseLayout_loader_firstSquareColor,
78+
firstSquareColor = typedArray.getColor(R.styleable.FourFoldLoader_fourfold_firstSquareColor,
7979
resources.getColor(R.color.red))
8080

81-
secondSquareColor = typedArray.getColor(R.styleable.FourSquaresBaseLayout_loader_secondSquareColor,
81+
secondSquareColor = typedArray.getColor(R.styleable.FourFoldLoader_fourfold_secondSquareColor,
8282
resources.getColor(R.color.green))
8383

84-
thirdSquareColor = typedArray.getColor(R.styleable.FourSquaresBaseLayout_loader_thirdSquareColor,
84+
thirdSquareColor = typedArray.getColor(R.styleable.FourFoldLoader_fourfold_thirdSquareColor,
8585
resources.getColor(R.color.blue))
8686

87-
forthSquareColor = typedArray.getColor(R.styleable.FourSquaresBaseLayout_loader_forthSquareColor,
87+
forthSquareColor = typedArray.getColor(R.styleable.FourFoldLoader_fourfold_forthSquareColor,
8888
resources.getColor(R.color.grey))
8989

90-
animationDuration = typedArray.getInteger(R.styleable.FourSquaresBaseLayout_loader_animDuration, 500)
90+
animationDuration = typedArray.getInteger(R.styleable.FourFoldLoader_fourfold_animDuration, 500)
9191

92-
startLoadingDefault = typedArray.getBoolean(R.styleable.FourSquaresBaseLayout_loader_startLoadingDefault, false)
92+
startLoadingDefault = typedArray.getBoolean(R.styleable.FourFoldLoader_fourfold_startLoadingDefault, false)
9393

9494
typedArray.recycle()
9595
}

fourfoldloader/src/main/res/values/attrs.xml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,14 @@
66
<attr name="squareColor" format="color" />
77
</declare-styleable>
88

9-
<declare-styleable name="FourSquaresBaseLayout">
10-
<attr name="loader_squareLength" format="dimension" />
11-
<attr name="loader_firstSquareColor" format="color" />
12-
<attr name="loader_secondSquareColor" format="color" />
13-
<attr name="loader_thirdSquareColor" format="color" />
14-
<attr name="loader_forthSquareColor" format="color" />
15-
<attr name="loader_animDuration" format="integer" />
16-
<attr name="loader_startLoadingDefault" format="boolean" />
17-
</declare-styleable>
18-
199
<declare-styleable name="FourFoldLoader">
10+
<attr name="fourfold_squareLength" format="dimension" />
11+
<attr name="fourfold_firstSquareColor" format="color" />
12+
<attr name="fourfold_secondSquareColor" format="color" />
13+
<attr name="fourfold_thirdSquareColor" format="color" />
14+
<attr name="fourfold_forthSquareColor" format="color" />
15+
<attr name="fourfold_animDuration" format="integer" />
16+
<attr name="fourfold_startLoadingDefault" format="boolean" />
2017
<attr name="fourfold_disappearAnimDuration" format="integer" />
2118
<attr name="fourfold_overridePadding" format="boolean" />
2219
</declare-styleable>
@@ -25,5 +22,4 @@
2522
<item name="fourfold_to_alpha" format="float" type="dimen">0.5</item>
2623

2724

28-
2925
</resources>

0 commit comments

Comments
 (0)