This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| **Bored waiting** | |
| 1. Risograph print of the green Android robot slumped in a waiting-room chair beside a phone showing a spinning loader, ticket number in hand, cobwebs forming on its antennae, fluorescent pink and teal ink, halftone grain, subject centered with wide margins, no text, 2:1 | |
| 2. Flat cartoon of the Android robot checking a wristwatch and tapping its foot in front of a phone stuck on a splash screen, thick outlines, pastel palette, impatient sweat drop, centered composition, no text, 2:1 | |
| 3. Chibi Android robot asleep on a pillow next to a phone, a snail slowly pushing a loading spinner across the screen, kawaii soft shading, white background, centered, no text, 2:1 | |
| **Aging while it loads** | |
| 4. Retro comic panel: the Android robot with a long grey beard and a walking cane still watching the same phone loading, calendar pages flying off the wall behind it, Ben-Day dots, primary colors, no lettering, 2:1 | |
| 5. Sumi-e ink painting of the Android robot as a stone statue, moss and a bird's nest on its head |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| event TypedEventHandler<object, IItemsChangedEventArgs> INotifyItemsChanged.ItemsChanged | |
| { | |
| add { _itemsChanged += value; RefreshPackages(); } // <-- the whole point | |
| remove => _itemsChanged -= value; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| process.Start(); | |
| string stdout = process.StandardOutput.ReadToEnd(); | |
| string stderr = process.StandardError.ReadToEnd(); | |
| process.WaitForExit(); // do NOT move this above the reads |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| internal sealed partial class ClearAppDataCommand : InvokableCommand | |
| { | |
| private readonly string _packageName; | |
| public ClearAppDataCommand(string packageName) | |
| { | |
| _packageName = packageName; | |
| Name = "Clear App Data"; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| buildTypes.release.proguard { | |
| configurationFiles.from("proguard-rules.pro") | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Tray( | |
| icon = clockIcon(), | |
| tooltip = "DogeClock", | |
| menu = { | |
| Item(if (isVisible) "Hide" else "Show", onClick = { isVisible = !isVisible }) | |
| Separator() | |
| Item("Exit", onClick = ::exitApplication) | |
| }, | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Serializable | |
| private data class PositionConfig(val x: Float, val y: Float) | |
| class PositionRepository { | |
| fun loadPosition(): WindowPosition? { | |
| if (!configFile.exists()) return null | |
| return try { | |
| val config = Json.decodeFromString<PositionConfig>(configFile.readText()) | |
| WindowPosition(config.x.dp, config.y.dp) | |
| } catch (e: Exception) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| val appModule = module { | |
| single<WindowStyleHelper> { | |
| if (System.getProperty("os.name").startsWith("Windows")) { | |
| WindowsWindowStyleHelper() | |
| } else { | |
| // provide macOS or Linux implementations below | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Define which Windows functions we need | |
| internal interface User32 : Library { | |
| fun FindWindowA(className: String?, windowTitle: String?): Pointer? | |
| fun GetWindowLongA(hwnd: Pointer, index: Int): Int | |
| fun SetWindowLongA(hwnd: Pointer, index: Int, newStyle: Int): Int | |
| } | |
| class WindowsWindowStyleHelper : WindowStyleHelper { | |
| // JNA loads the actual Windows DLL at runtime | |
| val user32 = Native.load("user32", User32::class.java) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ClockViewModel : ViewModel() { | |
| // .... | |
| init { | |
| viewModelScope.launch { | |
| while (true) { | |
| delay(60.seconds) | |
| _time.value = LocalTime.now().format(formatter) | |
| } | |
| } | |
| } |
NewerOlder