Fix form rendering

This commit is contained in:
Phillip Thelen 2015-08-26 20:01:52 +02:00
parent 2fff3b7b81
commit c8d2483dbc
3 changed files with 6 additions and 7 deletions

View file

@ -2,6 +2,6 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.habitrpg.android.habitica.TaskFormActivity">
<item android:id="@+id/action_settings" android:title="@string/action_settings"
<item android:id="@+id/action_discard_changes" android:title="@string/discard_changes"
android:orderInCategory="100" app:showAsAction="never" />
</menu>

View file

@ -120,7 +120,7 @@
<string name="checklist.item.hint">Add item…</string>
<string name="title_activity_task_form">Add Task</string>
<string name="discard_changed">Discard Changes</string>
<string name="discard_changes">Discard Changes</string>
<string name="notes">Notes</string>
<string name="text">Text</string>
<string name="difficulty">Difficulty</string>

View file

@ -47,7 +47,7 @@ public class TaskFormActivity extends AppCompatActivity implements AdapterView.O
Bundle bundle = intent.getExtras();
taskType = bundle.getString("type");
taskId = bundle.getString("taskId");
if (type == null) {
if (taskType == null) {
return;
}
@ -71,9 +71,7 @@ public class TaskFormActivity extends AppCompatActivity implements AdapterView.O
positiveCheckBox = (CheckBox) findViewById(R.id.task_positive_checkbox);
negativeCheckBox = (CheckBox) findViewById(R.id.task_negative_checkbox);
}
if (taskType.equals("habit")) {
} else {
LinearLayout actionsLayout = (LinearLayout) findViewById(R.id.task_actions_wrapper);
mainWrapper.removeView(actionsLayout);
}
@ -154,7 +152,8 @@ public class TaskFormActivity extends AppCompatActivity implements AdapterView.O
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
if (id == R.id.action_discard_changes) {
finish();
return true;
}