Skip to content

Commit daf0715

Browse files
committed
Refactor styleable
1 parent 2f993be commit daf0715

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

dynamic-motion/src/main/java/com/pranavpandey/android/dynamic/motion/widget/DynamicMotionLayout.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
import android.util.AttributeSet;
2222
import android.view.LayoutInflater;
2323

24-
import com.pranavpandey.android.dynamic.motion.R;
25-
import com.pranavpandey.android.dynamic.motion.adapter.ViewPagerAdapter;
26-
2724
import androidx.annotation.Nullable;
2825
import androidx.constraintlayout.motion.widget.MotionLayout;
2926
import androidx.viewpager.widget.ViewPager;
3027

28+
import com.pranavpandey.android.dynamic.motion.R;
29+
import com.pranavpandey.android.dynamic.motion.adapter.ViewPagerAdapter;
30+
3131
/**
3232
* A MotionLayout to perform operations according to the {@link ViewPager} page offset.
3333
*/
@@ -70,10 +70,13 @@ public DynamicMotionLayout(Context context, AttributeSet attrs, int defStyleAttr
7070
* @param attrs The supplied attribute set to load the values.
7171
*/
7272
public void loadFromAttributes(@Nullable AttributeSet attrs) {
73-
TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.DynamicMotion);
73+
TypedArray a = getContext().obtainStyledAttributes(
74+
attrs, R.styleable.DynamicMotionLayout);
7475

7576
try {
76-
mPageCount = a.getInteger(R.styleable.DynamicMotion_adm_pageCount, ADM_VALUE_UNKNOWN);
77+
mPageCount = a.getInteger(
78+
R.styleable.DynamicMotionLayout_adm_pageCount,
79+
ADM_VALUE_UNKNOWN);
7780
} finally {
7881
a.recycle();
7982
}

dynamic-motion/src/main/res/values/attrs.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
<resources>
1919

20-
<!-- Attributes for this library. -->
21-
<declare-styleable name="DynamicMotion">
20+
<!-- Attributes for the DynamicMotionLayout. -->
21+
<declare-styleable name="DynamicMotionLayout">
2222
<!-- Page count for the view pager. -->
2323
<attr name="adm_pageCount" format="integer" />
2424
</declare-styleable>

0 commit comments

Comments
 (0)