Skip to content

DevelopmentFAQ

RobbWatershed edited this page Apr 9, 2020 · 3 revisions

Frequently Asked Questions (development)

Debugging

Is there a way to view the content of the database ?

Visuals

How to add a new color theme ?

Q: : Is there a way to view the content of the database ?

A : You have to enable ObjectBox browser in your build. To do that, you need to set the INCLUDE_OBJECTBOX_BROWSER local environment variable to true on your computer before building Hentoid.

The ObjectBox browser shows a notification on your phone at app startup. Tapping on it, you can browse the database using your browser. More information here : ObjectBox Data Browser

On Windows : use Settings > Environment variables and set them up to look like the screenshot below. You should restart Android Studio after that for it to take the new variable into consideration.


Q: : How to add a new color theme ?

A : To add a new color theme, follow the steps below :

  1. Copy res/values/theme-light.xml into a new file (e.g. res/values/theme-newname.xml)
  2. Copy res/values/colors-light.xml into a nw file (e.g. res/values/colors-newname.xml)
  3. Open me.devsaki.hentoid.enums.Theme.java and add your theme in the enums (e.g. NEWNAME(3, "Newname")). The numeric code should be a new number that no other theme is using.
  4. Open res/values/array_preferences.xml, look for the pref_color_theme_entries and pref_color_theme_values entries and add the name and code of your theme
  5. Open res/layout/intro_slide_05.xml and duplicate the last TextView. Rename the new block with the properties of your theme
  6. Open me.devsaki.hentoid.fragments.intro.ThemeIntroFragment and create a new click listener for your theme (also edit me.devsaki.hentoid.util.Preferences.Constant to add a new static final attribute to use there)

Be sure to keep the same word to describe your theme (in our example : "newname") across all steps. Failing to do so will result in bugs.

  1. You may now tweak the colors defined in the files created at steps 1 and 2. Have fun !