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
| import android.graphics.ImageFormat | |
| import android.renderscript.Allocation | |
| import android.renderscript.Element | |
| import android.renderscript.RenderScript | |
| import android.renderscript.ScriptIntrinsicYuvToRGB | |
| import android.renderscript.Type | |
| import android.util.Log | |
| import android.util.Size | |
| import android.view.Surface |
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
| ## This file must *NOT* be checked into Version Control Systems, | |
| # as it contains information specific to your local configuration. | |
| # | |
| # Location of the SDK. This is only used by Gradle. | |
| # For customization when using a Version Control System, please read the | |
| # header note. | |
| sdk.dir=PleaseSpecifyAndroidSdkPathHere |
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 com.netvirta.common.login | |
| interface LoginView { | |
| fun loginResult(result: Boolean) | |
| } | |
| interface LoginPresenter { | |
| fun processLogin(password: String) | |
| } |
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 com.netvirta.common.login | |
| class LoginPresenterImpl(private val loginView: LoginView): LoginPresenter { | |
| val user = User("John", 1234) | |
| override fun processLogin(password: String) { | |
| if (password.toInt() == user.password){ | |
| loginView.loginResult("Login Successful! Welcome ${user.username}.") | |
| } else { |
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 com.netvirta.common.login | |
| interface LoginView { | |
| fun loginResult(result: String) | |
| } | |
| interface LoginPresenter { | |
| fun processLogin(password: String) | |
| } |
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 com.netvirta.android.login | |
| import android.support.v7.app.AppCompatActivity | |
| import android.os.Bundle | |
| import com.netvirta.common.login.LoginView | |
| import sample.R | |
| class LoginActivity : AppCompatActivity(), LoginView { | |
| 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
| task replaceTest { | |
| doLast { | |
| replaceText("$projectDir/tools/app_history_a", "history.txt", "OK Google", "OK Dara") | |
| } | |
| } | |
| void replaceText(String folderPath, String match, String oldText, String newText) { | |
| fileTree(folderPath).matching { | |
| include match | |
| }.each { |
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 com.netvirta.android.login | |
| import android.os.Bundle | |
| import android.support.v7.app.AppCompatActivity | |
| import com.netvirta.android.R | |
| import com.netvirta.common.login.LoginPresenter | |
| import com.netvirta.common.login.LoginPresenterImpl | |
| import com.netvirta.common.login.LoginView | |
| import kotlinx.android.synthetic.main.activity_login.* |
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="com.netvirta.android"> | |
| <application | |
| android:allowBackup="true" | |
| android:label="@string/app_name" | |
| android:supportsRtl="true" | |
| android:theme="@style/AppTheme"> | |
| <activity android:name="com.netvirta.android.login.LoginActivity"> | |
| <intent-filter> |
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"?> | |
| <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| xmlns:tools="http://schemas.android.com/tools" | |
| xmlns:app="http://schemas.android.com/apk/res-auto" | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| tools:context="com.netvirta.android.login.LoginActivity"> | |
| <EditText | |
| android:layout_width="wrap_content" |