|
|
|
@ -29,11 +29,13 @@ import com.fongmi.android.tv.ui.custom.SpaceItemDecoration; |
|
|
|
import com.fongmi.android.tv.ui.custom.dialog.SiteDialog; |
|
|
|
import com.fongmi.android.tv.ui.custom.dialog.SiteDialog; |
|
|
|
import com.fongmi.android.tv.utils.Prefers; |
|
|
|
import com.fongmi.android.tv.utils.Prefers; |
|
|
|
import com.fongmi.android.tv.utils.Utils; |
|
|
|
import com.fongmi.android.tv.utils.Utils; |
|
|
|
|
|
|
|
import com.google.common.net.HttpHeaders; |
|
|
|
|
|
|
|
|
|
|
|
import java.io.IOException; |
|
|
|
import java.io.IOException; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
import okhttp3.Call; |
|
|
|
import okhttp3.Call; |
|
|
|
|
|
|
|
import okhttp3.Headers; |
|
|
|
import okhttp3.Response; |
|
|
|
import okhttp3.Response; |
|
|
|
|
|
|
|
|
|
|
|
public class SearchActivity extends BaseActivity implements WordAdapter.OnClickListener, RecordAdapter.OnClickListener, CustomKeyboard.Callback, SiteCallback { |
|
|
|
public class SearchActivity extends BaseActivity implements WordAdapter.OnClickListener, RecordAdapter.OnClickListener, CustomKeyboard.Callback, SiteCallback { |
|
|
|
@ -98,7 +100,7 @@ public class SearchActivity extends BaseActivity implements WordAdapter.OnClickL |
|
|
|
private void getHot() { |
|
|
|
private void getHot() { |
|
|
|
mBinding.hint.setText(R.string.search_hot); |
|
|
|
mBinding.hint.setText(R.string.search_hot); |
|
|
|
mWordAdapter.addAll(Hot.get(Prefers.getHot())); |
|
|
|
mWordAdapter.addAll(Hot.get(Prefers.getHot())); |
|
|
|
OkHttp.newCall("https://api.web.360kan.com/v1/rank?cat=1").enqueue(new Callback() { |
|
|
|
OkHttp.newCall("https://api.web.360kan.com/v1/rank?cat=1", Headers.of(HttpHeaders.REFERER, "https://www.360kan.com/rank/general")).enqueue(new Callback() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void onResponse(@NonNull Call call, @NonNull Response response) throws IOException { |
|
|
|
public void onResponse(@NonNull Call call, @NonNull Response response) throws IOException { |
|
|
|
List<String> items = Hot.get(response.body().string()); |
|
|
|
List<String> items = Hot.get(response.body().string()); |
|
|
|
|