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.os.Bundle; | |
import android.support.v7.app.AppCompatActivity; | |
import android.widget.Button; | |
import android.widget.TextView; | |
import android.widget.Toast; | |
import butterknife.BindView; | |
import butterknife.ButterKnife; | |
import butterknife.OnClick; | |
import dart.Dart; |
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
apply plugin: 'com.android.application' | |
android { | |
compileSdkVersion 27 | |
buildToolsVersion '27.0.3' | |
defaultConfig { | |
applicationId "com.f22labs.darthensondemo" | |
minSdkVersion 21 | |
targetSdkVersion 27 | |
versionCode 1 |
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
buildscript { | |
repositories { | |
jcenter() | |
google() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:3.1.4' | |
classpath 'com.f2prateek.dart:henson-plugin:3.0.1' // Add the Henson plugin to the classpath | |
// NOTE: Do not place your application dependencies here; they belong |
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
apply plugin: 'com.android.application' | |
apply plugin: 'dart.henson-plugin' // Apply plugin | |
android { | |
compileSdkVersion 27 | |
buildToolsVersion '27.0.3' | |
defaultConfig { | |
applicationId "com.f22labs.darthensondemo" | |
minSdkVersion 21 | |
targetSdkVersion 27 |
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.Intent; | |
import android.os.Bundle; | |
import android.support.v7.app.AppCompatActivity; | |
import android.widget.Button; | |
import android.widget.EditText; | |
import butterknife.BindView; | |
import butterknife.ButterKnife; | |
import butterknife.OnClick; |
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
// MainActivity.java | |
private void onSomeItemSelected(Item item) { | |
Intent intent = new Intent(this, SomeAwesomeAndHyperRealisticDetailActivity.class); | |
intent.putExtra(SomeAwesomeAndHyperRealisticDetailActivity.EXTRA_ITEM_ID, "id"); | |
intent.putExtra(SomeAwesomeAndHyperRealisticDetailActivity.EXTRA_WANNA_SHOW, true); | |
startActivity(intent); | |
} | |
// SomeAwesomeAndHyperRealisticDetailActivity.java | |
public static String EXTRA_ITEM_ID = "EXTRA_ITEM_ID"; |
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
// MainActivity.java | |
public class MainActivity extends AppCompactActivity{ | |
public static String extra_item_id = "some item id"; | |
public static boolean extra_wanna_show = true; | |
public static String getExtraItemId(){ | |
return extra_item_id; | |
} | |
public static boolean getExtraWannaShow(){ |
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
// Reference taken from | |
// https://www.raywenderlich.com/262-dependency-injection-in-android-with-dagger-2-and-kotlin | |
class Parent { | |
private val child = Child() | |
} | |
class Parent(private val child: Child) |
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
class Info(val text: String) | |
// Module | |
val bag = module { | |
single { Info("Hello Koin") } | |
} | |
// MainActivity | |
class MainActivity : AppCompatActivity() { | |
OlderNewer