Skip to content

Commit 4b3466e

Browse files
Merge branch 'dev'
2 parents 4724669 + 54788ec commit 4b3466e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1658
-559
lines changed

README.md

Lines changed: 59 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Welcome to HangoverClock, the only clock which displays the real time in an unrealistic way!
44

55
If you just want to see what this widget looks like now,
6-
please click [here](https://github.com/programminghoch10/HangoverClock#the-next-generation)
6+
please take a look at the [screenshots](https://github.com/programminghoch10/HangoverClock#screenshots)
77

88
[Download from Play Store](https://play.google.com/store/apps/details?id=com.JJ.hangoverclock)
99

@@ -24,8 +24,8 @@ It all started with this meme:
2424

2525
"You will meet your girlfriend today at 11" and the clock shows 10:65.
2626

27-
I thought this needs to get real.
2827
Its obvious that 10:65 would actually be 11:05.
28+
I thought this needs to become real.
2929

3030
My first test of this was my [Stopwatch](https://github.com/programminghoch10/Stopwatch).
3131

@@ -38,6 +38,18 @@ Of course you could also go insane with this setting, which results in ridiculou
3838

3939
And because of that variable, which makes the clock unique, its named HangoverClock.
4040

41+
 
42+
43+
***Special info for 12h users:***
44+
45+
Overhang calculation turns out to be really difficult and confusing in the 12h format.
46+
That's why whole calculation happens in 24h format and then gets later subtracted down,
47+
if the hour is between 12+houroverhang and 24.
48+
Try setting houroverhang to 0 or 1 and watch what suits you better.
49+
*This behaviour is only relevant when using the date,*
50+
so please remember that using the 12h setting may not reflect the real time!
51+
But maybe nobody will notice...
52+
4153
## Good old times
4254

4355
![HangoverClock Toxic Picture 1](pictures/toxic1.png)
@@ -50,9 +62,9 @@ Also the text was always the same size, no matter how big the widget was resized
5062

5163
So my friends inspired me saying the idea is amazing, but the clocks design sucks. So I needed to do something about it.
5264

53-
## The next generation
65+
## Big steps forward
5466

55-
![HangoverClock Dynamite Google Play Banner](pictures/playbannercutted.png)
67+
![HangoverClock Dynamite Google Play Banner](pictures/dynamitebannercutted.png)
5668

5769
![HangoverClock Dynamite Picture 1](pictures/dynamite1.jpg)
5870
![HangoverClock Dynamite Picture 2](pictures/dynamite2.png)
@@ -74,7 +86,6 @@ Also you are now able to not choose one Overhang, but all 4 seperatly. Those are
7486
* Hours
7587
* Days
7688
* Months
77-
* _Seconds coming soon (maybe)_
7889

7990
Same thing as always,
8091
hours defines how much to go over 12/24h mark,
@@ -83,51 +94,70 @@ and months defines how much to go over a year.
8394

8495
[@IlijazM](https://github.com/IlijazM) im expecting you to live in 2017 :)
8596

86-
 
97+
## The next generation
8798

88-
***Special info for 12h users:***
99+
![HangoverClock Serenity Picture 1](pictures/serenity1.png)
100+
![HangoverClock Serenity Picture 2](pictures/serenity2.png)
89101

90-
Overhang calculation turns out to be really difficult and confusing in the 12h format.
91-
That's why whole calculation happens in 24h format and then gets later subtracted down,
92-
if the hour field is between or equal of 12+houroverhang and 24.
93-
Try setting houroverhang to 0 or 1 and watch what suits you better.
94-
*This behaviour is only relevant when using the date,*
95-
so please remember that using the 12h setting may not reflect the real time!
96-
But maybe nobody will notice...
102+
Now comes HangoverClock "Serenity":
103+
104+
Serenity comes with quite some overhauls and extra features.
105+
106+
The biggest new thing is the addition of a daydream/screensaver.
107+
You now have the possibility to use HangoverClock as always on display if your phone is charging or in the dock.
108+
109+
And here are some of the smaller changes:
110+
* The seconds overhang can now be configured
111+
* 10+ new fonts have been added
112+
* The configure menu now saves your settings
113+
* The widget is now available on lockscreens too _(depends on your device)_
114+
115+
Many performance improvements have been made, such as that the clock now manages numbers up to 2^31 (‭2.147.483.648‬) with great efficiency when date is disabled.
97116

98117
## The Future
99118

100-
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.
101-
Apple already learned that ;) So its probably not getting more customizable in regards to the current features,
102-
but I'm always thinking of new features.
119+
You can see my plans for this app [here](plans.md).
120+
103121
I'm always on the quest to make this the best HangoverClock ever.
104122

105123
## Code Stuff
106124

107-
* All calculations happen inside the Class WidgetGenerator.
108-
* The only public method is generateWidget, which returns a Bitmap Image.
125+
* All calculations happen inside the class `ClockGenerator`.
126+
* The only public method is `generateWidget`, which returns a Bitmap Image.
109127
* The fonts get dynamically collected from all available resource files
110-
and saved in a static String array within the ClockWidgetProvider class.
128+
and saved in a static String array within the `FontsProvider` class.
111129
* The resulting bitmap resolution will be calculated to reach the best quality possible on every device.
112-
* The sharedPreference keys are defined in preferencekeys.xml and their defaults in preferencekeydefaults.xml.
113-
* sharedPreferences are saved in the format key and directly appended widget ID.
114-
* If a key is not defined its default value is assumed and only gets saved when not default or when alwayssavepreferences bool is active.
115-
* if one of the widgets has seconds enabled, the setalarmmanager method will request intent for one second instead of one second.
116-
* That behaviour is dependent on sharedPreferences key "increaserefreshrate".
130+
* The sharedPreference keys are defined in `*keys.xml` and their defaults in `*keydefaults.xml`.
131+
* sharedPreferences are saved in following format: key and if needed a directly appended widget ID.
132+
* If a key is not defined its default value is assumed and only gets saved when not default or when `alwayssavepreferences` bool is active.
133+
* if one of the widgets has seconds enabled, the `setalarmmanager` method will request intent for one second instead of one minute.
134+
* That behaviour is dependent on sharedPreferences key `increaserefreshrate`.
117135
* That key will be determined on every clock update by looping though all widgets and looking if any has seconds enabled.
118136

137+
## License
138+
139+
You can see the current license [here](LICENSE.md).
140+
119141
## Thanksgiving
120142

121143
Thanks to all my friends, who motivated me to do this.
144+
122145
Also thanks to my laptop, which crashed 2 times with literally nothing saved to disk.
123146

124147
 
125148

126149
## Screenshots
127150

128-
![Screenshot 1](pictures/playphone.png)
129-
![Screenshot 2](pictures/playphoneconfig.png)
151+
![Screenshot 1 - Serenity Phone](pictures/serenityphone.png)
152+
![Screenshot 2 - Serenity Phone Config Activity](pictures/serenityphoneconfig.png)
153+
154+
![Screenshot 3 - Serenity 10inch Tablet](pictures/serenity10inch.png)
155+
156+
![Screenshot 4 - Serenity 7inch Tablet](pictures/serenity7inch.png)
157+
158+
![Screenshot 5 - Dynamite Phone](pictures/dynamitephone.png)
159+
![Screenshot 6 - Dynamite Phone Config Activity](pictures/dynamitephoneconfig.png)
130160

131-
![Screenshot 3](pictures/play10inch.png)
161+
![Screenshot 7 - Dynamite 10inch Tablet](pictures/dynamite10inch.png)
132162

133-
![Screenshot 4](pictures/play7inch.png)
163+
![Screenshot 8 - Dynamite 7inch Tablet](pictures/dynamite7inch.png)

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ android {
66
applicationId "com.JJ.hangoverclock"
77
minSdkVersion 14
88
targetSdkVersion 28
9-
versionCode 8
10-
versionName "dynamite"
9+
versionCode 10
10+
versionName "serenity"
1111
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1212
}
1313
buildTypes {

app/release/app-release.apk

555 KB
Binary file not shown.

app/release/output.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":8,"versionName":"dynamite","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
1+
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":10,"versionName":"serenity","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]

app/src/main/AndroidManifest.xml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@
1212
android:supportsRtl="true"
1313
android:theme="@style/AppTheme"
1414
tools:ignore="GoogleAppIndexingWarning">
15-
<activity android:name=".ConfigureWidget">
15+
<!-- widget stuff -->
16+
<activity android:name=".WidgetConfigure">
1617
<intent-filter>
1718
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
1819
</intent-filter>
1920
</activity>
20-
<receiver android:name=".ClockWidgetProvider">
21+
<receiver android:name=".WidgetProvider">
2122
<intent-filter>
2223
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
2324
<action android:name="com.JJ.hangoverclock.widgetupdate" />
@@ -26,6 +27,23 @@
2627
android:name="android.appwidget.provider"
2728
android:resource="@xml/appwidgetproviderinfo" />
2829
</receiver>
30+
<!-- daydream stuff -->
31+
<activity android:name=".DaydreamConfigure" />
32+
<service
33+
android:name=".DaydreamProvider"
34+
android:exported="true"
35+
android:label="@string/app_name"
36+
android:icon="@drawable/clockc"
37+
android:permission="android.permission.BIND_DREAM_SERVICE">
38+
<intent-filter>
39+
<action android:name="android.service.dreams.DreamService" />
40+
<category android:name="android.intent.category.DEFAULT" />
41+
</intent-filter>
42+
<meta-data
43+
android:name="android.service.dream"
44+
android:resource="@xml/dreaminfo" />
45+
</service>
46+
2947
</application>
3048

3149
</manifest>

0 commit comments

Comments
 (0)