Kiwix-android: Night mode does not work properly in library (with 3.0)

Created on 20 Jul 2019  路  9Comments  路  Source: kiwix/kiwix-android

Describe the bug
Night mode inverts book icon colour in 'Get Content' library

Steps to reproduce the behavior:
Navigate to 'Get Content' library with in-app night mode enabled

Screenshots

Environment

  • Version of Kiwix Android : Tested until this commit on develop
  • Device : Moto G5+
  • OS version : 8.1.0
bug

All 9 comments

@macgills might be similar to #905
The double inversion to support night-mode might be required here in LibraryViewHolder.kt

What I see is that the text is not inverted ether. To me the Night mode is broken within the library.

Our nightmode implementation is strange, it is not theme driven.
Can anyone supply a justification for the current approach? @mhutti1

A theme approach might work better. I implemented most of this so long ago I can't really remember the full details, android has changed a lot too since then.

Undoubtedly, it is a shifting sea of sand.
So this ticket becomes "rework night mode completely", not a small amount of work

@macgills when you say theme driven, is it different from specifying themes in styles.xml and using them?

It is a bit different and more powerful to use themes well as they are applied once in the Manifest and this affects every activity. Essentially we need to reparent our baseTheme to a material DayNight theme and then use android's inbuilt day night system to inform the system what mode we are currently in. It will also take some attribute chicanery and potentially supplying different resources for night mode. Basically it should allow us to stop querying isNightMode everywhere and just have all our widgets respect our theme innately.
I also habitually create a different xml file for themes because themes and styles while sharing a lot of similarities should not be used interchangeably.

Chris Banes goes into better detail than myself

@macgills I assign you the ticket to avoid any ambiguity about who should fix night mode problems

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chstdu picture chstdu  路  6Comments

brijeshshah13 picture brijeshshah13  路  4Comments

kelson42 picture kelson42  路  6Comments

asereze picture asereze  路  4Comments

RohanBh picture RohanBh  路  5Comments