Skip to content

Commit

Permalink
Merge pull request #2 from ItvisionAustralia/android10
Browse files Browse the repository at this point in the history
Android 10 support
  • Loading branch information
kadekParwanta committed Aug 4, 2023
2 parents 89333a6 + 355b20b commit addbed6
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
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

0 comments on commit addbed6

Please sign in to comment.