From 2ed469666f7294e51b4f112879c302d20e0236bd Mon Sep 17 00:00:00 2001 From: Marcello Montanino Date: Thu, 25 Oct 2018 14:13:52 +0200 Subject: [PATCH 1/3] Update SwitchMultiButton.java --- .../java/lib/kingja/switchbutton/SwitchMultiButton.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libk-switchbutton/src/main/java/lib/kingja/switchbutton/SwitchMultiButton.java b/libk-switchbutton/src/main/java/lib/kingja/switchbutton/SwitchMultiButton.java index d939c37..9bf0254 100644 --- a/libk-switchbutton/src/main/java/lib/kingja/switchbutton/SwitchMultiButton.java +++ b/libk-switchbutton/src/main/java/lib/kingja/switchbutton/SwitchMultiButton.java @@ -49,6 +49,7 @@ public class SwitchMultiButton extends View { private static final float STROKE_WIDTH = 2; private static final float TEXT_SIZE = 14; private static final int SELECTED_COLOR = 0xffeb7b00; + private static final int BACKGROUND_COLOR = 0xffffffff; private static final int SELECTED_TAB = 0; private static final String FONTS_DIR = "fonts/"; /*other*/ @@ -62,6 +63,7 @@ public class SwitchMultiButton extends View { private float mStrokeRadius; private float mStrokeWidth; private int mSelectedColor; + private int mBackgroundColor; private float mTextSize; private int mSelectedTab; private String mTypeface; @@ -97,6 +99,7 @@ private void initAttrs(Context context, AttributeSet attrs) { mStrokeWidth = typedArray.getDimension(R.styleable.SwitchMultiButton_strokeWidth, STROKE_WIDTH); mTextSize = typedArray.getDimension(R.styleable.SwitchMultiButton_textSize, TEXT_SIZE); mSelectedColor = typedArray.getColor(R.styleable.SwitchMultiButton_selectedColor, SELECTED_COLOR); + mBackgroundColor = typedArray.getColor(R.styleable.SwitchMultiButton_backgroundColor, BACKGROUND_COLOR); mSelectedTab = typedArray.getInteger(R.styleable.SwitchMultiButton_selectedTab, SELECTED_TAB); mTypeface = typedArray.getString(R.styleable.SwitchMultiButton_typeface); int mSwitchTabsResId = typedArray.getResourceId(R.styleable.SwitchMultiButton_switchTabs, 0); @@ -128,7 +131,7 @@ private void initPaint() { // selected text paint mSelectedTextPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG); mSelectedTextPaint.setTextSize(mTextSize); - mSelectedTextPaint.setColor(0xffffffff); + mSelectedTextPaint.setColor(mBackgroundColor); mStrokePaint.setAntiAlias(true); // unselected text paint mUnselectedTextPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG); @@ -405,6 +408,7 @@ protected Parcelable onSaveInstanceState() { bundle.putFloat("StrokeWidth", mStrokeWidth); bundle.putFloat("TextSize", mTextSize); bundle.putInt("SelectedColor", mSelectedColor); + bundle.putInt("BackgroundColor", mBackgroundColor); bundle.putInt("SelectedTab", mSelectedTab); return bundle; } @@ -417,6 +421,7 @@ protected void onRestoreInstanceState(Parcelable state) { mStrokeWidth = bundle.getFloat("StrokeWidth"); mTextSize = bundle.getFloat("TextSize"); mSelectedColor = bundle.getInt("SelectedColor"); + mBackgroundColor = bundle.getInt("BackgroundColor"); mSelectedTab = bundle.getInt("SelectedTab"); super.onRestoreInstanceState(bundle.getParcelable("View")); } else { From 2b8053e5ac4d1cb0fae47e36781326211d19227a Mon Sep 17 00:00:00 2001 From: Marcello Montanino Date: Thu, 25 Oct 2018 14:14:36 +0200 Subject: [PATCH 2/3] Update attr.xml --- libk-switchbutton/src/main/res/values/attr.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libk-switchbutton/src/main/res/values/attr.xml b/libk-switchbutton/src/main/res/values/attr.xml index 28f76ce..59eefd2 100644 --- a/libk-switchbutton/src/main/res/values/attr.xml +++ b/libk-switchbutton/src/main/res/values/attr.xml @@ -6,7 +6,8 @@ + - \ No newline at end of file + From 22371c1ac107d368998ddeb94e4c18237219e12b Mon Sep 17 00:00:00 2001 From: Marcello Montanino Date: Thu, 25 Oct 2018 14:39:03 +0200 Subject: [PATCH 3/3] Update config.gradle --- config.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.gradle b/config.gradle index bec55a9..bce9682 100644 --- a/config.gradle +++ b/config.gradle @@ -4,7 +4,7 @@ ext { minSdkVersion = 14 targetSdkVersion = 25 versionCode = 5 - versionName = "1.1.5" + versionName = "1.1.8" supportVersion = '25.3.1' -} \ No newline at end of file +}