修改测试问题

This commit is contained in:
18401019693
2022-08-09 17:44:44 +08:00
parent a3e647d74b
commit c3a4b57e18
5 changed files with 26 additions and 7 deletions

View File

@@ -66,6 +66,12 @@ public class SearchActivity extends AbsActivity {
transaction.replace(R.id.context_layout, searchRecommendFragment);
transaction.commit();
mEditText = findViewById(R.id.edit);
findViewById(R.id.btn_delete).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mEditText.setText("");
}
});
mEditText.setOnEditorActionListener(onEditorActionListener);
//退出检索页面保存搜索记录
findViewById(R.id.btn_back).setOnClickListener(new View.OnClickListener() {

View File

@@ -37,8 +37,9 @@
<EditText
android:id="@+id/edit"
android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@null"
android:hint="@string/search_hint"
android:imeActionLabel="@string/search"
@@ -49,6 +50,14 @@
android:textColor="@color/textColor"
android:textColorHint="@color/gray3"
android:textSize="15sp" />
<ImageView
android:id="@+id/btn_delete"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="center_vertical"
android:layout_marginRight="10dp"
android:src="@mipmap/icon_quxiao" />
</LinearLayout>
<TextView

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB