Skip to content

Instantly share code, notes, and snippets.

View darwind's full-sized avatar

Kasper Rugård Thomsen darwind

  • rugaard.it
  • Copenhagen
View GitHub Profile
@darwind
darwind / gist:0faf46c4bf0394a6dd10
Last active February 23, 2016 10:19
RGBA - Opacities
100% — FF
95% — F2
90% — E6
85% — D9
80% — CC
75% — BF
70% — B3
65% — A6
60% — 99
@darwind
darwind / gist:8bba058aa495c178a66fd744ad7b39b2
Last active June 1, 2016 23:42
Circular reveal splashscreen
**MainActivity**
package it.rugaard.circularreveal;
public class MainActivity extends AppCompatActivity {
private boolean isRevealed;
@Override
protected void onCreate(Bundle savedInstanceState) {
@darwind
darwind / AndroidManifest.xml
Created March 20, 2017 22:30
ViewPager with WebViews that shows individual ProgressBars for each WebView when it's loading
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.loadingview">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
#1. Create a file: adb_restart.sh and put these lines in:
#!/bin/sh
adb kill-server
adb start-server
adb devices
#2. Make the bashscript executable:
chmod a+x adb_restart.sh
@darwind
darwind / gist:4bd71c410a593a6eb136bf5b83c07a80
Created September 30, 2019 13:54
Custom tooltip (PopupWindow)
Create and show tooltip right above BottomNavigationBar:
val popup = PopupWindow(this@MainActivity).apply {
ItemPopupBinding.inflate(LayoutInflater.from(this@MainActivity)).apply {
contentView = this.root
root.setOnClickListener {
dismiss()
}
}