bug fix
This commit is contained in:
@@ -343,11 +343,13 @@ public class MainActivity extends BaseActivity {
|
||||
|
||||
private final View rootView;
|
||||
private final TextView subcategoryNameItem;
|
||||
private final View bottomLineView;
|
||||
|
||||
ItemViewHolder(View view) {
|
||||
super(view);
|
||||
rootView = view;
|
||||
subcategoryNameItem = (TextView) view.findViewById(R.id.subcategoryNameItem);
|
||||
bottomLineView = (View) view.findViewById(R.id.bottomLineView);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -392,6 +394,12 @@ public class MainActivity extends BaseActivity {
|
||||
final ItemViewHolder itemHolder = (ItemViewHolder) holder;
|
||||
String name = list.get(position).getName();
|
||||
itemHolder.subcategoryNameItem.setText(name);
|
||||
if(position == list.size() - 1){
|
||||
itemHolder.bottomLineView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
else {
|
||||
itemHolder.bottomLineView.setVisibility(View.GONE);
|
||||
}
|
||||
itemHolder.rootView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
@@ -35,6 +35,7 @@ public class AppEditText extends LinearLayout implements View.OnClickListener {
|
||||
private String hint;
|
||||
private String inputType;
|
||||
private String edittextTheme;
|
||||
private int characterCount;
|
||||
|
||||
/*
|
||||
public PizzalinkEditText(LinearLayout rootView, boolean isLeftIconVisible, int leftIconId,
|
||||
@@ -57,6 +58,7 @@ public class AppEditText extends LinearLayout implements View.OnClickListener {
|
||||
TypedArray a = context.getTheme().obtainStyledAttributes(attrs, R.styleable.AppEditText, 0, 0);
|
||||
try {
|
||||
hint = a.getString(R.styleable.AppEditText_hint);
|
||||
characterCount = a.getInt(R.styleable.AppEditText_characterCount, 5-1);
|
||||
inputType = a.getString(R.styleable.AppEditText_inputType);
|
||||
edittextTheme = a.getString(R.styleable.AppEditText_edittextTheme);
|
||||
} finally {
|
||||
@@ -77,6 +79,11 @@ public class AppEditText extends LinearLayout implements View.OnClickListener {
|
||||
editText.setTextColor(navyColor);
|
||||
bottomLineLayout.setBackgroundColor(navyColor);
|
||||
}
|
||||
|
||||
if(characterCount != -1){
|
||||
int maxLength = characterCount;
|
||||
editText.setFilters(new InputFilter[] {new InputFilter.LengthFilter(maxLength)});
|
||||
}
|
||||
setInputType();
|
||||
rootView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
app:edittextTheme="navy"
|
||||
app:hint="@string/order_note"
|
||||
app:characterCount="160"
|
||||
app:inputType="multiline"/>
|
||||
|
||||
<LinearLayout
|
||||
|
||||
@@ -1,35 +1,60 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:ignore="MissingPrefix"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="40dp"
|
||||
android:paddingStart="40dp"
|
||||
android:paddingRight="40dp"
|
||||
android:paddingEnd="40dp">
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingRight="20dp"
|
||||
android:paddingEnd="20dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/red"
|
||||
android:text="- "
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:textSize="16sp"
|
||||
fontPath="fonts/Quicksand-Bold.ttf" />
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingRight="20dp"
|
||||
android:paddingEnd="20dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/subcategoryNameItem"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/black"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:textSize="16sp"
|
||||
fontPath="fonts/Quicksand-Bold.ttf" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/red"
|
||||
android:text="- "
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:textSize="16sp"
|
||||
fontPath="fonts/Quicksand-Bold.ttf" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/subcategoryNameItem"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/black"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:textSize="16sp"
|
||||
fontPath="fonts/Quicksand-Bold.ttf" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<View
|
||||
android:id="@+id/bottomLineView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/black"
|
||||
android:visibility="gone"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
<attr name="hint" format="string" />
|
||||
<attr name="inputType" format="string" />
|
||||
<attr name="lineCount" format="integer" />
|
||||
<attr name="characterCount" format="integer" />
|
||||
<attr name="edittextTheme" format="string" />
|
||||
</declare-styleable>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user