Open search results when clicking a trending search.

This commit is contained in:
Alex Ning 2021-07-18 22:43:58 +08:00
parent f77ba0ef23
commit 3ecb39bc3e

View File

@ -1,5 +1,6 @@
package ml.docilealligator.infinityforreddit.activities; package ml.docilealligator.infinityforreddit.activities;
import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
@ -144,7 +145,10 @@ public class TrendingActivity extends BaseActivity {
dataSavingMode, disableImagePreview, new TrendingSearchRecyclerViewAdapter.ItemClickListener() { dataSavingMode, disableImagePreview, new TrendingSearchRecyclerViewAdapter.ItemClickListener() {
@Override @Override
public void onClick(TrendingSearch trendingSearch) { public void onClick(TrendingSearch trendingSearch) {
Intent intent = new Intent(TrendingActivity.this, SearchResultActivity.class);
intent.putExtra(SearchResultActivity.EXTRA_QUERY, trendingSearch.queryString);
intent.putExtra(SearchResultActivity.EXTRA_TRENDING_SOURCE, "trending");
startActivity(intent);
} }
}); });
recyclerView.setLayoutManager(new LinearLayoutManager(this)); recyclerView.setLayoutManager(new LinearLayoutManager(this));