From 92d122616f114d633f9275688c8ff70bdc46dc67 Mon Sep 17 00:00:00 2001 From: Recrown Date: Tue, 24 Oct 2017 18:10:41 -0500 Subject: [PATCH] currently working with music selection page being worked on --- .../graphics/ui/components/MusicControls.java | 5 +++++ .../graphics/ui/components/MusicSelectable.java | 15 ++++++++------- .../graphics/ui/pages/MusicSelectionPage.java | 2 +- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/core/src/zero1hd/rhythmbullet/graphics/ui/components/MusicControls.java b/core/src/zero1hd/rhythmbullet/graphics/ui/components/MusicControls.java index 7df6860..6e4a415 100755 --- a/core/src/zero1hd/rhythmbullet/graphics/ui/components/MusicControls.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/components/MusicControls.java @@ -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 diff --git a/core/src/zero1hd/rhythmbullet/graphics/ui/components/MusicSelectable.java b/core/src/zero1hd/rhythmbullet/graphics/ui/components/MusicSelectable.java index 0644a26..f2e54a9 100755 --- a/core/src/zero1hd/rhythmbullet/graphics/ui/components/MusicSelectable.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/components/MusicSelectable.java @@ -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); diff --git a/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MusicSelectionPage.java b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MusicSelectionPage.java index 6286a12..a5d9850 100755 --- a/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MusicSelectionPage.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MusicSelectionPage.java @@ -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(); }