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
.idea | |
out/* | |
*.iml | |
target | |
settings.xml |
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
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.github.insanusmokrassar</groupId> | |
<artifactId></artifactId> | |
<version></version> | |
<packaging>jar</packaging> | |
<name></name> |
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 FilesSaver { | |
protected static String absolutePath; | |
public static void setAbsolutePath(String absolutePath) { | |
FilesSaver.absolutePath = absolutePath; | |
} | |
public static String constructPath(String relationPath) { | |
while (relationPath.matches("^/.*$")) { | |
relationPath = relationPath.replaceFirst("/", ""); |
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 FieldsExtractor { | |
protected static final Map<Class, List<Field>> classFieldsCache = new HashMap<>(); | |
public static List<Field> getPublicFields(Class targetClass) { | |
List<Field> result = new ArrayList<>(); | |
if (!classFieldsCache.containsKey(targetClass)) { | |
List<Field> fields = new ArrayList<>(); | |
Class currentValuesTypeClass = targetClass; | |
do { |
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 ActionCaller<T> implements Runnable { | |
protected final Action1<T> target; | |
protected final T value; | |
public ActionCaller(Action1<T> target, T value) { | |
this.target = target; | |
this.value = value; | |
} | |
@Override |
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
fun calculateMeasure( | |
widthMeasureSpec: Int, | |
heightMeasureSpec: Int, | |
heightRatio: Int, | |
widthRatio: Int | |
): Pair<Int, Int> { | |
val originalWidth = MeasureSpec.getSize(widthMeasureSpec) | |
val originalHeight = MeasureSpec.getSize(heightMeasureSpec) |
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
/** | |
* Need "LOGGER_CONFIG_PATH" environment variable which set the place where was put .properties file with config of logger | |
*/ | |
fun loadLoggerConfig() { | |
FileInputStream(System.getenv("LOGGER_CONFIG_PATH")).use { | |
LogManager.getLogManager().readConfiguration(it) | |
} | |
} | |
/** |
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"?> | |
<resources> | |
<dimen name="textDefaultExtraSmallSize">10sp</dimen> | |
<dimen name="textDefaultSmallSize">14sp</dimen> | |
<dimen name="textDefaultMediumSize">18sp</dimen> | |
<dimen name="textDefaultLargeSize">22sp</dimen> | |
<dimen name="textDefaultExtraLargeSize">26sp</dimen> | |
<dimen name="viewDefaultSmallMargin">4dp</dimen> | |
<dimen name="viewDefaultMediumMargin">8dp</dimen> |
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 android.content.ContentValues | |
import android.database.Cursor | |
import android.database.sqlite.SQLiteDatabase | |
import android.util.Log | |
import kotlin.reflect.KClass | |
import kotlin.reflect.KProperty | |
val nativeTypesMap = mapOf( | |
Pair( | |
Int::class, |
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 android.support.v7.widget.RecyclerView | |
import android.view.View | |
abstract class AbstractViewHolder<in T>(viewCreator: () -> View) : RecyclerView.ViewHolder(viewCreator()) { | |
abstract fun refreshItem(item: T) | |
} |
OlderNewer