Skip to content

Edit mode support#5

Open
sondagcyrille wants to merge 1 commit into
lukaspili:masterfrom
sondagcyrille:master
Open

Edit mode support#5
sondagcyrille wants to merge 1 commit into
lukaspili:masterfrom
sondagcyrille:master

Conversation

@sondagcyrille

Copy link
Copy Markdown

Avoid NPE when view is in edit mode

public class MyView extends PresentedFrameLayout<MyPresenter> {

    public MyView(Context context, AttributeSet attrs) {
        super(context, attrs);
        if (!isInEditMode()) {
            DaggerService.<MyPresenter>getDaggerComponent(context).inject(this);
        }
    }
    ...
}
<foo.bar.MyView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
   ...
</foo.bar.MyView>

Avoid NPE in edit mode
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.

1 participant