butterknife.Bind类的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(9.1k)|赞(0)|评价(0)|浏览(135)

本文整理了Java中butterknife.Bind类的一些代码示例,展示了Bind类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bind类的具体详情如下:
包路径:butterknife.Bind
类名称:Bind

Bind介绍

暂无

代码示例

代码示例来源:origin: android10/Android-CleanArchitecture

static class UserViewHolder extends RecyclerView.ViewHolder {
  @Bind(R.id.title) TextView textViewTitle;

  UserViewHolder(View itemView) {
   super(itemView);
   ButterKnife.bind(this, itemView);
  }
 }
}

代码示例来源:origin: android10/Android-CleanArchitecture

/**
 * Main application screen. This is the app entry point.
 */
public class MainActivity extends BaseActivity {

 @Bind(R.id.btn_LoadData) Button btn_LoadData;

 @Override
 protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  ButterKnife.bind(this);
 }

 /**
  * Goes to the user list screen.
  */
 @OnClick(R.id.btn_LoadData)
 void navigateToUserList() {
  this.navigator.navigateToUserList(this);
 }
}

代码示例来源:origin: smuyyh/BookReader

static class HeaderViewHolder {
  @Bind(R.id.tvBookListTitle)
  TextView tvBookListTitle;
  @Bind(R.id.tvBookListDesc)
  TextView tvBookListDesc;
  @Bind(R.id.ivAuthorAvatar)
  ImageView ivAuthorAvatar;
  @Bind(R.id.tvBookListAuthor)
  TextView tvBookListAuthor;
  @Bind(R.id.btnShare)
  TextView btnShare;
  public HeaderViewHolder(View view) {
    ButterKnife.bind(this, view);
  }
}

代码示例来源:origin: jeasonlzy/NineGridView

static class ViewHolder {
    @Bind(R.id.tv_reply) TextView reply;

    public ViewHolder(View convertView) {
      ButterKnife.bind(this, convertView);
    }
  }
}

代码示例来源:origin: smuyyh/BookReader

static class HeaderViewHolder {
  @Bind(R.id.ivBookCover)
  ImageView ivAvatar;
  @Bind(R.id.tvBookTitle)
  TextView tvNickName;
  @Bind(R.id.tvTime)
  TextView tvTime;
  @Bind(R.id.tvTitle)
  TextView tvTitle;
  @Bind(R.id.tvContent)
  BookContentTextView tvContent;
  @Bind(R.id.tvBestComments)
  TextView tvBestComments;
  @Bind(R.id.rvBestComments)
  RecyclerView rvBestComments;
  @Bind(R.id.tvCommentCount)
  TextView tvCommentCount;
  public HeaderViewHolder(View view) {
    ButterKnife.bind(this, view);   //view绑定
  }
}

代码示例来源:origin: smuyyh/BookReader

static class HeaderViewHolder {
  @Bind(R.id.ivBookCover)
  ImageView ivAvatar;
  @Bind(R.id.tvBookTitle)
  TextView tvNickName;
  @Bind(R.id.tvTime)
  TextView tvTime;
  @Bind(R.id.tvTitle)
  TextView tvTitle;
  @Bind(R.id.tvContent)
  BookContentTextView tvContent;
  @Bind(R.id.tvBestComments)
  TextView tvBestComments;
  @Bind(R.id.rvBestComments)
  RecyclerView rvBestComments;
  @Bind(R.id.tvCommentCount)
  TextView tvCommentCount;
  public HeaderViewHolder(View view) {
    ButterKnife.bind(this, view);   //view绑定
  }
}

代码示例来源:origin: ImmortalZ/TransitionHelper

/**
 * Created by Mr_immortalZ on 2016/10/29.
 * email : mr_immortalz@qq.com
 */

public class FActivity extends BaseActivity {
  @Bind(R.id.btn_circle)
  FloatingActionButton btnCommit;

  @Override
  public int getLayoutId() {
    return R.layout.activity_fragment;
  }

  @OnClick(R.id.btn_circle)
  public void onClick() {
    TransitionsHeleper.startActivity(this, FDetailActivity.class, btnCommit);
  }

}

代码示例来源:origin: Karumi/Rosie

public class ComicRenderer extends MarvelRenderer<ComicSeriesDetailViewModel> {

 @Bind(R.id.iv_thumbnail) ImageView thumbnailView;
 @Bind(R.id.tv_title) TextView titleView;

 @Override public void render() {
  super.render();

  ComicViewModel comic = (ComicViewModel) getContent();
  titleView.setText(comic.getTitle());
  Picasso.with(getRootView().getContext())
    .load(comic.getThumbnailUrl())
    .fit()
    .centerCrop()
    .into(thumbnailView);
 }

 @Override protected View inflate(LayoutInflater inflater, ViewGroup parent) {
  return inflater.inflate(R.layout.item_comic, parent, false);
 }
}

代码示例来源:origin: jeasonlzy/NineGridView

public class NewsLinkActivity extends AppCompatActivity {

  @Bind(R.id.webView) WebView webView;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_news_link);
    ButterKnife.bind(this);

    String link = getIntent().getStringExtra("link");
    webView.setWebViewClient(new WebViewClient() {
      @Override
      public boolean shouldOverrideUrlLoading(WebView view, String url) {
        view.loadUrl(url);
        return true;
      }
    });
    webView.loadUrl(link);
  }
}

代码示例来源:origin: ImmortalZ/TransitionHelper

/**
 * Created by Mr_immortalZ on 2016/11/1.
 * email : mr_immortalz@qq.com
 */

public class IntentActivity extends BaseActivity {
  @Bind(R.id.btn)
  Button btn;

  @Override
  public int getLayoutId() {
    return R.layout.activity_intent;
  }

  @OnClick(R.id.btn)
  public void onClick() {
    Intent intent = new Intent(this, IntentDetailActivity.class);
    intent.putExtra(IntentDetailActivity.TRANSITION_DATA, "This is immortalZ");
    TransitionsHeleper.startActivity(this, intent, btn);
  }
}

代码示例来源:origin: hitherejoe/animate

public class SharedTransitionInToolbarActivity extends BaseActivity {

  @Bind(R.id.toolbar)
  Toolbar mToolbar;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_shared_transitions_in_toolbar);
    ButterKnife.bind(this);

    Slide slide = new Slide(Gravity.BOTTOM);
    slide.addTarget(R.id.text_detail);
    slide.addTarget(R.id.text_close);
    slide.addTarget(R.id.view_separator);
    getWindow().setEnterTransition(slide);

    setSupportActionBar(mToolbar);
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) actionBar.setDisplayHomeAsUpEnabled(true);
  }

  @OnClick(R.id.text_close)
  public void onCloseTextClicked() {
    finishAfterTransition();
  }

}

代码示例来源:origin: Karumi/Rosie

public class ComicSeriesRenderer extends MarvelRenderer<ComicSeriesViewModel> {

 private final ComicsSeriesPresenter presenter;

 @Bind(R.id.tv_comic_series_name) TextView nameView;

 public ComicSeriesRenderer(ComicsSeriesPresenter presenter) {
  this.presenter = presenter;
 }

 @Override public void render() {
  super.render();
  ComicSeriesViewModel comicSeries = getContent();
  nameView.setText(comicSeries.getTitle());
 }

 @Override protected View inflate(LayoutInflater inflater, ViewGroup parent) {
  return inflater.inflate(R.layout.item_comic_series, parent, false);
 }

 @OnClick(R.id.ll_root) public void onItemClicked() {
  ComicSeriesViewModel comicSeries = getContent();
  presenter.onComicSeriesClicked(comicSeries);
 }
}

代码示例来源:origin: smuyyh/BookReader

@Bind(R.id.feedbackView)
ProgressWebView feedbackView;

代码示例来源:origin: hitherejoe/animate

public class SharedTransitionToolbarActivity extends BaseActivity {

  @Bind(R.id.toolbar)
  Toolbar mToolbar;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Slide slide = new Slide(Gravity.BOTTOM);
    slide.addTarget(R.id.text_detail);
    slide.addTarget(R.id.text_close);
    slide.addTarget(R.id.view_separator);
    getWindow().setEnterTransition(slide);
    setContentView(R.layout.activity_shared_transition_in);
    ButterKnife.bind(this);

    setSupportActionBar(mToolbar);
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) actionBar.setDisplayHomeAsUpEnabled(true);
  }

  @OnClick(R.id.text_close)
  public void onCloseTextClicked() {
    finishAfterTransition();
  }

}

代码示例来源:origin: Karumi/Rosie

public class ComicSeriesHeaderDetailRenderer extends MarvelRenderer<ComicSeriesDetailViewModel> {

 @Bind(R.id.iv_cover) ImageView coverView;
 @Bind(R.id.tv_rating) TextView ratingView;
 @Bind(R.id.tv_description) TextView descriptionView;

 @Override public void render() {
  super.render();

  Context context = getRootView().getContext();
  ComicSeriesHeaderDetailViewModel comicSeries = (ComicSeriesHeaderDetailViewModel) getContent();

  Picasso.with(context).load(comicSeries.getCoverUrl()).fit().centerCrop().into(coverView);
  ratingView.setText(context.getString(R.string.marvel_rating_text, comicSeries.getRating()));

  if (comicSeries.getDescription() != null && !comicSeries.getDescription().isEmpty()) {
   descriptionView.setText(comicSeries.getDescription());
  } else {
   descriptionView.setText(getRootView().getResources().getString(R.string.no_description));
  }
 }

 @Override protected View inflate(LayoutInflater inflater, ViewGroup parent) {
  return inflater.inflate(R.layout.item_comic_series_header, parent, false);
 }
}

代码示例来源:origin: qs-lll/ExpandingPager

public class InfoActivity extends AppCompatActivity {

  private static final String EXTRA_TRAVEL = "EXTRA_TRAVEL";
  @Bind(R.id.image) ImageView image;
  @Bind(R.id.title) TextView title;

  public static Intent newInstance(Context context, Travel travel) {
    Intent intent = new Intent(context, InfoActivity.class);
    intent.putExtra(EXTRA_TRAVEL, travel);
    return intent;
  }

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_info);
    ButterKnife.bind(this);

    Travel travel = getIntent().getParcelableExtra(EXTRA_TRAVEL);
    if (travel != null) {
      image.setImageResource(travel.getImage());
      title.setText(travel.getName());
    }
  }
}

代码示例来源:origin: smuyyh/BookReader

static class HeaderViewHolder {
  @Bind(R.id.ivAuthorAvatar)
  ImageView ivAuthorAvatar;
  @Bind(R.id.tvBookAuthor)
  TextView tvBookAuthor;
  @Bind(R.id.tvTime)
  TextView tvTime;
  @Bind(R.id.tvTitle)
  TextView tvTitle;
  @Bind(R.id.tvContent)
  BookContentTextView tvContent;
  @Bind(R.id.rlBookInfo)
  RelativeLayout rlBookInfo;
  @Bind(R.id.ivBookCover)
  ImageView ivBookCover;
  @Bind(R.id.tvBookTitle)
  TextView tvBookTitle;
  @Bind(R.id.tvHelpfullYesCount)
  TextView tvHelpfullYesCount;
  @Bind(R.id.tvHelpfullNoCount)
  TextView tvHelpfullNoCount;
  @Bind(R.id.tvBestComments)
  TextView tvBestComments;
  @Bind(R.id.rvBestComments)
  RecyclerView rvBestComments;
  @Bind(R.id.tvCommentCount)
  TextView tvCommentCount;
  @Bind(R.id.rating)
  XLHRatingBar ratingBar;

代码示例来源:origin: GitLqr/LQRWeChat

@Bind(R.id.llSearchUser)
LinearLayout mLlSearchUser;
@Bind(R.id.tvAccount)
TextView mTvAccount;

代码示例来源:origin: smuyyh/BookReader

@Bind(R.id.slOverall)
SelectionLayout slOverall;

代码示例来源:origin: smuyyh/BookReader

@Bind(R.id.slOverall)
SelectionLayout slOverall;

相关文章