This file contains hidden or 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
buildscript { | |
ext.kotlin_version = '1.2.10' | |
ext.rxjava2_version = '2.1.9' | |
ext.retrofit_version = '2.3.0' | |
... | |
} | |
... | |
dependencies { | |
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" |
This file contains hidden or 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"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="org.nixan.splashscreenexample"> | |
... | |
<activity android:name=".ShareActivity"> | |
<intent-filter> | |
<action android:name="android.intent.action.SEND" /> | |
<category android:name="android.intent.category.DEFAULT" /> |
This file contains hidden or 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
class AuthActivity : AppCompatActivity() { | |
private val authCardView by lazy { findViewById<CardView>(R.id.authCardView) } | |
private val okButton by lazy { findViewById<Button>(R.id.okButton) } | |
private val cancelButton by lazy { findViewById<Button>(R.id.cancelButton) } | |
private val loginEditText by lazy { findViewById<EditText>(R.id.loginEditText) } | |
private val passwordEditText by lazy { findViewById<EditText>(R.id.passwordEditText) } | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) |
This file contains hidden or 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
private const val ACTIVITY_AUTH = 1000 | |
abstract class SplashedActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
if (!isAuthenticated()) { | |
startActivityForResult(Intent(this, AuthActivity::class.java), ACTIVITY_AUTH) | |
} | |
setTheme(R.style.AppTheme_Base) | |
super.onCreate(savedInstanceState) |
This file contains hidden or 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
<resources> | |
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> | |
<item name="colorPrimary">@color/colorPrimary</item> | |
<item name="colorPrimaryDark">@color/colorPrimaryDark</item> | |
<item name="colorAccent">@color/colorAccent</item> | |
</style> | |
<style name="AppTheme.SplashScreen" parent="AppTheme"> | |
<item name="android:windowBackground">@drawable/splash</item> |
This file contains hidden or 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
(0..10) | |
.asSequence() | |
.map { | |
println(it) | |
it | |
} | |
.filter { it % 2 == 0 } | |
.map { it + 10 } | |
.forEach { println(it) } | |
This file contains hidden or 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
... | |
allprojects { | |
repositories { | |
... | |
maven { url 'https://jitpack.io' } | |
} | |
} | |
... |
This file contains hidden or 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
... | |
dependencies { | |
compile 'com.github.thenixan:android-regexp-formatter:v0.0.+' | |
} | |
... |
This file contains hidden or 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 org.nixan.sandboxapp | |
import android.os.Bundle | |
import android.support.v7.app.AppCompatActivity | |
import android.widget.Button | |
import android.widget.EditText | |
import android.widget.Toast | |
import ru.nixan.regexpformatter.RegExpFormatter | |
class MainActivity : AppCompatActivity() { |