Screen API
When you use the Screen API, the {@code OnboardingActivity}
displays important advice for correctly photographing a document.
The {@code 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 {@code false}
to setShouldShowOnboardingAtFirstRun when creating a GiniCapture instance.
You can change the number of displayed pages and their content (image and short text) by setting an {@code ArrayList}
containing OnboardingPage objects when building a instance with .
Customizing the Onboarding Screen
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
{@code * gc_onboarding_fab_next.png}
- Next button color: via the color resources named
{@code gc_onboarding_fab}
and {@code * gc_onboarding_fab_pressed}
- Page indicators: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named
{@code * gc_onboarding_indicator_active.png}
and {@code gc_onboarding_indicator_inactive.png}
- Onboarding message color: via the color resource named
{@code gc_onboarding_message}
- Onboarding message font: via overriding the style named
{@code * GiniCaptureTheme.Onboarding.Message.TextStyle}
and setting an item named {@code gcCustomFont}
with the path to the font file in your {@code assets}
folder - Onboarding message text style: via overriding the style named
{@code * GiniCaptureTheme.Onboarding.Message.TextStyle}
and setting an item named {@code android:textStyle}
to {@code normal}
, {@code bold}
or {@code italic}
- Onboarding message text size: via overriding the style named
{@code * GiniCaptureTheme.Onboarding.Message.TextStyle}
and setting an item named {@code android:textSize}
to the desired {@code sp}
size - Tablet Onboarding Pages:
- First page image via images for sw600dp-mdpi, sw600dp-hdpi, sw600dp-xhdpi, sw600dp-xxhdpi, sw600dp-xxxhdpi named
{@code gc_onboarding_lighting.png}
- First page text: via the string resource named
{@code gc_onboarding_ligthing}
- Second page image via images for sw600dp-mdpi, sw600dp-hdpi, sw600dp-xhdpi, sw600dp-xxhdpi, sw600dp-xxxhdpi named
{@code gc_onboarding_flat.png}
- Second page text: via the string resource named
{@code gc_onboarding_flat}
- Third page image: via images for sw600dp-mdpi, sw600dp-hdpi, sw600dp-xhdpi, sw600dp-xxhdpi, sw600dp-xxxhdpi named
{@code gc_onboarding_parallel.png}
- Third page text: via the string resource named
{@code gc_onboarding_parallel}
- Fourth page image: via images for sw600dp-mdpi, sw600dp-hdpi, sw600dp-xhdpi, sw600dp-xxhdpi, sw600dp-xxxhdpi named
{@code gc_onboarding_align.png}
- Fourth page text: via the string resource named
{@code gc_onboarding_align}
- Phone Onboarding Pages:
- First page image: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named
{@code * gc_onboarding_flat.png}
- First page text: via the string resource named
{@code gc_onboarding_flat}
- Second page image: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named
{@code * gc_onboarding_parallel.png}
- Second page text: via the string resource named
{@code gc_onboarding_parallel}
- Third page image: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named
{@code * gc_onboarding_align.png}
- Third page text: via the string resource named
{@code gc_onboarding_align}
- Background transparency: via the string resource named
{@code * gc_onboarding_page_fragment_background_alpha}
which must contain a real number between [0,1]. - Background color: via the color resource named
{@code gc_background}
. Note: this color resource is global to all Activities ( CameraActivity , , ReviewActivity , AnalysisActivity )
Important: All overriden styles must have their respective {@code Root.}
prefixed style as their parent. Ex.: the parent of {@code GiniCaptureTheme.Onboarding.Message.TextStyle}
must be {@code Root.GiniCaptureTheme.Onboarding.Message.TextStyle}
.
Customizing the Action Bar
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
{@code gc_action_bar}
(highly recommended for Android 5+: customize the status bar color via {@code gc_status_bar}
) - Title: via the string resource named
{@code gc_title_onboarding}
- Title color: via the color resource named
{@code gc_action_bar_title}
- Back button: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named
{@code gc_action_bar_back}