Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove butter knife #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
20 changes: 10 additions & 10 deletions library/src/main/java/com/pchmn/materialchips/ChipView.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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;
Expand Down Expand Up @@ -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);

Expand Down
10 changes: 3 additions & 7 deletions library/src/main/java/com/pchmn/materialchips/ChipsInput.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;


Expand All @@ -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
Expand All @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<? extends ChipInterface> mFilterableList;
// others
Expand All @@ -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));
Expand Down