Skip to content

Instantly share code, notes, and snippets.

View WSAyan's full-sized avatar
🎯
Focusing

Wahid Sadique Ayan WSAyan

🎯
Focusing
View GitHub Profile
@jdsingh
jdsingh / RealmBackupRestore.java
Created July 3, 2017 12:57 — forked from paolorotolo/RealmBackupRestore.java
Class to easily backup/restore data from Realm.
package org.glucosio.android.tools;
import android.Manifest;
import android.app.Activity;
import android.content.pm.PackageManager;
import android.os.Environment;
import android.support.v4.app.ActivityCompat;
import android.util.Log;
import android.widget.Toast;
@Veeyikpong
Veeyikpong / MiddleDividerItemDecoration.kt
Last active April 29, 2025 08:30
MiddleDividerItemDecoration, suitable for both LinearLayoutManager and GridLayoutManager.
/*
* Copyright 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@shaon2016
shaon2016 / SpinnerDialog.txt
Last active September 24, 2020 11:43
Create a spinner dialog using Recycler view and Higher order function
# This is the Util function
````
import android.app.Dialog
import android.content.Context
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.view.LayoutInflater
import androidx.databinding.DataBindingUtil
import androidx.recyclerview.widget.RecyclerView
@ArnyminerZ
ArnyminerZ / MapLifecycle.kt
Created April 1, 2022 11:35
osmdroid approach with Jetpack Compose.
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.remember
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalLifecycleOwner
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleEventObserver
import org.osmdroid.views.MapView
@Composable
@ArnyminerZ
ArnyminerZ / Utils.kt
Created April 1, 2022 11:40
Some utility functions for osmdroid. Helps on using the library.
import org.osmdroid.util.BoundingBox
import org.osmdroid.util.GeoPoint
/**
* Computes the center point of all the ones in the list.
* @author Arnau Mora
* @since 20220302
* @return The center point between all the ones in the list.
*/
fun List<GeoPoint>.computeCentroid(): GeoPoint {