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
<service android:name=".ListenerServiceFromWear"> | |
<intent-filter> | |
<action android:name="com.google.android.gms.wearable.BIND_LISTENER" /> | |
</intent-filter> | |
</service> |
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 MyFragment { | |
boolean loaded; | |
private void maybeLoad() { | |
if (!loaded && getUserVisibleHint()) { | |
loaded = true; | |
loadMyData(); | |
} | |
} | |
@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 class ColoredSnackBar { | |
private static final int red = 0xfff44336; | |
private static final int green = 0xff4caf50; | |
private static final int blue = 0xff2195f3; | |
private static final int orange = 0xffffc107; | |
private static View getSnackBarLayout(Snackbar snackbar) { | |
if (snackbar != null) { |
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.twnel.android.ui.views; | |
/** | |
* Created by etiennelawlor on 8/20/15. | |
*/ | |
import android.graphics.Bitmap; | |
import android.graphics.drawable.BitmapDrawable; | |
import android.support.annotation.NonNull; | |
import android.support.v7.graphics.Palette; | |
import android.widget.ImageView; |
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
<EditText android:id="@+id/edtInput" | |
android:layout_width="0dip" | |
android:layout_height="wrap_content" | |
android:layout_weight="1" | |
android:inputType="textShortMessage|textAutoCorrect|textCapSentences|textMultiLine" | |
android:imeOptions="actionSend|flagNoEnterAction" | |
android:maxLines="4" | |
android:maxLength="2000" | |
android:hint="@string/compose_hint"/> |
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
DEPRECATED | |
About 24 hours after publishing this library, I found out that a regular LinearLayout with measureWithLargestChild="true" can indeed be used to achieve the desired result. Here is an example of how this can be done: | |
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:orientation="horizontal" | |
android:measureWithLargestChild="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
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.graphics.Canvas; | |
import android.graphics.Rect; | |
import android.graphics.drawable.Drawable; | |
import android.support.v4.content.ContextCompat; | |
import android.support.v7.widget.LinearLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
import android.util.AttributeSet; | |
import android.view.View; |
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.annotation.TargetApi; | |
import android.content.Context; | |
import android.content.ContextWrapper; | |
import android.content.SharedPreferences; | |
import android.content.SharedPreferences.Editor; | |
import android.os.Build; | |
import android.text.TextUtils; | |
import android.util.Log; |
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 SQLQueryBuilder { | |
private static final String STATEMENT_SELECT = "SELECT"; | |
private static final String STATEMENT_DISTINCT_SELECT = "SELECT DISTINCT"; | |
private static final String STATEMENT_UPDATE = "UPDATE"; | |
private static final String STATEMENT_INSERT_INTO = "INSERT INTO"; | |
private static final String STATEMENT_DELETE = "DELETE FROM"; | |
private static final String WHERE = "WHERE"; | |
private static final String FROM = "FROM"; |