Commit e33d96e3 authored by zhang_z's avatar zhang_z

Merge branch 'master' of 192.168.254.154:w525721508/TangKuPos

parents b265ccad f3cead13
......@@ -5,7 +5,6 @@ import android.support.v7.widget.LinearLayoutManager;
import android.view.View;
import android.widget.TextView;
import com.blankj.utilcode.util.KeyboardUtils;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentSendTickerVipBinding;
......@@ -13,7 +12,6 @@ import com.xingdata.zzdpos.model.Vip;
import com.xingdata.zzdpos.ui.sendticke.SendTicketPresenter;
import com.xingdata.zzdpos.ui.sendticke.adapter.VipAdapter;
import com.xingdata.zzdpos.ui.settle.SettleActivity;
import com.xingdata.zzdpos.util.Global;
import com.xingdata.zzdpos.util.OnClickListener;
import java.util.List;
......@@ -66,14 +64,11 @@ public class VipFragment extends BaseFragment<SendTicketPresenter, FragmentSendT
}
}
});
mViewBinding.etSearch.setOnEditorActionListener((textView, i, keyEvent) -> {
KeyboardUtils.hideSoftInput(textView);
mPresenter.searchVip(textView.getText().toString());
return false;
mViewBinding.vSearch.setOnSearchListener(keyword -> {
mViewBinding.vSearch.hideSoftInput();
mPresenter.searchVip(keyword);
});
Global.setFocus(mViewBinding.etSearch, getActivity());
// KeyboardUtils.showSoftInput(getActivity());
mViewBinding.vSearch.showSoftInput();
}
/**
......
......@@ -16,6 +16,7 @@ import com.blankj.utilcode.util.StringUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.databinding.ViewSearchBarBinding;
import com.xingdata.zzdpos.util.Global;
@SuppressLint("AppCompatCustomView")
public class SearchBar extends ConstraintLayout {
......@@ -60,7 +61,8 @@ public class SearchBar extends ConstraintLayout {
* 显示软键盘
*/
public void showSoftInput() {
KeyboardUtils.showSoftInput(mViewBinding.etSearch);
Global.setFocus(mViewBinding.etSearch,getContext());
// KeyboardUtils.showSoftInput(mViewBinding.etSearch);
}
/**
......@@ -81,6 +83,7 @@ public class SearchBar extends ConstraintLayout {
ToastUtils.showShort("请输入搜索内容");
return false;
}
KeyboardUtils.hideSoftInput(mViewBinding.etSearch);
mOnSearchListener.onSearch(str);
}
......
......@@ -20,7 +20,6 @@
<FrameLayout
android:id="@+id/fragment"
style="@style/xuline_margin"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
......
......@@ -48,29 +48,38 @@
android:src="@mipmap/back_black"
app:layout_constraintLeft_toLeftOf="parent"/>
<LinearLayout
<!--<LinearLayout-->
<!--android:layout_width="0dp"-->
<!--android:layout_height="match_parent"-->
<!--android:layout_marginEnd="@dimen/all_margin"-->
<!--app:layout_constraintBottom_toTopOf="parent"-->
<!--app:layout_constraintLeft_toRightOf="@id/btn_back"-->
<!--app:layout_constraintRight_toRightOf="parent"-->
<!--app:layout_constraintTop_toBottomOf="parent">-->
<!--<EditText-->
<!--android:id="@+id/et_search"-->
<!--style="@style/searchBarEditor"-->
<!--android:layout_width="0dp"-->
<!--android:layout_weight="1"-->
<!--android:hint="@string/vip_seach_hint"-->
<!--android:inputType="number"-->
<!--android:maxLength="11"-->
<!--android:textColor="@color/black_likui"-->
<!--android:textColorHint="@color/gray_huanggai"-->
<!--android:textSize="@dimen/all_text_size_low"-->
<!--android:visibility="gone"/>-->
<!---->
<!--</LinearLayout>-->
<com.xingdata.zzdpos.view.SearchBar
android:id="@+id/v_search"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/all_margin"
app:layout_constraintBottom_toTopOf="parent"
android:layout_height="0dp"
app:hint="@string/store_search_hint"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/btn_back"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="parent">
<EditText
android:id="@+id/et_search"
style="@style/searchBarEditor"
android:layout_width="0dp"
android:layout_weight="1"
android:hint="@string/vip_seach_hint"
android:inputType="number"
android:maxLength="11"
android:textColor="@color/black_likui"
android:textColorHint="@color/gray_huanggai"
android:textSize="@dimen/all_text_size_low"/>
</LinearLayout>
app:layout_constraintTop_toTopOf="parent" />
<View
android:layout_width="match_parent"
......
......@@ -5,7 +5,7 @@
<variable
name="onClickListener"
type="com.xingdata.zzdpos.util.OnClickListener"/>
type="com.xingdata.zzdpos.util.OnClickListener" />
</data>
......@@ -18,10 +18,11 @@
<ImageButton
android:id="@+id/iv_back"
android:layout_width="?attr/actionBarSize"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@color/transparent"
android:onClick="@{onClickListener}"
android:padding="@dimen/all_padding"
android:src="@mipmap/go_back" />
<TextView
......@@ -30,13 +31,12 @@
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="标题"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_sub_title_size"/>
android:textSize="@dimen/all_sub_title_size"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
......
......@@ -5,7 +5,7 @@
<variable
name="onClickListener"
type="com.xingdata.zzdpos.util.OnClickListener"/>
type="com.xingdata.zzdpos.util.OnClickListener" />
</data>
......@@ -19,13 +19,13 @@
<ImageButton
android:id="@+id/iv_back"
android:layout_width="?attr/actionBarSize"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@color/transparent"
android:gravity="center"
android:onClick="@{onClickListener}"
android:padding="@dimen/all_margin"
android:src="@mipmap/back_white"/>
android:padding="@dimen/all_padding"
android:src="@mipmap/back_white" />
<TextView
android:id="@+id/tv_title"
......@@ -34,8 +34,7 @@
android:layout_centerInParent="true"
android:text="标题"
android:textColor="@color/white"
android:textSize="@dimen/all_sub_title_size"
/>
android:textSize="@dimen/all_sub_title_size" />
</RelativeLayout>
......
......@@ -10,9 +10,10 @@
<ImageButton
android:id="@+id/iv_back"
android:layout_width="?attr/actionBarSize"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@mipmap/go_back" />
android:background="@mipmap/go_back"
android:padding="@dimen/all_padding" />
<TextView
android:id="@+id/tv_title"
......@@ -25,10 +26,11 @@
<ImageButton
android:id="@+id/pop_menu"
android:layout_width="60dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:background="@mipmap/pop_menu" />
android:background="@mipmap/pop_menu"
android:padding="@dimen/all_padding" />
</RelativeLayout>
......
......@@ -36,6 +36,7 @@
android:background="?attr/actionBarItemBackground"
android:contentDescription="@string/search_clear"
android:padding="@dimen/all_spacing"
android:src="@mipmap/ic_clear"
android:visibility="@{keywordLength>0?View.VISIBLE:View.GONE}"
app:layout_constraintBottom_toTopOf="parent"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment