mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-07-14 10:11:58 +00:00
improve task form display
This commit is contained in:
parent
34ca62f6e7
commit
243f269549
2 changed files with 11 additions and 25 deletions
|
|
@ -1,22 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<TableRow xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="72dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:id="@+id/label"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginTop="11dp" />
|
||||
|
||||
android:layout_height="wrap_content">
|
||||
<CheckBox
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/checkbox"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginTop="0dp" />
|
||||
</RelativeLayout>
|
||||
</TableRow>
|
||||
|
|
@ -603,13 +603,13 @@ public class TaskFormActivity extends BaseActivity implements AdapterView.OnItem
|
|||
private void createTagsCheckBoxes() {
|
||||
int position = 0;
|
||||
for (Tag tag : tags) {
|
||||
TableRow row = new TableRow(tagsContainerLinearLayout.getContext());
|
||||
TableRow row = (TableRow) getLayoutInflater().inflate(R.layout.row_checklist, this.tagsContainerLinearLayout, false);
|
||||
CheckBox checkbox = (CheckBox) row.findViewById(R.id.checkbox);
|
||||
row.setId(position);
|
||||
CheckBox tagsCheckBox = new CheckBox(tagsContainerLinearLayout.getContext());
|
||||
tagsCheckBox.setText(tag.getName()); // set text Name
|
||||
tagsCheckBox.setId(position);
|
||||
checkbox.setText(tag.getName()); // set text Name
|
||||
checkbox.setId(position);
|
||||
//This is to check if the tag was selected by the user. Similar to onClickListener
|
||||
tagsCheckBox.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||
checkbox.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||
if (buttonView.isChecked()) {
|
||||
if (!selectedTags.contains(tag)) {
|
||||
selectedTags.add(tag);
|
||||
|
|
@ -621,9 +621,8 @@ public class TaskFormActivity extends BaseActivity implements AdapterView.OnItem
|
|||
}
|
||||
}
|
||||
});
|
||||
row.addView(tagsCheckBox);
|
||||
tagsContainerLinearLayout.addView(row);
|
||||
tagCheckBoxList.add(tagsCheckBox);
|
||||
tagCheckBoxList.add(checkbox);
|
||||
position++;
|
||||
}
|
||||
|
||||
|
|
@ -669,11 +668,10 @@ public class TaskFormActivity extends BaseActivity implements AdapterView.OnItem
|
|||
String[] weekdays = getResources().getStringArray(R.array.weekdays);
|
||||
for (int i = 0; i < 7; i++) {
|
||||
View weekdayRow = getLayoutInflater().inflate(R.layout.row_checklist, this.frequencyContainer, false);
|
||||
TextView tv = (TextView) weekdayRow.findViewById(R.id.label);
|
||||
CheckBox checkbox = (CheckBox) weekdayRow.findViewById(R.id.checkbox);
|
||||
checkbox.setText(weekdays[i]);
|
||||
checkbox.setChecked(true);
|
||||
this.weekdayCheckboxes.add(checkbox);
|
||||
tv.setText(weekdays[i]);
|
||||
this.frequencyContainer.addView(weekdayRow);
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue