Skip to main content

Offline Images on Welcoming Pages (android-hola)

Welcoming Pages (android-hola) alpha-v1.0 has Released

Most mobile apps portray their experiences about what their users could get later using Welcoming Pages. These pages shown on first time user opens the app.

I portray the experiences using kitter and pupper images
As you noticed on the title, I have released android-hola. It provides welcoming pages - so called activity by mobile developers - that can be shown on top of your activity.

First, you need to add dependency to this library.
  • build.gradle (project)
allprojects {
    repositories {
      ...

      maven { url 'https://jitpack.io' }

      ...
  }
}
  • build.gradle (app)
dependencies {
  ...

  implementation 'com.github.hendrickpras:android-hola:alpha-v1.0'

  ...
}

Then, you can start HolaActivity using intent like code below.
...

val intent = Intent(this, HolaActivity::class.java)

intent.putStringArrayListExtra(HolaActivity.imageUrls, resources.getStringArray(R.array.image_urls).toCollection(ArrayList()))

intent.putStringArrayListExtra(HolaActivity.pageLabels, resources.getStringArray(R.array.page_labels).toCollection(ArrayList()))

intent.putExtra(HolaActivity.buttonText, getString(R.string.welcoming_page_button_ok))

startActivity(intent)

...

The numbers of imageUrls and pageLabels are depends on your welcoming pages number, as long as they are equals. Then you can add buttonText as your button's wording.

And that's it! You are about ready to go.

Comments

Popular posts from this blog

Offline Images on Welcoming Pages (android-hola)

Continuing from my previous post, now you can using offline images using alpha-v1.1 version.
First, you need to modify the dependency version. build.gradle (app) dependencies {
  ...

  implementation 'com.github.hendrickpras:android-hola:alpha-v1.1'

  ...
}
Then, you can start HolaActivity using intent like code below. ...

val intent = Intent(this, HolaActivity::class.java)

/* intent.putExtra(HolaActivity.imageUrls, resources.getStringArray(R.array.image_urls)) */

intent.putExtra(HolaActivity.imageResourceIds, intArrayOf(R.drawable.ringtoss, R.drawable.drinks, R.drawable.glasses))

intent.putExtra(HolaActivity.pageLabels, resources.getStringArray(R.array.page_labels))

intent.putExtra(HolaActivity.buttonText, getString(R.string.welcoming_page_button_ok))

startActivity(intent)

...
Once again, the numbers of imageResourceIds and pageLabels are depends on your welcoming pages number, as long as they are equals.
And you are about ready to go, again.