Skip to content

Commit cf1107d

Browse files
committed
RTL support added
1 parent f214044 commit cf1107d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/services/android-project-service.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -257,14 +257,15 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
257257
if (this.canUseGradle().wait()) {
258258
// Validate App_Resources drawable resources accoring to the official docs: https://developer.android.com/guide/topics/resources/providing-resources.html
259259
let drawableFilePrefix = "drawable-";
260+
let rtlDrawableFilePrefix = "drawable-ldrtl-";
260261
let allowedDrawables = ["ldpi", "mdpi", "hdpi", "xhdpi", "xxhdpi", "xxxhdpi", "nodpi", "tvdpi"];
261262
let appSourceDirectoryPath = path.join(this.$projectData.projectDir, constants.APP_FOLDER_NAME);
262263
let sourceAppResourcesDirectoryPath = path.join(appSourceDirectoryPath, constants.APP_RESOURCES_FOLDER_NAME, this.$devicePlatformsConstants.Android);
263264

264265
if (this.$fs.exists(sourceAppResourcesDirectoryPath).wait()) {
265266
this.$fs.enumerateFilesInDirectorySync(sourceAppResourcesDirectoryPath, (file: string, stat: IFsStats) => {
266-
if (stat.isDirectory() && file.indexOf(drawableFilePrefix) !== -1 &&
267-
allowedDrawables.indexOf(path.basename(file).replace(drawableFilePrefix, "")) === -1) {
267+
if (stat.isDirectory() && (file.indexOf(drawableFilePrefix) !== -1 && allowedDrawables.indexOf(path.basename(file).replace(drawableFilePrefix, "")) === -1) ||
268+
(file.indexOf(rtlDrawableFilePrefix) !== -1 && allowedDrawables.indexOf(path.basename(file).replace(rtlDrawableFilePrefix, "")) === -1)) {
268269
this.$errors.failWithoutHelp(`Invalid Android drawable resource folder detected: ${file}. Please check your ${constants.APP_RESOURCES_FOLDER_NAME} folder.`);
269270
return false;
270271
}

0 commit comments

Comments
 (0)