柬埔寨通 v6.1.5版本的 MD5 值为:9b68581ac30883219d6a25858a099d6b
以下内容为反编译后的 SearchActivity.java 源代码,内容仅作参考
package net.duohuo.magappx.circle.circle;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewStub;
import android.widget.EditText;
import android.widget.ListAdapter;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.OnClick;
import butterknife.OnTextChanged;
import com.jianpuzhaitong.forum.R;
import net.duohuo.core.adapter.DataPage;
import net.duohuo.core.adapter.DataPageAdapter;
import net.duohuo.core.net.Task;
import net.duohuo.core.util.IUtil;
import net.duohuo.magappx.DataViewType;
import net.duohuo.magappx.common.base.MagBaseActivity;
import net.duohuo.magappx.common.view.MagListView;
public class SearchActivity extends MagBaseActivity implements DataPage.OnLoadSuccessCallBack {
private DataPageAdapter adapter;
@BindView(R.id.content)
EditText contentV;
View headBoxV;
private View headView;
@BindView(R.id.listview)
MagListView listView;
@BindView(R.id.search_clear)
View searchClearV;
TextView titleV;
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.activity_search_topic_all);
((ViewStub) findViewById(R.id.empty_box)).inflate();
View findViewById = findViewById(R.id.listview_empty);
((TextView) findViewById.findViewById(R.id.list_empty_text)).setText("暂无相关圈子");
this.listView.setEmptyView(findViewById);
setDataList();
this.contentV.setHint(getString(R.string.search_topic_hint));
this.contentV.setOnKeyListener(new View.OnKeyListener() {
@Override
public boolean onKey(View view, int i, KeyEvent keyEvent) {
if (keyEvent.getKeyCode() != 66) {
return false;
}
IUtil.hideSoftInput(SearchActivity.this.contentV);
return false;
}
});
this.contentV.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
if (i != 3) {
return false;
}
SearchActivity.this.toNet();
return false;
}
});
}
private void setDataList() {
this.listView.setBackgroundResource(R.color.white);
View inflate = LayoutInflater.from(this).inflate(R.layout.data_view_circle_title, (ViewGroup) null);
this.headView = inflate;
this.headBoxV = inflate.findViewById(R.id.box);
TextView textView = (TextView) this.headView.findViewById(R.id.title);
this.titleV = textView;
textView.setText("");
this.listView.addHeaderView(this.headView);
this.headBoxV.setVisibility(8);
toNet();
}
@Override
public void onLoadSuccess(Task task, int i) {
if (task.getResult().success() && i == 1 && !TextUtils.isEmpty(this.contentV.getText().toString())) {
this.titleV.setText("与\"" + this.contentV.getText().toString() + "\"相关的圈子");
}
}
@OnTextChanged({R.id.content})
public void onTextChanged() {
this.searchClearV.setVisibility(!TextUtils.isEmpty(this.contentV.getText().toString()) ? 0 : 8);
this.headBoxV.setVisibility(TextUtils.isEmpty(this.contentV.getText().toString()) ? 8 : 0);
}
public void toNet() {
if (TextUtils.isEmpty(this.contentV.getText().toString())) {
return;
}
DataPageAdapter dataPageAdapter = new DataPageAdapter(this, "https://app.jpztong.com/mag/circle/v1/circle/circleNewList", DataViewType.circle_item);
this.adapter = dataPageAdapter;
dataPageAdapter.param("name", this.contentV.getText().toString());
this.adapter.next();
this.adapter.singlePage();
this.adapter.addOnLoadSuccessCallBack(this);
this.listView.setAdapter((ListAdapter) this.adapter);
}
@OnClick({R.id.search_clear})
public void onClear(View view) {
this.contentV.setText("");
}
@OnClick({R.id.search})
public void cacelClick(View view) {
toNet();
}
@OnClick({R.id.icon_navi_back})
public void cancel(View view) {
finish();
}
}