use of butterknife.Unbinder in project butterknife by JakeWharton.
the class BindColorTest method asColorStateList.
@Test
public void asColorStateList() {
ColorStateListTarget target = new ColorStateListTarget();
ColorStateList expected = context.getResources().getColorStateList(R.color.colors);
Unbinder unbinder = new BindColorTest$ColorStateListTarget_ViewBinding(target, context);
assertThat(target.actual.toString()).isEqualTo(expected.toString());
unbinder.unbind();
assertThat(target.actual.toString()).isEqualTo(expected.toString());
}
use of butterknife.Unbinder in project butterknife by JakeWharton.
the class BindDimenTest method asFloat.
@Test
public void asFloat() {
FloatTarget target = new FloatTarget();
float expected = context.getResources().getDimension(R.dimen.twelve_point_two_dp);
Unbinder unbinder = new BindDimenTest$FloatTarget_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 BindDrawableTest method asDrawable.
@Test
public void asDrawable() {
Target target = new Target();
Drawable expected = context.getResources().getDrawable(R.drawable.circle);
Unbinder unbinder = new BindDrawableTest$Target_ViewBinding(target, context);
assertThat(target.actual.getConstantState()).isEqualTo(expected.getConstantState());
unbinder.unbind();
assertThat(target.actual.getConstantState()).isEqualTo(expected.getConstantState());
}
use of butterknife.Unbinder in project butterknife by JakeWharton.
the class BindIntTest method asInt.
@Test
public void asInt() {
Target target = new Target();
int expected = context.getResources().getInteger(R.integer.twelve);
Unbinder unbinder = new BindIntTest$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 FolderFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_folder_browser, container, false);
unbinder = ButterKnife.bind(this, rootView);
if (displayedInTabs) {
breadcrumbsView = new BreadcrumbsView(currentDir);
showBreadcrumbsInList = true;
changeBreadcrumbPath();
appBarLayout.setVisibility(View.GONE);
statusBarView.setVisibility(View.GONE);
} else {
showBreadcrumbsInList = false;
breadcrumb.addBreadcrumbListener(this);
if (!TextUtils.isEmpty(currentDir)) {
breadcrumb.changeBreadcrumbPath(currentDir);
}
}
if (!displayedInTabs) {
toolbar.inflateMenu(R.menu.menu_folders);
toolbar.setNavigationOnClickListener(v -> getNavigationController().popViewController());
toolbar.setOnMenuItemClickListener(this);
updateMenuItems(toolbar.getMenu());
}
recyclerView.setRecyclerListener(new RecyclerListener());
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
recyclerView.setAdapter(adapter);
Aesthetic.get(getContext()).colorPrimary().take(1).subscribe(color -> ViewBackgroundAction.create(appBarLayout).accept(color), onErrorLogAndRethrow());
compositeDisposable.add(Aesthetic.get(getContext()).colorPrimary().compose(distinctToMainThread()).subscribe(color -> ViewBackgroundAction.create(appBarLayout).accept(color), onErrorLogAndRethrow()));
return rootView;
}
Aggregations