|
@@ -1,11 +1,16 @@
|
|
|
package com.sheep.gamegroup.module.search;
|
|
package com.sheep.gamegroup.module.search;
|
|
|
|
|
|
|
|
|
|
+import android.content.Context;
|
|
|
|
|
+import android.graphics.Color;
|
|
|
import android.text.TextUtils;
|
|
import android.text.TextUtils;
|
|
|
import android.view.LayoutInflater;
|
|
import android.view.LayoutInflater;
|
|
|
import android.view.View;
|
|
import android.view.View;
|
|
|
import android.view.inputmethod.EditorInfo;
|
|
import android.view.inputmethod.EditorInfo;
|
|
|
|
|
+import android.view.inputmethod.InputMethodManager;
|
|
|
|
|
+import android.widget.Button;
|
|
|
import android.widget.TextView;
|
|
import android.widget.TextView;
|
|
|
|
|
|
|
|
|
|
+import androidx.appcompat.widget.AppCompatAutoCompleteTextView;
|
|
|
import androidx.fragment.app.Fragment;
|
|
import androidx.fragment.app.Fragment;
|
|
|
|
|
|
|
|
import com.kfzs.android.view.tag.FlowLayout;
|
|
import com.kfzs.android.view.tag.FlowLayout;
|
|
@@ -148,6 +153,14 @@ public class ActSearch extends BaseContainerActivity {
|
|
|
.setTitleBackgroud(this, R.color.white_light)
|
|
.setTitleBackgroud(this, R.color.white_light)
|
|
|
.setRightBtn(this, "搜索", 0,
|
|
.setRightBtn(this, "搜索", 0,
|
|
|
v -> toSearchApp());
|
|
v -> toSearchApp());
|
|
|
|
|
+ AppCompatAutoCompleteTextView box = findViewById(R.id.box_baseactivity_search);
|
|
|
|
|
+ Button right = findViewById(R.id.btn_baseactivity_right);
|
|
|
|
|
+ right.setTextColor(Color.parseColor("#ff2ebef2"));
|
|
|
|
|
+ box.setFocusable(true);
|
|
|
|
|
+ box.setFocusableInTouchMode(true);
|
|
|
|
|
+ box.requestFocus();
|
|
|
|
|
+ InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
|
|
|
|
|
+ imm.showSoftInput(box, InputMethodManager.SHOW_IMPLICIT);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -156,6 +169,17 @@ public class ActSearch extends BaseContainerActivity {
|
|
|
onRefresh();
|
|
onRefresh();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onWindowFocusChanged(boolean hasFocus) {
|
|
|
|
|
+ super.onWindowFocusChanged(hasFocus);
|
|
|
|
|
+ if (hasFocus) {
|
|
|
|
|
+ AppCompatAutoCompleteTextView box = findViewById(R.id.box_baseactivity_search);
|
|
|
|
|
+ box.requestFocus();
|
|
|
|
|
+ InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
|
|
|
|
|
+ imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private void showKeywords() {
|
|
private void showKeywords() {
|
|
|
if (hintKeyword != null) {
|
|
if (hintKeyword != null) {
|
|
|
TitleBarUtils.getInstance().setSearchHint(ActSearch.this, hintKeyword.getKeyword());
|
|
TitleBarUtils.getInstance().setSearchHint(ActSearch.this, hintKeyword.getKeyword());
|