cyb3rko / flashdim

Modern flashlight app with dim functionality on Android 13+
Apache License 2.0
459 stars 18 forks source link

Light level 1 looks like 0 #9

Closed max-ishere closed 1 year ago

max-ishere commented 1 year ago

Google Pixel 6

The first bar should be filled in. Because the light is so dim you may not notice it's on and just close the app.

May be an issue after unlocking a device and if the app is open it will show the bar is empty. And you have to check the counter or the back of the phone.

cyb3rko commented 1 year ago

When does this happen to you? Normally the first button should be colored for light level 1.

You can manually tap the first bar at the bottom. It should be colored then but still be at light level 1, right?

max-ishere commented 1 year ago
max-ishere commented 1 year ago

It showed 1 as 1 bar filled in some older version, one of the first. Idk which one.

cyb3rko commented 1 year ago

Can you confirm you're on the most recent version (1.3.2)?

max-ishere commented 1 year ago

Just to make sure I installed 1.3.2-googleplay and F-Droid 1.3.2 and both show lvl 1 as 0 bars filled

max-ishere commented 1 year ago

And before I uninstalled I checked and it was 1.3.2

max-ishere commented 1 year ago

I tried 1.2.2 and it behaves the same.

cyb3rko commented 1 year ago

Weird, for me it works flawlessly (Pixel 7 Pro). A colleague uses a P6, I will ask him to test this out.

Atm I don't have any idea why that happens. Could you share your settings in the app?

max-ishere commented 1 year ago

![Uploading Screenshot_20221130-121644.png…]()

cyb3rko commented 1 year ago

Uhm, that link seems to be broken

max-ishere commented 1 year ago
max-ishere commented 1 year ago

Screenshot_20221130-131827

The last bar isn't alligned with 0ff button. And I can use the progress bar to set the level to 1 if I put my finger on where the bar should be for lvl 1 and I can even go down to 0. So seems like it's simply not displayed.

max-ishere commented 1 year ago

I counted them all... I'm confused

cyb3rko commented 1 year ago

Now you know how I feel 😄

max-ishere commented 1 year ago

Still an issue in 1.3.4-googleplay. (Just for history)

cyb3rko commented 1 year ago

Yep, still trying to figure out what's wrong. Does the light level always look like level 0 or on.y if you use the slider on the right?

What happens e.g. if you click the "Minimum" button.

max-ishere commented 1 year ago

Clicking Minimum, clicking the tile and then opening the app (default lvl 1), and using the slider make it show 1/45 and 0 bars filled.

Basically I could not make it show 1/45 and 1 bar no matter how I tried...

max-ishere commented 1 year ago

I tried opening the app in split view and I think this is purely a rendering bug. In the screenshot I can control lvls 1, 2 and 3, but can't see them. Either the code you use for the progress bar doesn't know the accurate height available to it or there's some UI drawn over the bottom of it.

max-ishere commented 1 year ago

For science I also went under a blanket and tested if the flashlight actually becomes brighter at the top levels and yes it does. (Reflections make telling the difference easier at high light levels).

Seanathan10 commented 1 year ago

Here's something: I have a Pixel 7 and I have the same bottom level bug. However, when I set the phone to 3 button navigation, it works. The bottom-most line lights up but not when I have gesture navigation turned on. Interesting issue.

Screenshot:

max-ishere commented 1 year ago

But not on Pixel 6

max-ishere commented 1 year ago

So I looked at the whole thread an though hmm how does it have 45 bars with 44 values. So I swiped my finger over the whole thing and found out that at level 24-25 it skips a bar. I added a red line for reference between screenshots.

Seanathan10 commented 1 year ago

On my Pixel 7 with either gesture or 3 button navigation, I don't get the skipping bug. Both 24 and 25 light up their respective bars without an issue.

max-ishere commented 1 year ago

@Seanathan10 Could you please send a screenshot of the app with gesture navigation? Before you send it however please add numbers as in this screenshot.

Seanathan10 commented 1 year ago

Gesture navigation at minimum

Gesture navigation at level 24 (there is no skipping of bars for me) Level 25 works fine as well, the next bar lights up as it should

cyb3rko commented 1 year ago

@max-ishere @Seanathan10 Hey guys, it's me again.

I reworked the calculations responsible for changing the bar colors, it seems to be a better solution than the previous solution. But before releasing it as a "fix", could you please verify it's working on your devices?

https://next.cyb3rko.de/tL41L (SHA256 Checksum: 5ccc1a7e18cb6c430af70d40ce3c47aeb71b18c1a8d732b6364dc7e950da614c)

Seanathan10 commented 1 year ago

Yep it works as intended now

Screenshot_20221230-181635.png

max-ishere commented 1 year ago

Works for me now too (pixel 6). I tested both gesture and 3 button navigation as well as having 2 apps on the screen. All bars look like working to me and I can see the first one and there's no skipping.

max-ishere commented 1 year ago

One thing I'd like to have is app version number in settings because there's no way to tell which one you have without looking in the Store.

cyb3rko commented 1 year ago

Sounds pretty good. Thanks to both of you for investing your time.

Update coming soon.

max-ishere commented 1 year ago

Oh thank you to you for finding this bug. I'll go look in the diffs and see what it was

cyb3rko commented 1 year ago

So basically the bars were colored by comparing the coordinate of your finger and the center coordinate of every single bar. If your finger was above a bar, it was colored. But that seems to be buggy (especially if the screen size is different to the one I tested and developed (Pixel 7 Pro). That's also why changing navigation type from 3 button navigation to gesture navigation can change the behaviour of the app because the app size slightly changes.

Now I just check wether the "index" of a bar is lower or equal to the current light level. Take a look at the last two lines changed at https://github.com/cyb3rko/flashdim/commit/e9161a6a90c35be716b65c68dc2e5baf6f77f247.

@max-ishere Btw, app version can now be found in the About section.

cyb3rko commented 1 year ago

Implemented in Version 1.3.5

max-ishere commented 1 year ago

Btw, app version can now be found in the About section.

I only see GitHub, settings and flaticon buttons. No "about".

max-ishere commented 1 year ago

I found the version in phone's settings > apps > flashdim.

cyb3rko commented 1 year ago

Are you sure you have updated the app? It should be Version 1.3.5. On GooglePlay you can already find the current version, F-Droid takes some more time.

max-ishere commented 1 year ago

I will check it out when F-Droid updates it.

cyb3rko commented 1 year ago

@max-ishere It's online now

max-ishere commented 1 year ago

Looks good. And the (i) opens about instead of icon credits which fits more. Great job. Thanks.