This file contains hidden or 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.madebyatomicrobot.things | |
import android.app.Activity | |
import android.os.Bundle | |
import android.util.Log | |
import android.widget.SeekBar | |
import android.widget.SeekBar.OnSeekBarChangeListener | |
import android.widget.TextView | |
import com.google.android.things.pio.PeripheralManagerService | |
import com.google.android.things.pio.UartDevice |
This file contains hidden or 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.drawable.Drawable; | |
import android.support.annotation.ColorRes; | |
import android.support.annotation.DrawableRes; | |
import android.support.v4.content.ContextCompat; | |
import android.support.v4.graphics.drawable.DrawableCompat; | |
public class DrawableHelper { | |
public static Drawable setupTintedIcon(Context context, @DrawableRes int iconDrawableResId, @ColorRes int iconColorResId) { | |
Drawable icon = ContextCompat.getDrawable(context, iconDrawableResId); |
This file contains hidden or 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
// When the EditText is touched, disable touches on it's ScrollView's parents. | |
// Once the user lifts up their finger, enable touches on on the ScrollView's parents once again. | |
@OnTouch(R.id.edit_text) | |
boolean handleNoteFieldTouch(View v, MotionEvent event) { | |
v.getParent().getParent().requestDisallowInterceptTouchEvent(true); | |
switch (event.getAction() & MotionEvent.ACTION_MASK){ | |
case MotionEvent.ACTION_UP: | |
v.getParent().getParent().requestDisallowInterceptTouchEvent(false); | |
break; |
This file contains hidden or 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
// ------------------------------------------------------------------------ | |
// App code: These classes that describe the state of executing a query | |
// that we want to consume as a stream of events. | |
public class Loading { | |
} | |
public class Results<T> { | |
final List<T> results; |
This file contains hidden or 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 (C) 2013 Square, 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 |