use of butterknife.Unbinder in project butterknife by JakeWharton.
the class BindArrayTest method asIntArray.
@Test
public void asIntArray() {
IntArrayTarget target = new IntArrayTarget();
int[] expected = context.getResources().getIntArray(R.array.int_one_two_three);
Unbinder unbinder = ButterKnife.bind(target, tree);
assertThat(target.actual).isEqualTo(expected);
unbinder.unbind();
assertThat(target.actual).isEqualTo(expected);
}
use of butterknife.Unbinder in project butterknife by JakeWharton.
the class UnbinderTest method verifyContentViewBinding.
@Test
public void verifyContentViewBinding() {
FrameLayout frameLayout = new FrameLayout(context);
Button button1 = new Button(context);
button1.setId(android.R.id.button1);
frameLayout.addView(button1);
Button button2 = new Button(context);
button2.setId(android.R.id.button2);
frameLayout.addView(button2);
Button button3 = new Button(context);
button3.setId(android.R.id.button3);
frameLayout.addView(button3);
View content = new View(context);
content.setId(android.R.id.content);
frameLayout.addView(content);
H h = new H(frameLayout);
Unbinder unbinder = ButterKnife.bind(h, frameLayout);
verifyHBound(h);
unbinder.unbind();
verifyHUnbound(h);
}
use of butterknife.Unbinder in project butterknife by JakeWharton.
the class OnItemLongClickTest method optionalIdAbsent.
@UiThreadTest
@Test
public void optionalIdAbsent() {
View tree = ViewTree.create(TestSpinner.class, 2);
TestSpinner spinner = tree.findViewById(2);
OptionalId target = new OptionalId();
Unbinder unbinder = ButterKnife.bind(target, tree);
assertEquals(-1, target.clickedPosition);
spinner.performItemLongClick(0);
assertEquals(-1, target.clickedPosition);
unbinder.unbind();
spinner.performItemLongClick(0);
assertEquals(-1, target.clickedPosition);
}
use of butterknife.Unbinder in project RxJava-Android-Samples by kaushikgopal.
the class DoubleBindingTextViewFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View layout = inflater.inflate(R.layout.fragment_double_binding_textview, container, false);
unbinder = ButterKnife.bind(this, layout);
_resultEmitterSubject = PublishProcessor.create();
_disposable = _resultEmitterSubject.subscribe(aFloat -> {
_result.setText(String.valueOf(aFloat));
});
onNumberChanged();
_number2.requestFocus();
return layout;
}
use of butterknife.Unbinder in project Shuttle by timusus.
the class LibraryController method onCreateView.
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
final View rootView = inflater.inflate(R.layout.fragment_library, container, false);
unbinder = ButterKnife.bind(this, rootView);
((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);
setupViewPager();
compositeDisposable.add(Aesthetic.get(getContext()).colorPrimary().compose(distinctToMainThread()).subscribe(color -> ViewBackgroundAction.create(appBarLayout).accept(color), onErrorLogAndRethrow()));
return rootView;
}
Aggregations