@OnClick(R.id.row_browse_activity_adapter_root) protected void onRootViewClick() { if (isDeviceOk()) { activity.startActivity(new Intent(activity, exampleDetail.getActivity())); } else { Snackbar.make( activity.findViewById(android.R.id.content), String.format( activity.getString(R.string.wrong_device_version), exampleDetail.getMinSdk()), Snackbar.LENGTH_LONG) .show(); } }
@OnClick(R.id.row_browse_activity_adapter_icon) protected void onIconClick() { Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse(exampleDetail.getUrl())); activity.startActivity(intent); }
private boolean isDeviceOk() { return android.os.Build.VERSION.SDK_INT >= exampleDetail.getMinSdk(); }
public void onBind(ExampleDetail exampleDetail) { this.exampleDetail = exampleDetail; title.setText(exampleDetail.getTitle()); }