Skip to content

Instantly share code, notes, and snippets.

View mmobin789's full-sized avatar
💭
Vene Vidi Vici

Mobin Munir mmobin789

💭
Vene Vidi Vici
View GitHub Profile
@mmobin789
mmobin789 / DrawRoute Usage.kt
Last active October 30, 2020 20:08
A sample for using DrawRoute Library.
override fun onMapReady(p0: GoogleMap?) {
this.googleMap = p0
val source = LatLng(31.490127, 74.316971) //starting point (LatLng)
val destination = LatLng(31.474316, 74.316112) // ending point (LatLng)
googleMap?.run {
moveCameraOnMap(latLng = source)
@mmobin789
mmobin789 / Pixel.kt
Last active May 28, 2020 00:17
Shows use-cases for image loading using Pixel library.
// Loads an image without a placeholder.
Pixel.load("https://example.com/image.jpg", iv)
// Loads an image with a placeholder resource.
Pixel.load("https://example.com/image.jpg", iv3, PixelOptions.Builder().setPlaceholderResource(R.drawable.ic_loading_android).build())
// Loads an image of 30x30 pixels with a placeholder resource.
Pixel.load("https://example.com/image.jpg", holder.iv, PixelOptions.Builder().setPlaceholderResource(R.drawable.ic_loading_android)
.setImageSize(30, 30).build())
@mmobin789
mmobin789 / InternetMonitor.kt
Last active July 29, 2021 10:41
An Internet Monitor class which can be registered in Android to listen for internet connectivity states.
import android.annotation.TargetApi
import android.content.Context
import android.net.ConnectivityManager
import android.net.Network
import android.net.NetworkRequest
import android.os.Build
/**