Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
app:startDestination="@id/splashFragment">
<fragment
android:id="@+id/splashFragment"
android:name="com.example.navigationsample.fragments.SplashFragment"
android:label="SplashFragment"
<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
app:startDestination="@id/splashFragment">
<fragment
android:id="@+id/splashFragment"
android:name="com.example.navigationsample.fragments.SplashFragment"
android:label="SplashFragment"
private static int WORK_HOURS_PER_DAY = 8;
private static int WORK_DAYS_PER_WEEK = 5;
public static int calculatePayforWeek(int payPerHour){
int s = payPerHour*WORK_HOURS_PER_DAY*WORK_DAYS_PER_WEEK;
return s;
}
public static int calculatePayforWeek(int payPerHour){
int s = payPerHour*5*8;
return s;
}
public static void copyNumbers(int a1[], int a2[]) {
for (int i = 0; i < a1.length; i++) {
a2[i] = a1[i];
}
}
public static void copyNumbers(int source[], int destination[]) {
for (int i = 0; i < source.length; i++) {
destination[i] = source[i];
}
}
public List<Integer> getEvenNumbers(List<Integer> theList) {
List<Integer> list1 = new ArrayList<Integer>();
for (Integer i : theList)
if (i%2 == 0)
list1.add(i);
return list1;
}
public List<Integer> getThem(List<Integer> theList) {
List<Integer> list1 = new ArrayList<Integer>();
for (Integer i : theList)
if (i%2 == 0)
list1.add(i);
return list1;
}
@gogeta95
gogeta95 / Rxjava remove query.java
Last active January 23, 2017 12:32
Rxjava remove query
public void removeMovie(final int id) {
Observable.fromCallable(new Func0<Integer>() {
@Override
public Integer call() {
return database.delete(MyDatabaseHelper.TABLE_FAVORITES, MyDatabaseHelper.COLUMN_ID + " = " + id, null);
}
}).subscribeOn(Schedulers.io())
.observeOn(Schedulers.io())
.subscribe(new Action1<Integer>() {
@Override
@gogeta95
gogeta95 / build.gradle
Last active September 23, 2016 21:34
Enable different build numbers for different ABIs.
android {
//.....
}
// map for the version code that gives each ABI a value. make sure to list all ABIs mentioned in splits block, an keep the order.
ext.versionCodes = ['armeabi': 3, 'armeabi-v7a': 4, 'arm64-v8a': 5, mips: 6, 'x86': 7, 'x86_64': 8]
import com.android.build.OutputFile
// For each APK output variant, override versionCode with a combination of
// ABI APK value * 1000 + defaultConfig.versionCode
android.applicationVariants.all { variant ->