XuiMod icon indicating copy to clipboard operation
XuiMod copied to clipboard

Added charge animation offset.

Open ahstro opened this issue 11 years ago • 3 comments
trafficstars

I loved the battery bar charging animation, but I got stressed out and distracted from how quickly it fired so I added the option to set an offset between animations. You might need to restart the system UI to see the difference. (Slowly de- and reactivating the charge animation works as well. It just needs start() to run. I'll try to make it cleaner once I fully figure out your code.)

ahstro avatar Jul 20 '14 15:07 ahstro

Hi LumenTeun,

Thanks for your contribution. It seems that the code looks all good, but I haven't tested it yet.

One way to make the change apply on the go is by adding this code in updateSettings() inside BatteryBarView.java

int animOffset = mPref.getInt(Common.KEY_BATTERYBAR_ANIMATE_OFFSET,
                Common.DEFAULT_BATTERYBAR_ANIMATE_OFFSET);
if (animOffset != ANIM_OFFSET) {
    stop();
    start();
    ANIM_OFFSET = animOffset;
}

updateSettings() is called when any setting is changed, so it should work, although again, I haven't tested this. I'll try to test it once I find some time :p

Regards, zst123

zst123 avatar Jul 21 '14 13:07 zst123

Okay, that makes it change as soon as the settings are changed. Thanks for the code snippet. :)

ahstro avatar Jul 21 '14 20:07 ahstro

Was there any reason not to pull this? I've got the Xposed Repo version installed on my phone and since there's no settings export, going between apks signed with different keys are a hastle.

ahstro avatar Jan 02 '15 15:01 ahstro