mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-22 20:18:57 +08:00
add support for sub-activities
This commit is contained in:
@@ -136,20 +136,24 @@ EOS
|
||||
File.open(android_manifest, 'w') do |io|
|
||||
io.print <<EOS
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="#{App.config.package}"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0">
|
||||
<uses-sdk android:minSdkVersion="3" />
|
||||
<application android:label="#{App.config.name}"
|
||||
android:debuggable="true">
|
||||
<activity android:name="#{App.config.main_activity}"
|
||||
android:label="#{App.config.name}">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="#{App.config.package}" android:versionCode="1" android:versionName="1.0">
|
||||
<uses-sdk android:minSdkVersion="3" />
|
||||
<application android:label="#{App.config.name}" android:debuggable="true">
|
||||
<activity android:name="#{App.config.main_activity}" android:label="#{App.config.name}">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
EOS
|
||||
(App.config.sub_activities.uniq - [App.config.main_activity]).each do |activity|
|
||||
io.print <<EOS
|
||||
<activity android:name="#{activity}" android:label="#{activity}" android:parentActivityName="#{App.config.main_activity}">
|
||||
<meta-data android:name="android.support.PARENT_ACTIVITY" android:value="#{App.config.main_activity}"/>
|
||||
</activity>
|
||||
EOS
|
||||
end
|
||||
io.print <<EOS
|
||||
</application>
|
||||
</manifest>
|
||||
EOS
|
||||
|
||||
@@ -28,12 +28,13 @@ module Motion; module Project;
|
||||
register :android
|
||||
|
||||
variable :sdk_path, :ndk_path, :avd_config, :package, :main_activity,
|
||||
:api_version, :arch, :vendored_jars
|
||||
:sub_activities, :api_version, :arch, :vendored_jars
|
||||
|
||||
def initialize(project_dir, build_mode)
|
||||
super
|
||||
@avd_config = { :name => 'RubyMotion', :target => '1', :abi => 'armeabi-v7a' }
|
||||
@main_activity = '.Main'
|
||||
@sub_activities = []
|
||||
@arch = 'armv5te'
|
||||
@vendored_jars = []
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user