diff --git a/library/build.gradle b/library/build.gradle index 974cc24f..e9cf4348 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -36,10 +36,6 @@ dependencies { // circle image view compile 'de.hdodenhof:circleimageview:2.1.0' - - // butter knife - compile 'com.jakewharton:butterknife:8.5.1' - annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1' } apply plugin: 'com.github.dcendents.android-maven' diff --git a/library/src/main/java/com/pchmn/materialchips/ChipView.java b/library/src/main/java/com/pchmn/materialchips/ChipView.java index 07e3aea9..8dd9f8f7 100644 --- a/library/src/main/java/com/pchmn/materialchips/ChipView.java +++ b/library/src/main/java/com/pchmn/materialchips/ChipView.java @@ -10,20 +10,16 @@ import android.support.annotation.ColorInt; import android.support.v4.content.ContextCompat; import android.util.AttributeSet; -import android.util.Log; import android.view.View; import android.widget.ImageButton; import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.TextView; -import com.pchmn.materialchips.model.Chip; import com.pchmn.materialchips.model.ChipInterface; import com.pchmn.materialchips.util.LetterTileProvider; import com.pchmn.materialchips.util.ViewUtil; -import butterknife.BindView; -import butterknife.ButterKnife; import de.hdodenhof.circleimageview.CircleImageView; public class ChipView extends RelativeLayout { @@ -32,10 +28,10 @@ public class ChipView extends RelativeLayout { // context private Context mContext; // xml elements - @BindView(R2.id.content) LinearLayout mContentLayout; - @BindView(R2.id.icon) CircleImageView mAvatarIconImageView; - @BindView(R2.id.label) TextView mLabelTextView; - @BindView(R2.id.delete_button) ImageButton mDeleteButton; + private LinearLayout mContentLayout; + private CircleImageView mAvatarIconImageView; + private TextView mLabelTextView; + private ImageButton mDeleteButton; // attributes private static final int NONE = -1; private String mLabel; @@ -72,8 +68,12 @@ public ChipView(Context context, AttributeSet attrs) { private void init(AttributeSet attrs) { // inflate layout View rootView = inflate(getContext(), R.layout.chip_view, this); - // butter knife - ButterKnife.bind(this, rootView); + + mContentLayout = (LinearLayout) rootView.findViewById(R.id.content); + mAvatarIconImageView = (CircleImageView) rootView.findViewById(R.id.icon); + mLabelTextView = (TextView) rootView.findViewById(R.id.label); + mDeleteButton = (ImageButton) rootView.findViewById(R.id.delete_button); + // letter tile provider mLetterTileProvider = new LetterTileProvider(mContext); diff --git a/library/src/main/java/com/pchmn/materialchips/ChipsInput.java b/library/src/main/java/com/pchmn/materialchips/ChipsInput.java index ba3dbd56..d220e436 100644 --- a/library/src/main/java/com/pchmn/materialchips/ChipsInput.java +++ b/library/src/main/java/com/pchmn/materialchips/ChipsInput.java @@ -11,7 +11,6 @@ import android.support.v7.widget.RecyclerView; import android.util.AttributeSet; import android.view.View; -import android.widget.EditText; import com.beloo.widget.chipslayoutmanager.ChipsLayoutManager; import com.pchmn.materialchips.adapter.ChipsAdapter; @@ -28,16 +27,13 @@ import java.util.ArrayList; import java.util.List; -import butterknife.BindView; -import butterknife.ButterKnife; - public class ChipsInput extends ScrollViewMaxHeight { private static final String TAG = ChipsInput.class.toString(); // context private Context mContext; // xml element - @BindView(R2.id.chips_recycler) RecyclerView mRecyclerView; + private RecyclerView mRecyclerView; // adapter private ChipsAdapter mChipsAdapter; // attributes @@ -87,8 +83,8 @@ public ChipsInput(Context context, AttributeSet attrs) { private void init(AttributeSet attrs) { // inflate layout View rootView = inflate(getContext(), R.layout.chips_input, this); - // butter knife - ButterKnife.bind(this, rootView); + + mRecyclerView = (RecyclerView) rootView.findViewById(R.id.chips_recycler); // attributes if(attrs != null) { diff --git a/library/src/main/java/com/pchmn/materialchips/views/DetailedChipView.java b/library/src/main/java/com/pchmn/materialchips/views/DetailedChipView.java index 766a2e92..1fd0f771 100644 --- a/library/src/main/java/com/pchmn/materialchips/views/DetailedChipView.java +++ b/library/src/main/java/com/pchmn/materialchips/views/DetailedChipView.java @@ -1,14 +1,11 @@ package com.pchmn.materialchips.views; -import android.app.Activity; import android.content.Context; import android.content.res.ColorStateList; import android.graphics.Bitmap; import android.graphics.Color; import android.graphics.PorterDuff; -import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; -import android.graphics.drawable.LayerDrawable; import android.net.Uri; import android.support.v4.content.ContextCompat; import android.util.AttributeSet; @@ -19,16 +16,10 @@ import android.widget.TextView; import com.pchmn.materialchips.R; -import com.pchmn.materialchips.R2; -import com.pchmn.materialchips.model.Chip; import com.pchmn.materialchips.model.ChipInterface; import com.pchmn.materialchips.util.ColorUtil; import com.pchmn.materialchips.util.LetterTileProvider; -import com.pchmn.materialchips.util.MyWindowCallback; -import com.pchmn.materialchips.util.ViewUtil; -import butterknife.BindView; -import butterknife.ButterKnife; import de.hdodenhof.circleimageview.CircleImageView; @@ -38,11 +29,11 @@ public class DetailedChipView extends RelativeLayout { // context private Context mContext; // xml elements - @BindView(R2.id.content) RelativeLayout mContentLayout; - @BindView(R2.id.avatar_icon) CircleImageView mAvatarIconImageView; - @BindView(R2.id.name) TextView mNameTextView; - @BindView(R2.id.info) TextView mInfoTextView; - @BindView(R2.id.delete_button) ImageButton mDeleteButton; + private RelativeLayout mContentLayout; + private CircleImageView mAvatarIconImageView; + private TextView mNameTextView; + private TextView mInfoTextView; + private ImageButton mDeleteButton; // letter tile provider private static LetterTileProvider mLetterTileProvider; // attributes @@ -68,8 +59,13 @@ public DetailedChipView(Context context, AttributeSet attrs) { private void init(AttributeSet attrs) { // inflate layout View rootView = inflate(getContext(), R.layout.detailed_chip_view, this); - // butter knife - ButterKnife.bind(this, rootView); + + mContentLayout = (RelativeLayout) rootView.findViewById(R.id.content); + mAvatarIconImageView = (CircleImageView) rootView.findViewById(R.id.avatar_icon); + mNameTextView = (TextView) rootView.findViewById(R.id.name); + mInfoTextView = (TextView) rootView.findViewById(R.id.info); + mDeleteButton = (ImageButton) rootView.findViewById(R.id.delete_button); + // letter tile provider mLetterTileProvider = new LetterTileProvider(mContext); diff --git a/library/src/main/java/com/pchmn/materialchips/views/FilterableListView.java b/library/src/main/java/com/pchmn/materialchips/views/FilterableListView.java index 8e94cd52..fad72b6e 100644 --- a/library/src/main/java/com/pchmn/materialchips/views/FilterableListView.java +++ b/library/src/main/java/com/pchmn/materialchips/views/FilterableListView.java @@ -18,22 +18,18 @@ import com.pchmn.materialchips.ChipsInput; import com.pchmn.materialchips.R; -import com.pchmn.materialchips.R2; import com.pchmn.materialchips.adapter.FilterableAdapter; import com.pchmn.materialchips.model.ChipInterface; import com.pchmn.materialchips.util.ViewUtil; import java.util.List; -import butterknife.BindView; -import butterknife.ButterKnife; - public class FilterableListView extends RelativeLayout { private static final String TAG = FilterableListView.class.toString(); private Context mContext; // list - @BindView(R2.id.recycler_view) RecyclerView mRecyclerView; + private RecyclerView mRecyclerView; private FilterableAdapter mAdapter; private List mFilterableList; // others @@ -48,8 +44,8 @@ public FilterableListView(Context context) { private void init() { // inflate layout View view = inflate(getContext(), R.layout.list_filterable_view, this); - // butter knife - ButterKnife.bind(this, view); + + mRecyclerView = (RecyclerView) view.findViewById(R.id.recycler_view); // recycler mRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));