Skip to content

Commit 4f2c8cd

Browse files
committed
Merge branch 'develop' of https://github.com/HabitRPG/habitrpg-android into develop
2 parents 69a80d2 + 81e5ed4 commit 4f2c8cd

File tree

7 files changed

+30
-12
lines changed

7 files changed

+30
-12
lines changed

Habitica/res/layout/daily_item_card.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
android:paddingLeft="16dp"
5050
android:paddingRight="16dp"
5151
android:paddingEnd="16dp"
52-
android:paddingBottom="20dp"
53-
android:paddingTop="20dp"
52+
android:paddingBottom="@dimen/task_top_bottom_padding"
53+
android:paddingTop="@dimen/task_top_bottom_padding"
5454
android:id="@+id/linearLayout"
5555
android:layout_alignParentTop="true"
5656
android:layout_alignParentLeft="true"

Habitica/res/layout/habit_item_card.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
android:layout_height="wrap_content"
1717
android:orientation="vertical"
1818
android:background="@color/white">
19+
android:minHeight="@dimen/task_min_height">
1920
<LinearLayout
2021
android:layout_width="match_parent"
2122
android:layout_height="match_parent">
@@ -56,8 +57,8 @@
5657
android:paddingLeft="16dp"
5758
android:paddingRight="16dp"
5859
android:paddingEnd="16dp"
59-
android:paddingBottom="20dp"
60-
android:paddingTop="20dp">
60+
android:paddingBottom="@dimen/task_top_bottom_padding"
61+
android:paddingTop="@dimen/task_top_bottom_padding">
6162
<TextView
6263
android:id="@+id/checkedTextView"
6364
style="@style/CardTitle"

Habitica/res/layout/todo_item_card.xml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,15 @@
4242
android:layout_width="match_parent"
4343
android:layout_height="match_parent">
4444
<LinearLayout
45-
android:orientation="vertical"
4645
android:layout_width="match_parent"
47-
android:layout_height="match_parent"
48-
android:padding="5dp">
46+
android:layout_height="wrap_content"
47+
android:orientation="vertical"
48+
android:layout_centerVertical="true"
49+
android:paddingLeft="16dp"
50+
android:paddingRight="16dp"
51+
android:paddingEnd="16dp"
52+
android:paddingBottom="@dimen/task_top_bottom_padding"
53+
android:paddingTop="@dimen/task_top_bottom_padding">
4954
<CheckedTextView
5055
android:id="@+id/checkedTextView"
5156
style="@style/CardTitle"

Habitica/res/values/dimens.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,5 @@
4444
<dimen name="checkbox_size">30dp</dimen>
4545

4646
<dimen name="login_field_width">350dp</dimen>
47+
<dimen name="task_top_bottom_padding">20dp</dimen>
4748
</resources>

Habitica/src/com/habitrpg/android/habitica/MainActivity.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,12 @@ public void onEvent(OpenGemPurchaseFragmentCommand cmd) {
166166
drawer.setSelection(MainDrawerBuilder.SIDEBAR_PURCHASE);
167167
}
168168

169+
@Override
170+
public void onStart() {
171+
super.onStart();
172+
mAPIHelper.retrieveUser(new HabitRPGUserCallback(this));
173+
}
174+
169175
@Override
170176
public boolean onCreateOptionsMenu(Menu menu) {
171177
return true;

Habitica/src/com/habitrpg/android/habitica/TaskFormActivity.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ protected void onCreate(Bundle savedInstanceState) {
129129

130130
private void createCheckListRecyclerView() {
131131
List<ChecklistItem> checklistItems = new ArrayList<>();
132-
if (task.getChecklist() != null) {
132+
if (task != null && task.getChecklist() != null) {
133133
checklistItems = task.getChecklist();
134134
}
135135
checklistAdapter = new CheckListAdapter(checklistItems);
@@ -302,7 +302,12 @@ private void populate(Task task) {
302302
private boolean saveTask(Task task) {
303303
task.text = taskText.getText().toString();
304304

305-
task.setChecklist(checklistAdapter.getCheckListItems());
305+
if (checklistAdapter != null) {
306+
if (checklistAdapter.getCheckListItems() != null) {
307+
task.setChecklist(checklistAdapter.getCheckListItems());
308+
}
309+
}
310+
306311

307312
if (task.text.isEmpty())
308313
return false;

Habitica/src/com/habitrpg/android/habitica/ui/fragments/TasksFragment.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public void onClick(View v) {
149149
.withCloseOnClick(false)
150150
.append(activity.drawer);
151151

152-
filterDrawer.getDrawerLayout().setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED);
152+
filterDrawer.getDrawerLayout().setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED, Gravity.RIGHT);
153153

154154
viewPager.setCurrentItem(0);
155155
this.tagsHelper = new TagsHelper();
@@ -682,8 +682,8 @@ public void onCheckedChanged(IDrawerItem iDrawerItem, CompoundButton compoundBut
682682

683683
@Override
684684
public void onDestroyView() {
685-
filterDrawer.getDrawerLayout().setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
686-
685+
DrawerLayout layout = filterDrawer.getDrawerLayout();
686+
layout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED, Gravity.RIGHT);
687687
super.onDestroyView();
688688
}
689689
}

0 commit comments

Comments
 (0)