本文整理汇总了Java中android.widget.ListView.setBackgroundResource方法的典型用法代码示例。如果您正苦于以下问题:Java ListView.setBackgroundResource方法的具体用法?Java ListView.setBackgroundResource怎么用?Java ListView.setBackgroundResource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.ListView
的用法示例。
在下文中一共展示了ListView.setBackgroundResource方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: popupList
import android.widget.ListView; //导入方法依赖的package包/类
public popupList(Context context, int width, int height) {
super(context, width, height);
setBackgroundColor(0x66000000);
sl = new FMlyt(getContext(), Ui.cd.getHt(200), Ui.cd.getHt(300)){};
sl.setBackgroundColor(0x00000000);
sl.InCenter(width,height);
rs = new radiusSqure(sl.width - Ui.cd.getHt(4),sl.height - Ui.cd.getHt(4),0,0, Ui.cd.getHt(13));
rs.setColor(popupBack.Color0);
// addShape(rs);
rb = new radiusBorder(sl.width,sl.height,0,0, Ui.cd.getHt(2), Ui.cd.getHt(13));
rb.setColor(savebtnRingColor.Color0);
sl.addShape(rb);
presetAdapter data;
listview = new ListView(getContext()){
@Override
protected void onDraw(Canvas canvas) {
canvas.clipPath(rs.S0);
super.onDraw(canvas);
}
};
listview.setLayoutParams(new FrameLayout.LayoutParams( sl.width - Ui.cd.getHt(4), sl.height - Ui.cd.getHt(4)));
listview.setDivider(null);
listview.setX(Ui.cd.getHt(2));
listview.setY(Ui.cd.getHt(2));
listview.setBackgroundResource(0);
//listview.setBackgroundColor(com.shape.home.slider.backgroundImg.Color0);
data = new presetAdapter(){
@Override
public int getHeigtht() {
return sl.width - Ui.cd.getHt(4);
}
@Override
public void onReload(){
if(listview != null){
Ui.bk.back();
popupList.this.onReload();
}
}
};
listview.setAdapter(data);
sl.addView(listview);
addView(sl);
}
示例2: Main
import android.widget.ListView; //导入方法依赖的package包/类
public Main(Context context, int width, int height) {
super(context, width, height);
setBackgroundColor(0x00000000);
This = this;
squre sqTitle = new squre(width, Ui.cd.getHt(50),0,0);
sqTitle.setColor(titleBack.Color0);
addShape(sqTitle);
squre btmSq = new squre(width, Ui.cd.getHt(120),0,height - Ui.cd.getHt(120 + 60));
btmSq.setColor(btmBack.Color0);
addShape(btmSq);
squre sq = new squre(width,height - Ui.cd.getHt(50) - btmSq.height + - Ui.cd.getHt(60),0, Ui.cd.getHt(50));
sq.setColor(backgroundImg.Color0);
addShape(sq);
squre bmLine = new squre(width, Ui.cd.getHt(2) ,0,btmSq.y+ btmSq.height);
bmLine.setColor(backgroundImg.Color0);
addShape(bmLine);
squre volumeBack = new squre(width, Ui.cd.getHt(60-2) ,0,bmLine.y+ bmLine.height);
volumeBack.setColor(btmBack.Color0);
addShape(volumeBack);
VolumeRocker Vr = new VolumeRocker(getContext(),width,(int)volumeBack.height);
Vr.setBackgroundResource(0);
Vr.setY(volumeBack.y);
addView(Vr);
FMText title = textImg.getFMText(context,"Equalizer Presets", Ui.cd.getHt(18));
title.img.setColor(textColor.Color0);
title.InCenter(width, Ui.cd.getHt(50));
title.setX(Ui.cd.getHt(10));
addView(title);
addWhells((int) btmSq.y, (int) btmSq.height);
presetAdapter data;
listview = new ListView(getContext());
listview.setLayoutParams(new FrameLayout.LayoutParams((int)sq.width,(int)sq.height));
listview.setY(sq.y);
listview.setDivider(null);
listview.setBackgroundResource(0);
//listview.setBackgroundColor(com.shape.home.slider.backgroundImg.Color0);
data = new presetAdapter(){
@Override
public void onReload(){
if(listview != null){
refreshData();
}
}
};
listview.setAdapter(data);
addView(listview);
final radioBtn rBtn = new radioBtn(getContext(), Ui.cd.getHt(95), Ui.cd.getHt(40));
rBtn.InCenter(width, Ui.cd.getHt(50));
rBtn.setX(width - rBtn.width - Ui.cd.getHt(5));
addView(rBtn);
Ui.ef.playerEvent.addEvent(new EventCall(new int[]{playerEvents.EQ_CHANGED, Ui.ef.Event_onBind}){
@Override
public void onCall(int eventId) {
refreshData();
rBtn.switchBtn(Ui.ef.MusicPlayer.handler.EQs.isOn);
}
});
}