Skip to content

Instantly share code, notes, and snippets.

View captainstu72's full-sized avatar

stualsford captainstu72

View GitHub Profile
@captainstu72
captainstu72 / strings_main.xml
Created July 29, 2015 15:28
Home Switch localisation base
<resources>
<string name="open_settings">Open Settings</string>
<string name="retry">Retry</string>
<string name="emui_title">EMUI is unsupported</string>
<string name="emui_text">Unfortunately EMUI (Huawei/Honor) does not support how Home Switch changes launchers. You will need to do this manually. \n\n1. Open Settings \n2. Manage Apps\n3.Default Apps\n4.Launcher. Pick a new launcher (Other than Home Switch).</string>
<string name="miui_title">MIUI is unsupported</string>
<string name="miui_text">Unfortunately MIUI (Xiaomi) does not support how Home Switch changes launchers. You will need to do this manually.\n\n1. Open Settings \n2. Manage Apps\n3.Default Apps\n4.Launcher. Pick a new launcher (Other than Home Switch).</string>
@captainstu72
captainstu72 / CircleButton.java
Created September 16, 2014 13:01
Modified CircleButton
import android.animation.ObjectAnimator;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Build;
import android.util.AttributeSet;
import android.util.TypedValue;
@captainstu72
captainstu72 / PmLabelSort
Last active August 29, 2015 14:03
Android Package Manager Sort by Label
List<ApplicationInfo> packages = pm.getInstalledApplications(PackageManager.GET_META_DATA);
Comparator<ApplicationInfo> packageComparator = new Comparator<ApplicationInfo>() {
public int compare(ApplicationInfo obj1,ApplicationInfo obj2) {
return obj1.loadLabel(pm).toString().compareToIgnoreCase(obj2.loadLabel(pm).toString());
}
};
Collections.sort(packages, packageComparator);
@captainstu72
captainstu72 / PercentView.java
Last active January 2, 2016 02:19
Please see the read me below for usage instructions.
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
//modified version of the code provided on this SO thread.