Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android 10 support #2

Merged
merged 2 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions before_plugin_install.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
var fs = require("fs");
var path = require("path");
var rootdir = process.env.PWD;
var valuesPath = "/platforms/android/app/src/main/res/values/";
var themesFile = "themes.xml";
var destFile = path.join(rootdir, valuesPath, themesFile);
var destDir = path.dirname(destFile);

module.exports = function (context) {
console.log("*************************************");
console.log(`before_plugin_install running`);
console.log("*************************************");

if (fs.existsSync(destDir)) {
if (!fs.existsSync(destFile)) {
console.log("*************************************");
console.log(`creating new ${destFile}`);
console.log("*************************************");
fs.writeFile(
destFile,
'<?xml version="1.0" encoding="utf-8"?>\n<resources>\n<style name="MyTheme" parent="android:Theme.Holo.Light">\n</style>\n</resources>',
function (err) {
if (err) {
console.error("writeFile error" + err);
}
console.log(`${themesFile} created!`);
}
);
} else {
console.log(`skipping, file ${themesFile} exists`);
}
} else {
console.log("skipping, android platform not found");
}
};
7 changes: 6 additions & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@

<!-- android -->
<platform name="android">
<hook type="before_plugin_install" src="scripts/before_plugin_install.js" />
<edit-config file="AndroidManifest.xml" target="/manifest/application" mode="merge">
<application android:requestLegacyExternalStorage="true"/>
</edit-config>

<config-file target="res/xml/config.xml" parent="/*">
<feature name="ImagePicker">
<param name="android-package" value="com.synconset.ImagePicker"/>
Expand Down Expand Up @@ -136,7 +141,7 @@
<resource-file src="src/android/Library/res/layout/actionbar_done_button.xml" target="res/layout/actionbar_done_button.xml"/>
<resource-file src="src/android/Library/res/layout/multiselectorgrid.xml" target="res/layout/multiselectorgrid.xml"/>
<resource-file src="src/android/Library/res/values/multiimagechooser_strings_en.xml" target="res/values/multiimagechooser_strings_en.xml"/>
<resource-file src="src/android/Library/res/values/themes.xml" target="res/values/themes.xml"/>
<!-- <resource-file src="src/android/Library/res/values/themes.xml" target="res/values/themes.xml"/> -->

<resource-file src="src/android/Library/res/values-de/multiimagechooser_strings_de.xml" target="res/values-de/multiimagechooser_strings_de.xml"/>
<resource-file src="src/android/Library/res/values-es/multiimagechooser_strings_es.xml" target="res/values-es/multiimagechooser_strings_es.xml"/>
Expand Down