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

Frontlight - Add checkbox use system settings #5307

Merged
merged 10 commits into from Sep 4, 2019

Conversation

@robert00s
Copy link
Contributor

commented Sep 2, 2019

See: #5205 (comment)

Devices with hasLightLevelFallback = true (for now Android) has extra checkbutton Use system settings. Default checked.

After check button we have Frontlight widget with read only status.

Also frontlight gestures are disabled.

Checkbutton status is written in global variable light_fallback.

@robert00s robert00s requested a review from pazos Sep 2, 2019

@Frenzie Frenzie added this to the 2019.09 milestone Sep 2, 2019

@Frenzie Frenzie added the Android label Sep 2, 2019

-- when using frontlight system settings
if lightFrontlight() then
UIManager:show(Notification:new{
text = _("Frontlight controlled by system settings."),

This comment has been minimized.

Copy link
@Frenzie

Frenzie Sep 2, 2019

Member

is/will now be?

Also I think 1 s might be a bit short.

This comment has been minimized.

Copy link
@robert00s

robert00s Sep 2, 2019

Author Contributor

2 s or more?

This comment has been minimized.

Copy link
@Frenzie

Frenzie Sep 2, 2019

Member

I'd say 2 or 3.

This comment has been minimized.

Copy link
@robert00s

robert00s Sep 2, 2019

Author Contributor

2.5 s :)

@pazos

This comment has been minimized.

Copy link
Contributor

commented Sep 2, 2019

Awesome job @robert00s !

I will review changes at night and submit a PR on top of your branch.

A few things I noticed:

Devices with hasLightLevelFallback = true (for now Android) has extra checkbutton Use system settings. Default unchecked.

Default is system settings, at least on Android. No problem with that since it can be retrieved using

function Device:isUsingSystemSettings()
    return android.getScreenBrightness < 0
end
@robert00s

This comment has been minimized.

Copy link
Contributor Author

commented Sep 2, 2019

Now the system settings are the default (checkbox checked)

@pazos
pazos approved these changes Sep 3, 2019
Copy link
Contributor

left a comment

Thanks for your help!!!

I ended adapting luajit-launcher a bit to work with this implementation as it looks better than my original idea. Please review the changes I PR'ed to your branch and feel free to adapt it if you find a better fit for them!

robert00s and others added 6 commits Sep 2, 2019
@pazos

This comment has been minimized.

Copy link
Contributor

commented Sep 4, 2019

Fixes #5205

@robert00s robert00s changed the title [WIP] Frontlight - Add checkbox use system settings Frontlight - Add checkbox use system settings Sep 4, 2019

@Frenzie Frenzie merged commit ae50569 into koreader:master Sep 4, 2019

1 check passed

ci/circleci: build Your tests passed on CircleCI!
Details

@robert00s robert00s deleted the robert00s:frontlight_android branch Sep 21, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.