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