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 org.chromium.base.library_loader; | |
import android.content.Context; | |
import android.content.pm.ApplicationInfo; | |
import android.os.Build; | |
import android.util.Log; | |
import java.io.File; | |
import java.io.FileOutputStream; | |
import java.io.IOException; |
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 static List<T> fromJsonList(String json, Class<T> klass) { | |
Gson gson = new Gson(); | |
return gson.fromJson(json, new ListOfSomething<T>(klass)); | |
} |
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
//Thanks to https://github.com/stephanenicolas/Quality-Tools-for-Android/blob/master/build.gradle | |
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:0.7.+' | |
} | |
} |
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 void processMouseMove(int mouseX, int mouseY, int pid) | |
public void processMouseDown(int mouseX, int mouseY, int pid) | |
public void processMouseUp(int mouseX, int mouseY, int pid) | |
public boolean onTouch(View v, MotionEvent event) { | |
int p = event.getActionIndex(); | |
switch(event.getActionMasked()){ | |
case MotionEvent.ACTION_DOWN: | |
case MotionEvent.ACTION_POINTER_DOWN: |
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 RecyclerItemClickListener implements RecyclerView.OnItemTouchListener { | |
private OnItemClickListener mListener; | |
public interface OnItemClickListener { | |
public void onItemClick(View view, int position); | |
} | |
GestureDetector mGestureDetector; | |
public RecyclerItemClickListener(Context context, OnItemClickListener listener) { |
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 static boolean isMIUI() { | |
String propName = "ro.miui.ui.version.name"; | |
String line; | |
BufferedReader input = null; | |
try { | |
Process p = Runtime.getRuntime().exec("getprop " + propName); | |
input = new BufferedReader(new InputStreamReader(p.getInputStream()), 1024); | |
line = input.readLine(); | |
input.close(); | |
} catch (IOException ex) { |
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"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.teambition.today" > | |
<uses-permission android:name="android.permission.GET_TASKS" /> | |
</manifest> |
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
/* | |
* Author: Felipe Herranz (felhr85@gmail.com) | |
* Contributors:Francesco Verheye (verheye.francesco@gmail.com) | |
* Israel Dominguez (dominguez.israel@gmail.com) | |
*/ | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.concurrent.atomic.AtomicBoolean; | |
import android.os.Handler; |
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 SimpleBaseAdapter<T> extends BaseAdapter { | |
protected Context context; | |
protected List<T> data; | |
public SimpleBaseAdapter(Context context, List<T> data) { | |
this.context = context; | |
this.data = data == null ? new ArrayList<T>() : new ArrayList<T>(data); | |
} |
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 | |
### BEGIN INIT INFO | |
# Provides: redis-server | |
# Required-Start: $syslog | |
# Required-Stop: $syslog | |
# Should-Start: $local_fs | |
# Should-Stop: $local_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: redis-server - Persistent key-value db |
NewerOlder