• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

[Mod/App] AOSP Desk Clock 4.1 with Custom Nightmode Color (updated)

dhworph

Android Enthusiast
This is built from AOSP 4.1.1_r6.1 desk clock source code. I'm looking for a few people to test it out on different software/hardware.

You can install this app as a regular app. To change the color, open the app and click set alarm > overflow (menu 3 dots) > Settings > Night Mode Color. Then use the sliders to set alpha, red, green, and blue. Your color will be displayed in the text below the sliders.

Examples:
To get white, just put all the sliders all the way to the right.
To get a dark green, put green all the way right and red/blue all the way left, and crank the alpha somewhat to the left to make it dark. Or leave the alpha all the way to the right, and crank the green down to the left.

===

This started off in the JBSourcery thread (a great ROM btw), when I saw someone who wanted the deskclock night mode text color modifiable. Since I have recently began to dabble in AOSP source, I went off looking for where that color is stored in the source code. I found it pretty quickly and was able to change it. However, there were some problems getting it installed (as it was an exact copy of the system app, so I decided to play around with the 4.1.1 clock source in the android sdk to see if I could figure out how to make a dialog that customizes a color. And after many hours of tinkering, here is the result. I hope someone enjoys it... because I'm stoked on it. :)

If people like it, I might try to put the changes on the 4.2.2 desk clock, and use some more advanced color picker, like a wheel or some palette. And maybe compile it as an android system app.

Personally, I like this clock better than the 4.2.2 clock for one reason: When in night mode you can toggle the screen on and off and it STAYS in night mode! I do love the timer and stopwatch on 4.2.2 obviously, but really dig the lightweight minimalism of the 4.1.1 clock. I'd fix that in the 4.2.2 clock if I could, but that is for another project...

The name of the app is "nmcClock", so you won't confuse it with you regular clock (unless you are on 4.2.2 already, since the icons are different). If I turn this into a better app, or some more official release, I'll probably change the name.

Note that there is some conflict between this app and the stock android clock for displaying a notification in the notification bar when alarms are set. (see more detailed explanation in bugs below)

Currently it requires API level 11 or higher to work (Android 4.x Ice Cream Sandwich, Jelly Bean, or Honeycomb), and will probably not work on Gingerbread. I think you might need a minimum of Android 3.0 in order to have your system let you install it. I've only tested in in 4.1.1 (my Verizon GNex) and on 4.1.2 and 4.2.2 emulators. I have a LG Ally (some version of Gingerbread) and Droid Bionic (ICS) I'll test it on later. I might be able to get it working on gingerbread without much issue, its mostly a holo-theme problem it seems.

===

If the app crashes for whatever reason, just go into Settings > Apps > nmcClock and clear its data. That should fix it... of course, you'll lose whatever you set as your color and any alarms you have set (but clearing nmcClock's data will not affect your stock clock's data).


===

Be patient for my responding to bug reports or feature requests... I'm a noob at programming. This is really my first 'serious' project for learning Java and the Android API's. A more apt developer could have cobbled together my mods in a fraction of the time it took me!

Attached below is the apk outputted by the android sdk... I'm updating this OP as I go, and will eventually clean it up.


***DISCLAIMER: I take no responsibility for any bricks, or other errors, or acts of God, or any other act or event. Please take responsibility for yourself for installing this app. It should be safe, as it is exactly the same as the stock Android 4.1 Desk Clock, except with a dialog added to customize the night mode color. However, like I said, I'm a noob at programming...

===

Bugs:

1. It reads you alarms from the stock android desk clock. I kinda like this actually... but might be an issue for someone. For example, if you have an alarm set in stock desk clock, nmcClock will show it on the main screen, unless you go into nmcClock's alarm settings and click an alarm to edit it, then your stock alarm will no longer be shown on the main clock screen in nmcClock (however, that alarm will still be active). So there is some cross reading of alarms that I don't understand. But both clocks will set off their alarms independently and simultaneously. If you have an alarm set in your stock clock, nmcClock will also make your stock clock's notification icon disappear form your notification bar if you try to edit nmcClock's alarms. However, you stock clock alarm is still set and will go off.
2. Color choosing dialog does not scale correctly when changing to landscape mode.

Other things to possibly add:
1. custom clock fonts
2. make color picking dialog look prettier
3. make font and color modifiable on regular clock screen in addition to night mode
4. Add a couple of quick options to color choices, such as red, green, blue, holo, white, and maybe a quick slider for brightness/alpha or something.

big TODO: Clean up the code, its pretty nasty and ineficient right now!

current version 2.0.3.6 (2.0.3 clock, version 6 of my modifications)

credits to: whoever made the AOSP desk clock... Google and all the open source coders!
 

Attachments

Back
Top Bottom