diff --git a/build.gradle b/build.gradle
index 914e8c1..cb555f0 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,8 +1,8 @@
ext {
minSdkVersion = 17
targetSdkVersion = 28
- versionCode = 11
- versionName = "0.2.6"
+ versionCode = 12
+ versionName = "0.2.7"
}
buildscript {
diff --git a/demo/src/main/res/values/colors.xml b/demo/src/main/res/values/colors.xml
index e84590c..d193476 100644
--- a/demo/src/main/res/values/colors.xml
+++ b/demo/src/main/res/values/colors.xml
@@ -1,9 +1,9 @@
- #3F51B5
- #303F9F
- #FF4081
+ #3F51B5
+ #303F9F
+ #FF4081
- #FFC901
- #777475
+ #2CE218
+ #EC0A56
diff --git a/library/src/main/java/moe/feng/common/view/breadcrumbs/BreadcrumbsView.java b/library/src/main/java/moe/feng/common/view/breadcrumbs/BreadcrumbsView.java
index 9beb3c2..b0ded70 100644
--- a/library/src/main/java/moe/feng/common/view/breadcrumbs/BreadcrumbsView.java
+++ b/library/src/main/java/moe/feng/common/view/breadcrumbs/BreadcrumbsView.java
@@ -28,7 +28,6 @@ public class BreadcrumbsView extends FrameLayout {
/**
* Popup Menu Theme Id
*/
- private int mPopupThemeId = -1;
private int mTextColorSelected = -1;
private int mTextColorUnSelected = -1;
private int mTextSizeCustom = -1;
@@ -37,20 +36,24 @@ public class BreadcrumbsView extends FrameLayout {
private static final String KEY_SUPER_STATES = BuildConfig.APPLICATION_ID + ".superStates";
private static final String KEY_BREADCRUMBS = BuildConfig.APPLICATION_ID + ".breadcrumbs";
- public BreadcrumbsView(Context context) {
- this(context, null);
+ public BreadcrumbsView(@NonNull Context context) {
+ super(context);
+ getCustomAttrs(context, null, 0);
}
public BreadcrumbsView(Context context, AttributeSet attrs) {
- this(context, attrs, 0);
+ super(context, attrs);
+ getCustomAttrs(context, attrs, 0);
}
public BreadcrumbsView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
+ getCustomAttrs(context, attrs, defStyleAttr);
+ }
+ private void getCustomAttrs(Context context, AttributeSet attrs, int defStyle) {
if (attrs != null) {
- TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.BreadcrumbsView, defStyleAttr, 0);
- mPopupThemeId = a.getResourceId(R.styleable.BreadcrumbsView_popupTheme, -1);
+ TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.BreadcrumbsView, 0, 0);
mTextColorSelected = a.getColor(R.styleable.BreadcrumbsView_textColorSelected, -1);
mTextColorUnSelected = a.getColor(R.styleable.BreadcrumbsView_textColorUnSelected, -1);
mTextSizeCustom = a.getDimensionPixelSize(R.styleable.BreadcrumbsView_textSizeCustom, -1);
@@ -82,9 +85,6 @@ private void init() {
// Init Adapter
if (mAdapter == null) {
mAdapter = new BreadcrumbsAdapter(this, mTextColorSelected, mTextColorUnSelected, mTextSizeCustom);
- if (mPopupThemeId != -1) {
- mAdapter.setPopupThemeId(mPopupThemeId);
- }
}
mRecyclerView.setAdapter(mAdapter);
}
diff --git a/library/src/main/res/layout/breadcrumbs_view_dropdown_item.xml b/library/src/main/res/layout/breadcrumbs_view_dropdown_item.xml
index 3a8815d..9ad798a 100644
--- a/library/src/main/res/layout/breadcrumbs_view_dropdown_item.xml
+++ b/library/src/main/res/layout/breadcrumbs_view_dropdown_item.xml
@@ -1,17 +1,4 @@
-
+
-
-
-
-
-
+
+
+
+
\ No newline at end of file