を追加するために何でもしますフックで
<hook type="before_prepare" src="scripts/020_copy_resources.js" />
、私は<project>/scripts/020_copy_resources.js"
#!/usr/bin/env node
// Native resources to copy
var androidNativePath = 'native/android/';
// Android platform resource path
var androidResPath = 'platforms/android/res/';
// Copy native resources
var rootdir = process.argv[2];
var fs = require('fs');
var path = require('path');
function copyFileSync(source, target) {
var targetFile = target;
//if target is a directory a new file with the same name will be created
if (fs.existsSync(target)) {
if (fs.lstatSync(target).isDirectory()) {
targetFile = path.join(target, path.basename(source));
}
}
process.stdout.write('Copying ' + source + ' to ' + targetFile);
fs.writeFileSync(targetFile, fs.readFileSync(source));
}
function copyFolderRecursiveSync(source, target) {
var files = [];
//check if folder needs to be created or integrated
//var targetFolder = path.join(target, path.basename(source));
var targetFolder = target;
if (!fs.existsSync(targetFolder)) {
fs.mkdirSync(targetFolder);
process.stdout.write('fs.mkdirSync(' + targetFolder + ')');
}
//copy
if (fs.lstatSync(source).isDirectory()) {
files = fs.readdirSync(source);
files.forEach(function (file) {
var curSource = path.join(source, file);
if (fs.lstatSync(curSource).isDirectory()) {
var newTarget = path.join(targetFolder, path.basename(curSource));
copyFolderRecursiveSync(curSource, newTarget);
process.stdout.write('copyFolderRecursiveSync(' + curSource + ', ' + newTarget + ')');
} else {
copyFileSync(curSource, targetFolder);
process.stdout.write('copyFileSync(' + curSource + ', ' + targetFolder + ')');
}
});
}
}
if (rootdir) {
copyFolderRecursiveSync(androidNativePath, androidResPath);
process.stdout.write('Copied android native resources');
}
に保存され、this answerに基づいてスクリプトを実行しましたこれは、<project>/native/android
にあるファイル/フォルダをコピーします。<project>/platforms/android/res
次に、this answerに続いて日付ピッカーのテーマを作成します。私の目的のために、私はcolorAccent
とcolorBackground
をメインテーマに設定し、datePickerDialogTheme
を設定する必要がありました。