Added disabled button texture, added max resolution compatibility check
This commit is contained in:
parent
173da4f6cd
commit
3d52583de2
@ -99,6 +99,14 @@ default-round-down
|
||||
orig: 12, 20
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
default-round-disabled
|
||||
rotate: false
|
||||
xy: 89, 8
|
||||
size: 12, 20
|
||||
split: 5, 5, 5, 5
|
||||
orig: 12, 20
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
default-scroll
|
||||
rotate: false
|
||||
xy: 57, 29
|
||||
|
BIN
android/assets/uiskin.png
Normal file → Executable file
BIN
android/assets/uiskin.png
Normal file → Executable file
Binary file not shown.
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 3.5 KiB |
@ -161,11 +161,12 @@ public class Polyjet extends Game {
|
||||
defaultTextButton.down = defaultSkin.getDrawable("default-round-down");
|
||||
defaultTextButton.font = defaultSkin.getFont("default-font");
|
||||
defaultTextButton.fontColor = defaultSkin.getColor("default");
|
||||
defaultTextButton.disabled = defaultSkin.getDrawable("default-round-disabled");
|
||||
defaultSkin.add("default", defaultTextButton);
|
||||
|
||||
TextButtonStyle smallTextButton = new TextButtonStyle(defaultTextButton);
|
||||
smallTextButton.font = defaultSkin.getFont("small-font");
|
||||
defaultSkin.add("small", smallTextButton);
|
||||
// TextButtonStyle smallTextButton = new TextButtonStyle(defaultTextButton);
|
||||
// smallTextButton.font = defaultSkin.getFont("small-font");
|
||||
// defaultSkin.add("small", smallTextButton);
|
||||
|
||||
TextButtonStyle textButtonLeft = new TextButtonStyle();
|
||||
textButtonLeft.up = defaultSkin.getDrawable("left-button");
|
||||
|
@ -28,12 +28,14 @@ public class MusicSelectable extends Button implements Disposable {
|
||||
WavInfo wavinfo;
|
||||
private byte[] albumWorkBytes;
|
||||
|
||||
private Image imageIcon;
|
||||
private volatile Image imageIcon;
|
||||
private Label displayName;
|
||||
private Label runTime;
|
||||
private Skin skin;
|
||||
|
||||
public MusicSelectable(FileHandle musicFile, Preferences musicData, final Skin skin, Texture defaultAlbumC) {
|
||||
super(skin, "info-button");
|
||||
this.skin = skin;
|
||||
|
||||
debug();
|
||||
|
||||
@ -65,7 +67,9 @@ public class MusicSelectable extends Button implements Disposable {
|
||||
if (songName == null || songName.isEmpty()) {
|
||||
songName = musicFile.nameWithoutExtension();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public synchronized void addInfoToPanel() {
|
||||
Gdx.app.postRunnable(new Runnable() {
|
||||
|
||||
@Override
|
||||
@ -82,6 +86,10 @@ public class MusicSelectable extends Button implements Disposable {
|
||||
}
|
||||
System.out.println("invalid or null");
|
||||
}
|
||||
float scale = getWidth()/imageIcon.getWidth();
|
||||
imageIcon.setScale(scale);
|
||||
// imageIcon.setSize(scale*imageIcon.getWidth(), scale*imageIcon.getHeight());
|
||||
|
||||
|
||||
add(imageIcon);
|
||||
|
||||
@ -89,7 +97,8 @@ public class MusicSelectable extends Button implements Disposable {
|
||||
|
||||
displayName = new Label(songName, skin);
|
||||
displayName.setWrap(true);
|
||||
add(displayName).prefWidth(getWidth()-5);
|
||||
add(displayName).prefWidth(getPrefWidth()-5).center();
|
||||
|
||||
|
||||
row();
|
||||
|
||||
|
@ -1,5 +1,8 @@
|
||||
package zero1hd.polyjet.ui.builders;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Toolkit;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.Preferences;
|
||||
import com.badlogic.gdx.scenes.scene2d.Actor;
|
||||
@ -12,6 +15,12 @@ public class SetResolutionButton extends TextButton {
|
||||
public SetResolutionButton(final int width, final int height, Skin skin, final Preferences prefs) {
|
||||
super(width + "x" + height, skin);
|
||||
|
||||
Dimension screenDim = Toolkit.getDefaultToolkit().getScreenSize();
|
||||
|
||||
if (screenDim.getWidth() < width || screenDim.getHeight() < height) {
|
||||
setDisabled(true);
|
||||
}
|
||||
|
||||
addListener(new ChangeListener() {
|
||||
|
||||
@Override
|
||||
|
@ -2,6 +2,7 @@ package zero1hd.polyjet.ui.pages;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FilenameFilter;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.Preferences;
|
||||
@ -22,7 +23,7 @@ import zero1hd.polyjet.ui.builders.MusicSelectable;
|
||||
|
||||
public class MusicSelectionPage extends Page {
|
||||
Image loading;
|
||||
volatile Table musicChoices;
|
||||
private volatile Table musicChoices;
|
||||
Preferences musicFileAnnotation;
|
||||
private Polyjet core;
|
||||
|
||||
@ -74,6 +75,8 @@ public class MusicSelectionPage extends Page {
|
||||
private int startingID;
|
||||
private Skin skin;
|
||||
private FileHandle musicDir;
|
||||
// private CountDownLatch latch;
|
||||
private volatile MusicSelectable selectable;
|
||||
|
||||
public MusicFinderRunnable(FileHandle musicDir, Skin skin, int startingID) {
|
||||
super();
|
||||
@ -82,6 +85,7 @@ public class MusicSelectionPage extends Page {
|
||||
this.skin = skin;
|
||||
this.musicDir = musicDir;
|
||||
|
||||
// latch = new CountDownLatch(1);
|
||||
}
|
||||
|
||||
|
||||
@ -98,8 +102,8 @@ public class MusicSelectionPage extends Page {
|
||||
}
|
||||
});
|
||||
for (int music = startingID; music < musicFiles.length && music < 15; music++) {
|
||||
MusicSelectable selectable = new MusicSelectable(musicFiles[music], musicFileAnnotation, skin, core.assetManager.get("defaultCover.png", Texture.class));
|
||||
musicChoices.add(selectable).prefSize(0.2f*Gdx.graphics.getWidth(), 0.8f*Gdx.graphics.getHeight());
|
||||
selectable = new MusicSelectable(musicFiles[music], musicFileAnnotation, skin, core.assetManager.get("defaultCover.png", Texture.class));
|
||||
musicChoices.add(selectable).prefSize(0.2f*getWidth(), 0.8f*getHeight());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user