Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
programminghoch10 committed Jan 15, 2020
2 parents 4724669 + 54788ec commit 4b3466e
Show file tree
Hide file tree
Showing 57 changed files with 1,658 additions and 559 deletions.
88 changes: 59 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Welcome to HangoverClock, the only clock which displays the real time in an unrealistic way!

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

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

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

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

I thought this needs to get real.
Its obvious that 10:65 would actually be 11:05.
I thought this needs to become real.

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

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

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

 

***Special info for 12h users:***

Overhang calculation turns out to be really difficult and confusing in the 12h format.
That's why whole calculation happens in 24h format and then gets later subtracted down,
if the hour is between 12+houroverhang and 24.
Try setting houroverhang to 0 or 1 and watch what suits you better.
*This behaviour is only relevant when using the date,*
so please remember that using the 12h setting may not reflect the real time!
But maybe nobody will notice...

## Good old times

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

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

## The next generation
## Big steps forward

![HangoverClock Dynamite Google Play Banner](pictures/playbannercutted.png)
![HangoverClock Dynamite Google Play Banner](pictures/dynamitebannercutted.png)

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

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

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

 
## The next generation

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

Overhang calculation turns out to be really difficult and confusing in the 12h format.
That's why whole calculation happens in 24h format and then gets later subtracted down,
if the hour field is between or equal of 12+houroverhang and 24.
Try setting houroverhang to 0 or 1 and watch what suits you better.
*This behaviour is only relevant when using the date,*
so please remember that using the 12h setting may not reflect the real time!
But maybe nobody will notice...
Now comes HangoverClock "Serenity":

Serenity comes with quite some overhauls and extra features.

The biggest new thing is the addition of a daydream/screensaver.
You now have the possibility to use HangoverClock as always on display if your phone is charging or in the dock.

And here are some of the smaller changes:
* The seconds overhang can now be configured
* 10+ new fonts have been added
* The configure menu now saves your settings
* The widget is now available on lockscreens too _(depends on your device)_

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.

## The Future

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.
Apple already learned that ;) So its probably not getting more customizable in regards to the current features,
but I'm always thinking of new features.
You can see my plans for this app [here](plans.md).

I'm always on the quest to make this the best HangoverClock ever.

## Code Stuff

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

## License

You can see the current license [here](LICENSE.md).

## Thanksgiving

Thanks to all my friends, who motivated me to do this.

Also thanks to my laptop, which crashed 2 times with literally nothing saved to disk.

 

## Screenshots

![Screenshot 1](pictures/playphone.png)
![Screenshot 2](pictures/playphoneconfig.png)
![Screenshot 1 - Serenity Phone](pictures/serenityphone.png)
![Screenshot 2 - Serenity Phone Config Activity](pictures/serenityphoneconfig.png)

![Screenshot 3 - Serenity 10inch Tablet](pictures/serenity10inch.png)

![Screenshot 4 - Serenity 7inch Tablet](pictures/serenity7inch.png)

![Screenshot 5 - Dynamite Phone](pictures/dynamitephone.png)
![Screenshot 6 - Dynamite Phone Config Activity](pictures/dynamitephoneconfig.png)

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

![Screenshot 4](pictures/play7inch.png)
![Screenshot 8 - Dynamite 7inch Tablet](pictures/dynamite7inch.png)
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ android {
applicationId "com.JJ.hangoverclock"
minSdkVersion 14
targetSdkVersion 28
versionCode 8
versionName "dynamite"
versionCode 10
versionName "serenity"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
Binary file modified app/release/app-release.apk
Binary file not shown.
2 changes: 1 addition & 1 deletion app/release/output.json
Original file line number Diff line number Diff line change
@@ -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":{}}]
[{"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":{}}]
22 changes: 20 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name=".ConfigureWidget">
<!-- widget stuff -->
<activity android:name=".WidgetConfigure">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
</intent-filter>
</activity>
<receiver android:name=".ClockWidgetProvider">
<receiver android:name=".WidgetProvider">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<action android:name="com.JJ.hangoverclock.widgetupdate" />
Expand All @@ -26,6 +27,23 @@
android:name="android.appwidget.provider"
android:resource="@xml/appwidgetproviderinfo" />
</receiver>
<!-- daydream stuff -->
<activity android:name=".DaydreamConfigure" />
<service
android:name=".DaydreamProvider"
android:exported="true"
android:label="@string/app_name"
android:icon="@drawable/clockc"
android:permission="android.permission.BIND_DREAM_SERVICE">
<intent-filter>
<action android:name="android.service.dreams.DreamService" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data
android:name="android.service.dream"
android:resource="@xml/dreaminfo" />
</service>

</application>

</manifest>
Loading

0 comments on commit 4b3466e

Please sign in to comment.