| | |
| | | import android.widget.TextView; |
| | | import android.widget.Toast; |
| | | |
| | | import com.androidquery.AQuery; |
| | | import com.google.gson.FieldNamingPolicy; |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.google.gson.reflect.TypeToken; |
| | | import com.lcjian.library.util.ManifestDataUtil; |
| | | import com.lcjian.library.util.common.StringUtils; |
| | | import com.lcjian.library.widget.FlowLayout; |
| | | import com.lcjian.library.widget.MyGridView; |
| | |
| | | import com.weikou.beibeivideo.entity.ad.AdPositionEnum; |
| | | import com.weikou.beibeivideo.entity.ad.ExpressAdContainer; |
| | | import com.weikou.beibeivideo.ui.BaseActivity; |
| | | import com.weikou.beibeivideo.ui.common.CommonFragmentActivity; |
| | | import com.weikou.beibeivideo.ui.common.GridVideoAdapter1; |
| | | import com.weikou.beibeivideo.ui.main.MainActivity; |
| | | import com.weikou.beibeivideo.ui.video.SuggestKeysAdapter; |
| | | import com.weikou.beibeivideo.util.BeibeiConstant; |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.util.DimenUtils; |
| | | import com.weikou.beibeivideo.util.ad.AdUtil; |
| | | import com.weikou.beibeivideo.util.ad.ExpressAdManager; |
| | | import com.weikou.beibeivideo.util.goldcorn.GoldCornUtil; |
| | | import com.weikou.beibeivideo.util.ui.TopStatusSettings; |
| | | |
| | | import org.apache.http.Header; |
| | |
| | | |
| | | private String value = ""; |
| | | |
| | | private boolean touchSearchInput = false; |
| | | private AQuery mAQuery; |
| | | |
| | | |
| | | private void initView() { |
| | | fl_advertisement = findViewById(R.id.fl_advertisement); |
| | |
| | | ll_search_history = findViewById(R.id.ll_search_history); |
| | | fl_suggest = findViewById(R.id.fl_suggest); |
| | | ll_search_rank = findViewById(R.id.ll_search_rank); |
| | | mAQuery = new AQuery(this); |
| | | } |
| | | |
| | | @Override |
| | |
| | | if (actionId == EditorInfo.IME_ACTION_SEARCH) { |
| | | |
| | | if (StringUtils.isEmpty(et_search_key.getEditableText() |
| | | .toString()) && StringUtils.isEmpty(et_search_key.getHint() |
| | | .toString())) { |
| | | + "") && StringUtils.isEmpty(et_search_key.getHint() + "")) { |
| | | Toast.makeText(SearchActivity.this, "请输入搜索内容!", Toast.LENGTH_LONG).show(); |
| | | return false; |
| | | } else { |
| | | if (!StringUtils.isEmpty(et_search_key.getEditableText() |
| | | .toString())) { |
| | | + "")) { |
| | | jumpToSearch(et_search_key.getEditableText() |
| | | .toString()); |
| | | + ""); |
| | | } else { |
| | | jumpToSearch(et_search_key.getHint() + ""); |
| | | } |
| | |
| | | }); |
| | | |
| | | et_search_key.setHint(getIntent().getStringExtra("key")); |
| | | mAQuery.id(R.id.iv_short_video).clicked(new OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | startActivity(new Intent(SearchActivity.this, MainActivity.class).putExtra("position", 0+"").putExtra("cposition", 1+"")); |
| | | finish(); |
| | | } |
| | | }); |
| | | |
| | | getHotSearch(); |
| | | getHistorySearch(); |
| | |
| | | } else { |
| | | gv_hot_search.setVisibility(View.VISIBLE); |
| | | } |
| | | |
| | | gv_hot_search.setAdapter(new HotSearchAdapter( |
| | | hotSearchs, true)); |
| | | } else { |
| | |
| | | |
| | | // 1.加载广告,先设置加载上下文环境和条件 |
| | | private void initAdvertisement() { |
| | | //vivo无广告 |
| | | // if ("vivo".equalsIgnoreCase(ManifestDataUtil.getAppMetaData(getApplicationContext(), "UMENG_CHANNEL"))) { |
| | | // return; |
| | | // } |
| | | |
| | | AdUtil.AD_TYPE adType1 = AdUtil.getAdType(getApplicationContext(), AdPositionEnum.videoSearch); |
| | | if (adType1 == AdUtil.AD_TYPE.gdt) { |
| | | adType1 = AdUtil.AD_TYPE.gdt2; |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
| | | }); |
| | | } |
| | |
| | | Intent intent = new Intent(SearchActivity.this, |
| | | SearchResultActivity.class); |
| | | intent.putExtra("key", key); |
| | | if (getIntent() != null) { |
| | | intent.putExtra("goldcorn", getIntent().getStringExtra("goldcorn")); |
| | | getIntent().removeExtra("goldcorn"); |
| | | } |
| | | startActivity(intent); |
| | | } |
| | | |
| | |
| | | layoutInflater = LayoutInflater.from(context); |
| | | } |
| | | |
| | | //最多8个 |
| | | @Override |
| | | public int getCount() { |
| | | return mList == null ? 0 : mList.size(); |
| | | return mList == null ? 0 : (mList.size()>8?8:mList.size()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | if (position % 2 == 0) { |
| | | viewHolder.tv_rank.setText((position / 2 + 1) + ""); |
| | | } else { |
| | | viewHolder.tv_rank.setText((mList.size() / 2 + (position + 1) / 2) + ""); |
| | | viewHolder.tv_rank.setText((getCount() / 2 + (position + 1) / 2) + ""); |
| | | } |
| | | viewHolder.tv_content.setText(mList.get(position)); |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | protected void onDestroy() { |
| | | super.onDestroy(); |
| | | |
| | | } |
| | | } |