Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clock Alignment Control Needed #31

Open
Firefairy opened this issue Apr 17, 2014 · 4 comments
Open

Clock Alignment Control Needed #31

Firefairy opened this issue Apr 17, 2014 · 4 comments

Comments

@Firefairy
Copy link

This is somewhere between a feature request and a bug fix. If the Alignment of the clock is set to center using a non-Xposed setting, the custom format from Xui is lost. Using an Xposed module (in my case, XBlast) to also "change" the alignment to center fixes the problem, but most of the mods that include this feature are the large AIO conglomerations of features. Adding Alignment to Xui's options would be much preferable.

@zst123
Copy link
Owner

zst123 commented Apr 18, 2014

I did have a look at GravityBox's source code a few months back. However, I gave up after an hour since its codes are so messy..
If you know any (cleaner) open-source code, please inform me and I'll look through it

@Firefairy
Copy link
Author

Okay, will keep an eye out.

I tried some other mods, and it seems there are multiple methods of centering the clock, and not all of them fix this. You might try contacting FemBlack and seeing if she is open to sharing the relevant bit of code. She credits another coder for some source code, so she might be willing to share one small chunk.

If you can figure out why the format is Alignment-dependent, that would solve the bug aspect of this as well.

@ahstro
Copy link

ahstro commented Jul 23, 2014

@zst123 OmniROM has a feature which centers the clock. I can't be bothered digging through the code right now, just thought I'd tip you off in case you felt like working on this feature. I might give it a shot myself in the future.
Did you just skip the GravityBox code because it was messy or was there something in that didn't work?

@zst123
Copy link
Owner

zst123 commented Jul 24, 2014

@Firefairy
The reason the format doesn't work for centered clock is because ROMs usually don't center the clock. They hide the right clock and show another clock in the center.

For example,
Some ROMs have a center clock feature which hides the com.android.systemui.statusbar.policy.Clock and shows a com.android.systemui.statusbar.policy.ClockCenter.java.

I hooked only Clock.java, thus ClockCenter.java is not hooked. This is the same problem for multiple ROMs but with differing class names.

(If I'm not wrong it was SlimROM JB that I saw the ClockCenter, but I'm recalling from memory now)

@LumenTeun
GravityBox's codes are messy now since it contains multiple clock mods. The center clock feature actually relied on another clock feature (forgot what it was exactly). It also hooked the status_bar.xml which might not be so compatible (some manufacturers like Samsung renamed it to tw_status_bar.xml and other variants). I actually wanted to implement this some time ago but I keep pushing it forward because of the possible xml compatibility problem and messy code :P

I have just looked at OmniROM's center clock feature and realized that GravityBox's version is easier to implement. OmniROM's one needed the status bar xml to be modified which is quite difficult in Xposed. omnirom/android_frameworks_base@970bcf5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants