|
|
|
|
@ -4,6 +4,7 @@ import android.app.Activity; |
|
|
|
|
import android.content.Intent; |
|
|
|
|
import android.text.Editable; |
|
|
|
|
import android.text.TextUtils; |
|
|
|
|
import android.util.Log; |
|
|
|
|
import android.view.KeyEvent; |
|
|
|
|
import android.view.View; |
|
|
|
|
import android.view.inputmethod.EditorInfo; |
|
|
|
|
@ -117,7 +118,7 @@ public class SearchActivity extends BaseActivity implements WordAdapter.OnClickL |
|
|
|
|
private void getSuggest(String text) { |
|
|
|
|
mBinding.hint.setText(R.string.search_suggest); |
|
|
|
|
mWordAdapter.clear(); |
|
|
|
|
OkHttp.newCall("https://tv.aiseet.atianqi.com/i-tvbin/qtv_video/search/get_search_smart_box?format=json&page_num=0&page_size=10&key=" + URLEncoder.encode(convertBopomofoToPinyin(text))).enqueue(new Callback() { |
|
|
|
|
OkHttp.newCall("https://tv.aiseet.atianqi.com/i-tvbin/qtv_video/search/get_search_smart_box?format=json&page_num=0&page_size=10&key=" + URLEncoder.encode(Trans.z2p(text))).enqueue(new Callback() { |
|
|
|
|
@Override |
|
|
|
|
public void onResponse(@NonNull Call call, @NonNull Response response) throws IOException { |
|
|
|
|
if (mBinding.keyword.getText().toString().trim().isEmpty()) return; |
|
|
|
|
@ -125,6 +126,14 @@ public class SearchActivity extends BaseActivity implements WordAdapter.OnClickL |
|
|
|
|
App.post(() -> mWordAdapter.appendAll(items)); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
OkHttp.newCall("https://suggest.video.iqiyi.com/?if=mobile&key=" + URLEncoder.encode(Trans.z2p(text))).enqueue(new Callback() { |
|
|
|
|
@Override |
|
|
|
|
public void onResponse(@NonNull Call call, @NonNull Response response) throws IOException { |
|
|
|
|
if (mBinding.keyword.getText().toString().trim().isEmpty()) return; |
|
|
|
|
List<String> items = Suggest.get(response.body().string()); |
|
|
|
|
App.post(() -> mWordAdapter.appendAll(items), 200); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|