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 ObjectSerializer { | |
companion object { | |
public fun serialize(obj: Any?) : String { | |
if (obj == null) { | |
return "" | |
} | |
var baos = ByteArrayOutputStream() | |
var oos = ObjectOutputStream(baos) | |
oos.writeObject(obj) |
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 SquareImageView extends ImageView { | |
public SquareImageView(Context context) { | |
this(context, null); | |
} | |
public SquareImageView(Context context, AttributeSet attrs) { | |
this(context, attrs, 0); | |
} | |
public SquareImageView(Context context, AttributeSet attrs, int defStyle) { |
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 CollectionUtil { | |
public interface PropertyGetter <T, U> { | |
public U getProperty(T from); | |
} | |
public static <T, U> List<T> getPropertiesFromList(List<U> list, PropertyGetter<U, T> getter) { | |
List<T> result = new ArrayList<T>(); | |
for (U object : list) { | |
result.add(getter.getProperty(object)); | |
} |
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 FilteringAdapter<T> extends BaseAdapter implements Filterable { | |
public interface StringGetter<T> { | |
String getString(T from); | |
} | |
protected Context context; | |
protected List<T> origin; |