Add all project files and configuration 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
93 lines
3.0 KiB
Python
93 lines
3.0 KiB
Python
#!/usr/bin/env python3
|
|
|
|
import os
|
|
from PIL import Image, ImageDraw, ImageFont
|
|
import sys
|
|
|
|
def create_icon(size, filename):
|
|
"""Create a simple streaming app icon"""
|
|
# Create image with transparent background
|
|
img = Image.new('RGBA', (size, size), (0, 0, 0, 0))
|
|
draw = ImageDraw.Draw(img)
|
|
|
|
# Background circle - dark blue gradient effect
|
|
margin = size // 10
|
|
draw.ellipse([margin, margin, size-margin, size-margin],
|
|
fill=(25, 25, 112, 255), outline=(70, 130, 180, 255), width=2)
|
|
|
|
# Play button triangle
|
|
play_margin = size // 4
|
|
play_size = size - 2 * play_margin
|
|
points = [
|
|
(play_margin + play_size // 4, play_margin),
|
|
(play_margin + play_size // 4, play_margin + play_size),
|
|
(play_margin + 3 * play_size // 4, play_margin + play_size // 2)
|
|
]
|
|
draw.polygon(points, fill=(255, 255, 255, 255))
|
|
|
|
# Save image
|
|
img.save(filename, 'PNG')
|
|
print(f"Created icon: {filename} ({size}x{size})")
|
|
|
|
def create_adaptive_icon(filename, size):
|
|
"""Create adaptive icon (no background)"""
|
|
img = Image.new('RGBA', (size, size), (0, 0, 0, 0))
|
|
draw = ImageDraw.Draw(img)
|
|
|
|
# Center play button
|
|
margin = size // 4
|
|
play_size = size - 2 * margin
|
|
points = [
|
|
(margin + play_size // 4, margin),
|
|
(margin + play_size // 4, margin + play_size),
|
|
(margin + 3 * play_size // 4, margin + play_size // 2)
|
|
]
|
|
draw.polygon(points, fill=(255, 255, 255, 255))
|
|
|
|
# Add decorative circle
|
|
circle_margin = size // 8
|
|
draw.ellipse([circle_margin, circle_margin, size-circle_margin, size-circle_margin],
|
|
fill=None, outline=(100, 149, 237, 255), width=3)
|
|
|
|
img.save(filename, 'PNG')
|
|
print(f"Created adaptive icon: {filename} ({size}x{size})")
|
|
|
|
def main():
|
|
# Define icon sizes and paths
|
|
icons = [
|
|
('app/src/main/res/mipmap-mdpi/ic_launcher.png', 48),
|
|
('app/src/main/res/mipmap-hdpi/ic_launcher.png', 72),
|
|
('app/src/main/res/mipmap-xhdpi/ic_launcher.png', 96),
|
|
('app/src/main/res/mipmap-xxhdpi/ic_launcher.png', 144),
|
|
('app/src/main/res/mipmap-xxxhdpi/ic_launcher.png', 192),
|
|
]
|
|
|
|
round_icons = [
|
|
('app/src/main/res/mipmap-mdpi/ic_launcher_round.png', 48),
|
|
('app/src/main/res/mipmap-hdpi/ic_launcher_round.png', 72),
|
|
('app/src/main/res/mipmap-xhdpi/ic_launcher_round.png', 96),
|
|
('app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png', 144),
|
|
('app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png', 192),
|
|
]
|
|
|
|
adaptive_icons = [
|
|
('app/src/main/res/drawable/ic_launcher_foreground.xml', 108), # Not using PIL for XML
|
|
]
|
|
|
|
print("Creating app icons...")
|
|
|
|
# Create regular icons
|
|
for filename, size in icons:
|
|
create_icon(size, filename)
|
|
|
|
# Create round icons
|
|
for filename, size in round_icons:
|
|
create_icon(size, filename)
|
|
|
|
# Create adaptive icon foreground
|
|
create_adaptive_icon('app/src/main/res/drawable/ic_launcher_foreground.png', 108)
|
|
|
|
print("All icons created successfully!")
|
|
|
|
if __name__ == "__main__":
|
|
main() |