Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display commit hash on splash #86

Merged
merged 1 commit into from
Jun 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/mahomaps/screens/Splash.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;

import mahomaps.MahoMapsApp;
import tube42.lib.imagelib.ColorUtils;

public class Splash extends Canvas {
Expand All @@ -28,15 +29,15 @@ protected void paint(Graphics g) {

final int c1 = 0xa74134;
final int c2 = 0xf8503c;

for (int i = 0; i < h; i++) {
g.setColor(ColorUtils.blend(c1, c2, i * 255 / h));
g.drawLine(0, i, w, i);
}



g.setColor(-1);

if (this.image == null) {
g.setColor(-1);
g.setFont(Font.getFont(0, Font.STYLE_BOLD, Font.SIZE_LARGE));
int x = w >> 1;
int y = h >> 1;
Expand All @@ -45,5 +46,10 @@ protected void paint(Graphics g) {
} else {
g.drawImage(image, w >> 1, h >> 1, Graphics.VCENTER | Graphics.HCENTER);
}

if (MahoMapsApp.commit != null) {
g.setFont(Font.getDefaultFont());
g.drawString(MahoMapsApp.commit, w >> 1, h, Graphics.BOTTOM | Graphics.HCENTER);
}
}
}