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 org.jetbrains.spek.api.Spek | |
import org.jetbrains.spek.api.dsl.given | |
import org.jetbrains.spek.api.dsl.it | |
import org.junit.Assert | |
class ExampleSpekTest : Spek({ | |
val x = 2 | |
val y = 3 |
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
public class ChromeTabUtils { | |
public static void openUrl(Context context, String url) { | |
if (isChromeTabSupported(context)) { | |
// Build intent to open Chrome Tab | |
CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder(); | |
builder.setToolbarColor(getColor(context, R.color.toolbarBackground)); | |
CustomTabsIntent customTabsIntent = builder.build(); | |
customTabsIntent.launchUrl(context, Uri.parse(url)); | |
} else { |
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
package com.github.marwinxxii.rxsamples; | |
import rx.Observable; | |
import rx.subjects.PublishSubject; | |
import rx.subjects.Subject; | |
public class SeparateBusSample { | |
public static void test() { | |
EventBus<String> stringEventBus = new EventBus<>(); | |
EventBus<Long> longEventBus = new EventBus<>(); |
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
package com.inperson.android.utils.leastview; | |
import android.content.Context; | |
import android.support.v7.widget.GridLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.View; | |
import android.view.ViewGroup; | |
public class WrappableGridLayoutManager extends GridLayoutManager { |
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.app.Activity; | |
import android.app.Dialog; | |
import android.support.v4.app.DialogFragment; | |
/** | |
* Base dialog fragment. | |
* @param <Listener> listener type. | |
*/ | |
public abstract class BaseDialogFragment<Listener> extends DialogFragment { |
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.content.Context; | |
import android.graphics.Canvas; | |
import android.support.design.widget.TextInputLayout; | |
import android.support.v4.view.ViewCompat; | |
import android.util.AttributeSet; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.EditText; | |
public class CustomTextInputLayout extends TextInputLayout { |
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
Bitmap batmapBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.batman); | |
RoundedBitmapDrawable circularBitmapDrawable = RoundedBitmapDrawableFactory.create(getResources(), batmapBitmap); | |
// option 1 h/t [Chris Banes](https://chris.banes.me/) | |
circularBitmapDrawable.setCornerRadius(batmapBitmap.getWidth()); | |
// option 2 h/t @csorgod in the comments | |
circularBitmapDrawable.setCircular(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
<?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
/* | |
* Copyright 2014 Google Inc. | |
* | |
* 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 |
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
#!/bin/sh | |
# This script runs a configure script with the Android NDK toolchain | |
# You may need to adjust the COMPILE_TARGET and ANDROID_API variables | |
# depending on your requirements. | |
# | |
# Call this script in a directory with a valid configure script. | |
# Example: PREFIX=${PWD}/bin android-configure.sh | |
# Set the ANDROID_NDK variable to the root |
NewerOlder