标签:null
泡泡popu
public void onClick(View v) {
final View contentView=LayoutInflater.from(MainActivity.this).inflate(R.layout.popuwindow, null);
pw = new PopupWindow(contentView, 200, 200,true);
pw.showAtLocation(btn_set, Gravity.CENTER, 0, 0);
RadioGroup rg_changestatus=(RadioGroup) contentView.findViewById(R.id.rg_changestatus);
btn_cancel = (Button) contentView.findViewById(R.id.btn_cancel);
rg_changestatus.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
RadioButton rb=(RadioButton)contentView.findViewById(group.getCheckedRadioButtonId());
tv_status.setText(rb.getText().toString());
}
});
btn_cancel.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
pw.dismiss();
抽屉slide
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
sd = (SlidingDrawer) findViewById(R.id.sd_ct);
tv = (TextView) findViewById(R.id.con);
btn = (Button) findViewById(R.id.hd);
sd.setOnDrawerCloseListener(new OnDrawerCloseListener() {
@Override
public void onDrawerClosed() {
// TODO Auto-generated method stub
btn.setText("马上出发");
}
});
sd.setOnDrawerOpenListener(new OnDrawerOpenListener() {
@Override
public void onDrawerOpened() {
btn.setText("到达目的");
}
});
sd.setOnDrawerScrollListener(new OnDrawerScrollListener() {
@Override
public void onScrollStarted() {
tv.setText("将要结束");
}
@Override
public void onScrollEnded() {
// TODO Auto-generated method stub
tv.setText("将要开始");
}
标签:null
原文地址:http://9334777.blog.51cto.com/9324777/1586806