Skip to content

Commit 98666c8

Browse files
author
Kittinun Vantasin
committed
inception of Fuel
0 parents  commit 98666c8

File tree

25 files changed

+547
-0
lines changed

25 files changed

+547
-0
lines changed

.gitignore

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
.DS_Store
2+
3+
# built application files
4+
*.apk
5+
*.ap_
6+
7+
# files for the dex VM
8+
*.dex
9+
10+
# Java class files
11+
*.class
12+
13+
# generated files
14+
bin/
15+
gen/
16+
17+
# Local configuration file (sdk path, etc)
18+
local.properties
19+
20+
# Eclipse project files
21+
.classpath
22+
.project
23+
24+
# Android Studio
25+
.idea/
26+
.gradle
27+
gradle
28+
/*/local.properties
29+
/*/out
30+
/*/*/build
31+
build
32+
/*/*/production
33+
*.iml
34+
*.iws
35+
*.ipr
36+
*~
37+
*.swp

app/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
apply plugin: 'com.android.application'
2+
apply plugin: 'kotlin-android'
3+
4+
android {
5+
compileSdkVersion 22
6+
buildToolsVersion "22.0.1"
7+
8+
defaultConfig {
9+
applicationId "com.example.kotlin.fueldemo"
10+
minSdkVersion 16
11+
targetSdkVersion 22
12+
versionCode 1
13+
versionName "1.0"
14+
}
15+
buildTypes {
16+
release {
17+
minifyEnabled false
18+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
19+
}
20+
}
21+
sourceSets {
22+
main.java.srcDirs += 'src/main/kotlin'
23+
}
24+
}
25+
26+
dependencies {
27+
compile fileTree(dir: 'libs', include: ['*.jar'])
28+
29+
compile 'com.android.support:appcompat-v7:22.1.1'
30+
31+
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
32+
33+
compile project(':fuel')
34+
}
35+
36+
buildscript {
37+
ext.kotlin_version = '0.11.91.4'
38+
repositories {
39+
mavenCentral()
40+
}
41+
dependencies {
42+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
43+
}
44+
}
45+
46+
repositories {
47+
mavenCentral()
48+
}

app/proguard-rules.pro

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in /Users/kittinunf/Library/Android/sdk/tools/proguard/proguard-android.txt
4+
# You can edit the include path and order by changing the proguardFiles
5+
# directive in build.gradle.
6+
#
7+
# For more details, see
8+
# http://developer.android.com/guide/developing/tools/proguard.html
9+
10+
# Add any project specific keep options here:
11+
12+
# If your project uses WebView with JS, uncomment the following
13+
# and specify the fully qualified class name to the JavaScript interface
14+
# class:
15+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16+
# public *;
17+
#}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.example.kotlin.fueldemo;
2+
3+
import android.app.Application;
4+
import android.test.ApplicationTestCase;
5+
6+
/**
7+
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
8+
*/
9+
public class ApplicationTest extends ApplicationTestCase<Application> {
10+
public ApplicationTest() {
11+
super(Application.class);
12+
}
13+
}

app/src/main/AndroidManifest.xml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.example.kotlin.fueldemo" >
4+
5+
<application
6+
android:allowBackup="true"
7+
android:icon="@mipmap/ic_launcher"
8+
android:label="@string/app_name"
9+
android:theme="@style/AppTheme" >
10+
<activity
11+
android:name=".MainActivity"
12+
android:label="@string/app_name" >
13+
<intent-filter>
14+
<action android:name="android.intent.action.MAIN" />
15+
16+
<category android:name="android.intent.category.LAUNCHER" />
17+
</intent-filter>
18+
</activity>
19+
</application>
20+
21+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package com.example.kotlin.fueldemo
2+
3+
import android.os.Bundle
4+
import android.support.v7.app.AppCompatActivity
5+
import android.view.Menu
6+
import android.view.MenuItem
7+
import android.widget.Toast
8+
import fuel.Fuel
9+
10+
public class MainActivity : AppCompatActivity() {
11+
12+
override fun onCreate(savedInstanceState: Bundle?) {
13+
super.onCreate(savedInstanceState)
14+
setContentView(R.layout.activity_main)
15+
16+
val str = Fuel().greet("Octto")
17+
Toast.makeText(this, str, Toast.LENGTH_LONG).show()
18+
}
19+
20+
override fun onCreateOptionsMenu(menu: Menu?): Boolean {
21+
// Inflate the menu; this adds items to the action bar if it is present.
22+
getMenuInflater().inflate(R.menu.menu_main, menu)
23+
return true
24+
}
25+
26+
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
27+
// Handle action bar item clicks here. The action bar will
28+
// automatically handle clicks on the Home/Up button, so long
29+
// as you specify a parent activity in AndroidManifest.xml.
30+
val id = item!!.getItemId()
31+
32+
//noinspection SimplifiableIfStatement
33+
if (id == R.id.action_settings) {
34+
return true
35+
}
36+
37+
return super.onOptionsItemSelected(item)
38+
}
39+
}
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:tools="http://schemas.android.com/tools"
3+
android:layout_width="match_parent"
4+
android:layout_height="match_parent"
5+
android:paddingLeft="@dimen/activity_horizontal_margin"
6+
android:paddingRight="@dimen/activity_horizontal_margin"
7+
android:paddingTop="@dimen/activity_vertical_margin"
8+
android:paddingBottom="@dimen/activity_vertical_margin"
9+
tools:context=".MainActivity">
10+
11+
<TextView
12+
android:text="@string/hello_world"
13+
android:layout_width="wrap_content"
14+
android:layout_height="wrap_content"/>
15+
16+
</RelativeLayout>

app/src/main/res/menu/menu_main.xml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<menu xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:app="http://schemas.android.com/apk/res-auto"
3+
xmlns:tools="http://schemas.android.com/tools"
4+
tools:context=".MainActivity">
5+
<item android:id="@+id/action_settings"
6+
android:title="@string/action_settings"
7+
android:orderInCategory="100"
8+
app:showAsAction="never"/>
9+
</menu>
3.34 KB
Loading
2.15 KB
Loading
4.73 KB
Loading
7.54 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<resources>
2+
<!-- Example customization of dimensions originally defined in res/values/dimens.xml
3+
(such as screen margins) for screens with more than 820dp of available width. This
4+
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
5+
<dimen name="activity_horizontal_margin">64dp</dimen>
6+
</resources>

app/src/main/res/values/dimens.xml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<resources>
2+
<!-- Default screen margins, per the Android Design guidelines. -->
3+
<dimen name="activity_horizontal_margin">16dp</dimen>
4+
<dimen name="activity_vertical_margin">16dp</dimen>
5+
</resources>

app/src/main/res/values/strings.xml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<resources>
2+
<string name="app_name">FuelDemo</string>
3+
4+
<string name="hello_world">Hello world!</string>
5+
<string name="action_settings">Settings</string>
6+
</resources>

app/src/main/res/values/styles.xml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<resources>
2+
3+
<!-- Base application theme. -->
4+
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
5+
<!-- Customize your theme here. -->
6+
</style>
7+
8+
</resources>

build.gradle

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2+
3+
buildscript {
4+
repositories {
5+
jcenter()
6+
}
7+
dependencies {
8+
classpath 'com.android.tools.build:gradle:1.2.3'
9+
10+
// NOTE: Do not place your application dependencies here; they belong
11+
// in the individual module build.gradle files
12+
}
13+
}
14+
15+
allprojects {
16+
repositories {
17+
jcenter()
18+
}
19+
}

fuel/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

fuel/build.gradle

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apply plugin: 'kotlin'
2+
3+
dependencies {
4+
compile fileTree(dir: 'libs', include: ['*.jar'])
5+
6+
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
7+
}
8+
9+
buildscript {
10+
ext.kotlin_version = '0.11.91.4'
11+
12+
repositories {
13+
mavenCentral()
14+
}
15+
16+
dependencies {
17+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
18+
}
19+
}

fuel/src/main/kotlin/fuel/Fuel.kt

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package fuel
2+
3+
/**
4+
* Created by Kittinun Vantasin on 5/13/15.
5+
*/
6+
7+
class Fuel {
8+
9+
}

gradle.properties

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Project-wide Gradle settings.
2+
3+
# IDE (e.g. Android Studio) users:
4+
# Gradle settings configured through the IDE *will override*
5+
# any settings specified in this file.
6+
7+
# For more details on how to configure your build environment visit
8+
# http://www.gradle.org/docs/current/userguide/build_environment.html
9+
10+
# Specifies the JVM arguments used for the daemon process.
11+
# The setting is particularly useful for tweaking memory settings.
12+
# Default value: -Xmx10248m -XX:MaxPermSize=256m
13+
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14+
15+
# When configured, Gradle will run in incubating parallel mode.
16+
# This option should only be used with decoupled projects. More details, visit
17+
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18+
# org.gradle.parallel=true

0 commit comments

Comments
 (0)