Skip to content

Instantly share code, notes, and snippets.

View NezSpencer's full-sized avatar

Nnabueze Uhiara NezSpencer

  • Portugal
View GitHub Profile
@NezSpencer
NezSpencer / LoggerCrashHandler.kt
Created January 12, 2020 11:57
This crashHandler shows the crash logs on the device when the app crashes
import androidx.fragment.app.FragmentActivity
class LoggerCrashHandler(private val app: FragmentActivity) : Thread.UncaughtExceptionHandler {
private val defaultUEH: Thread.UncaughtExceptionHandler? =
Thread.getDefaultUncaughtExceptionHandler()
override fun uncaughtException(t: Thread, e: Throwable) {
var arr = e.stackTrace
var report = "$e\n\n"
report += "--------- Stack trace ---------\n\n"
@mykeels
mykeels / PoliceNG.yaml
Last active December 10, 2019 09:55
The Nigerian Police Emergency Numbers
--- !https://twitter.com/PoliceNG/status/1204006677990821888?s=19
states:
- state : abia
phones:
- '0803541540'
- '08079210003'
- '08079210004'
- '08079210005'
- state : adamawa
phones:
@ArthurNagy
ArthurNagy / RoundedBottomSheetDialogFragment.kt
Last active May 10, 2024 09:22
Rounded modal bottom sheet as seen in new Google products(Tasks, News, etc.), described in this article: https://medium.com/halcyon-mobile/implementing-googles-refreshed-modal-bottom-sheet-4e76cb5de65b
package com.your.package
import android.app.Dialog
import android.os.Bundle
import com.your.package.R
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
/**
* BottomSheetDialog fragment that uses a custom
@NezSpencer
NezSpencer / README.md
Created September 15, 2017 03:51 — forked from polbins/README.md
Android Studio as default Git Diff Tool

Create Android Studio Command-line Launcher

  1. Open Android Studio
  2. Go to: Tools > Create Command-line Launcher
  3. Leave as default, Press OK

Configure Git to use Android Studio as default Diff Tool

  1. Add the following lines to your .gitconfig
@lopspower
lopspower / README.md
Last active July 20, 2024 20:26
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@alexfu
alexfu / FragmentObserver.java
Last active June 21, 2024 19:11
Observer pattern for notifying Fragments of a ViewPager to update their views. This will update the current Fragment, as well as the off screen Fragments that are retained.
public class FragmentObserver extends Observable {
@Override
public void notifyObservers() {
setChanged(); // Set the changed flag to true, otherwise observers won't be notified.
super.notifyObservers();
}
}