-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added some styling methods #222
base: develop
Are you sure you want to change the base?
Conversation
Added methods for styling the selected and unselected colors and the background of the bottom navigation
@@ -9,7 +9,7 @@ buildscript { | |||
google() | |||
} | |||
dependencies { | |||
classpath "com.android.tools.build:gradle:$gradleAndroidVersion" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, modify gradleAndroidVersion
variable above.
|
||
@BindColor(R.color.ms_custom_button_text_color) | ||
lateinit var customButtonColor: ColorStateList | ||
|
||
@BindColor(R.color.custom_active_step_color) | ||
@JvmField | ||
var customActiveStepColor: Int = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the same code style as above using lateinit
type modifier.
Hi @darkyelox, |
*/ | ||
public void setActiveStepColor(@ColorInt int newActiveStepColor) { | ||
mSelectedColor = newActiveStepColor; | ||
mDottedProgressBar.setSelectedColor(newActiveStepColor); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be moved to mStepperType
and handled by each subtype of AbstractStepperType
instead. This way each stepper type can change it as needed (including the tabbed stepper).
I would also remove
applied to dotted or progress bars
from the JavaDoc and implement it for the tabbed stepper instead as the corresponding XML attribute does change the color of the tabs (so that we don't have inconsistencies between XML attribute and Java method).
As described above the logic for that should probably be in TabsStepperType
and include:
mTabsContainer.setSelectedColor(stepperLayout.getSelectedColor());
+ what is done in TabsStepperType#onNewAdapter
(tabs need to be recreated).
* @param newBottomNavigationBackground the drawable | ||
*/ | ||
public void setBottomNavigationBackground(@NonNull Drawable newBottomNavigationBackground){ | ||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use ViewCompat.setBackground(mStepNavigation , newBottomNavigationBackground)
instead.
@@ -25,7 +25,7 @@ | |||
* @author Piotr Zawadzki | |||
*/ | |||
@LargeTest | |||
public class SetButtonColorProgrammaticallyActivityTest extends AbstractActivityTest<SetButtonColorProgrammaticallyActivity> { | |||
public class SetButtonColorProgrammaticallyActivityTest extends AbstractActivityTest<StyledProgrammaticallyActivity> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename the test class name to StyledProgrammaticallyActivityTest
i will do that when have some time, wait for it in next days, thanks |
Hi, is there any update on this PR? :) |
@darkyelox do you have any updates on this? :) |
I added some methods for change the colors for selected, unselected and bottom navigation background, i also refactor the color button activity sample for be more generic in styling and use the methods as example.