Code Monkey home page Code Monkey logo

progressbuttonview's Issues

Expose setBackgroundTintList, setBackgroundTintMode

We need to do:

progressButtonView.setBackgroundTintMode(SRC_IN);
progressButtonView.setBackgroundTintList(colorStateList);

Expose these two methods, or create a public method called tintBackground that calls these two with a resolved color and/or a colorResId (tintBackgroundWithColorResId). Example calls:

progressButtonView.tintBackground(ContextCompat.getColor(ctx, R.color.red));
progressButtonView.tintBackgroundWithColorResId(R.color.red);

BackgroundColorResource not working

When there is a backgroundDrawable defined, it overwrites background color resource.
A good solution could be to remove the default background resource.
Or to make the parameter optional in the style method

setTypeface method

Add two setTypeface methods to ProgressButtonView:

public void setTypeface(Typeface tf) {
    button.setTypeface(tf);
}

public void setTypeface(Typeface tf, int style) {
    button.setTypeface(tf, int style);
}

tintColor without tintMode

users may forget to add the progressBarTintMode attribute when they try to tint the ProgressBar. Maybe a default value like "SRC_ATOP" would make lib usage more intuitive

Rename strings and attrs

Rename R.string.send from strings.xml, and attrs like FullScreen, Element, FullW, to avoid possible clashes with another libraries in android projects.

Assign better-scoped names like ProgressButtonView_send or PBV_send

Improve nested framelayout using merge tag

ProgressButtonView inherits from FrameLayout, and inside its creation method, it inflates another FrameLayout.
The result is

<FrameLayout>
    <FrameLayout>

use the <merge> tag to improve performance using only one FrameLayout

Instrumentation tests fail because of timing issues

For example, in ViewWithBackgroundColorTest, 1) succeeds but since it takes a while when 2) is executed, the view still has the progressButtonView_tint_mode text.

1) onView(withText(R.string.progressButtonView_tint_mode)).perform(click());
2) onView(withText(R.string.progressButtonView_visibility_response)).check(matches(isDisplayed()));

Simply waiting is enough to make the tests pass.

Alternative ProgressButtonView without merge tag

Maybe there should be a ProgressButtonView subclass that overrides getLayoutId() with a new layout containing its own RelativeLayout root. That should fit some cases like FrameLayouts or ConstraintLayouts

one of our apps demand this feature

Text capitalization

Text appears with AllCaps mode always on.

Please expose some methods to disable text capitalizations, and display lowercase text

Remove @string/send from Strings

As long as this is a library, it should not define very common strings like @string/send.

Maybe a customized name like progressButtonView_send or even hardcode the Send message

setText programatically not taking effect

setBackgroundColor works fine but setText doesn't
Sample code

public void showOrderCompleted(Order order) {
    int color = ContextCompat.getColor(this, R.color.red);
    btnComplete.setBackgroundColor(color);
    btnComplete.setText(R.string.delivered);
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.