summaryrefslogtreecommitdiff
path: root/platform/android
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android')
-rw-r--r--platform/android/SCsub14
-rw-r--r--platform/android/build.gradle.template2
-rw-r--r--platform/android/os_android.cpp8
-rw-r--r--platform/android/os_android.h2
4 files changed, 19 insertions, 7 deletions
diff --git a/platform/android/SCsub b/platform/android/SCsub
index 02a8c3bc42..a6da33e7bf 100644
--- a/platform/android/SCsub
+++ b/platform/android/SCsub
@@ -92,9 +92,23 @@ gradle_asset_dirs_text = ""
gradle_default_config_text = ""
+minSdk = 14
+targetSdk = 23
+
for x in env.android_default_config:
+ if x.startswith("minSdkVersion") and int(x.split(" ")[-1]) < minSdk:
+ x = "minSdkVersion " + str(minSdk)
+ if x.startswith("targetSdkVersion") and int(x.split()[-1]) > targetSdk:
+ x = "targetSdkVersion " + str(targetSdk)
+
gradle_default_config_text += x + "\n\t\t"
+if "minSdkVersion" not in gradle_default_config_text:
+ gradle_default_config_text += ("minSdkVersion " + str(minSdk) + "\n\t\t")
+
+if "targetSdkVersion" not in gradle_default_config_text:
+ gradle_default_config_text += ("targetSdkVersion " + str(targetSdk) + "\n\t\t")
+
gradle_text = gradle_text.replace("$$GRADLE_REPOSITORY_URLS$$", gradle_maven_repos_text)
gradle_text = gradle_text.replace("$$GRADLE_DEPENDENCIES$$", gradle_maven_dependencies_text)
gradle_text = gradle_text.replace("$$GRADLE_JAVA_DIRS$$", gradle_java_dirs_text)
diff --git a/platform/android/build.gradle.template b/platform/android/build.gradle.template
index ec5bbb6630..8dfb006c00 100644
--- a/platform/android/build.gradle.template
+++ b/platform/android/build.gradle.template
@@ -39,8 +39,6 @@ android {
exclude 'META-INF/NOTICE'
}
defaultConfig {
- minSdkVersion 14
- targetSdkVersion 23
$$GRADLE_DEFAULT_CONFIG$$
}
// Both signing and zip-aligning will be done at export time
diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp
index 0cdc2bbddf..6772964c2f 100644
--- a/platform/android/os_android.cpp
+++ b/platform/android/os_android.cpp
@@ -245,7 +245,7 @@ bool OS_Android::is_mouse_grab_enabled() const {
return false;
}
-Point2 OS_Android::get_mouse_pos() const {
+Point2 OS_Android::get_mouse_position() const {
return Point2();
}
@@ -414,7 +414,7 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos>
ev.mouse_button.y = touch[0].pos.y;
ev.mouse_button.global_x = touch[0].pos.x;
ev.mouse_button.global_y = touch[0].pos.y;
- input->set_mouse_pos(Point2(touch[0].pos.x, touch[0].pos.y));
+ input->set_mouse_position(Point2(touch[0].pos.x, touch[0].pos.y));
last_mouse = touch[0].pos;
input->parse_input_event(ev);
}
@@ -441,7 +441,7 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos>
ev.mouse_motion.button_mask = BUTTON_MASK_LEFT;
ev.mouse_motion.x = p_points[0].pos.x;
ev.mouse_motion.y = p_points[0].pos.y;
- input->set_mouse_pos(Point2(ev.mouse_motion.x, ev.mouse_motion.y));
+ input->set_mouse_position(Point2(ev.mouse_motion.x, ev.mouse_motion.y));
ev.mouse_motion.speed_x = input->get_last_mouse_speed().x;
ev.mouse_motion.speed_y = input->get_last_mouse_speed().y;
ev.mouse_motion.relative_x = p_points[0].pos.x - last_mouse.x;
@@ -493,7 +493,7 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos>
ev.mouse_button.y = touch[0].pos.y;
ev.mouse_button.global_x = touch[0].pos.x;
ev.mouse_button.global_y = touch[0].pos.y;
- input->set_mouse_pos(Point2(touch[0].pos.x, touch[0].pos.y));
+ input->set_mouse_position(Point2(touch[0].pos.x, touch[0].pos.y));
input->parse_input_event(ev);
for (int i = 0; i < touch.size(); i++) {
diff --git a/platform/android/os_android.h b/platform/android/os_android.h
index 87ab0bb757..f1da2867f0 100644
--- a/platform/android/os_android.h
+++ b/platform/android/os_android.h
@@ -171,7 +171,7 @@ public:
virtual void set_mouse_show(bool p_show);
virtual void set_mouse_grab(bool p_grab);
virtual bool is_mouse_grab_enabled() const;
- virtual Point2 get_mouse_pos() const;
+ virtual Point2 get_mouse_position() const;
virtual int get_mouse_button_state() const;
virtual void set_window_title(const String &p_title);