Skip to content

Commit

Permalink
[butterknife-fragments] fix: add missing unbinding
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoslacz committed Jul 27, 2017
1 parent e36dae5 commit 7269b5f
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.mateuszkoslacz.moviper.iface.view.ViperView;

import butterknife.ButterKnife;
import butterknife.Unbinder;

/**
* Created by mateuszkoslacz on 14.12.2016.
Expand All @@ -20,9 +21,17 @@ public abstract class ViperButterKnifeFragment
extends ViperAiFragment<ViewType, Presenter>
implements ViperView {

private Unbinder unbinder;

@Override
protected void injectViews(View view) {
super.injectViews(view);
ButterKnife.bind(this, view);
unbinder = ButterKnife.bind(this, view);
}

@Override
public void onDestroyView() {
super.onDestroyView();
unbinder.unbind();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.mateuszkoslacz.moviper.iface.view.ViperView;

import butterknife.ButterKnife;
import butterknife.Unbinder;

/**
* Created by mateuszkoslacz on 14.12.2016.
Expand All @@ -22,9 +23,17 @@ public abstract class ViperButterKnifeLceFragment
extends ViperLceAiFragment<ContentView, Model, ViewType, Presenter>
implements ViperLceView<Model> {

private Unbinder unbinder;

@Override
protected void injectViews(View view) {
super.injectViews(view);
ButterKnife.bind(this, view);
unbinder = ButterKnife.bind(this, view);
}

@Override
public void onDestroyView() {
super.onDestroyView();
unbinder.unbind();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.mateuszkoslacz.moviper.iface.view.ViperLceView;

import butterknife.ButterKnife;
import butterknife.Unbinder;

/**
* Created by mateuszkoslacz on 14.12.2016.
Expand All @@ -19,9 +20,17 @@ public abstract class ViperButterKnifeLcePassiveFragment
extends ViperLceAiPassiveFragment<ContentView, Model, ViewType>
implements ViperLceView<Model> {

private Unbinder unbinder;

@Override
protected void injectViews(View view) {
super.injectViews(view);
ButterKnife.bind(this, view);
unbinder = ButterKnife.bind(this, view);
}

@Override
public void onDestroyView() {
super.onDestroyView();
unbinder.unbind();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.mateuszkoslacz.moviper.iface.view.ViperView;

import butterknife.ButterKnife;
import butterknife.Unbinder;

/**
* Created by mateuszkoslacz on 14.12.2016.
Expand All @@ -17,9 +18,17 @@ public abstract class ViperButterKnifePassiveFragment
extends ViperAiPassiveFragment<ViewType>
implements ViperView {

private Unbinder unbinder;

@Override
protected void injectViews(View view) {
super.injectViews(view);
ButterKnife.bind(this, view);
unbinder = ButterKnife.bind(this, view);
}

@Override
public void onDestroyView() {
super.onDestroyView();
unbinder.unbind();
}
}

0 comments on commit 7269b5f

Please sign in to comment.