diff --git a/app/build.gradle b/app/build.gradle index 2136de6..377d8be 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,4 +1,5 @@ apply plugin: 'com.android.application' +apply plugin: 'com.jakewharton.butterknife' android { compileSdkVersion 24 @@ -26,7 +27,8 @@ dependencies { compile 'com.android.support:design:24.2.1' // ButterKnife - compile 'com.jakewharton:butterknife:7.0.1' + compile 'com.jakewharton:butterknife:8.4.0' + annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0' // Glide compile 'com.github.bumptech.glide:glide:3.7.0' diff --git a/app/src/main/java/com/sunfusheng/StickyHeaderListView/adapter/FilterLeftAdapter.java b/app/src/main/java/com/sunfusheng/StickyHeaderListView/adapter/FilterLeftAdapter.java index 24725d3..79ed43f 100644 --- a/app/src/main/java/com/sunfusheng/StickyHeaderListView/adapter/FilterLeftAdapter.java +++ b/app/src/main/java/com/sunfusheng/StickyHeaderListView/adapter/FilterLeftAdapter.java @@ -12,7 +12,7 @@ import java.util.List; -import butterknife.Bind; +import butterknife.BindView; import butterknife.ButterKnife; /** @@ -64,10 +64,10 @@ public View getView(int position, View convertView, ViewGroup parent) { } static class ViewHolder { - @Bind(R.id.ll_root_view) - LinearLayout llRootView; - @Bind(R.id.tv_title) + @BindView(R.id.tv_title) TextView tvTitle; + @BindView(R.id.ll_root_view) + LinearLayout llRootView; ViewHolder(View view) { ButterKnife.bind(this, view); diff --git a/app/src/main/java/com/sunfusheng/StickyHeaderListView/adapter/FilterOneAdapter.java b/app/src/main/java/com/sunfusheng/StickyHeaderListView/adapter/FilterOneAdapter.java index 0e6f3ca..68473b3 100644 --- a/app/src/main/java/com/sunfusheng/StickyHeaderListView/adapter/FilterOneAdapter.java +++ b/app/src/main/java/com/sunfusheng/StickyHeaderListView/adapter/FilterOneAdapter.java @@ -12,7 +12,7 @@ import java.util.List; -import butterknife.Bind; +import butterknife.BindView; import butterknife.ButterKnife; /** @@ -62,9 +62,9 @@ public View getView(int position, View convertView, ViewGroup parent) { } static class ViewHolder { - @Bind(R.id.iv_image) + @BindView(R.id.iv_image) ImageView ivImage; - @Bind(R.id.tv_title) + @BindView(R.id.tv_title) TextView tvTitle; ViewHolder(View view) { diff --git a/app/src/main/java/com/sunfusheng/StickyHeaderListView/adapter/FilterRightAdapter.java b/app/src/main/java/com/sunfusheng/StickyHeaderListView/adapter/FilterRightAdapter.java index 7ca5c1f..29fa88d 100644 --- a/app/src/main/java/com/sunfusheng/StickyHeaderListView/adapter/FilterRightAdapter.java +++ b/app/src/main/java/com/sunfusheng/StickyHeaderListView/adapter/FilterRightAdapter.java @@ -12,7 +12,7 @@ import java.util.List; -import butterknife.Bind; +import butterknife.BindView; import butterknife.ButterKnife; /** @@ -62,9 +62,9 @@ public View getView(int position, View convertView, ViewGroup parent) { } static class ViewHolder { - @Bind(R.id.iv_image) + @BindView(R.id.iv_image) ImageView ivImage; - @Bind(R.id.tv_title) + @BindView(R.id.tv_title) TextView tvTitle; ViewHolder(View view) { diff --git a/app/src/main/java/com/sunfusheng/StickyHeaderListView/adapter/HeaderChannelAdapter.java b/app/src/main/java/com/sunfusheng/StickyHeaderListView/adapter/HeaderChannelAdapter.java index f566593..399b1a1 100644 --- a/app/src/main/java/com/sunfusheng/StickyHeaderListView/adapter/HeaderChannelAdapter.java +++ b/app/src/main/java/com/sunfusheng/StickyHeaderListView/adapter/HeaderChannelAdapter.java @@ -13,7 +13,7 @@ import java.util.List; -import butterknife.Bind; +import butterknife.BindView; import butterknife.ButterKnife; /** @@ -51,11 +51,11 @@ public View getView(int position, View convertView, ViewGroup parent) { } static class ViewHolder { - @Bind(R.id.iv_image) + @BindView(R.id.iv_image) ImageView ivImage; - @Bind(R.id.tv_title) + @BindView(R.id.tv_title) TextView tvTitle; - @Bind(R.id.tv_tips) + @BindView(R.id.tv_tips) TextView tvTips; ViewHolder(View view) { diff --git a/app/src/main/java/com/sunfusheng/StickyHeaderListView/adapter/HeaderOperationAdapter.java b/app/src/main/java/com/sunfusheng/StickyHeaderListView/adapter/HeaderOperationAdapter.java index 9346e6a..c9034fe 100644 --- a/app/src/main/java/com/sunfusheng/StickyHeaderListView/adapter/HeaderOperationAdapter.java +++ b/app/src/main/java/com/sunfusheng/StickyHeaderListView/adapter/HeaderOperationAdapter.java @@ -13,7 +13,7 @@ import java.util.List; -import butterknife.Bind; +import butterknife.BindView; import butterknife.ButterKnife; /** @@ -55,11 +55,11 @@ public View getView(int position, View convertView, ViewGroup parent) { } static class ViewHolder { - @Bind(R.id.iv_image) + @BindView(R.id.iv_image) ImageView ivImage; - @Bind(R.id.tv_title) + @BindView(R.id.tv_title) TextView tvTitle; - @Bind(R.id.tv_subtitle) + @BindView(R.id.tv_subtitle) TextView tvSubtitle; ViewHolder(View view) { diff --git a/app/src/main/java/com/sunfusheng/StickyHeaderListView/adapter/TravelingAdapter.java b/app/src/main/java/com/sunfusheng/StickyHeaderListView/adapter/TravelingAdapter.java index 3577a0c..745f63e 100644 --- a/app/src/main/java/com/sunfusheng/StickyHeaderListView/adapter/TravelingAdapter.java +++ b/app/src/main/java/com/sunfusheng/StickyHeaderListView/adapter/TravelingAdapter.java @@ -16,7 +16,7 @@ import java.util.ArrayList; import java.util.List; -import butterknife.Bind; +import butterknife.BindView; import butterknife.ButterKnife; /** @@ -103,13 +103,13 @@ public View getView(int position, View convertView, ViewGroup parent) { } static class ViewHolder { - @Bind(R.id.ll_root_view) + @BindView(R.id.ll_root_view) LinearLayout llRootView; - @Bind(R.id.iv_image) + @BindView(R.id.iv_image) ImageView ivImage; - @Bind(R.id.tv_title) + @BindView(R.id.tv_title) TextView tvTitle; - @Bind(R.id.tv_rank) + @BindView(R.id.tv_rank) TextView tvRank; ViewHolder(View view) { diff --git a/app/src/main/java/com/sunfusheng/StickyHeaderListView/ui/AboutActivity.java b/app/src/main/java/com/sunfusheng/StickyHeaderListView/ui/AboutActivity.java index b07217f..2cb0633 100644 --- a/app/src/main/java/com/sunfusheng/StickyHeaderListView/ui/AboutActivity.java +++ b/app/src/main/java/com/sunfusheng/StickyHeaderListView/ui/AboutActivity.java @@ -19,7 +19,7 @@ import com.sunfusheng.StickyHeaderListView.R; -import butterknife.Bind; +import butterknife.BindView; import butterknife.ButterKnife; /** @@ -27,9 +27,9 @@ */ public class AboutActivity extends AppCompatActivity { - @Bind(R.id.toolbar) + @BindView(R.id.toolbar) Toolbar toolbar; - @Bind(R.id.webView) + @BindView(R.id.webView) WebView webView; private WebSettings settings; diff --git a/app/src/main/java/com/sunfusheng/StickyHeaderListView/ui/MainActivity.java b/app/src/main/java/com/sunfusheng/StickyHeaderListView/ui/MainActivity.java index b35f034..6d96aea 100644 --- a/app/src/main/java/com/sunfusheng/StickyHeaderListView/ui/MainActivity.java +++ b/app/src/main/java/com/sunfusheng/StickyHeaderListView/ui/MainActivity.java @@ -35,7 +35,7 @@ import java.util.ArrayList; import java.util.List; -import butterknife.Bind; +import butterknife.BindView; import butterknife.ButterKnife; /** @@ -45,19 +45,19 @@ */ public class MainActivity extends AppCompatActivity implements SmoothListView.ISmoothListViewListener { - @Bind(R.id.listView) + @BindView(R.id.listView) SmoothListView smoothListView; - @Bind(R.id.fv_top_filter) + @BindView(R.id.fv_top_filter) FilterView fvTopFilter; - @Bind(R.id.rl_bar) + @BindView(R.id.rl_bar) RelativeLayout rlBar; - @Bind(R.id.tv_title) + @BindView(R.id.tv_title) TextView tvTitle; - @Bind(R.id.view_title_bg) + @BindView(R.id.view_title_bg) View viewTitleBg; - @Bind(R.id.view_action_more_bg) + @BindView(R.id.view_action_more_bg) View viewActionMoreBg; - @Bind(R.id.fl_action_more) + @BindView(R.id.fl_action_more) FrameLayout flActionMore; private Context mContext; diff --git a/app/src/main/java/com/sunfusheng/StickyHeaderListView/view/FilterView.java b/app/src/main/java/com/sunfusheng/StickyHeaderListView/view/FilterView.java index b1deb1a..93ce40f 100644 --- a/app/src/main/java/com/sunfusheng/StickyHeaderListView/view/FilterView.java +++ b/app/src/main/java/com/sunfusheng/StickyHeaderListView/view/FilterView.java @@ -22,7 +22,7 @@ import com.sunfusheng.StickyHeaderListView.model.FilterEntity; import com.sunfusheng.StickyHeaderListView.model.FilterTwoEntity; -import butterknife.Bind; +import butterknife.BindView; import butterknife.ButterKnife; /** @@ -30,33 +30,33 @@ */ public class FilterView extends LinearLayout implements View.OnClickListener { - @Bind(R.id.tv_category) + @BindView(R.id.tv_category) TextView tvCategory; - @Bind(R.id.iv_category_arrow) + @BindView(R.id.iv_category_arrow) ImageView ivCategoryArrow; - @Bind(R.id.tv_sort) + @BindView(R.id.tv_sort) TextView tvSort; - @Bind(R.id.iv_sort_arrow) + @BindView(R.id.iv_sort_arrow) ImageView ivSortArrow; - @Bind(R.id.tv_filter) + @BindView(R.id.tv_filter) TextView tvFilter; - @Bind(R.id.iv_filter_arrow) + @BindView(R.id.iv_filter_arrow) ImageView ivFilterArrow; - @Bind(R.id.ll_category) + @BindView(R.id.ll_category) LinearLayout llCategory; - @Bind(R.id.ll_sort) + @BindView(R.id.ll_sort) LinearLayout llSort; - @Bind(R.id.ll_filter) + @BindView(R.id.ll_filter) LinearLayout llFilter; - @Bind(R.id.lv_left) + @BindView(R.id.lv_left) ListView lvLeft; - @Bind(R.id.lv_right) + @BindView(R.id.lv_right) ListView lvRight; - @Bind(R.id.ll_head_layout) + @BindView(R.id.ll_head_layout) LinearLayout llHeadLayout; - @Bind(R.id.ll_content_list_view) + @BindView(R.id.ll_content_list_view) LinearLayout llContentListView; - @Bind(R.id.view_mask_bg) + @BindView(R.id.view_mask_bg) View viewMaskBg; private Context mContext; diff --git a/app/src/main/java/com/sunfusheng/StickyHeaderListView/view/HeaderBannerView.java b/app/src/main/java/com/sunfusheng/StickyHeaderListView/view/HeaderBannerView.java index 5a3f7a7..9933f80 100644 --- a/app/src/main/java/com/sunfusheng/StickyHeaderListView/view/HeaderBannerView.java +++ b/app/src/main/java/com/sunfusheng/StickyHeaderListView/view/HeaderBannerView.java @@ -22,16 +22,16 @@ import java.util.ArrayList; import java.util.List; -import butterknife.Bind; +import butterknife.BindView; import butterknife.ButterKnife; public class HeaderBannerView extends HeaderViewInterface> { - @Bind(R.id.vp_banner) + @BindView(R.id.vp_banner) ViewPager vpBanner; - @Bind(R.id.ll_index_container) + @BindView(R.id.ll_index_container) LinearLayout llIndexContainer; - @Bind(R.id.rl_banner) + @BindView(R.id.rl_banner) RelativeLayout rlBanner; private static final int BANNER_TYPE = 0; diff --git a/app/src/main/java/com/sunfusheng/StickyHeaderListView/view/HeaderChannelView.java b/app/src/main/java/com/sunfusheng/StickyHeaderListView/view/HeaderChannelView.java index 4e0201c..2fa4f1f 100644 --- a/app/src/main/java/com/sunfusheng/StickyHeaderListView/view/HeaderChannelView.java +++ b/app/src/main/java/com/sunfusheng/StickyHeaderListView/view/HeaderChannelView.java @@ -12,7 +12,7 @@ import java.util.List; -import butterknife.Bind; +import butterknife.BindView; import butterknife.ButterKnife; /** @@ -20,7 +20,7 @@ */ public class HeaderChannelView extends HeaderViewInterface> { - @Bind(R.id.gv_channel) + @BindView(R.id.gv_channel) FixedGridView gvChannel; public HeaderChannelView(Activity context) { diff --git a/app/src/main/java/com/sunfusheng/StickyHeaderListView/view/HeaderFilterView.java b/app/src/main/java/com/sunfusheng/StickyHeaderListView/view/HeaderFilterView.java index 96dcad5..d6bf6ac 100644 --- a/app/src/main/java/com/sunfusheng/StickyHeaderListView/view/HeaderFilterView.java +++ b/app/src/main/java/com/sunfusheng/StickyHeaderListView/view/HeaderFilterView.java @@ -6,7 +6,7 @@ import com.sunfusheng.StickyHeaderListView.R; -import butterknife.Bind; +import butterknife.BindView; import butterknife.ButterKnife; /** @@ -14,7 +14,7 @@ */ public class HeaderFilterView extends HeaderViewInterface implements FilterView.OnFilterClickListener { - @Bind(R.id.fv_filter) + @BindView(R.id.fv_filter) FilterView fvFilter; public HeaderFilterView(Activity context) { diff --git a/app/src/main/java/com/sunfusheng/StickyHeaderListView/view/HeaderOperationView.java b/app/src/main/java/com/sunfusheng/StickyHeaderListView/view/HeaderOperationView.java index e3495a8..084a5c5 100644 --- a/app/src/main/java/com/sunfusheng/StickyHeaderListView/view/HeaderOperationView.java +++ b/app/src/main/java/com/sunfusheng/StickyHeaderListView/view/HeaderOperationView.java @@ -12,7 +12,7 @@ import java.util.List; -import butterknife.Bind; +import butterknife.BindView; import butterknife.ButterKnife; /** @@ -20,7 +20,7 @@ */ public class HeaderOperationView extends HeaderViewInterface> { - @Bind(R.id.gv_operation) + @BindView(R.id.gv_operation) FixedGridView gvOperation; public HeaderOperationView(Activity context) { diff --git a/build.gradle b/build.gradle index b4a544a..5a5531c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,10 +1,12 @@ buildscript { repositories { + mavenCentral() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.2.0' + classpath 'com.jakewharton:butterknife-gradle-plugin:8.4.0' } }