Skip to content

Commit fdad7f8

Browse files
committed
添加安卓新标准目录
1 parent bc5c265 commit fdad7f8

5 files changed

Lines changed: 16 additions & 23 deletions

File tree

src/main/java/org/yzr/poi/controller/SettingController.java

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ public class SettingController extends VBox {
3434

3535
@FXML private CheckBox fixAndroidIdLanguage;
3636

37+
@FXML private CheckBox useNewAndroid;
38+
3739
@FXML private CheckBox useDefault;
3840

3941
@FXML private TextField defaultValue;
@@ -61,11 +63,6 @@ public void init() {
6163

6264
closeButton.setImage("/images/close_normal.png", ButtonState.Normal);
6365

64-
// ignoreChinese.setOnAction(event -> {
65-
// PropertiesManager.setProperty(Constant.IGNORE_CHINESE, ignoreChinese.isSelected() ? Constant.TRUE : Constant.FALSE);
66-
// });
67-
// ignoreChinese.setSelected(new Boolean(PropertiesManager.getProperty(Constant.IGNORE_CHINESE)));
68-
6966
ignoreAndroidEnglish.setOnAction(event -> {
7067
PropertiesManager.setProperty(Constant.IGNORE_ENGLISH_SUFFIX, ignoreAndroidEnglish.isSelected() ? Constant.TRUE : Constant.FALSE);
7168
});
@@ -76,27 +73,15 @@ public void init() {
7673
});
7774
fixAndroidIdLanguage.setSelected(new Boolean(PropertiesManager.getProperty(Constant.FIX_ID_LANGUAGE)));
7875

76+
useNewAndroid.setOnAction(event -> {
77+
PropertiesManager.setProperty(Constant.USE_NEW_ANDROID, useNewAndroid.isSelected() ? Constant.TRUE : Constant.FALSE);
78+
});
79+
useNewAndroid.setSelected(new Boolean(PropertiesManager.getProperty(Constant.USE_NEW_ANDROID)));
80+
7981
useDefault.setOnAction(event -> {
8082
PropertiesManager.setProperty(Constant.USE_DEFAULT_VALUE, useDefault.isSelected() ? Constant.TRUE : Constant.FALSE);
81-
// defaultValue.setDisable(!useDefault.isSelected());
8283
});
8384
useDefault.setSelected(new Boolean(PropertiesManager.getProperty(Constant.USE_DEFAULT_VALUE)));
84-
85-
// defaultValue.setDisable(!useDefault.isSelected());
86-
// defaultValue.setText(PropertiesManager.getProperty(Constant.DEFAULT_VALUE));
87-
// defaultValue.focusedProperty().addListener(new ChangeListener<Boolean>() {
88-
// @Override
89-
// public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) {
90-
// if (!newValue) {
91-
// String text = defaultValue.getText();
92-
// if (text.trim().length() < 1) {
93-
// text = "##我是没有翻译的##";
94-
// }
95-
// PropertiesManager.setProperty(Constant.DEFAULT_VALUE, text);
96-
// }
97-
// }
98-
// });
99-
10085
}
10186

10287
@FXML

src/main/java/org/yzr/poi/utils/Constant.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public class Constant {
2424
public static final String IGNORE_ENGLISH_SUFFIX = "ignoreEnglishSuffix";
2525
public static final String IGNORE_CHINESE = "ignoreChinese";
2626
public static final String FIX_ID_LANGUAGE = "fixIdLanguage";
27+
public static final String USE_NEW_ANDROID = "useNewAndroid";
2728

2829
public static final String IOS_SWITCH = "iOSOpen";
2930
public static final String ANDROID_SWITCH = "AndroidOpen";

src/main/java/org/yzr/poi/utils/ExcelUtils.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,14 @@ private static void createLocalizeFile(String language, String code, List<Locali
358358
}
359359
}
360360

361+
Boolean useNewAndroid = new Boolean(PropertiesManager.getProperty(Constant.USE_NEW_ANDROID));
361362
String values = "values-";
362363
if (language.length() < 1) {
363364
values = "values";
365+
} else {
366+
if (useNewAndroid) {
367+
values = "values" + File.separator + "values-b-";
368+
}
364369
}
365370
filePath = basePath + values + language + File.separator + PropertiesManager.getProperty(code+"FileName");
366371

src/main/resources/config/config.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ JAVAFileName = i18n_
1414
ignoreEnglishSuffix = true
1515
ignoreChinese = true
1616
fixIdLanguage = true
17+
useNewAndroid = true
1718

1819
useDefaultValue = true
1920
defaultValue = ##NO VALUE##

src/main/resources/layout/setting_stage.fxml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
<!--<CheckBox fx:id="ignoreChinese" layoutX="10" layoutY="10" text="忽略中文备注文案" />-->
3131
<CheckBox fx:id="ignoreAndroidEnglish" layoutX="10" layoutY="10" text="忽略Android英文文件夹后缀" />
3232
<CheckBox fx:id="fixAndroidIdLanguage" layoutX="10" layoutY="35" text="修复Android印尼语key" />
33-
<CheckBox fx:id="useDefault" layoutX="10" layoutY="60" text="缺失文案填充默认值" />
33+
<CheckBox fx:id="useNewAndroid" layoutX="10" layoutY="60" text="使用安卓新标准" />
34+
<CheckBox fx:id="useDefault" layoutX="10" layoutY="85" text="缺失文案填充默认值" />
3435
<!--<Label layoutX="10" layoutY="90.0" prefWidth="60" text="默认文案:" />-->
3536
<!--<TextField fx:id="defaultValue" layoutX="70.0" layoutY="85.0" />-->
3637
</Pane>

0 commit comments

Comments
 (0)