use of com.zyyoona7.lib.EasyPopup in project weibo by dingdangmao123.
the class WeicoFG method CreateView.
@Override
public void CreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState, View v) {
target.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
msg.hide(false);
Intent i = new Intent(getActivity(), Message.class);
startActivity(i);
}
});
title.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final EasyPopup mCirclePop;
mCirclePop = new EasyPopup(getActivity()).setContentView(R.layout.popmenu).setFocusAndOutsideEnable(true).createPopup();
TextView t1 = mCirclePop.getView(R.id.t1);
TextView t2 = mCirclePop.getView(R.id.t2);
TextView t3 = mCirclePop.getView(R.id.t3);
t1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mCirclePop.dismiss();
type = "new";
if (current != 1) {
reset = true;
current = 1;
} else {
reset = false;
}
title.setText("最新微博");
Refresh(1);
}
});
t2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mCirclePop.dismiss();
type = "hot";
if (current != 2) {
reset = true;
current = 2;
} else {
reset = false;
}
title.setText("热门微博");
Refresh(1);
}
});
t3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mCirclePop.dismiss();
type = "care";
if (current != 3) {
reset = true;
current = 3;
} else {
reset = false;
}
title.setText("我关注的");
Refresh(1);
}
});
mCirclePop.showAtAnchorView(v, VerticalGravity.BELOW, HorizontalGravity.ALIGN_LEFT, 0, 0);
}
});
adapter = new WeicoAdapter(data, getActivity());
tl.setLayoutManager(new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false));
tl.setAdapter(adapter);
rf.setOnRefreshListener(new OnRefreshListener() {
@Override
public void onRefresh(RefreshLayout refreshlayout) {
Refresh(1);
}
});
rf.setOnLoadmoreListener(new OnLoadmoreListener() {
@Override
public void onLoadmore(RefreshLayout refreshlayout) {
Refresh(0);
}
});
msg = new QBadgeView(getActivity());
msg.bindTarget(target).setBadgeGravity(Gravity.END | Gravity.TOP);
getMessage();
rf.autoRefresh();
}
Aggregations