first.
This commit is contained in:
27
android/AndroidManifest.xml
Normal file
27
android/AndroidManifest.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="advent.core"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0" >
|
||||
|
||||
<uses-sdk android:minSdkVersion="15" />
|
||||
|
||||
<application
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:label="@string/app_name">
|
||||
<activity android:name=".SplashActivity"
|
||||
android:theme="@android:style/Theme.Translucent.NoTitleBar">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name=".AndroidLauncher">
|
||||
<intent-filter>
|
||||
<action android:name='advent.core.MAIN'/>
|
||||
<category android:name='android.intent.category.DEFAULT'/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
BIN
android/libs/armeabi-v7a/libgdx-box2d.so
Normal file
BIN
android/libs/armeabi-v7a/libgdx-box2d.so
Normal file
Binary file not shown.
BIN
android/libs/armeabi-v7a/libgdx-bullet.so
Normal file
BIN
android/libs/armeabi-v7a/libgdx-bullet.so
Normal file
Binary file not shown.
BIN
android/libs/armeabi-v7a/libgdx.so
Normal file
BIN
android/libs/armeabi-v7a/libgdx.so
Normal file
Binary file not shown.
BIN
android/libs/armeabi/libgdx-box2d.so
Normal file
BIN
android/libs/armeabi/libgdx-box2d.so
Normal file
Binary file not shown.
BIN
android/libs/armeabi/libgdx-bullet.so
Normal file
BIN
android/libs/armeabi/libgdx-bullet.so
Normal file
Binary file not shown.
BIN
android/libs/armeabi/libgdx.so
Normal file
BIN
android/libs/armeabi/libgdx.so
Normal file
Binary file not shown.
BIN
android/libs/x86/libgdx-box2d.so
Normal file
BIN
android/libs/x86/libgdx-box2d.so
Normal file
Binary file not shown.
BIN
android/libs/x86/libgdx-bullet.so
Normal file
BIN
android/libs/x86/libgdx-bullet.so
Normal file
Binary file not shown.
BIN
android/libs/x86/libgdx.so
Normal file
BIN
android/libs/x86/libgdx.so
Normal file
Binary file not shown.
37
android/project.clj
Normal file
37
android/project.clj
Normal file
@@ -0,0 +1,37 @@
|
||||
(defproject advent "0.0.1-SNAPSHOT"
|
||||
:description "FIXME: write description"
|
||||
|
||||
:dependencies [[com.badlogicgames.gdx/gdx "1.3.0" :use-resources true]
|
||||
[com.badlogicgames.gdx/gdx-backend-android "1.3.0"]
|
||||
[com.badlogicgames.gdx/gdx-box2d "1.3.0"]
|
||||
[com.badlogicgames.gdx/gdx-bullet "1.3.0"]
|
||||
[neko/neko "3.0.2"]
|
||||
[org.clojure-android/clojure "1.6.0-RC1" :use-resources true]
|
||||
[play-clj "0.3.9"]]
|
||||
:profiles {:dev {:dependencies [[android/tools.nrepl "0.2.0-bigstack"]
|
||||
[compliment "0.1.3"]]
|
||||
:android {:aot :all-with-unused}}
|
||||
:release {:android
|
||||
{;; Specify the path to your private
|
||||
;; keystore and the the alias of the
|
||||
;; key you want to sign APKs with.
|
||||
;; :keystore-path "/home/user/.android/private.keystore"
|
||||
;; :key-alias "mykeyalias"
|
||||
:aot :all}}}
|
||||
|
||||
:android {;; Specify the path to the Android SDK directory either
|
||||
;; here or in your ~/.lein/profiles.clj file.
|
||||
;; :sdk-path "/home/user/path/to/android-sdk/"
|
||||
|
||||
;; Uncomment this if dexer fails with OutOfMemoryException
|
||||
;; :force-dex-optimize true
|
||||
|
||||
:assets-path "../desktop/resources"
|
||||
:native-libraries-paths ["libs"]
|
||||
:target-version "15"
|
||||
:aot-exclude-ns ["clojure.parallel" "clojure.core.reducers"]
|
||||
:dex-opts ["-JXmx2048M"]}
|
||||
|
||||
:source-paths ["src/clojure" "../desktop/src-common"]
|
||||
:java-source-paths ["src/java" "gen"]
|
||||
:javac-options ["-target" "1.6" "-source" "1.6" "-Xlint:-options"])
|
||||
11
android/res/anim/splash_rotation.xml
Normal file
11
android/res/anim/splash_rotation.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:interpolator="@android:anim/linear_interpolator">
|
||||
<rotate
|
||||
android:duration="2000"
|
||||
android:fromDegrees="0"
|
||||
android:pivotX="49.566%"
|
||||
android:pivotY="66.65%"
|
||||
android:repeatCount="infinite"
|
||||
android:toDegrees="360"/>
|
||||
</set>
|
||||
BIN
android/res/drawable-hdpi/ic_launcher.png
Normal file
BIN
android/res/drawable-hdpi/ic_launcher.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.4 KiB |
BIN
android/res/drawable-hdpi/splash_circle.png
Normal file
BIN
android/res/drawable-hdpi/splash_circle.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.4 KiB |
BIN
android/res/drawable-hdpi/splash_droid.png
Normal file
BIN
android/res/drawable-hdpi/splash_droid.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
BIN
android/res/drawable-hdpi/splash_hands.png
Normal file
BIN
android/res/drawable-hdpi/splash_hands.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.0 KiB |
BIN
android/res/drawable-ldpi/ic_launcher.png
Normal file
BIN
android/res/drawable-ldpi/ic_launcher.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
BIN
android/res/drawable-mdpi/ic_launcher.png
Normal file
BIN
android/res/drawable-mdpi/ic_launcher.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
6
android/res/drawable/splash_background.xml
Normal file
6
android/res/drawable/splash_background.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="20dp"/>
|
||||
<padding android:left="10dp" android:right="10dp" android:top="10dp" android:bottom="10dp"/>
|
||||
<solid android:color="@android:color/black"/>
|
||||
</shape>
|
||||
59
android/res/layout/splashscreen.xml
Normal file
59
android/res/layout/splashscreen.xml
Normal file
@@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:orientation="vertical"
|
||||
android:layout_margin="10dp"
|
||||
android:background="@drawable/splash_background" >
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center" >
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/splash_droid"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/splash_droid" >
|
||||
</ImageView>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/splash_circles"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/splash_circle" >
|
||||
</ImageView>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/splash_droid_hands"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/splash_hands" >
|
||||
</ImageView>
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/splash_app_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="18dp"
|
||||
android:text="Application name"
|
||||
android:textSize="30sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="18dp"
|
||||
android:text="Please wait for the application to load..." />
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
6
android/res/values/strings.xml
Normal file
6
android/res/values/strings.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="app_name">advent</string>
|
||||
|
||||
</resources>
|
||||
20
android/src/java/advent/core/AndroidLauncher.java
Normal file
20
android/src/java/advent/core/AndroidLauncher.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package advent.core;
|
||||
|
||||
import clojure.lang.RT;
|
||||
import clojure.lang.Symbol;
|
||||
|
||||
import com.badlogic.gdx.backends.android.AndroidApplication;
|
||||
import com.badlogic.gdx.Game;
|
||||
|
||||
public class AndroidLauncher extends AndroidApplication {
|
||||
public void onCreate (android.os.Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
RT.var("clojure.core", "require").invoke(Symbol.intern("advent.core"));
|
||||
try {
|
||||
Game game = (Game) RT.var("advent.core", "advent").deref();
|
||||
initialize(game);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
74
android/src/java/advent/core/SplashActivity.java
Normal file
74
android/src/java/advent/core/SplashActivity.java
Normal file
@@ -0,0 +1,74 @@
|
||||
package advent.core;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.AnimationUtils;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.util.Log;
|
||||
|
||||
import clojure.lang.Symbol;
|
||||
import clojure.lang.Var;
|
||||
import clojure.lang.RT;
|
||||
|
||||
import advent.core.R;
|
||||
|
||||
public class SplashActivity extends Activity {
|
||||
|
||||
private static boolean firstLaunch = true;
|
||||
private static String TAG = "Splash";
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
|
||||
if (firstLaunch) {
|
||||
firstLaunch = false;
|
||||
setupSplash();
|
||||
loadClojure();
|
||||
} else {
|
||||
proceed();
|
||||
}
|
||||
}
|
||||
|
||||
public void setupSplash() {
|
||||
setContentView(R.layout.splashscreen);
|
||||
|
||||
TextView appNameView = (TextView)findViewById(R.id.splash_app_name);
|
||||
appNameView.setText(R.string.app_name);
|
||||
|
||||
Animation rotation = AnimationUtils.loadAnimation(this, R.anim.splash_rotation);
|
||||
ImageView circleView = (ImageView)findViewById(R.id.splash_circles);
|
||||
circleView.startAnimation(rotation);
|
||||
}
|
||||
|
||||
public void proceed() {
|
||||
startActivity(new Intent("advent.core.MAIN"));
|
||||
finish();
|
||||
}
|
||||
|
||||
public void loadClojure() {
|
||||
new Thread(new Runnable(){
|
||||
@Override
|
||||
public void run() {
|
||||
Symbol CLOJURE_MAIN = Symbol.intern("neko.init");
|
||||
Var REQUIRE = RT.var("clojure.core", "require");
|
||||
REQUIRE.invoke(CLOJURE_MAIN);
|
||||
|
||||
Var INIT = RT.var("neko.init", "init");
|
||||
INIT.invoke(SplashActivity.this.getApplication());
|
||||
|
||||
try {
|
||||
Class.forName("advent.core.AndroidLauncher");
|
||||
} catch (ClassNotFoundException e) {
|
||||
Log.e(TAG, "Failed loading AndroidLauncher", e);
|
||||
}
|
||||
|
||||
proceed();
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user