currently working with music selection page being worked on

This commit is contained in:
Harrison Deng 2017-10-24 18:10:41 -05:00
parent 54e9a90ac4
commit 92d122616f
3 changed files with 14 additions and 8 deletions

View File

@ -1,5 +1,6 @@
package zero1hd.rhythmbullet.graphics.ui.components;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.ui.CheckBox;
import com.badlogic.gdx.scenes.scene2d.ui.HorizontalGroup;
@ -88,6 +89,10 @@ public class MusicControls extends HorizontalGroup {
});
addActor(shuffle);
space(15);
invalidate();
debugAll();
}
@Override

View File

@ -8,6 +8,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.Image;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.scenes.scene2d.ui.Table;
import com.badlogic.gdx.scenes.scene2d.ui.VerticalGroup;
import com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup;
import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable;
import com.badlogic.gdx.utils.Disposable;
@ -29,10 +30,12 @@ public class MusicSelectable extends WidgetGroup implements Disposable {
private boolean selected;
private VerticalGroup vGroup;
public MusicSelectable(FileHandle musicFile, Preferences musicAnnotation, Skin skin, Texture defaultAlbumC) {
table = new Table(skin);
table.setBackground("holo-pane");
vGroup = new VerticalGroup();
setName(musicFile.name());
table.defaults().pad(10f);
@ -41,18 +44,16 @@ public class MusicSelectable extends WidgetGroup implements Disposable {
songInfo = new SongInfo(musicFile, musicAnnotation);
imageIcon = new Image(albumCover);
table.add(imageIcon).size(115).padTop(15).center();
table.add(imageIcon).fill();
displayName = new ScrollText(musicFile.nameWithoutExtension().replace('_', ' '), null, skin, true, false);
table.add(displayName).expandX().fillX();
table.row();
vGroup.addActor(displayName);
durationLabel = new Label("Loading...", skin, "sub-font", skin.getColor("default"));
table.add(durationLabel);
vGroup.addActor(durationLabel);
authorLabel = new Label("Loading...", skin, "sub-font", skin.getColor("default"));
table.add(authorLabel);
vGroup.addActor(authorLabel);
addActor(table);

View File

@ -119,7 +119,7 @@ public class MusicSelectionPage extends Page {
MusicSelectable selectable = new MusicSelectable(songList.getSongFileHandleFromIndex(i), musicFileAnnotation, skin, assets.get("defaultCover.png", Texture.class));
selectables.add(selectable);
songTable.add(selectable).expandX().fillX().minHeight(200f);
songTable.add(selectable).expandX().fillX().height(200f);
songTable.row();
}