- Remove
local.properties
from VCS - Hide api key from VCS, multi-env support
- Craft and choose code style
- Know last android dev news
- Migrate from jCenter to Maven Central
- Use Material Components
local.properties
from VCSimport org.junit.Test | |
class ExampleUnitTest { | |
// any collection | |
private val set: MutableCollection<Int> = mutableSetOf() | |
@Test | |
fun test() { | |
val range = 1 until 6 |
import org.assertj.core.api.Assertions.* | |
import org.junit.Test | |
class DemoUnitTest { | |
@Test | |
fun additionIsCorrect() { | |
assertThat(2 + 2).isEqualTo(4) | |
} |
import org.assertj.core.api.Assertions.assertThat | |
import org.junit.Assert.assertNotNull | |
import org.junit.Test | |
class ChainTest { | |
sealed class Chain<T> { | |
companion object { |
package ru.kontur.cashbox.presentation.settings.about | |
import ru.kontur.cashbox.R | |
import ru.kontur.cashbox.global.ResourceManager | |
import java.text.SimpleDateFormat | |
import java.util.* | |
class NotOccurredFormatter(private val stub: String): PossibilityFormatter() { | |
override fun should(diff: DiffTime) = diff.point.time < 1 |
abstract class HeaderScrollingViewBehavior extends ViewOffsetBehavior<View> { | |
// also code | |
@Override | |
public boolean onMeasureChild(CoordinatorLayout parent, View child, | |
int parentWidthMeasureSpec, int widthUsed, int parentHeightMeasureSpec, | |
int heightUsed) { | |
final int childLpHeight = child.getLayoutParams().height; | |
if (childLpHeight == ViewGroup.LayoutParams.MATCH_PARENT |
/** | |
* Реализует выделение изменившейся ячейки RecyclerView. Ячейка лпавно изменяет свой фон от [primaryColor] до [accentColor]. | |
* При повторном изменении ячейки состояние предыдущей анимации переносится на новую (происходит возобновление). | |
* | |
* @see <a href="https://github.com/google/android-ui-toolkit-demos/tree/master/RecyclerView/RecyclerViewAnimations">Пример от Google</a> | |
* @param primaryColor нормальный цвет ячейки | |
* @param accentColor выделенный цвет ячейки | |
* @param shouldSaveAnimation следует ли сохранять состояние анимации при ее возобновлении | |
*/ | |
class BlinkAnimator(@ColorInt private val primaryColor: Int, @ColorInt private val accentColor: Int, private val shouldSaveAnimation: Boolean): DefaultItemAnimator() { |
package com.turlir.abakgists; | |
import com.google.gson.Gson; | |
import org.junit.Test; | |
import java.util.Objects; | |
import static org.junit.Assert.*; | |
public class Demo { | |
@Test |
@Test | |
fun copyIntToString() { | |
val ints: Array<Int> = arrayOf(1, 2, 3) | |
val anys: Array<Any> = arrayOf("first", "second", "three") | |
copy(ints, anys) | |
for (a in anys) { | |
println(a) // 1, 2, 3 | |
} | |
assertArrayEquals(ints, anys) | |
} |
<!-- | |
layout | |
--> | |
<TextView xmlns:android="http://schemas.android.com/apk/res/android" | |
android:id="@android:id/title" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_marginBottom="16dip" | |
android:textAppearance="@style/Preference_TextAppearanceMaterialBody2" | |
android:textColor="@color/preference_fallback_accent_color" |