Once you have integrated a Unity module in an Android app, you should add the following to make sure you’re not launching the module on devices that do not support ARCore. It also instructs users to install the ARCore app for devices that support it, but don’t have it yet.
Read more…All snippets tagged with kotlin
Page 1 of 2Check for ARCore before launching a Unity module on Android.
Kotlin extension functions for Views
A collection of Kotlin extension methods that simplify many common tasks related to Android Views.
Read more…Kotlin extension functions for Numbers
A collection of Kotlin extension methods that simplify many common tasks related to numbers and maths.
Read more…Kotlin extension functions for Arrays and Lists
A collection of Kotlin extension methods that simplify many common tasks related to Arrays and Lists.
Read more…Common kotlin extensions
Common Kotlin extension functions for several tasks.
Read more…Kotlin extension functions for Bitmaps
A collection of Kotlin extension methods that simplify many common tasks related to Bitmaps.
Read more…View with a hook to add draw operations
This view allows draw operations to be executed in a different class. This makes it easier to draw onto a canvas without having to create a custom view for every different use case.
Read more…GIF compatible EditText
The snippet below is a custom view that enables keyboard like GBoard to enter GIFs and stickers.
Read more…Shrinkin/growing ViewPager
When iOS-ifying a ViewPager
, it is often needed to animate the pages when they come into view.
The following snippet shrinks the offscreen pages a little bit, and grows them to regular size when swiping them
to the center of the display.
Handle links in a TextView
Various ways of using weblinks in a TextView.
Read more…The Ultimate Sharing snippet for social platforms
This recipe contains a big snippet that helps sharing media to various social platforms, and the instructions to set it up. Includes working with the Twitter and Facebook SDKs.
Read more…Picking a contact using the Contacts app
There are to ways (besides implementing your own UI) to pick contact details through the Contacts app. One of them needs read access to your contacts list, the other does not.
Read more…Glide bitmap transformations
Various bitmap transformations that can be used with Glide to manipulate bitmaps.
Read more…Connectivity live data
Monitor network connectivity, and show a SnackBar when the connection is lost.
Read more…Turn timestamps into "time ago" strings
This recipe creates a “time ago” string from any timestamp, often used to display how long ago a comment was posted or a notification was received.
We’re creating an extension method, so any Long
timestamp can be converted like so: 12313131.timeAgo(arr)
where arr
is a list of labels.
This list can be retrieved from a string-array
in the strings.xml
to make it localizable.