extract DelegateWindowCallback superclass for MyWindowCallback

This commit is contained in:
Vincent Breitmoser
2018-07-03 10:47:42 +02:00
parent 71c3b71e35
commit 355a4eaa0f
3 changed files with 165 additions and 143 deletions

View File

@@ -41,9 +41,6 @@ import com.pchmn.materialchips.views.ScrollViewMaxHeight;
public class ChipsInput extends ScrollViewMaxHeight {
// context
private Context mContext;
// xml element
private RecyclerView mRecyclerView;
// adapter
private ChipsAdapter mChipsAdapter;
// attributes
private static final int NONE = -1;
@@ -91,7 +88,7 @@ public class ChipsInput extends ScrollViewMaxHeight {
// inflate filterableListLayout
View rootView = inflate(getContext(), R.layout.chips_input, this);
mRecyclerView = rootView.findViewById(R.id.chips_recycler);
RecyclerView recyclerView = rootView.findViewById(R.id.chips_recycler);
initEditText();
@@ -132,13 +129,13 @@ public class ChipsInput extends ScrollViewMaxHeight {
}
// adapter
mChipsAdapter = new ChipsAdapter(mContext, this, mEditText, mRecyclerView);
mChipsAdapter = new ChipsAdapter(mContext, this, mEditText, recyclerView);
ChipsLayoutManager chipsLayoutManager = ChipsLayoutManager.newBuilder(mContext)
.setOrientation(ChipsLayoutManager.HORIZONTAL)
.build();
mRecyclerView.setLayoutManager(chipsLayoutManager);
mRecyclerView.setNestedScrollingEnabled(false);
mRecyclerView.setAdapter(mChipsAdapter);
recyclerView.setLayoutManager(chipsLayoutManager);
recyclerView.setNestedScrollingEnabled(false);
recyclerView.setAdapter(mChipsAdapter);
// set window callback
// will hide DetailedOpenView and hide keyboard on touch outside