This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Workaround for 'unknown to this navigation controller' error */ | |
fun Fragment.isCurrentDestination(): Boolean { | |
val navController = findNavController() | |
val currentDestinationId = navController.currentDestination?.id | |
val fragmentDestinationId = view?.getTag(R.id.tag_navigation_destination_id) ?: currentDestinationId | |
return if (currentDestinationId == fragmentDestinationId) { | |
view?.setTag(R.id.tag_navigation_destination_id, fragmentDestinationId) | |
true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/expect -f | |
# usage: ./hubottest "hubot help" | |
spawn bin/hubot.coffee | |
sleep 3 | |
expect "Hubot>" | |
send "hubot [lrange $argv 0 10]\n" | |
expect eof |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.view.animation.Interpolator; | |
import static java.lang.Math.*; | |
public class BetterBounceInterpolator implements Interpolator { | |
private int mBounces; | |
private double mEnergy; | |
/** Have more control over how to bounce your values. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- the provider must extend com.google.firebase.provider.FirebaseInitProvider --> | |
<provider | |
android:process=":background_process" | |
android:name="my.app.package.BackgroundProcessFirebaseProvider" | |
android:exported="false" | |
android:authorities="my.app.package.firebaseinitprovider" | |
android:initOrder="100" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<!-- google's material design colours from | |
http://www.google.com/design/spec/style/color.html#color-ui-color-palette --> | |
<!--reds--> | |
<color name="md_red_50">#FFEBEE</color> | |
<color name="md_red_100">#FFCDD2</color> | |
<color name="md_red_200">#EF9A9A</color> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<activity | |
android:enabled="false" | |
android:icon="@drawable/leak_canary_icon" | |
android:label="@string/__leak_canary_display_activity_label" | |
android:name="com.squareup.leakcanary.internal.DisplayLeakActivity" | |
android:taskAffinity="com.squareup.leakcanary" | |
android:theme="@style/__LeakCanary.Base"> | |
<intent-filter tools:node="remove"> | |
<action android:name="android.intent.action.MAIN"/> | |
<category android:name="android.intent.category.LAUNCHER"/> |