@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ButterKnife.bind(this);
presenterMpl = new PresenterMpl();
presenterMpl.attach(this);
// presenterMpl.requeset("板鞋",1,10);
searchShop.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String ss = searchEdit.getText().toString();
presenterMpl.requeset(ss, 1, 10);
/* TextView textView = new TextView(MainActivity.this);
textView.setText(ss);
flowLayout.addView(textView);*/
}
});
searchMenu.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(MainActivity.this, Main2Activity.class));
}
});
}
@Override
public void showData(SereachBean mBean) {
if (mBean.getResult().size() == 0) {
searchXrecy.setVisibility(View.INVISIBLE);
} else {
Toast.makeText(this, "不为空", Toast.LENGTH_SHORT).show();
result = mBean.getResult();
searchXrecy.setLayoutManager(new GridLayoutManager(this, 2));
searchXrecy.setAdapter(new MyAdapter(this, result));
}
}
搜索
最新推荐文章于 2021-01-09 22:41:33 发布