App Android: tambah ikon launcher (hijau zamrud, grafik putih, badge Rp)

This commit is contained in:
2026-09-02 16:38:47 +07:00
parent 5ab72678a3
commit 3c34e86641
10 changed files with 152 additions and 1 deletions

View File

@@ -3,7 +3,7 @@
<application <application
android:label="Saat Invest" android:label="Saat Invest"
android:name="${applicationName}" android:name="${applicationName}"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/launcher_icon"
android:usesCleartextTraffic="true"> android:usesCleartextTraffic="true">
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View File

@@ -1,6 +1,14 @@
# Generated by pub # Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile # See https://dart.dev/tools/pub/glossary#lockfile
packages: packages:
archive:
dependency: transitive
description:
name: archive
sha256: ace891da0862b0e4cabbb064ee3fd87b2728b898949fdb366d83fe98342c9f19
url: "https://pub.dev"
source: hosted
version: "4.2.0"
args: args:
dependency: transitive dependency: transitive
description: description:
@@ -33,6 +41,22 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.4.1" version: "1.4.1"
checked_yaml:
dependency: transitive
description:
name: checked_yaml
sha256: "959525d3162f249993882720d52b7e0c833978df229be20702b33d48d91de70f"
url: "https://pub.dev"
source: hosted
version: "2.0.4"
cli_util:
dependency: transitive
description:
name: cli_util
sha256: ff6785f7e9e3c38ac98b2fb035701789de90154024a75b6cb926445e83197d1c
url: "https://pub.dev"
source: hosted
version: "0.4.2"
clock: clock:
dependency: transitive dependency: transitive
description: description:
@@ -102,6 +126,14 @@ packages:
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
flutter_launcher_icons:
dependency: "direct dev"
description:
name: flutter_launcher_icons
sha256: "10f13781741a2e3972126fae08393d3c4e01fa4cd7473326b94b72cf594195e7"
url: "https://pub.dev"
source: hosted
version: "0.14.4"
flutter_lints: flutter_lints:
dependency: "direct dev" dependency: "direct dev"
description: description:
@@ -192,6 +224,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "4.1.2" version: "4.1.2"
image:
dependency: transitive
description:
name: image
sha256: "1976370a4df3091bb0f72409c187ad1f9132a818bc6b95ca59c0bae1c75c688e"
url: "https://pub.dev"
source: hosted
version: "4.9.2"
intl: intl:
dependency: "direct main" dependency: "direct main"
description: description:
@@ -224,6 +264,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.0.0" version: "1.0.0"
json_annotation:
dependency: transitive
description:
name: json_annotation
sha256: "2a743920d81b7910627f68ee2c9ac1fc0bfee32b9fc3403587d7c6791ca12f80"
url: "https://pub.dev"
source: hosted
version: "4.12.0"
leak_tracker: leak_tracker:
dependency: transitive dependency: transitive
description: description:
@@ -376,6 +424,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.8" version: "2.1.8"
posix:
dependency: transitive
description:
name: posix
sha256: bc1bad54ad2b735816e31f8d4600cfde6c7839975085ddfbca48b6c9f7c4044e
url: "https://pub.dev"
source: hosted
version: "6.5.2"
pub_semver: pub_semver:
dependency: transitive dependency: transitive
description: description:

View File

@@ -48,6 +48,7 @@ dev_dependencies:
# package. See that file for information about deactivating specific lint # package. See that file for information about deactivating specific lint
# rules and activating additional ones. # rules and activating additional ones.
flutter_lints: ^6.0.0 flutter_lints: ^6.0.0
flutter_launcher_icons: ^0.14.4
# For information on the generic Dart part of this file, see the # For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec # following page: https://dart.dev/tools/pub/pubspec
@@ -60,6 +61,14 @@ flutter:
# the material Icons class. # the material Icons class.
uses-material-design: true uses-material-design: true
assets:
- assets/icon/app_icon.png
flutter_launcher_icons:
android: "launcher_icon"
image_path: "assets/icon/app_icon.png"
min_sdk_android: 21
# To add assets to your application, add an assets section, like this: # To add assets to your application, add an assets section, like this:
# assets: # assets:
# - images/a_dot_burr.jpeg # - images/a_dot_burr.jpeg

86
scripts/gen_icon.py Normal file
View File

@@ -0,0 +1,86 @@
#!/usr/bin/env python3
"""Generate app icon for Saat Invest (1024x1024, anti-aliased 4x supersample).
Desain: bg hijau zamrud gradient, garis grafik naik putih tebal, titik akhir,
badge 'Rp' kecil. Simpan ke flutter/assets/icon/app_icon.png."""
import math
from PIL import Image, ImageDraw, ImageFont
SS = 4 # supersample factor
SIZE = 1024
W = H = SIZE * SS
# --- background gradient (emerald) ---
top = (0x16, 0x8a, 0x63) # lebih terang
bot = (0x07, 0x53, 0x3a) # lebih gelap
img = Image.new('RGB', (W, H))
px = img.load()
for y in range(H):
t = y / (H - 1)
r = int(top[0] + (bot[0] - top[0]) * t)
g = int(top[1] + (bot[1] - top[1]) * t)
b = int(top[2] + (bot[2] - top[2]) * t)
for x in range(W):
px[x, y] = (r, g, b)
d = ImageDraw.Draw(img)
WHITE = (255, 255, 255, 255)
SOFT = (255, 255, 255, 128)
def pt(x, y):
"""convert normalized (0..1) to supersampled px coords."""
return (x * W, y * H)
# --- line chart (naik) ---
# area chart di tengah (safe zone); baseline 0.78 -> puncak 0.34
line_pts = [
(0.18, 0.72),
(0.36, 0.58),
(0.52, 0.62),
(0.68, 0.46),
(0.82, 0.34),
]
pts_px = [pt(x, y) for x, y in line_pts]
# stroke tebal dengan join bulat
lw = int(0.078 * W)
d.line(pts_px, fill=WHITE, width=lw, joint='curve')
# titik pada tiap vertex (bulatan kecil)
r = int(0.042 * W)
for (x, y) in pts_px:
d.ellipse([x - r, y - r, x + r, y + r], fill=WHITE)
# area di bawah garis (fill lembut)
base_y = 0.80 * H
poly = [(pts_px[0][0], base_y)] + list(pts_px) + [(pts_px[-1][0], base_y)]
overlay = Image.new('RGBA', (W, H), (0, 0, 0, 0))
od = ImageDraw.Draw(overlay)
od.polygon(poly, fill=(255, 255, 255, 45))
img = Image.alpha_composite(img.convert('RGBA'), overlay)
d = ImageDraw.Draw(img)
# --- badge 'Rp' ---
# posisikan di kiri-atas dari ujung grafik, tetap dalam safe zone
font_path = '/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf'
fsize = int(0.105 * W)
f = ImageFont.truetype(font_path, fsize)
text = 'Rp'
bbox = d.textbbox((0, 0), text, font=f)
tw = bbox[2] - bbox[0]
th = bbox[3] - bbox[1]
# badge bulat: di atas segmen terakhir, kiri dari titik ujung
bcx = pts_px[-2][0] * 0.92 + pts_px[-1][0] * 0.08 - 0.10 * W
bcy = pts_px[-2][1] * 0.5 + pts_px[-1][1] * 0.5 - 0.20 * H
br = int(0.105 * W)
d.ellipse([bcx - br, bcy - br, bcx + br, bcy + br], fill=(255, 255, 255, 240))
# teks Rp hijau tua di badge
d.text((bcx - tw / 2 - bbox[0], bcy - th / 2 - bbox[1]), text,
font=f, fill=(0x07, 0x53, 0x3a, 255))
# --- downscale to 1024 (Lanczos) ---
out = img.resize((SIZE, SIZE), Image.Resampling.LANCZOS).convert('RGB')
import os
os.makedirs('flutter/assets/icon', exist_ok=True)
out.save('flutter/assets/icon/app_icon.png')
print('saved flutter/assets/icon/app_icon.png', out.size)