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
android.applicationVariants.all { variant -> | |
println "*********" + variant.description + "**********"; | |
def variants = variant.baseName.split("-"); | |
def apkName = "ricebook-"; | |
apkName += variants[0]; | |
apkName += "-v" + android.defaultConfig.versionName; | |
if (!variant.zipAlign) { | |
apkName += "-unaligned"; | |
} | |
if (variant.buildType.name == "release") { |
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.Service; | |
import android.content.Intent; | |
import android.graphics.ImageFormat; | |
import android.hardware.camera2.CameraAccessException; | |
import android.hardware.camera2.CameraCaptureSession; | |
import android.hardware.camera2.CameraCharacteristics; | |
import android.hardware.camera2.CameraDevice; | |
import android.hardware.camera2.CameraManager; | |
import android.hardware.camera2.CaptureRequest; | |
import android.media.Image; |
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
class UsersAdapter extends RecyclerView.Adapter<UsersAdapter.UserViewHolder> { | |
private Context mContext; | |
private LayoutInflater mLayoutInflater; | |
private List<User> mUsers; | |
private OnUserClickListener mOnUserClickListener; | |
private final View.OnClickListener mOnItemClickListener = new View.OnClickListener() { | |
@Override |
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 | |
set -e | |
if [ -z "$1" ]; then | |
shot_path=$(date +%Y-%m-%d-%H-%M-%S).mp4 | |
else | |
shot_path="$*" | |
fi |
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.me.keyboard.test; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import android.view.KeyEvent; | |
import android.widget.EditText; | |
import android.widget.TextView; | |
import android.widget.Toast; | |
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.util.Log; | |
import com.crashlytics.android.Crashlytics; | |
import timber.log.Timber; | |
/** | |
* A logging implementation which reports 'info', 'warning', and 'error' logs to Crashlytics. | |
*/ | |
public final class CrashlyticsTree extends Timber.Tree { | |
@Override |
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 abstract class AppBarStateChangedListener implements AppBarLayout.OnOffsetChangedListener { | |
public enum State { | |
EXPANDED, | |
COLLAPSED, | |
IDLE | |
} | |
private State mCurrentState = State.IDLE; |
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
String networkSSID = "Your Network SSID here"; | |
String networkPasskey = "YourNetworkPasswordHere"; | |
WifiConfiguration wifiConfiguration = new WifiConfiguration(); | |
wifiConfiguration.SSID = "\"" + networkSSID + "\""; | |
wifiConfiguration.preSharedKey = "\"" + networkPasskey + "\""; | |
WifiManager manager = (WifiManager) getSystemService(WIFI_SERVICE); | |
manager.addNetwork(wifiConfiguration); |
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.support.annotation.IntRange; | |
import android.support.annotation.NonNull; | |
import android.text.TextUtils; | |
import com.petcube.android.helpers.Log; | |
import java.util.concurrent.TimeUnit; | |
import rx.Observable; | |
import rx.Subscriber; |
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 java.io.File; | |
import java.io.IOException; | |
import java.nio.charset.Charset; | |
import java.text.DateFormat; | |
import java.text.SimpleDateFormat; | |
import java.util.Date; | |
import java.util.Locale; | |
import java.util.TimeZone; | |
import okio.BufferedSource; | |
import okio.ByteString; |