码迷,mamicode.com
首页 > 其他好文 > 详细

12月4日

时间:2014-12-06 06:40:06      阅读:171      评论:0      收藏:0      [点我收藏+]

标签: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("将要开始");
  }      

12月4日

标签:null

原文地址:http://9334777.blog.51cto.com/9324777/1586806

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!