Skip to content

Instantly share code, notes, and snippets.

@whalemare
whalemare / dict.dts
Created September 9, 2017 14:00
Dictionary dts for pyglossary tests
#NAME "Lingua"
#INDEX_LANGUAGE "Russian"
#CONTENTS_LANGUAGE "Chinese"
быть в силе
[m1]1) ([i]обладать физическими и душевными силами[/i]) 有势力[/m][m1]2) ([i]иметь власть, влияние[/i]) 有权力[/m]
не с того конца
[m1]\[做得\]不对头[/m]
@whalemare
whalemare / build.gradle
Created September 3, 2017 05:11
Flavors setup
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "ru.whalemare.app"
minSdkVersion 16
@whalemare
whalemare / BasePresenter.kt
Last active July 6, 2017 12:36
MVP implementation
/**
* @since 2017
* @author Anton Vlasov - whalemare
*/
interface BasePresenter<in V : BaseView, R> {
fun attachView(view: V)
fun detachView()
fun attachRouter(router: R?)
fun detachRouter()
@whalemare
whalemare / fonts.xml
Created June 24, 2017 13:08
Android fonts for font-family attribute
<resources>
<string name="roboto_light" translatable="false">sans-serif-light</string>
<string name="roboto_medium" translatable="false">sans-serif-medium</string>
<string name="roboto_regular" translatable="false">sans-serif</string>
<string name="roboto_condensed" translatable="false">sans-serif-condensed</string>
<string name="roboto_black" translatable="false">sans-serif-black</string>
<string name="roboto_thin" translatable="false">sans-serif-thin</string>
</resources>
# RxJava
-keepclassmembers class rx.internal.util.unsafe.*ArrayQueue*Field* {
long producerIndex;
long consumerIndex;
}
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef {
rx.internal.util.atomic.LinkedQueueNode producerNode;
}
@whalemare
whalemare / ic_triangle.xml
Created May 28, 2017 03:11
Треугольник
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportHeight="12"
android:viewportWidth="12">
<!-- Этот путь рисует оранжевый треугольник -->
<path
android:fillColor="#FF9800"
/**
* @since 2017
* @author Anton Vlasov - whalemare
*/
class NoteMakerPresenterImpl : BaseMvpPresenterK<NoteMakerView>(), NoteMakerPresenter {
override fun onClickNoteView() {
isActive { it.showKeyboard() }
}
package ru.whalemare.vkbirthday.mvp.presenter.base
import com.hannesdorfmann.mosby.mvp.MvpBasePresenter
import com.hannesdorfmann.mosby.mvp.MvpView
/**
* @since 2017
* @author Anton Vlasov - whalemare
*/
open class BaseMvpPresenterK<V : MvpView> : MvpBasePresenter<V>() {
@whalemare
whalemare / BaseMvpPresenterK.kt
Created May 27, 2017 09:42
MvpPresenter, Kotlin: how avoid check isViewAttached()
package ru.whalemare.vkbirthday.mvp.presenter.base
import com.hannesdorfmann.mosby.mvp.MvpBasePresenter
import com.hannesdorfmann.mosby.mvp.MvpView
/**
* @since 2017
* @author Anton Vlasov - whalemare
*/
open class BaseMvpPresenterK<V : MvpView> : MvpBasePresenter<V>() {
@whalemare
whalemare / layout.xml
Last active October 18, 2022 04:53
EditText like TextView
<EditText
android:id="@+id/text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:cursorVisible="false"
android:longClickable="false"
android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false"/>