1代码中设置margin
RelativeLayout.LayoutParams margin = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.FILL_PARENT,RelativeLayout.LayoutParams.WRAP_CONTENT);
margin.setMargins(30, 8, 0, 0);
viewHolder.tvName.setLayoutParams(margin);
margin.setMargins(30, 8, 0, 0);
viewHolder.tvName.setLayoutParams(margin);
2圆弧的效果
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android=" http://schemas.android.com/apk/res/android" >
<solid android:color="@color/areaschildrenselected"/>
<corners android:radius="8dip" />
</shape>
<shape xmlns:android=" http://schemas.android.com/apk/res/android" >
<solid android:color="@color/areaschildrenselected"/>
<corners android:radius="8dip" />
</shape>
3onkeydown
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
// TODO Auto-generated method stub
CommonUtils.log(TAG, "onKeyDown");
if(KeyEvent.ACTION_DOWN==event.getAction()){
return DoubleBack.doubleBackHanlder(this,event.getKeyCode());
}
return false;
}
public boolean dispatchKeyEvent(KeyEvent event) {
// TODO Auto-generated method stub
CommonUtils.log(TAG, "onKeyDown");
if(KeyEvent.ACTION_DOWN==event.getAction()){
return DoubleBack.doubleBackHanlder(this,event.getKeyCode());
}
return false;
}
4得到资源中的asset数据流
InputStream in = getResources().getAssets().open("ehcache.xml");//得到资源中的asset数据流
5
if(progressDialog==null){
progressDialog = new ProgressDialog(mContext);
}
progressDialog.setMessage("视频正在加载中,请稍后");
progressDialog.show();
progressDialog = new ProgressDialog(mContext);
}
progressDialog.setMessage("视频正在加载中,请稍后");
progressDialog.show();
if (progressDialog == null) {
progressDialog = ProgressDialog.show(this, null, getString(R.string.loginwait), true);
}
progressDialog.show();
progressDialog = ProgressDialog.show(this, null, getString(R.string.loginwait), true);
}
progressDialog.show();