diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c6cbe56 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +*.iml +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..95121b2 --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +KAndy \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..9a8b7e5 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..97626ba --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..508b3d9 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..6a0ef23 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Android API 23 Platform + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..d2340d1 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml new file mode 100644 index 0000000..7f68460 --- /dev/null +++ b/.idea/runConfigurations.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..3c024e8 --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,35 @@ +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' + +android { + compileSdkVersion 23 + buildToolsVersion "23.0.3" + + defaultConfig { + applicationId "github.vatsal.kandy" + minSdkVersion 14 + targetSdkVersion 23 + versionCode 1 + versionName "1.0" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + } +} + +dependencies { + compile fileTree(dir: 'libs', include: ['*.jar']) + testCompile 'junit:junit:4.12' + compile 'com.android.support:appcompat-v7:23.4.0' + compile 'com.android.support:design:23.4.0' + compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" +} +repositories { + mavenCentral() +} diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..03e48fa --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in /Users/appyware/Documents/AndroidSdk/android-sdk-macosx/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/app/src/androidTest/java/github/vatsal/kandy/ApplicationTest.java b/app/src/androidTest/java/github/vatsal/kandy/ApplicationTest.java new file mode 100644 index 0000000..1c7cfbb --- /dev/null +++ b/app/src/androidTest/java/github/vatsal/kandy/ApplicationTest.java @@ -0,0 +1,13 @@ +package github.vatsal.kandy; + +import android.app.Application; +import android.test.ApplicationTestCase; + +/** + * Testing Fundamentals + */ +public class ApplicationTest extends ApplicationTestCase { + public ApplicationTest() { + super(Application.class); + } +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..78f796d --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/github/vatsal/kandy/KotlinActivity.kt b/app/src/main/java/github/vatsal/kandy/KotlinActivity.kt new file mode 100644 index 0000000..630616d --- /dev/null +++ b/app/src/main/java/github/vatsal/kandy/KotlinActivity.kt @@ -0,0 +1,83 @@ +package github.vatsal.kandy + +import android.content.Intent +import android.net.Uri +import android.os.Bundle +import android.support.design.widget.FloatingActionButton +import android.support.v7.app.AppCompatActivity +import android.support.v7.widget.Toolbar +import android.view.Menu +import android.view.MenuItem +import android.widget.TextView + +class KotlinActivity : AppCompatActivity() { + + // declaring value + // does not need any type + // Kotlin does it automatically + // also notice no more semi-colon(;) needed + // rad right! + val textStart = "Made with" + val textEnd = "using Kotlin!" + + // the ? is used to ensure the null exception never comes + // we are thy saved + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_kotlin) + + // the initialising method call + init(); + } + + // no more return type for a method :@ + private fun init() { + + // no more typecasting...loving it already? + val toolbar = findViewById(R.id.toolbar) as Toolbar? + setSupportActionBar(toolbar) + + // eliminate the NULL by using question mark + val tvStart = findViewById(R.id.tv_start) as TextView? + val tvEnd = findViewById(R.id.tv_end) as TextView? + + // easy val setting + // not-null assertions(!!) + tvStart!!.text = textStart + tvEnd!!.text = textEnd + + val fab = findViewById(R.id.fab) as FloatingActionButton? + + // finally no more big ClickListeners!! + // just one line + fab!!.setOnClickListener { openRepo() } + + //Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG).setAction("Action", null).show() + } + + private fun openRepo() { + val url = "https://github.com/code-crusher/KAndy" + val i = Intent(Intent.ACTION_VIEW) + i.data = Uri.parse(url) + startActivity(i) + } + + override fun onCreateOptionsMenu(menu: Menu): Boolean { + // Inflate the menu; this adds items to the action bar if it is present. + menuInflater.inflate(R.menu.menu_kotlin, menu) + return true + } + + override fun onOptionsItemSelected(item: MenuItem): Boolean { + // Handle action bar item clicks here. The action bar will + // automatically handle clicks on the Home/Up button, so long + // as you specify a parent activity in AndroidManifest.xml. + val id = item.itemId + + //noinspection SimplifiableIfStatement + if (id == R.id.action_settings) { + return true + } + return super.onOptionsItemSelected(item) + } +} diff --git a/app/src/main/res/drawable-hdpi/ic_action_name.png b/app/src/main/res/drawable-hdpi/ic_action_name.png new file mode 100644 index 0000000..d470096 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_name.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_action_name.png b/app/src/main/res/drawable-mdpi/ic_action_name.png new file mode 100644 index 0000000..dd4ef2a Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_action_name.png differ diff --git a/app/src/main/res/drawable-nodpi/hero.png b/app/src/main/res/drawable-nodpi/hero.png new file mode 100644 index 0000000..8e9ba07 Binary files /dev/null and b/app/src/main/res/drawable-nodpi/hero.png differ diff --git a/app/src/main/res/drawable-nodpi/kotlin_800x320.png b/app/src/main/res/drawable-nodpi/kotlin_800x320.png new file mode 100644 index 0000000..6b965ac Binary files /dev/null and b/app/src/main/res/drawable-nodpi/kotlin_800x320.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_action_name.png b/app/src/main/res/drawable-xhdpi/ic_action_name.png new file mode 100644 index 0000000..0f2eb62 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_name.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_name.png b/app/src/main/res/drawable-xxhdpi/ic_action_name.png new file mode 100644 index 0000000..9e7ce63 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_name.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_github_logo.png b/app/src/main/res/drawable-xxxhdpi/ic_github_logo.png new file mode 100755 index 0000000..a74e749 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_github_logo.png differ diff --git a/app/src/main/res/layout/activity_kotlin.xml b/app/src/main/res/layout/activity_kotlin.xml new file mode 100644 index 0000000..487e515 --- /dev/null +++ b/app/src/main/res/layout/activity_kotlin.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/content_kotlin.xml b/app/src/main/res/layout/content_kotlin.xml new file mode 100644 index 0000000..7ec1137 --- /dev/null +++ b/app/src/main/res/layout/content_kotlin.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + diff --git a/app/src/main/res/menu/menu_kotlin.xml b/app/src/main/res/menu/menu_kotlin.xml new file mode 100644 index 0000000..5eb1340 --- /dev/null +++ b/app/src/main/res/menu/menu_kotlin.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..cde69bc Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..c133a0c Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..bfa42f0 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..324e72c Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..aee44e1 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/values-v21/styles.xml b/app/src/main/res/values-v21/styles.xml new file mode 100644 index 0000000..dbbdd40 --- /dev/null +++ b/app/src/main/res/values-v21/styles.xml @@ -0,0 +1,9 @@ + + + + diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..149de9a --- /dev/null +++ b/app/src/main/res/values/colors.xml @@ -0,0 +1,6 @@ + + + #486896 + #395f94 + #F78D33 + diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml new file mode 100644 index 0000000..da62b5f --- /dev/null +++ b/app/src/main/res/values/dimens.xml @@ -0,0 +1,5 @@ + + 180dp + 16dp + 16dp + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..b0a76af --- /dev/null +++ b/app/src/main/res/values/strings.xml @@ -0,0 +1,4 @@ + + KAndy + Settings + diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..545b9c6 --- /dev/null +++ b/app/src/main/res/values/styles.xml @@ -0,0 +1,20 @@ + + + + + + + +