예제 #1
0
 @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();
   }
 }
예제 #2
0
  @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);
  }
예제 #3
0
 private boolean isDeviceOk() {
   return android.os.Build.VERSION.SDK_INT >= exampleDetail.getMinSdk();
 }
예제 #4
0
  public void onBind(ExampleDetail exampleDetail) {
    this.exampleDetail = exampleDetail;

    title.setText(exampleDetail.getTitle());
  }