Skip to content
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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

darkyelox
Copy link

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.

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"

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

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.

@zawadz88
Copy link
Contributor

Hi @darkyelox,
Thanks for contributing! We'll review these changes shortly :)

*/
public void setActiveStepColor(@ColorInt int newActiveStepColor) {
mSelectedColor = newActiveStepColor;
mDottedProgressBar.setSelectedColor(newActiveStepColor);
Copy link
Contributor

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) {
Copy link
Contributor

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> {
Copy link
Contributor

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

@darkyelox
Copy link
Author

i will do that when have some time, wait for it in next days, thanks

@niklilland
Copy link

Hi, is there any update on this PR? :)

@niklilland
Copy link

@darkyelox do you have any updates on this? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants