Onboarding Activity
When you use the Screen API, the OnboardingActivity
displays important advice for correctly photographing a document.
The OnboardingActivity
is started by the CameraActivity when the latter is launched for the first time. You may disable this behavior - we highly recommend keeping it - by passing false
to setShouldShowOnboardingAtFirstRun when creating a GiniVision instance. If you don't use GiniVision yet you can also use the extra EXTRA_IN_SHOW_ONBOARDING_AT_FIRST_RUN with false
when starting the CameraActivity.
You can change the number of displayed pages and their content (image and short text) by setting an ArrayList
containing OnboardingPage objects when building a instance with setCustomOnboardingPages. If you don't use GiniVision yet you can also provide the list using the extra EXTRA_IN_ONBOARDING_PAGES for the Screen API and createInstance or createInstance for the Component API.
Customizing the look of the Onboarding Screen is done via overriding of app resources or by providing your own pages with your own strings and drawable resources.
The following items are customizable:
- Next button icon: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named
gv_onboarding_fab_next.png
- Next button color: via the color resources named
gv_onboarding_fab
andgv_onboarding_fab_pressed
- Page indicators: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named
gv_onboarding_indicator_active.png
andgv_onboarding_indicator_inactive.png
- Onboarding message color: via the color resource named
gv_onboarding_message
- Onboarding message font: via overriding the style named
GiniVisionTheme.Onboarding.Message.TextStyle
and setting an item namedgvCustomFont
with the path to the font file in yourassets
folder - Onboarding message text style: via overriding the style named
GiniVisionTheme.Onboarding.Message.TextStyle
and setting an item namedandroid:textStyle
tonormal
,bold
oritalic
- Onboarding message text size: via overriding the style named
GiniVisionTheme.Onboarding.Message.TextStyle
and setting an item namedandroid:textSize
to the desiredsp
size - Tablet Onboarding Pages:
- First page image via images for sw600dp-mdpi, sw600dp-hdpi, sw600dp-xhdpi, sw600dp-xxhdpi, sw600dp-xxxhdpi named
gv_onboarding_lighting.png
- First page text: via the string resource named
gv_onboarding_ligthing
- Second page image via images for sw600dp-mdpi, sw600dp-hdpi, sw600dp-xhdpi, sw600dp-xxhdpi, sw600dp-xxxhdpi named
gv_onboarding_flat.png
- Second page text: via the string resource named
gv_onboarding_flat
- Third page image: via images for sw600dp-mdpi, sw600dp-hdpi, sw600dp-xhdpi, sw600dp-xxhdpi, sw600dp-xxxhdpi named
gv_onboarding_parallel.png
- Third page text: via the string resource named
gv_onboarding_parallel
- Fourth page image: via images for sw600dp-mdpi, sw600dp-hdpi, sw600dp-xhdpi, sw600dp-xxhdpi, sw600dp-xxxhdpi named
gv_onboarding_align.png
- Fourth page text: via the string resource named
gv_onboarding_align
- First page image via images for sw600dp-mdpi, sw600dp-hdpi, sw600dp-xhdpi, sw600dp-xxhdpi, sw600dp-xxxhdpi named
- Phone Onboarding Pages:
- First page image: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named
gv_onboarding_flat.png
- First page text: via the string resource named
gv_onboarding_flat
- Second page image: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named
gv_onboarding_parallel.png
- Second page text: via the string resource named
gv_onboarding_parallel
- Third page image: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named
gv_onboarding_align.png
- Third page text: via the string resource named
gv_onboarding_align
- First page image: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named
- Background transparency: via the string resource named
gv_onboarding_page_fragment_background_alpha
which must contain a real number between [0,1]. - Background color: via the color resource named
gv_background
. Note: this color resource is global to all Activities (CameraActivity, , ReviewActivity, AnalysisActivity)
Important: All overriden styles must have their respective Root.
prefixed style as their parent. Ex.: the parent of GiniVisionTheme.Onboarding.Message.TextStyle
must be Root.GiniVisionTheme.Onboarding.Message.TextStyle
.
Customizing the Action Bar is also done via overriding of app resources and each one - except the title string resource - is global to all Activities (CameraActivity, , ReviewActivity, AnalysisActivity).
The following items are customizable:
- Background color: via the color resource named
gv_action_bar
(highly recommended for Android 5+: customize the status bar color viagv_status_bar
) - Title: via the string resource named
gv_title_onboarding
- Title color: via the color resource named
gv_action_bar_title
- Back button: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named
gv_action_bar_back