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.text.TextUtils; | |
import io.realm.Case; | |
import io.realm.Realm; | |
import io.realm.RealmObject; | |
import io.realm.RealmResults; | |
public class RealmFullTextSearch { | |
public static <T extends RealmObject> RealmResults<T> search(Realm realm, Class<T> modelClass, String query, String fieldName, boolean partialSearch){ |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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"?> | |
<fragment xmlns:android="http://schemas.android.com/apk/res/android" | |
android:id="@+id/map" | |
android:name="com.google.android.gms.maps.SupportMapFragment" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" /> |
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 BatteryActivity extends Activity { | |
//UI Elements | |
private TextView mTextViewLevel; | |
private TextView mTextViewTemperature; | |
private TextView mTextViewVoltage; | |
private TextView mTextViewHealth; | |
//Battery details | |
private int level; |
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
/** | |
* A collection of authentication and account connection utilities. With strong inspiration from the Google IO session | |
* app. | |
* @author Dandré Allison | |
*/ | |
public class AccountUtils { | |
/** | |
* Interface for interacting with the result of {@link AccountUtils#getUserProfile}. | |
*/ |
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 AnimatedActivity extends Activity | |
{ | |
@Override | |
protected void onCreate(Bundle savedInstanceState) | |
{ | |
super.onCreate(savedInstanceState); | |
//opening transition animations | |
overridePendingTransition(R.anim.activity_open_translate,R.anim.activity_close_scale); | |
} |
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
// Slide up animation | |
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" > | |
<translate | |
android:duration="@android:integer/config_mediumAnimTime" | |
android:fromYDelta="100%" | |
android:interpolator="@android:anim/accelerate_interpolator" | |
android:toXDelta="0" /> |
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.res.Configuration; | |
import android.os.Bundle; | |
import android.support.v4.view.MenuItemCompat; | |
import android.support.v4.widget.DrawerLayout; | |
import android.support.v7.app.ActionBarActivity; | |
import android.support.v7.app.ActionBarDrawerToggle; | |
import android.support.v7.widget.SearchView; | |
import android.util.Log; | |
import android.view.Menu; | |
import android.view.MenuItem; |
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.example; | |
import android.content.Context; | |
import com.squareup.okhttp.HttpResponseCache; | |
import com.squareup.okhttp.OkHttpClient; | |
import com.squareup.picasso.OkHttpDownloader; | |
import com.squareup.picasso.Picasso; | |
import javax.net.ssl.SSLContext; | |
import java.io.File; |
NewerOlder