|
|
|
|
@ -25,6 +25,7 @@ import com.fongmi.android.tv.ui.custom.CustomKeyboard; |
|
|
|
|
import com.fongmi.android.tv.ui.custom.CustomTextListener; |
|
|
|
|
import com.fongmi.android.tv.ui.custom.SpaceItemDecoration; |
|
|
|
|
import com.fongmi.android.tv.ui.custom.dialog.SiteDialog; |
|
|
|
|
import com.fongmi.android.tv.utils.Prefers; |
|
|
|
|
import com.fongmi.android.tv.utils.Utils; |
|
|
|
|
|
|
|
|
|
import java.io.IOException; |
|
|
|
|
@ -94,10 +95,12 @@ public class SearchActivity extends BaseActivity implements WordAdapter.OnClickL |
|
|
|
|
|
|
|
|
|
private void getHot() { |
|
|
|
|
mBinding.hint.setText(R.string.search_hot); |
|
|
|
|
mWordAdapter.addAll(Hot.get(Prefers.getHot())); |
|
|
|
|
OkHttp.newCall("https://api.web.360kan.com/v1/rank?cat=1").enqueue(new Callback() { |
|
|
|
|
@Override |
|
|
|
|
public void onResponse(@NonNull Call call, @NonNull Response response) throws IOException { |
|
|
|
|
List<String> items = Hot.get(response.body().string()); |
|
|
|
|
if (mWordAdapter.getItemCount() > 0) return; |
|
|
|
|
App.post(() -> mWordAdapter.addAll(items)); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|