<commit_before>Aloha
=====
A library for adding a simple welcome activity to your Android app.

Specify resource identifiers to customize each welcome page:

| Description           | View      | Resource Id                |
| :-------------------- |:--------- |----------------------------|
| **image**             | ImageView | R.drawable.your_image      |
| **header**            | TextView  | R.string.your_page_header  |
| **content**           | TextView  | R.string.your_page_content |
| **background color**  | Layout    | R.color.your_page_color    |


The `versionCode` of the client app is stored in a SharedPreference to help determine if the welcome should be displayed.

Sample App
----------

For a working implementation see the application in the `sample/` folder.

Usage
-----

  1. Prepare your resources for each welcome page: image, header, content, and background color
  2. Create a WelcomeActivity that extends [BaseWelcomeActivity](https://github.com/bdiegel/android-aloha/blob/master/aloha/src/main/java/com/honu/aloha/BaseWelcomeActivity.java)
  3. Implement createPages() in WelcomeActivity:

        @Override
        public void createPages() {
          addPage(new PageDescriptor(R.string.welcome_header_0, R.string.welcome_content_0, R.drawable.welcome_image_0, R.color.welcome_color_0));
          addPage(new PageDescriptor(R.string.welcome_header_1, R.string.welcome_content_1, R.drawable.welcome_image_1, R.color.welcome_color_1));
          addPage(new PageDescriptor(R.string.welcome_header_2, R.string.welcome_content_2, R.drawable.welcome_image_2, R.color.welcome_color_2));
        }

  4. Declare your WelcomeActivity in AndroidManifest.xml:

        <activity android:name=".WelcomeActivity" />

  5. Modify your MainActivity to start the WelcomeActivity:

        if (WelcomeHelper.isWelcomeRequired(this)) {
            startActivity(new Intent(MainActivity.this, WelcomeActivity.class));
            overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
        }

Recommendations
---------------

Follow these suggestions for the best results:

  * Use reasonably sized image resources: try 400x400
  * The default (and currently only) theme is light on dark. Choose appropriate colors.
  * Use Toolbar in your MainActivity layout and disable the window title in the style:

        <style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
            <item name="android:windowNoTitle">true</item>
        </style>


Acknowledgments
---------------

<commit_msg>Added more info to readme<commit_after>Aloha
=====
A library for adding a simple welcome activity to your Android app.

Specify resource identifiers to customize each welcome page:

| Description           | View      | Resource Id                |
| :-------------------- |:--------- |----------------------------|
| **image**             | ImageView | R.drawable.your_image      |
| **header**            | TextView  | R.string.your_page_header  |
| **content**           | TextView  | R.string.your_page_content |
| **background color**  | Layout    | R.color.your_page_color    |

Sample App
----------

For a working implementation see the application in the `sample/` folder.


Usage
-----

  1. Prepare your resources for each welcome page: image, header, content, and background color.
  2. Create a WelcomeActivity that extends [BaseWelcomeActivity](https://github.com/bdiegel/android-aloha/blob/master/aloha/src/main/java/com/honu/aloha/BaseWelcomeActivity.java).
  3. Implement createPages() in WelcomeActivity:

        @Override
        public void createPages() {
          addPage(new PageDescriptor(R.string.welcome_header_0, R.string.welcome_content_0, R.drawable.welcome_image_0, R.color.welcome_color_0));
          addPage(new PageDescriptor(R.string.welcome_header_1, R.string.welcome_content_1, R.drawable.welcome_image_1, R.color.welcome_color_1));
          addPage(new PageDescriptor(R.string.welcome_header_2, R.string.welcome_content_2, R.drawable.welcome_image_2, R.color.welcome_color_2));
        }

  4. Declare your WelcomeActivity in AndroidManifest.xml:

        <activity android:name=".WelcomeActivity" />

  5. Modify your MainActivity to start the WelcomeActivity:

        if (WelcomeHelper.isWelcomeRequired(this)) {
            startActivity(new Intent(MainActivity.this, WelcomeActivity.class));
            overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
        }

About
-----

The `versionCode` of the client app can be used to show the welcome activity on app install or upgrade.
WelcomeHelper.isWelcomeRequired(this) compares versions and updates a SharedPreference when 'true'.

The PageTansformer provides a cross-fading transition between page slides of the view pager. The text slides with the
page and gradually fades out. The image and background color also fade out as the new page increases in opacity. When
you scroll off the last welcome page, the main activity is revealed.

Recommendations
---------------

Follow these suggestions for the best results:

  * Use reasonably sized image resources (try 400x400).
  * The default (and currently only) theme is light on dark. Choose appropriate colors.
  * Use Toolbar in your MainActivity layout and disable the window title in the style:

        <style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
            <item name="android:windowNoTitle">true</item>
        </style>


Acknowledgments
---------------


{'fraction_non_alphanumeric': 0.12207509522945764, 'fraction_numerical': 0.008343914384182841, 'mean_word_length': 2.986984815618221, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1804795', 'n_tokens_mistral': 1567, 'n_tokens_neox': 1482, 'n_words': 442}