Skip to content
This repository was archived by the owner on Jun 27, 2020. It is now read-only.

Commit 633514a

Browse files
author
Evgenii Kanivets
committed
#114[30m]. Display 'Edit' title when editing record.
1 parent 7a82cc3 commit 633514a

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

app/src/main/java/com/blogspot/e_kanivets/moneytracker/activity/record/AddRecordActivity.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ protected void initViews() {
132132
if (getSupportActionBar() != null) {
133133
switch (type) {
134134
case Record.TYPE_EXPENSE:
135-
getSupportActionBar().setTitle(R.string.title_add_expense);
135+
if (mode == Mode.MODE_ADD) getSupportActionBar().setTitle(R.string.title_add_expense);
136+
else getSupportActionBar().setTitle(R.string.title_edit_expense);
136137
getSupportActionBar().setBackgroundDrawable(
137138
new ColorDrawable(getResources().getColor(R.color.red_light)));
138139
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
@@ -144,7 +145,8 @@ protected void initViews() {
144145
break;
145146

146147
case Record.TYPE_INCOME:
147-
getSupportActionBar().setTitle(R.string.title_add_income);
148+
if (mode == Mode.MODE_ADD) getSupportActionBar().setTitle(R.string.title_add_income);
149+
else getSupportActionBar().setTitle(R.string.title_edit_income);
148150
getSupportActionBar().setBackgroundDrawable(
149151
new ColorDrawable(getResources().getColor(R.color.green_light)));
150152
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {

app/src/main/res/values-ru/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,7 @@
9393
<string name="warning">Предупреждение</string>
9494
<string name="want_erase_and_restore">Вы действительно хотите удалить все текущие данные и восстановить бэкап %1$s? Пожалуйста, сделайте бэкап текущих данных.</string>
9595
<string name="backup_now">Сделать бэкап</string>
96+
97+
<string name="title_edit_income">Редактировать доход</string>
98+
<string name="title_edit_expense">Редактировать расход</string>
9699
</resources>

app/src/main/res/values-uk/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,7 @@
9393
<string name="warning">Попередження</string>
9494
<string name="want_erase_and_restore">Ви дійсно хочете видалити усі поточні дані і відновити бекап %1$s? Будь ласка, зробіть бекап поточних даних.</string>
9595
<string name="backup_now">Зробити бекап</string>
96+
97+
<string name="title_edit_income">Редагувати дохід</string>
98+
<string name="title_edit_expense">Редагувати витрату</string>
9699
</resources>

app/src/main/res/values/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,5 +101,8 @@
101101
<string name="warning">Warning</string>
102102
<string name="want_erase_and_restore">Do you really want to erase all current data and restore backup file %1$s? Be sure to backup current data.</string>
103103
<string name="backup_now">Backup now</string>
104+
105+
<string name="title_edit_income">Edit income</string>
106+
<string name="title_edit_expense">Edit expense</string>
104107
<!-- Not translated strings -->
105108
</resources>

0 commit comments

Comments
 (0)