|
1 | 1 | # HangoverClock |
2 | | -This is a clock app/widget using the previously tested new time display from my [Stopwatch](https://github.com/programminghoch10/Stopwatch) |
3 | 2 |
|
4 | | -_Currently this app is in alpha stadium, don't expect it to work, maybe look at latest commits to know how good it works yet._ |
| 3 | +Welcome to HangoverClock, the only clock which displays the real time in an unrealistic way! |
5 | 4 |
|
6 | | -[Download APK](https://github.com/programminghoch10/HangoverClock/raw/master/app/release/app-release.apk) |
| 5 | +If you just want to see what this widget looks like now, |
| 6 | +please click [here](https://github.com/programminghoch10/HangoverClock#the-next-generation) |
| 7 | + |
| 8 | +[Download the newest APK](https://github.com/programminghoch10/HangoverClock/raw/master/app/release/app-release.apk) |
| 9 | +or look at the |
| 10 | +[latest stable releases](https://github.com/programminghoch10/HangoverClock/releases) |
| 11 | + |
| 12 | +For Wear OS Users, please look [here](https://github.com/programminghoch10/HangoverClock/tree/wear) |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | +## What makes HangoverClock special? |
| 18 | + |
| 19 | +It all started with this meme: |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | +"You will meet your girlfriend today at 11" and the clock shows 10:65. |
| 24 | + |
| 25 | +I thought this needs to get real. |
| 26 | +Its obvious that 10:65 would actually be 11:05. |
| 27 | + |
| 28 | +My first test of this was my [Stopwatch](https://github.com/programminghoch10/Stopwatch). |
| 29 | + |
| 30 | +To describe how many minutes the clock should go over the full hour, I used the word "Overhang". |
| 31 | +An Overhang of 0 would result in the clock being totally normal. |
| 32 | +Any Overhang above 0 would result in the clock counting over 60 until the Overhang is reached, at which point it shows the real time again. |
| 33 | +E.g. With an overhang of 10 the clock would go up to 10:69 and the next minute to 11:10. |
| 34 | +Of course you could also go insane with this setting, which results in ridiculous clocks like 03:384829323 |
| 35 | +(Yes my friend [@IlijazM](https://github.com/IlijazM) actually did that). |
| 36 | + |
| 37 | +And because of that variable, which makes the clock unique, its named HangoverClock. |
| 38 | + |
| 39 | +## Good old times |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | +This was HangoverClock "Toxic". A simple widget which displayed the time. |
| 45 | +You were able to modify the Overhang, by clicking in the middle once. |
| 46 | +Then the current overhang was displayed and you could increase or decrease it by clicking the + or - button. |
| 47 | +Also the text was always the same size, no matter how big the widget was resized too. |
| 48 | + |
| 49 | +So my friends inspired me saying the idea is amazing, but the clocks design sucks. So I needed to do something about it. |
| 50 | + |
| 51 | +## The next generation |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | +(background not included) |
| 56 | + |
| 57 | +Here is HangoverClock "Dynamite". |
| 58 | + |
| 59 | +Dynamite brings a lot of new features: |
| 60 | +First of there are fonts. Around 20 fonts (more incoming) are just waiting for amazing clock widgets to be created. |
| 61 | +With the freely choosable color (16.777.216 combinations) you can select the most fitting for your background. |
| 62 | +And you can enable a date to be shown below the clock, which **also has the ability to overhang**! |
| 63 | +Also you can now choose whether to use 12 or 24h time format, or use the system setting. |
| 64 | + |
| 65 | +When creating the widget on your home launcher the app greets you with a settings menu, |
| 66 | +which lets you easily set up the widget as you like it. |
| 67 | + |
| 68 | +Also you are now able to not choose one Overhang, but all 4 seperatly. Those are: |
| 69 | +* Minutes |
| 70 | +* Hours |
| 71 | +* Days |
| 72 | +* Months |
| 73 | +* _Seconds coming soon (maybe)_ |
| 74 | + |
| 75 | +Same thing as always, |
| 76 | +hours defines how much to go over 12/24h mark, |
| 77 | +days defines how much to go over a month |
| 78 | +and months defines how much to go over a year. |
| 79 | + |
| 80 | +[@IlijazM](https://github.com/IlijazM) im expecting you to live in 2017 :) |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | +***Special info for 12h users:*** |
| 85 | + |
| 86 | +Overhang calculation turns out to be really difficult and confusing in the 12h format. |
| 87 | +That's why whole calculation happens in 24h format and then gets later subtracted down, |
| 88 | +if the hour field is between or equal of 12+houroverhang and 24. |
| 89 | +Try setting houroverhang to 0 or 1 and watch what suits you better. |
| 90 | +*This behaviour is only relevant when using the date,* |
| 91 | +so please remember that using the 12h setting may not reflect the real time! |
| 92 | +But maybe nobody will notice... |
| 93 | + |
| 94 | +## The Future |
| 95 | + |
| 96 | +I'm always trying to leave as much options open as possible, but at some point there are too much settings for the user to choose. |
| 97 | +Apple already learned that ;) So its probably not getting more customizable in regards to the current features, |
| 98 | +but I'm always thinking of new features. |
| 99 | +I'm always on the quest to make this the best HangoverClock ever. |
| 100 | + |
| 101 | +## Code Stuff |
| 102 | + |
| 103 | +* All calculations happen inside the Class WidgetGenerator. |
| 104 | +* The only public method is generateWidget, which returns a Bitmap Image. |
| 105 | +* The fonts get dynamically collected from all available resource files |
| 106 | + and saved in a static String array within the ClockWidgetProvider class. |
| 107 | +* The sharedPreference keys are defined in preferencekeys.xml and their defaults in preferencekeydefaults.xml. |
| 108 | + * sharedPreferences are saved in the format key and directly appended widget ID. |
| 109 | + * If a key is not defined its default value is assumed and only gets saved when not default or when alwayssavepreferences bool is active. |
| 110 | +* if one of the widgets has seconds enabled, the setalarmmanager method will request intent for one second instead of one second. |
| 111 | + * That behaviour is dependent on sharedPreferences key "increaserefreshrate". |
| 112 | + * That key will be determined on every clock update by looping though all widgets and looking if any has seconds enabled. |
| 113 | + |
| 114 | +## Thanksgiving |
| 115 | + |
| 116 | +Thanks to all my friends, who motivated me to do this. |
| 117 | +Also thanks to my laptop, which crashed 2 times with literally nothing saved to disk. |
0 commit comments