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 nl.qbusict.cupboard; | |
import android.content.ContentValues; | |
import android.database.Cursor; | |
import android.database.MatrixCursor; | |
import android.test.AndroidTestCase; | |
import nl.qbusict.cupboard.convert.EntityConverter.ColumnType; | |
import nl.qbusict.cupboard.convert.FieldConverter; |
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 StringArrayFieldConverter implements FieldConverter<String[]> { | |
@Override | |
public String[] fromCursorValue(Cursor cursor, int columnIndex) { | |
return cursor.getString(columnIndex).split(","); | |
} | |
@Override | |
public void toContentValue(String[] value, String key, ContentValues values) { | |
} |
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
// TypeToken is a Gson class | |
Type type = new TypeToken<List<Author>>(){}.getType(); | |
GsonFieldConverterFactory factory = new GsonFieldConverterFactory(type); | |
// Register the factory and set the instance as the global Cupboard instance | |
CupboardFactory.setCupboard(new CupboardBuilder().registerFieldConverterFactory(factory).build()); |
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 | |
# This script runs a configure script with the Android NDK toolchain | |
# You may need to adjust the COMPILE_TARGET and ANDROID_API variables | |
# depending on your requirements. | |
# | |
# Call this script in a directory with a valid configure script. | |
# Example: PREFIX=${PWD}/bin android-configure.sh | |
# Set the ANDROID_NDK variable to the root |
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
/* | |
* Copyright 2014 Google Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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.inperson.android.utils.leastview; | |
import android.content.Context; | |
import android.support.v7.widget.GridLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.View; | |
import android.view.ViewGroup; | |
public class WrappableGridLayoutManager extends GridLayoutManager { |
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 org.jetbrains.spek.api.Spek | |
import org.jetbrains.spek.api.dsl.given | |
import org.jetbrains.spek.api.dsl.it | |
import org.junit.Assert | |
class ExampleSpekTest : Spek({ | |
val x = 2 | |
val y = 3 |