Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
classichu committed Mar 13, 2017
1 parent b635949 commit 18fc3c6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
5 changes: 4 additions & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
app:layout_constraintTop_toTopOf="parent" />

<com.classichu.lineseditview.LinesEditView
android:layout_margin="10dp"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
android:layout_height="wrap_content"
app:classic_contentHeight="100dp"
/>

</LinearLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,13 @@ public LinesEditView(Context context, AttributeSet attrs, int defStyleAttr) {

private void init() {
View view = LayoutInflater.from(mContext).inflate(R.layout.layout_lines_edit_view, this);
id_ll_multi = (LinearLayout) view.findViewById(R.id.id_ll_lines_edit_view);
id_et_input = (EditText) view.findViewById(R.id.id_et_input);
id_tv_input = (TextView) view.findViewById(R.id.id_tv_input);

if (this.getBackground()==null){
this.setBackgroundResource(R.drawable.selector_lines_edit_view_bg);
}

id_et_input.addTextChangedListener(mTextWatcher);
id_et_input.setHint(hintText);
id_et_input.setText(contentText);
Expand All @@ -84,9 +87,11 @@ private void init() {
id_et_input.setOnFocusChangeListener(new OnFocusChangeListener() {
@Override
public void onFocusChange(View view, boolean b) {
id_ll_multi.setSelected(b);
LinesEditView.this.setSelected(b);
}
});


}

private TextWatcher mTextWatcher =new TextWatcher() {
Expand Down
2 changes: 0 additions & 2 deletions library/src/main/res/layout/layout_lines_edit_view.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/id_ll_lines_edit_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/selector_lines_edit_view_bg"
android:orientation="vertical"
>

Expand Down

0 comments on commit 18fc3c6

Please sign in to comment.