Update translations, fix fragment ordering issue

* Japanese - naofumi
* Russian - @uryevich
pull/384/head
Alex Baker 9 years ago
parent 698bf7f574
commit aa1ba8e76e

@ -27,7 +27,7 @@ android {
buildToolsVersion "23.0.2"
defaultConfig {
versionCode 389
versionCode 390
versionName "4.8.4"
minSdkVersion 14
targetSdkVersion 23

@ -330,7 +330,7 @@ public final class TaskEditFragment extends InjectingFragment implements EditNot
/** Save task model from values in UI components */
public void save() {
List<TaskEditControlFragment> fragments = taskEditControlSetFragmentManager.getFragments();
List<TaskEditControlFragment> fragments = taskEditControlSetFragmentManager.getFragmentsInPersistOrder();
if (hasChanges(fragments)) {
for (TaskEditControlFragment fragment : fragments) {
fragment.apply(model);
@ -398,7 +398,7 @@ public final class TaskEditFragment extends InjectingFragment implements EditNot
}
public void discardButtonClick() {
if (hasChanges(taskEditControlSetFragmentManager.getFragments())) {
if (hasChanges(taskEditControlSetFragmentManager.getFragmentsInPersistOrder())) {
dialogBuilder.newMessageDialog(R.string.discard_confirmation)
.setPositiveButton(R.string.keep_editing, null)
.setNegativeButton(R.string.discard, new DialogInterface.OnClickListener() {

@ -115,7 +115,7 @@ public class TaskListActivity extends InjectingAppCompatActivity implements
taskEditFragment.save();
taskEditFragment = null;
} else {
taskEditControlFragments = taskEditControlSetFragmentManager.getFragments();
taskEditControlFragments = taskEditControlSetFragmentManager.getFragmentsInDisplayOrder();
}
}

@ -70,16 +70,14 @@ public class TaskEditControlSetFragmentManager {
}
private final Map<String, Integer> controlSetFragments = new LinkedHashMap<>();
private final Activity activity;
private final Preferences preferences;
private final List<String> displayOrder;
private final String hideAlwaysTrigger;
private final FragmentManager fragmentManager;
@Inject
public TaskEditControlSetFragmentManager(Activity activity, Preferences preferences) {
this.activity = activity;
this.preferences = preferences;
displayOrder = BeastModePreferences.constructOrderedControlList(preferences, activity);
displayOrder.add(0, activity.getString(EditTitleControlSet.TAG));
fragmentManager = activity.getFragmentManager();
hideAlwaysTrigger = activity.getString(R.string.TEA_ctrl_hide_section_pref);
@ -90,11 +88,8 @@ public class TaskEditControlSetFragmentManager {
public List<TaskEditControlFragment> createNewFragments(boolean isNewTask, Task task) {
List<TaskEditControlFragment> taskEditControlFragments = new ArrayList<>();
List<String> controlOrder = BeastModePreferences.constructOrderedControlList(preferences, activity);
controlOrder.add(0, activity.getString(EditTitleControlSet.TAG));
for (int i = 0; i < controlOrder.size(); i++) {
String item = controlOrder.get(i);
for (int i = 0; i < displayOrder.size(); i++) {
String item = displayOrder.get(i);
if (item.equals(hideAlwaysTrigger)) {
break;
}
@ -111,9 +106,17 @@ public class TaskEditControlSetFragmentManager {
return taskEditControlFragments;
}
public List<TaskEditControlFragment> getFragments() {
public List<TaskEditControlFragment> getFragmentsInDisplayOrder() {
return getFragments(displayOrder);
}
public List<TaskEditControlFragment> getFragmentsInPersistOrder() {
return getFragments(controlSetFragments.keySet());
}
private List<TaskEditControlFragment> getFragments(Iterable<String> tags) {
List<TaskEditControlFragment> fragments = new ArrayList<>();
for (String tag : controlSetFragments.keySet()) {
for (String tag : tags) {
TaskEditControlFragment fragment = (TaskEditControlFragment) fragmentManager.findFragmentByTag(tag);
if (fragment != null) {
fragments.add(fragment);

@ -24,6 +24,8 @@
<string name="import_file_prompt">復元に使うファイルを選択してください</string>
<string name="read_permission_label">タスクの読み込み</string>
<string name="write_permission_label">タスクの読み込み</string>
<string name="discard_confirmation">変更を破棄してもよろしいですか?</string>
<string name="keep_editing">編集を続ける</string>
<string name="DLG_delete_this_task_question">このタスクを削除しますか?</string>
<string name="DLG_upgrading">タスクを更新しています</string>
<string name="DLG_hour_minutes">時間 (時:分)</string>
@ -389,6 +391,7 @@
<string name="doze_notifications">通知の Doze モード割り込み</string>
<string name="doze_notifications_off">デバイスが Doze モードの間、Android は通知を大幅に遅らせます</string>
<string name="doze_notifications_on">デバイスが Doze モードの間、Android は限定された割り込みを許可します</string>
<string name="no_title">(タイトルなし)</string>
<string-array name="sync_SPr_interval_entries">
<item>無効</item>
<item>15分毎</item>

@ -24,6 +24,8 @@
<string name="import_file_prompt">Выберите файл для восстановления</string>
<string name="read_permission_label">Разрешения Tasks</string>
<string name="write_permission_label">Разрешения Tasks</string>
<string name="discard_confirmation">Вы действительно хотите отказаться от сделанных изменений?</string>
<string name="keep_editing">Продолжайте редактировать</string>
<string name="DLG_delete_this_task_question">Удалить эту задачу?</string>
<string name="DLG_upgrading">Обновление ваших задач…</string>
<string name="DLG_hour_minutes">Время (час : мин)</string>
@ -388,6 +390,7 @@
<string name="doze_notifications">Прерывать спящий режим для уведомлений</string>
<string name="doze_notifications_off">Android будет сильно задерживать уведомления, если устройство находится в спящем режиме</string>
<string name="doze_notifications_on">Android разрешит ограниченные прерывания, если устройство находится в спящем режиме</string>
<string name="no_title">(Без заголовка)</string>
<string-array name="sync_SPr_interval_entries">
<item>отключить</item>
<item>каждые 15 минут</item>

Loading…
Cancel
Save