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

Suggestion: add "isInEditMode" for the CTOR of JazzyViewPager #50

Open
AndroidDeveloperLB opened this issue Aug 31, 2014 · 0 comments
Open

Comments

@AndroidDeveloperLB
Copy link

Currently, the view causes errors while showing itself via the UI designer.

I suggest using isInEditMode() command, maybe like so:

public JazzyViewPager(final Context context, final AttributeSet attrs) {
    super(context, attrs);
    setClipChildren(false);
    // now style everything!
    final TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.JazzyViewPager);
    final int effect = ta.getInt(R.styleable.JazzyViewPager_style, 0);
    if (!isInEditMode()) {
        final String[] transitions = getResources().getStringArray(R.array.jazzy_effects);
        setTransitionEffect(TransitionEffect.valueOf(transitions[effect]));
    }
    setFadeEnabled(ta.getBoolean(R.styleable.JazzyViewPager_fadeEnabled, false));
            ...
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

No branches or pull requests

1 participant