Java Code Examples for android.widget.ListView.setBackgroundResource()

The following are Jave code examples for showing how to use setBackgroundResource() of the android.widget.ListView class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: Android-Music-Player   File: popupList.java   View Source Code Vote up 4 votes
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);
}
 
Example 2
Project: Android-Music-Player   File: Main.java   View Source Code Vote up 4 votes
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);
        }
    });

}