use of butterknife.Unbinder in project butterknife by JakeWharton.
the class BindColorTest method asInt.
@Test
public void asInt() {
IntTarget target = new IntTarget();
int expected = context.getResources().getColor(R.color.red);
Unbinder unbinder = new BindColorTest$IntTarget_ViewBinding(target, context);
assertThat(target.actual).isEqualTo(expected);
unbinder.unbind();
assertThat(target.actual).isEqualTo(expected);
}
use of butterknife.Unbinder in project butterknife by JakeWharton.
the class BindDimenTest method asInt.
@Test
public void asInt() {
IntTarget target = new IntTarget();
int expected = context.getResources().getDimensionPixelSize(R.dimen.twelve_point_two_dp);
Unbinder unbinder = new BindDimenTest$IntTarget_ViewBinding(target, context);
assertThat(target.actual).isEqualTo(expected);
unbinder.unbind();
assertThat(target.actual).isEqualTo(expected);
}
use of butterknife.Unbinder in project butterknife by JakeWharton.
the class BindFloatTest method asFloat.
@Test
public void asFloat() {
Target target = new Target();
TypedValue value = new TypedValue();
context.getResources().getValue(R.dimen.twelve_point_two, value, true);
float expected = value.getFloat();
Unbinder unbinder = new BindFloatTest$Target_ViewBinding(target, context);
assertThat(target.actual).isEqualTo(expected);
unbinder.unbind();
assertThat(target.actual).isEqualTo(expected);
}
use of butterknife.Unbinder in project butterknife by JakeWharton.
the class BindStringTest method simpleInt.
@Test
public void simpleInt() {
Target target = new Target();
String expected = context.getString(R.string.hey);
Unbinder unbinder = new BindStringTest$Target_ViewBinding(target, context);
assertThat(target.actual).isEqualTo(expected);
unbinder.unbind();
assertThat(target.actual).isEqualTo(expected);
}
use of butterknife.Unbinder in project Shuttle by timusus.
the class MiniPlayerFragment method onCreateView.
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
rootView = inflater.inflate(R.layout.fragment_mini_player, container, false);
unbinder = ButterKnife.bind(this, rootView);
rootView.setOnClickListener(v -> {
MultiSheetView multiSheetView = MultiSheetView.getParentMultiSheetView(rootView);
if (multiSheetView != null) {
multiSheetView.expandSheet(MultiSheetView.Sheet.FIRST);
}
});
rootView.setOnTouchListener(new OnSwipeTouchListener(getActivity()));
playPauseView.setOnClickListener(v -> playPauseView.toggle(() -> {
presenter.togglePlayback();
return Unit.INSTANCE;
}));
progressBar.setMax(1000);
disposables.add(Aesthetic.get(getContext()).isDark().subscribe(isDark -> {
int color = isDark ? getContext().getResources().getColor(android.R.color.primary_text_dark) : getContext().getResources().getColor(android.R.color.primary_text_light);
titleTextView.setTextColor(color);
playPauseView.setDrawableColor(color);
}));
return rootView;
}
Aggregations