minor design tweaks

This commit is contained in:
Phillip Thelen 2017-04-17 21:16:26 +02:00
parent 88355e7acd
commit 2b7a67b3c6
9 changed files with 34 additions and 45 deletions

View file

@ -19,6 +19,7 @@
android:background="@drawable/login_gradient"
android:clipChildren="false"
android:clipToPadding="false"
android:layout_marginRight="-2dp"
>
<ImageView
android:id="@+id/city_view"
@ -70,7 +71,9 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/spacing_large"
android:paddingTop="@dimen/spacing_large"
android:paddingLeft="@dimen/spacing_large"
android:paddingRight="@dimen/spacing_large"
android:id="@+id/login_intro_view"
android:orientation="vertical"
android:background="@color/transparent"
@ -114,6 +117,7 @@
android:id="@+id/login_scrollview"
android:scrollIndicators="none"
tools:visibility="visible"
android:padding="0dp"
>
<LinearLayout

View file

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/tagEditText" android:layout_gravity="center_horizontal"
android:focusable="true"
android:maxLines="1"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/edit_tag_btn_delete"
android:textColor="@color/white"
android:id="@+id/btnDelete"
android:drawableEnd="@drawable/ic_action_delete_white_24"
android:drawableRight="@drawable/ic_action_delete_white_24"/>
</LinearLayout>

View file

@ -63,7 +63,9 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
android:orientation="horizontal"
android:paddingTop="8dp"
android:paddingBottom="8dp">
<TextView
android:id="@+id/tags_title"
@ -98,7 +100,7 @@
android:orientation="vertical"
android:showDividers="middle"
android:divider="@color/transparent"
android:dividerPadding="12dp"/>
android:dividerPadding="8dp"/>
</ScrollView>
</LinearLayout>

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:layout_width="match_parent"
@ -13,15 +12,15 @@
android:padding="0dp"
android:drawableLeft="@drawable/ic_close_purple_300_36dp"
style="@style/Base.Widget.AppCompat.Button.Borderless"/>
<EditText
android:id="@+id/edit_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginLeft="8dp"
android:drawableRight="@drawable/ic_create_grey_400_18dp"
tools:text="hello"
style="@style/TagEditTextTheme"
android:paddingBottom="14dp"
/>
<EditText
android:id="@+id/edit_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginLeft="8dp"
android:drawableRight="@drawable/ic_create_grey_400_18dp"
tools:text="hello"
style="@style/TagEditTextTheme"
android:paddingBottom="14dp"
/>
</LinearLayout>

View file

@ -31,7 +31,6 @@
android:paddingBottom="@dimen/task_top_bottom_padding"
android:paddingEnd="@dimen/reward_spacing"
android:paddingRight="@dimen/reward_spacing"
android:paddingStart="12dp"
android:paddingTop="@dimen/task_top_bottom_padding">
<net.pherth.android.emoji_library.EmojiTextView

View file

@ -54,7 +54,6 @@
<color name="changelog.note">#ffcf42</color>
<color name="colorPrimary">@color/brand_300</color>
<color name="colorPrimaryDark">@color/brand_50</color>
<!-- text -->
@ -116,6 +115,7 @@
<color name="white_75_alpha">#bfffffff</color>
<color name="white_50_alpha">#7fffffff</color>
<color name="white_15_alpha">#26ffffff</color>
<color name="black_5_alpha">#0b000000</color>
<color name="black_10_alpha">#16000000</color>
<color name="black_20_alpha">#33000000</color>
<color name="light_gray_bg">#F6F4F8</color>

View file

@ -22,7 +22,14 @@ public class UserRepositoryImpl extends BaseRepositoryImpl<UserLocalRepository>
@Override
public Observable<HabitRPGUser> getUser(String userID) {
return localRepository.getUser(userID);
return localRepository.getUser(userID)
.flatMap(habitRPGUser -> {
if (habitRPGUser == null) {
return retrieveUser(true);
} else {
return Observable.just(habitRPGUser);
}
});
}
@Override

View file

@ -139,15 +139,12 @@ public class TaskFilterDialog extends AlertDialog implements RadioGroup.OnChecke
private void createTagViews() {
ColorStateList colorStateList = new ColorStateList(
new int[][]{
new int[]{-android.R.attr.state_checked}, //disabled
new int[]{android.R.attr.state_checked} //enabled
},
new int[] {
Color.GRAY, //disabled
Color.LTGRAY, //disabled
ContextCompat.getColor(getContext(), R.color.brand_400) //enabled
}
);
int leftPadding = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 16, getContext().getResources().getDisplayMetrics());
@ -155,11 +152,12 @@ public class TaskFilterDialog extends AlertDialog implements RadioGroup.OnChecke
for (Tag tag : tags) {
AppCompatCheckBox tagCheckbox = new AppCompatCheckBox(getContext());
tagCheckbox.setText(tag.getName());
tagCheckbox.setTextSize(TypedValue.COMPLEX_UNIT_SP,20);
tagCheckbox.setTextSize(TypedValue.COMPLEX_UNIT_SP,16);
tagCheckbox.setPadding(tagCheckbox.getPaddingLeft()+ leftPadding,
verticalPadding,
tagCheckbox.getPaddingRight(),
verticalPadding);
tagCheckbox.setTextColor(ContextCompat.getColor(getContext(), R.color.textColorLight));
CompoundButtonCompat.setButtonTintList(tagCheckbox, colorStateList);
tagCheckbox.setOnCheckedChangeListener((buttonView, isChecked) -> {
if (isChecked) {
@ -184,6 +182,7 @@ public class TaskFilterDialog extends AlertDialog implements RadioGroup.OnChecke
button.setOnClickListener(v -> createTag());
button.setCompoundDrawablesWithIntrinsicBounds(addIcon, null, null, null);
button.setBackgroundResource(R.drawable.layout_rounded_bg_lighter_gray);
button.setTextColor(ContextCompat.getColor(getContext(), R.color.text_light));
tagsList.addView(button);
}

View file

@ -22,7 +22,7 @@ public class ChatMessageDeserializer implements JsonDeserializer<ChatMessage> {
if (obj.has("id")) {
message.id = obj.get("id").getAsString();
}
if (obj.has("text") && !obj.get("text").isJsonNull()) {
if (obj.has("text") && !obj.get("text").isJsonNull() && obj.get("text").isJsonPrimitive()) {
message.text = obj.get("text").getAsString();
}
if (obj.has("timestamp")) {