Fix minor bugs

This commit is contained in:
Phillip Thelen 2020-09-18 18:34:53 +02:00
parent d86704c080
commit 499fca1d34
42 changed files with 232 additions and 188 deletions

View file

@ -158,7 +158,7 @@ android {
multiDexEnabled true multiDexEnabled true
resConfigs "en", "bg", "de", "en-rGB", "es", "fr", "hr-rHR", "in", "it", "iw", "ja", "ko", "lt", "nl", "pl", "pt-rBR", "pt-rPT", "ru", "tr", "zh", "zh-rTW" resConfigs "en", "bg", "de", "en-rGB", "es", "fr", "hr-rHR", "in", "it", "iw", "ja", "ko", "lt", "nl", "pl", "pt-rBR", "pt-rPT", "ru", "tr", "zh", "zh-rTW"
versionCode 2552 versionCode 2554
versionName "3.0" versionName "3.0"
} }

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/red_100" /> <solid android:color="@color/background_red" />
<corners android:radius="@dimen/rounded_button_radius"/> <corners android:radius="@dimen/rounded_button_radius"/>
<padding android:left="0dip" android:top="0dip" android:right="0dip" android:bottom="0dip" /> <padding android:left="0dip" android:top="0dip" android:right="0dip" android:bottom="0dip" />
</shape> </shape>

View file

@ -61,7 +61,7 @@
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/healthEditText" android:id="@+id/healthEditText"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:inputType="numberDecimal" android:inputType="numberDecimal"
android:background="@android:color/transparent"/> android:background="@android:color/transparent"/>
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
@ -103,7 +103,7 @@
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/experienceEditText" android:id="@+id/experienceEditText"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:inputType="numberDecimal" android:inputType="numberDecimal"
android:background="@android:color/transparent"/> android:background="@android:color/transparent"/>
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
@ -145,7 +145,7 @@
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/manaEditText" android:id="@+id/manaEditText"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:inputType="numberDecimal" android:inputType="numberDecimal"
android:background="@android:color/transparent"/> android:background="@android:color/transparent"/>
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
@ -187,7 +187,7 @@
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/goldEditText" android:id="@+id/goldEditText"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:inputType="numberDecimal" android:inputType="numberDecimal"
android:background="@android:color/transparent"/> android:background="@android:color/transparent"/>
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
@ -229,7 +229,7 @@
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/levelEditText" android:id="@+id/levelEditText"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:inputType="number" android:inputType="number"
android:background="@android:color/transparent"/> android:background="@android:color/transparent"/>
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
@ -266,13 +266,13 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/layout_rounded_bg_window" android:background="@color/transparent"
android:hint="@string/streak_label" android:hint="@string/streak_label"
android:paddingStart="16dp"> android:paddingStart="16dp">
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/streakEditText" android:id="@+id/streakEditText"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:inputType="number" android:inputType="number"
android:background="@android:color/transparent"/> android:background="@android:color/transparent"/>
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>

View file

@ -33,7 +33,38 @@
android:orientation="vertical"> android:orientation="vertical">
<FrameLayout <FrameLayout
android:background="@drawable/layout_rounded_bg_window" android:id="@+id/blocked_disclaimer_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/FlatCardView"
android:background="@drawable/layout_rounded_bg_red"
android:visibility="gone">
<LinearLayout
style="@style/CardContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/CardTitle"
android:text="@string/user_is_blocked"
android:textColor="@color/white"
android:layout_gravity="center" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/CardText"
android:text="@string/user_is_blocked_explanation"
android:textColor="@color/white"
android:gravity="center"
android:layout_gravity="center" />
</LinearLayout>
</FrameLayout>
<FrameLayout
style="@style/FlatCardView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
@ -119,7 +150,7 @@
</FrameLayout> </FrameLayout>
<FrameLayout <FrameLayout
android:background="@drawable/layout_rounded_bg_window" style="@style/FlatCardView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<LinearLayout <LinearLayout
@ -134,6 +165,7 @@
android:text="@string/profile_send_message" android:text="@string/profile_send_message"
style="?android:attr/buttonBarButtonStyle" style="?android:attr/buttonBarButtonStyle"
android:textAllCaps="false" android:textAllCaps="false"
android:drawableTint="?colorPrimary"
android:textSize="13sp" android:textSize="13sp"
android:drawableTop="@drawable/icon_messages"/> android:drawableTop="@drawable/icon_messages"/>
<Button <Button
@ -143,6 +175,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/profile_gift_gems" android:text="@string/profile_gift_gems"
style="?android:attr/buttonBarButtonStyle" style="?android:attr/buttonBarButtonStyle"
android:drawableTint="?colorPrimary"
android:textAllCaps="false" android:textAllCaps="false"
android:textSize="13sp" android:textSize="13sp"
android:drawableTop="@drawable/icon_gift_gems"/> android:drawableTop="@drawable/icon_gift_gems"/>
@ -153,6 +186,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/profile_gift_subscription" android:text="@string/profile_gift_subscription"
style="?android:attr/buttonBarButtonStyle" style="?android:attr/buttonBarButtonStyle"
android:drawableTint="?colorPrimary"
android:textAllCaps="false" android:textAllCaps="false"
android:textSize="13sp" android:textSize="13sp"
android:drawableTop="@drawable/icon_gift_subscription"/> android:drawableTop="@drawable/icon_gift_subscription"/>
@ -160,10 +194,9 @@
</FrameLayout> </FrameLayout>
<FrameLayout <FrameLayout
android:background="@drawable/layout_rounded_bg_window" style="@style/FlatCardView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<LinearLayout <LinearLayout
style="@style/CardContent" style="@style/CardContent"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -186,7 +219,7 @@
</FrameLayout> </FrameLayout>
<FrameLayout <FrameLayout
android:background="@drawable/layout_rounded_bg_window" style="@style/FlatCardView"
android:id="@+id/costume_card" android:id="@+id/costume_card"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
@ -213,7 +246,7 @@
</FrameLayout> </FrameLayout>
<FrameLayout <FrameLayout
android:background="@drawable/layout_rounded_bg_window" style="@style/FlatCardView"
android:id="@+id/attributes_card_view" android:id="@+id/attributes_card_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -283,7 +316,7 @@
<FrameLayout <FrameLayout
android:background="@drawable/layout_rounded_bg_window" style="@style/FlatCardView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
@ -352,7 +385,7 @@
<FrameLayout <FrameLayout
android:background="@drawable/layout_rounded_bg_window" style="@style/FlatCardView"
android:id="@+id/profile_achievements_card" android:id="@+id/profile_achievements_card"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">

View file

@ -13,68 +13,68 @@
android:layout_marginBottom="8dp"> android:layout_marginBottom="8dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<com.habitrpg.android.habitica.ui.AvatarView <com.habitrpg.android.habitica.ui.AvatarView
android:id="@+id/avatarView" android:id="@+id/avatarView"
android:layout_width="@dimen/avatar_header_width" android:layout_width="@dimen/avatar_header_width"
android:layout_height="@dimen/avatar_header_height" android:layout_height="@dimen/avatar_header_height"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginEnd="20dp" android:layout_marginEnd="20dp"
android:contentDescription="@string/sidebar_avatar" android:contentDescription="@string/sidebar_avatar"
app:showBackground="true" app:showBackground="true"
app:showMount="true" app:showMount="true"
app:showPet="true"/> app:showPet="true"/>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.habitrpg.android.habitica.ui.views.ValueBar
android:id="@+id/hpBar"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:layout_marginBottom="@dimen/header_bar_spacing"
app:barForegroundColor="@color/background_red"
app:barBackgroundColor="@color/window_background"
app:description="@string/HP_default"/>
<com.habitrpg.android.habitica.ui.views.ValueBar <com.habitrpg.android.habitica.ui.views.ValueBar
android:id="@+id/hpBar" android:id="@+id/xpBar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/header_bar_spacing" android:layout_marginBottom="@dimen/header_bar_spacing"
app:barForegroundColor="@color/hpColor" app:barForegroundColor="@color/background_yellow"
app:barBackgroundColor="@color/window_background" app:barBackgroundColor="@color/window_background"
app:description="@string/HP_default"/> app:description="@string/XP_default"/>
<com.habitrpg.android.habitica.ui.views.ValueBar <com.habitrpg.android.habitica.ui.views.ValueBar
android:id="@+id/xpBar" android:id="@+id/mpBar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/header_bar_spacing" app:barForegroundColor="@color/background_blue"
app:barForegroundColor="@color/xpColor"
app:barBackgroundColor="@color/window_background" app:barBackgroundColor="@color/window_background"
app:description="@string/XP_default"/> app:description="@string/MP_default"/>
<com.habitrpg.android.habitica.ui.views.ValueBar
android:id="@+id/mpBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:barForegroundColor="@color/mpColor"
app:barBackgroundColor="@color/window_background"
app:description="@string/MP_default"/>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_vertical"> android:gravity="center_vertical">
<TextView <TextView
android:id="@+id/lvl_tv" android:id="@+id/lvl_tv"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="36dp" android:layout_height="36dp"
android:drawablePadding="6dp" android:drawablePadding="6dp"
android:gravity="center" android:gravity="center"
android:textColor="@color/text_secondary" android:textColor="@color/text_secondary"
android:textSize="12sp" android:textSize="12sp"
tools:text="Lvl 12 Warrior"/> tools:text="Lvl 12 Warrior"/>
<ImageView <ImageView
android:id="@+id/buffImageView" android:id="@+id/buffImageView"
@ -85,13 +85,13 @@
tools:srcCompat="@tools:sample/avatars" /> tools:srcCompat="@tools:sample/avatars" />
<View <View
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1"/> android:layout_weight="1"/>
<com.habitrpg.android.habitica.ui.views.CurrencyViews <com.habitrpg.android.habitica.ui.views.CurrencyViews
android:id="@+id/currencyView" android:id="@+id/currencyView"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"/>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>

View file

@ -21,8 +21,7 @@
android:layout_gravity="center" /> android:layout_gravity="center" />
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"/>
android:background="@color/task_tint_overlay"/>
<ImageView <ImageView
android:id="@+id/checkmark" android:id="@+id/checkmark"
android:layout_width="20dp" android:layout_width="20dp"

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/card_view" android:id="@+id/card_view"
style="@style/FlatCardView"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_width="match_parent"> android:layout_width="match_parent">
<RelativeLayout <RelativeLayout
@ -32,4 +33,4 @@
android:layout_centerHorizontal="true" /> android:layout_centerHorizontal="true" />
</RelativeLayout> </RelativeLayout>
</androidx.cardview.widget.CardView> </FrameLayout>

View file

@ -40,10 +40,6 @@
android:gravity="center" android:gravity="center"
android:background="@drawable/daily_checked" android:background="@drawable/daily_checked"
android:layout_gravity="center" /> android:layout_gravity="center" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/task_tint_overlay"/>
<ImageView <ImageView
android:id="@+id/checkmark" android:id="@+id/checkmark"
android:layout_width="24dp" android:layout_width="24dp"

View file

@ -83,7 +83,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:checked="true" android:checked="true"
android:text="@string/owned" android:text="@string/owned"
android:textColor="@color/textColorLight" android:textColor="@color/text_primary"
android:paddingStart="8dp" /> android:paddingStart="8dp" />
<CheckBox <CheckBox
@ -93,7 +93,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:checked="true" android:checked="true"
android:text="@string/not_owned" android:text="@string/not_owned"
android:textColor="@color/textColorLight" android:textColor="@color/text_primary"
android:paddingStart="8dp"/> android:paddingStart="8dp"/>
</LinearLayout> </LinearLayout>
</com.habitrpg.android.habitica.ui.MaxHeightLinearLayout> </com.habitrpg.android.habitica.ui.MaxHeightLinearLayout>

View file

@ -12,8 +12,6 @@
android:id="@+id/editText" android:id="@+id/editText"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingBottom="16dp"
android:paddingTop="16dp"
android:paddingStart="@dimen/spacing_large" android:paddingStart="@dimen/spacing_large"
android:paddingEnd="@dimen/spacing_large" /> android:paddingEnd="@dimen/spacing_large" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>

View file

@ -12,8 +12,6 @@
android:id="@+id/editText" android:id="@+id/editText"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingBottom="16dp"
android:paddingTop="16dp"
android:paddingStart="@dimen/spacing_large" android:paddingStart="@dimen/spacing_large"
android:paddingEnd="@dimen/spacing_large" /> android:paddingEnd="@dimen/spacing_large" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
@ -28,8 +26,6 @@
android:id="@+id/passwordEditText" android:id="@+id/passwordEditText"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingBottom="16dp"
android:paddingTop="16dp"
android:paddingStart="@dimen/spacing_large" android:paddingStart="@dimen/spacing_large"
android:paddingEnd="@dimen/spacing_large" /> android:paddingEnd="@dimen/spacing_large" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>

View file

@ -22,16 +22,11 @@
android:layout_height="match_parent" android:layout_height="match_parent"
tools:background="@color/red_10"> tools:background="@color/red_10">
<View <View
android:id="@+id/checkBoxBackground" android:id="@+id/checkbox_background"
android:layout_width="24dp" android:layout_width="24dp"
android:layout_height="24dp" android:layout_height="24dp"
android:gravity="center" android:gravity="center"
android:background="@drawable/daily_checked"
android:layout_gravity="center" /> android:layout_gravity="center" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/task_tint_overlay"/>
<ImageView <ImageView
android:id="@+id/checkmark" android:id="@+id/checkmark"
android:layout_width="24dp" android:layout_width="24dp"

View file

@ -20,10 +20,10 @@
style="@style/SectionTitle" style="@style/SectionTitle"
android:text="@string/my_guilds" android:text="@string/my_guilds"
android:textAppearance="?android:attr/textAppearanceMedium" /> android:textAppearance="?android:attr/textAppearanceMedium" />
<androidx.cardview.widget.CardView <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
style="@style/CardView.Default"> style="@style/FlatCardView">
<LinearLayout <LinearLayout
android:id="@+id/my_guilds_listview" android:id="@+id/my_guilds_listview"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -33,7 +33,7 @@
tools:layout_height="50dp" tools:layout_height="50dp"
android:showDividers="middle"> android:showDividers="middle">
</LinearLayout> </LinearLayout>
</androidx.cardview.widget.CardView> </FrameLayout>
<Button <Button
android:id="@+id/publicGuildsButton" android:id="@+id/publicGuildsButton"
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -16,10 +16,10 @@
android:orientation="vertical" android:orientation="vertical"
android:paddingBottom="?android:actionBarSize"> android:paddingBottom="?android:actionBarSize">
<androidx.cardview.widget.CardView <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
style="@style/CardView.Default" style="@style/FlatCardView"
android:id="@+id/invitationWrapper"> android:id="@+id/invitationWrapper">
<com.habitrpg.android.habitica.ui.views.social.InvitationsView <com.habitrpg.android.habitica.ui.views.social.InvitationsView
@ -27,7 +27,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
style="@style/CardContent" /> style="@style/CardContent" />
</androidx.cardview.widget.CardView> </FrameLayout>
<LinearLayout <LinearLayout
android:id="@+id/noPartyWrapper" android:id="@+id/noPartyWrapper"

View file

@ -13,10 +13,10 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
> >
<androidx.cardview.widget.CardView <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
style="@style/CardView.Default" style="@style/FlatCardView"
android:id="@+id/party_invitation_wrapper"> android:id="@+id/party_invitation_wrapper">
<com.habitrpg.android.habitica.ui.views.social.InvitationsView <com.habitrpg.android.habitica.ui.views.social.InvitationsView
@ -24,7 +24,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
style="@style/CardContent" /> style="@style/CardContent" />
</androidx.cardview.widget.CardView> </FrameLayout>
<TextView <TextView
android:id="@+id/title_view" android:id="@+id/title_view"

View file

@ -11,7 +11,7 @@
<RelativeLayout <RelativeLayout
android:id="@+id/promo_banner" android:id="@+id/promo_banner"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="80dp" android:layout_height="103dp"
android:layout_marginStart="4dp" android:layout_marginStart="4dp"
android:layout_marginEnd="4dp" android:layout_marginEnd="4dp"
android:layout_marginBottom="16dp" android:layout_marginBottom="16dp"
@ -55,7 +55,7 @@
android:id="@+id/promo_banner_duration_view" android:id="@+id/promo_banner_duration_view"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
style="@style/Subheader2"/> style="@style/Subheader1"/>
</LinearLayout> </LinearLayout>
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -75,14 +75,15 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/subscriptionDetails"/> android:id="@+id/subscriptionDetails"/>
<TextView <com.habitrpg.android.habitica.ui.views.DayNightTextView
android:id="@+id/subscribeBenefitsTitle" android:id="@+id/subscribeBenefitsTitle"
android:layout_width="250dp" android:layout_width="250dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/subscribe_prompt" android:text="@string/subscribe_prompt"
android:gravity="center" android:gravity="center"
style="@style/Subheader1" style="@style/Subheader1"
android:textColor="@color/text_brand" app:dayTextColor="@color/text_brand"
app:nightTextColor="@color/gray_400"
android:lineSpacingExtra="4dp" android:lineSpacingExtra="4dp"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:layout_gravity="center_horizontal"/> android:layout_gravity="center_horizontal"/>

View file

@ -31,8 +31,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:scaleType="center" android:scaleType="center"
android:layout_gravity="center" android:layout_gravity="center"
android:src="@drawable/habit_plus" android:src="@drawable/habit_plus" />
android:background="@color/task_tint_overlay" />
<Button <Button
android:id="@+id/btnPlus" android:id="@+id/btnPlus"
@ -75,8 +74,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="center" android:layout_gravity="center"
android:scaleType="center" android:scaleType="center"
android:src="@drawable/habit_minus" android:src="@drawable/habit_minus"/>
android:background="@color/task_tint_overlay" />
<Button <Button
android:id="@+id/btnMinus" android:id="@+id/btnMinus"
style="@style/HabitButton" style="@style/HabitButton"

View file

@ -42,8 +42,7 @@
android:layout_gravity="center" /> android:layout_gravity="center" />
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"/>
android:background="@color/task_tint_overlay"/>
<ImageView <ImageView
android:id="@+id/checkmark" android:id="@+id/checkmark"
android:layout_width="24dp" android:layout_width="24dp"

View file

@ -4,10 +4,10 @@
android:orientation="vertical" android:layout_width="match_parent" android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<androidx.cardview.widget.CardView <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
style="@style/CardView.Default" style="@style/FlatCardView"
android:id="@+id/party_invitation_wrapper"> android:id="@+id/party_invitation_wrapper">
<LinearLayout <LinearLayout
android:orientation="horizontal" android:orientation="horizontal"
@ -67,5 +67,5 @@
android:background="@drawable/party_invite_reject" /> android:background="@drawable/party_invite_reject" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</androidx.cardview.widget.CardView> </FrameLayout>
</LinearLayout> </LinearLayout>

View file

@ -858,7 +858,7 @@
<string name="sent_card">%sを送りました</string> <string name="sent_card">%sを送りました</string>
<string name="share_challenge_with">チャレンジをシェアする</string> <string name="share_challenge_with">チャレンジをシェアする</string>
<string name="details">詳細</string> <string name="details">詳細</string>
<string name="create_task">%sを作成する</string> <string name="create_task">%s を作成する</string>
<string name="confirm_deletion">削除を承認する</string> <string name="confirm_deletion">削除を承認する</string>
<string name="take_me_back">戻る</string> <string name="take_me_back">戻る</string>
<string name="setup_task_habit_2_notes">または編集画面から削除しましょう</string> <string name="setup_task_habit_2_notes">または編集画面から削除しましょう</string>

View file

@ -31,12 +31,12 @@
<color name="equipment_overview_background">@color/gray_10</color> <color name="equipment_overview_background">@color/gray_10</color>
<color name="inverted_background">@color/gray_10</color> <color name="inverted_background">@color/gray_10</color>
<color name="inverted_background_offset">@color/gray_50</color> <color name="inverted_background_offset">@color/gray_50</color>
<color name="background_red">@color/red_10</color> <color name="background_red">@color/red_50</color>
<color name="background_orange">@color/orange_10</color> <color name="background_orange">@color/orange_50</color>
<color name="background_yellow">@color/yellow_5</color> <color name="background_yellow">@color/yellow_10</color>
<color name="background_green">@color/green_10</color> <color name="background_green">@color/green_50</color>
<color name="background_blue">@color/blue_10</color> <color name="background_blue">@color/blue_50</color>
<color name="background_teal">@color/teal_10</color> <color name="background_teal">@color/teal_50</color>
<color name="background_brand">@color/brand_200</color> <color name="background_brand">@color/brand_200</color>
<color name="checkbox_fill">#40000000</color> <color name="checkbox_fill">#40000000</color>
@ -44,7 +44,6 @@
<color name="checkbox_fill_selected">#40ffffff</color> <color name="checkbox_fill_selected">#40ffffff</color>
<color name="taskform_gray">#3D3945</color> <color name="taskform_gray">#3D3945</color>
<color name="reward_buy_button_text">#FFFFB445</color> <color name="reward_buy_button_text">#FFFFB445</color>
<color name="task_tint_overlay">#4D19171C</color>
<color name="content_95_alpha">#f21A181D</color> <color name="content_95_alpha">#f21A181D</color>
<color name="content_80_alpha">#cc1A181D</color> <color name="content_80_alpha">#cc1A181D</color>

View file

@ -76,7 +76,6 @@
<color name="colorPrimaryDark">@color/brand_50</color> <color name="colorPrimaryDark">@color/brand_50</color>
<!-- text --> <!-- text -->
<color name="textColorSecondaryDark">@color/brand_500</color> <color name="textColorSecondaryDark">@color/brand_500</color>
<color name="textColorLight">#212121</color>
<!-- Cards --> <!-- Cards -->
<color name="text_light">#66000000</color> <color name="text_light">#66000000</color>
@ -184,19 +183,18 @@
<color name="equipment_overview_background">@color/gray_50</color> <color name="equipment_overview_background">@color/gray_50</color>
<color name="inverted_background">@color/gray_100</color> <color name="inverted_background">@color/gray_100</color>
<color name="inverted_background_offset">@color/gray_200</color> <color name="inverted_background_offset">@color/gray_200</color>
<color name="background_red">@color/red_50</color> <color name="background_red">@color/red_100</color>
<color name="background_orange">@color/orange_50</color> <color name="background_orange">@color/orange_100</color>
<color name="background_yellow">@color/yellow_10</color> <color name="background_yellow">@color/yellow_100</color>
<color name="background_green">@color/green_50</color> <color name="background_green">@color/green_100</color>
<color name="background_blue">@color/blue_50</color> <color name="background_blue">@color/blue_100</color>
<color name="background_teal">@color/teal_50</color> <color name="background_teal">@color/teal_100</color>
<color name="background_brand">@color/brand_300</color> <color name="background_brand">@color/brand_300</color>
<color name="checkbox_fill">#50ffffff</color> <color name="checkbox_fill">#50ffffff</color>
<color name="checkbox_fill_inactive">#99FFFFFF</color> <color name="checkbox_fill_inactive">#99FFFFFF</color>
<color name="checkbox_fill_selected">@color/gray_600</color> <color name="checkbox_fill_selected">@color/gray_600</color>
<color name="taskform_gray">#99edecee</color> <color name="taskform_gray">#99edecee</color>
<color name="task_tint_overlay">#00000000</color>
<color name="content_95_alpha">#f2ffffff</color> <color name="content_95_alpha">#f2ffffff</color>
<color name="content_80_alpha">#ccffffff</color> <color name="content_80_alpha">#ccffffff</color>

View file

@ -1107,4 +1107,6 @@
<string name="theme_mode">Theme Mode</string> <string name="theme_mode">Theme Mode</string>
<string name="theme_color">Theme Color</string> <string name="theme_color">Theme Color</string>
<string name="submit_feedback">Submit Feedback</string> <string name="submit_feedback">Submit Feedback</string>
<string name="user_is_blocked">You blocked this user</string>
<string name="user_is_blocked_explanation">A blocked user cannot send you Private Messages but you will still see their posts in Tavern or Guilds.</string>
</resources> </resources>

View file

@ -32,8 +32,8 @@
<item name="textColorPrimaryDark">@color/brand_600</item> <item name="textColorPrimaryDark">@color/brand_600</item>
<item name="textColorSecondaryDark">@color/brand_500</item> <item name="textColorSecondaryDark">@color/brand_500</item>
<item name="android:textColorPrimary">@color/text_primary</item> <item name="android:textColorPrimary">@color/text_primary</item>
<item name="android:textColorSecondary">@color/text_ternary</item> <item name="android:textColorSecondary">@color/text_ternary</item>te
<item name="barColor">@color/brand_200</item> <item name="barColor">@color/brand_300</item>
<item name="colorContentBackground">@color/content_background</item> <item name="colorContentBackground">@color/content_background</item>
<item name="colorWindowBackground">@color/window_background</item> <item name="colorWindowBackground">@color/window_background</item>
@ -64,7 +64,7 @@
<item name="colorPrimary">@color/gray_500</item> <item name="colorPrimary">@color/gray_500</item>
<item name="barColor">@color/gray_1</item> <item name="barColor">@color/gray_1</item>
<item name="colorPrimaryOffset">@color/gray_10</item> <item name="colorPrimaryOffset">@color/gray_10</item>
<item name="textColorPrimaryDark">@color/brand_500</item> <item name="textColorPrimaryDark">@color/gray_200</item>
</style> </style>
<style name="MainAppTheme.Red"> <style name="MainAppTheme.Red">
@ -87,7 +87,7 @@
</style> </style>
<style name="MainAppTheme.Red.Dark"> <style name="MainAppTheme.Red.Dark">
<item name="barColor">@color/gray_10</item> <item name="barColor">@color/gray_1</item>
<item name="colorPrimaryOffset">@color/gray_10</item> <item name="colorPrimaryOffset">@color/gray_10</item>
<item name="textColorPrimaryDark">@color/gray_200</item> <item name="textColorPrimaryDark">@color/gray_200</item>
</style> </style>
@ -111,7 +111,7 @@
</style> </style>
<style name="MainAppTheme.Maroon.Dark"> <style name="MainAppTheme.Maroon.Dark">
<item name="barColor">@color/gray_10</item> <item name="barColor">@color/gray_1</item>
<item name="colorPrimaryOffset">@color/gray_10</item> <item name="colorPrimaryOffset">@color/gray_10</item>
<item name="textColorPrimaryDark">@color/gray_200</item> <item name="textColorPrimaryDark">@color/gray_200</item>
</style> </style>
@ -136,7 +136,7 @@
</style> </style>
<style name="MainAppTheme.Orange.Dark"> <style name="MainAppTheme.Orange.Dark">
<item name="barColor">@color/gray_10</item> <item name="barColor">@color/gray_1</item>
<item name="colorPrimaryOffset">@color/gray_10</item> <item name="colorPrimaryOffset">@color/gray_10</item>
<item name="textColorPrimaryDark">@color/gray_200</item> <item name="textColorPrimaryDark">@color/gray_200</item>
</style> </style>
@ -161,7 +161,7 @@
</style> </style>
<style name="MainAppTheme.Yellow.Dark"> <style name="MainAppTheme.Yellow.Dark">
<item name="barColor">@color/gray_10</item> <item name="barColor">@color/gray_1</item>
<item name="colorPrimaryOffset">@color/gray_10</item> <item name="colorPrimaryOffset">@color/gray_10</item>
<item name="textColorPrimaryDark">@color/gray_200</item> <item name="textColorPrimaryDark">@color/gray_200</item>
</style> </style>
@ -186,7 +186,7 @@
</style> </style>
<style name="MainAppTheme.Green.Dark"> <style name="MainAppTheme.Green.Dark">
<item name="barColor">@color/gray_10</item> <item name="barColor">@color/gray_1</item>
<item name="colorPrimaryOffset">@color/gray_10</item> <item name="colorPrimaryOffset">@color/gray_10</item>
<item name="textColorPrimaryDark">@color/gray_200</item> <item name="textColorPrimaryDark">@color/gray_200</item>
</style> </style>
@ -211,7 +211,7 @@
</style> </style>
<style name="MainAppTheme.Teal.Dark"> <style name="MainAppTheme.Teal.Dark">
<item name="barColor">@color/gray_10</item> <item name="barColor">@color/gray_1</item>
<item name="colorPrimaryOffset">@color/gray_10</item> <item name="colorPrimaryOffset">@color/gray_10</item>
<item name="textColorPrimaryDark">@color/gray_200</item> <item name="textColorPrimaryDark">@color/gray_200</item>
</style> </style>
@ -236,7 +236,7 @@
</style> </style>
<style name="MainAppTheme.Blue.Dark"> <style name="MainAppTheme.Blue.Dark">
<item name="barColor">@color/gray_10</item> <item name="barColor">@color/gray_1</item>
<item name="colorPrimaryOffset">@color/gray_10</item> <item name="colorPrimaryOffset">@color/gray_10</item>
<item name="textColorPrimaryDark">@color/gray_200</item> <item name="textColorPrimaryDark">@color/gray_200</item>
</style> </style>
@ -280,11 +280,6 @@
<item name="android:padding">@dimen/card_padding_compact</item> <item name="android:padding">@dimen/card_padding_compact</item>
</style> </style>
<style name="CardView.Default" parent="Widget.MaterialComponents.CardView">
<item name="android:layout_margin">@dimen/card_margin</item>
<item name="android:backgroundTint">@color/window_background</item>
</style>
<style name="RowWrapper"> <style name="RowWrapper">
<item name="android:padding">@dimen/row_padding</item> <item name="android:padding">@dimen/row_padding</item>
<item name="android:background">@drawable/selection_highlight</item> <item name="android:background">@drawable/selection_highlight</item>
@ -750,7 +745,7 @@
<style name="TextInputLayoutAppearance" parent="Widget.MaterialComponents.TextInputLayout.FilledBox"> <style name="TextInputLayoutAppearance" parent="Widget.MaterialComponents.TextInputLayout.FilledBox">
<item name="boxBackgroundColor">@color/taskform_gray</item> <item name="boxBackgroundColor">@color/taskform_gray</item>
<item name="android:textColor">@color/textColorLight</item> <item name="android:textColor">@color/text_primary</item>
<item name="android:textColorHint">@color/text_quad</item> <item name="android:textColorHint">@color/text_quad</item>
</style> </style>
@ -802,4 +797,9 @@
<style name="PreferenceThemeOverlay.v14" tools:override="true"> <style name="PreferenceThemeOverlay.v14" tools:override="true">
<item name="android:background">@color/content_background</item> <item name="android:background">@color/content_background</item>
</style> </style>
<style name="FlatCardView">
<item name="android:background">@drawable/layout_rounded_bg_window</item>
<item name="android:layout_margin">@dimen/spacing_medium</item>
</style>
</resources> </resources>

View file

@ -6,9 +6,7 @@ import android.view.Window
fun Window.updateStatusBarColor(color: Int, isLight: Boolean) { fun Window.updateStatusBarColor(color: Int, isLight: Boolean) {
statusBarColor = color statusBarColor = color
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
isStatusBarContrastEnforced = true
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
@Suppress("DEPRECATION") @Suppress("DEPRECATION")
decorView.systemUiVisibility = if (isLight) View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR else View.SYSTEM_UI_FLAG_VISIBLE decorView.systemUiVisibility = if (isLight) View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR else View.SYSTEM_UI_FLAG_VISIBLE
} }

View file

@ -72,7 +72,7 @@ open class ShopItem : RealmObject() {
get() = "eggs" == purchaseType || "hatchingPotions" == purchaseType || "food" == purchaseType || "gems" == purchaseType get() = "eggs" == purchaseType || "hatchingPotions" == purchaseType || "food" == purchaseType || "gems" == purchaseType
fun canAfford(user: User?, quantity: Int): Boolean = when(currency) { fun canAfford(user: User?, quantity: Int): Boolean = when(currency) {
"gold" -> (value * quantity) <= user?.stats?.gp ?: 0.0 "gold" -> (value * quantity) <= (user?.stats?.gp ?: 0.0)
else -> true else -> true
} }

View file

@ -23,6 +23,7 @@ import com.habitrpg.android.habitica.data.SocialRepository
import com.habitrpg.android.habitica.data.UserRepository import com.habitrpg.android.habitica.data.UserRepository
import com.habitrpg.android.habitica.databinding.ActivityFullProfileBinding import com.habitrpg.android.habitica.databinding.ActivityFullProfileBinding
import com.habitrpg.android.habitica.extensions.addCancelButton import com.habitrpg.android.habitica.extensions.addCancelButton
import com.habitrpg.android.habitica.extensions.getThemeColor
import com.habitrpg.android.habitica.helpers.MainNavigationController import com.habitrpg.android.habitica.helpers.MainNavigationController
import com.habitrpg.android.habitica.helpers.RxErrorHandler import com.habitrpg.android.habitica.helpers.RxErrorHandler
import com.habitrpg.android.habitica.helpers.UserStatComputer import com.habitrpg.android.habitica.helpers.UserStatComputer
@ -91,6 +92,9 @@ class FullProfileActivity : BaseActivity() {
avatarWithBars = AvatarWithBarsViewModel(this, binding.avatarWithBars) avatarWithBars = AvatarWithBarsViewModel(this, binding.avatarWithBars)
binding.avatarWithBars.root.setBackgroundColor(ContextCompat.getColor(this, R.color.transparent)) binding.avatarWithBars.root.setBackgroundColor(ContextCompat.getColor(this, R.color.transparent))
binding.avatarWithBars.hpBar.barBackgroundColor = getThemeColor(R.color.content_background)
binding.avatarWithBars.xpBar.barBackgroundColor = getThemeColor(R.color.content_background)
binding.avatarWithBars.mpBar.barBackgroundColor = getThemeColor(R.color.content_background)
attributeRows.clear() attributeRows.clear()
binding.attributesCardView.setOnClickListener { toggleAttributeDetails() } binding.attributesCardView.setOnClickListener { toggleAttributeDetails() }
@ -100,6 +104,7 @@ class FullProfileActivity : BaseActivity() {
binding.giftSubscriptionButton.setOnClickListener { MainNavigationController.navigate(R.id.giftSubscriptionActivity, bundleOf(Pair("userID", userID), Pair("username", null))) } binding.giftSubscriptionButton.setOnClickListener { MainNavigationController.navigate(R.id.giftSubscriptionActivity, bundleOf(Pair("userID", userID), Pair("username", null))) }
compositeSubscription.add(userRepository.getUser().subscribe({ compositeSubscription.add(userRepository.getUser().subscribe({
blocks = it.inbox?.blocks ?: listOf() blocks = it.inbox?.blocks ?: listOf()
binding.blockedDisclaimerView.visibility = if (isUserBlocked()) View.VISIBLE else View.GONE
}, RxErrorHandler.handleEmptyError())) }, RxErrorHandler.handleEmptyError()))
} }
@ -112,7 +117,7 @@ class FullProfileActivity : BaseActivity() {
val inflater = menuInflater val inflater = menuInflater
inflater.inflate(R.menu.menu_full_profile, menu) inflater.inflate(R.menu.menu_full_profile, menu)
val item = menu?.findItem(R.id.block_user) val item = menu?.findItem(R.id.block_user)
if (blocks.contains(userID)) { if (isUserBlocked()) {
item?.title = getString(R.string.unblock_user) item?.title = getString(R.string.unblock_user)
} else { } else {
item?.title = getString(R.string.block) item?.title = getString(R.string.block)
@ -121,6 +126,10 @@ class FullProfileActivity : BaseActivity() {
return super.onCreateOptionsMenu(menu) return super.onCreateOptionsMenu(menu)
} }
private fun isUserBlocked(): Boolean {
return blocks.contains(userID)
}
override fun onOptionsItemSelected(item: MenuItem): Boolean { override fun onOptionsItemSelected(item: MenuItem): Boolean {
return when (item.itemId) { return when (item.itemId) {
android.R.id.home -> { android.R.id.home -> {

View file

@ -81,6 +81,7 @@ import io.reactivex.schedulers.Schedulers
import org.greenrobot.eventbus.EventBus import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.Subscribe
import java.util.* import java.util.*
import java.util.concurrent.TimeUnit
import javax.inject.Inject import javax.inject.Inject
open class MainActivity : BaseActivity(), TutorialView.OnTutorialReaction { open class MainActivity : BaseActivity(), TutorialView.OnTutorialReaction {
@ -261,11 +262,13 @@ open class MainActivity : BaseActivity(), TutorialView.OnTutorialReaction {
} }
private fun updateToolbarTitle(destination: NavDestination, arguments: Bundle?) { private fun updateToolbarTitle(destination: NavDestination, arguments: Bundle?) {
binding.toolbarTitle.text = if (destination.id == R.id.petDetailRecyclerFragment || destination.id == R.id.mountDetailRecyclerFragment) { binding.toolbarTitle.text = if (destination.id == R.id.promoInfoFragment) {
""
} else if (destination.id == R.id.petDetailRecyclerFragment || destination.id == R.id.mountDetailRecyclerFragment) {
arguments?.getString("type") arguments?.getString("type")
} else if (destination.label.isNullOrEmpty() && user?.isValid == true) { } else if (destination.label.isNullOrEmpty() && user?.isValid == true) {
user?.profile?.name user?.profile?.name
} else if (user?.isValid == true && user?.profile != null) { } else if (destination.label != null) {
destination.label destination.label
} else { } else {
"" ""
@ -360,6 +363,9 @@ open class MainActivity : BaseActivity(), TutorialView.OnTutorialReaction {
launchTrace?.stop() launchTrace?.stop()
launchTrace = null launchTrace = null
val navigationController = findNavController(R.id.nav_host_fragment)
navigationController.currentDestination?.let { updateToolbarTitle(it, null) }
} }
override fun onPause() { override fun onPause() {

View file

@ -28,17 +28,17 @@ class HabiticaClassArrayAdapter(context: Context, resource: Int, objects: List<C
when (getItem(position)) { when (getItem(position)) {
Stats.WARRIOR -> { Stats.WARRIOR -> {
textView?.text = context.getString(R.string.warrior) textView?.text = context.getString(R.string.warrior)
textView?.setTextColor(ContextCompat.getColor(context, R.color.red_10)) textView?.setTextColor(ContextCompat.getColor(context, R.color.text_red))
imageView?.setImageBitmap(HabiticaIconsHelper.imageOfWarriorLightBg()) imageView?.setImageBitmap(HabiticaIconsHelper.imageOfWarriorLightBg())
} }
Stats.MAGE -> { Stats.MAGE -> {
textView?.text = context.getString(R.string.mage) textView?.text = context.getString(R.string.mage)
textView?.setTextColor(ContextCompat.getColor(context, R.color.blue_10)) textView?.setTextColor(ContextCompat.getColor(context, R.color.text_blue))
imageView?.setImageBitmap(HabiticaIconsHelper.imageOfMageLightBg()) imageView?.setImageBitmap(HabiticaIconsHelper.imageOfMageLightBg())
} }
Stats.HEALER -> { Stats.HEALER -> {
textView?.text = context.getString(R.string.healer) textView?.text = context.getString(R.string.healer)
textView?.setTextColor(ContextCompat.getColor(context, R.color.yellow_10)) textView?.setTextColor(ContextCompat.getColor(context, R.color.text_yellow))
imageView?.setImageBitmap(HabiticaIconsHelper.imageOfHealerLightBg()) imageView?.setImageBitmap(HabiticaIconsHelper.imageOfHealerLightBg())
} }
Stats.ROGUE -> { Stats.ROGUE -> {
@ -48,7 +48,7 @@ class HabiticaClassArrayAdapter(context: Context, resource: Int, objects: List<C
} }
else -> { else -> {
textView?.text = context.getString(R.string.classless) textView?.text = context.getString(R.string.classless)
textView?.setTextColor(ContextCompat.getColor(context, R.color.textColorLight)) textView?.setTextColor(ContextCompat.getColor(context, R.color.text_primary))
imageView?.setImageBitmap(null) imageView?.setImageBitmap(null)
} }
} }

View file

@ -1,8 +1,6 @@
package com.habitrpg.android.habitica.ui.adapter.social package com.habitrpg.android.habitica.ui.adapter.social
import android.view.ViewGroup import android.view.ViewGroup
import androidx.paging.DataSource
import androidx.paging.PagedList
import androidx.paging.PagedListAdapter import androidx.paging.PagedListAdapter
import androidx.recyclerview.widget.DiffUtil import androidx.recyclerview.widget.DiffUtil
import com.habitrpg.android.habitica.R import com.habitrpg.android.habitica.R

View file

@ -33,6 +33,10 @@ class PromoInfoFragment : BaseMainFragment<FragmentPromoInfoBinding>() {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
val promo = context?.let { configManager.activePromo(it) } val promo = context?.let { configManager.activePromo(it) }
promo?.configureInfoFragment(this) promo?.configureInfoFragment(this)
}
override fun onResume() {
super.onResume()
activity?.title = "" activity?.title = ""
} }
} }

View file

@ -40,7 +40,7 @@ class DayStartPreferenceDialogFragment : PreferenceDialogFragmentCompat() {
picker = TimePicker(context) picker = TimePicker(context)
descriptionTextView = TextView(context) descriptionTextView = TextView(context)
@Suppress("DEPRECATION") @Suppress("DEPRECATION")
descriptionTextView?.setTextColor(resources.getColor(R.color.textColorLight)) descriptionTextView?.setTextColor(resources.getColor(R.color.text_primary))
val padding = resources.getDimension(R.dimen.card_padding).toInt() val padding = resources.getDimension(R.dimen.card_padding).toInt()
descriptionTextView?.setPadding(padding, padding, padding, padding) descriptionTextView?.setPadding(padding, padding, padding, padding)
val lp = LinearLayout.LayoutParams( val lp = LinearLayout.LayoutParams(

View file

@ -73,22 +73,21 @@ class InboxMessageListFragment : BaseMainFragment<FragmentInboxMessageListBindin
val layoutManager = androidx.recyclerview.widget.LinearLayoutManager(this.getActivity()) val layoutManager = androidx.recyclerview.widget.LinearLayoutManager(this.getActivity())
binding?.recyclerView?.layoutManager = layoutManager binding?.recyclerView?.layoutManager = layoutManager
compositeSubscription.add(apiClient.getMember(replyToUserUUID!!).subscribe( Consumer compositeSubscription.add(apiClient.getMember(replyToUserUUID!!).subscribe( { member ->
{ member ->
chatAdapter = InboxAdapter(user, member) chatAdapter = InboxAdapter(user, member)
viewModel?.messages?.observe(this.viewLifecycleOwner, Observer { chatAdapter?.submitList(it) }) viewModel?.messages?.observe(this.viewLifecycleOwner, { chatAdapter?.submitList(it) })
binding?.recyclerView?.adapter = chatAdapter binding?.recyclerView?.adapter = chatAdapter
binding?.recyclerView?.itemAnimator = SafeDefaultItemAnimator() binding?.recyclerView?.itemAnimator = SafeDefaultItemAnimator()
chatAdapter?.let { adapter -> chatAdapter?.let { adapter ->
compositeSubscription.add(adapter.getUserLabelClickFlowable().subscribe(Consumer<String> { compositeSubscription.add(adapter.getUserLabelClickFlowable().subscribe({
FullProfileActivity.open(it) FullProfileActivity.open(it)
}, RxErrorHandler.handleEmptyError())) }, RxErrorHandler.handleEmptyError()))
compositeSubscription.add(adapter.getDeleteMessageFlowable().subscribe(Consumer { this.showDeleteConfirmationDialog(it) }, RxErrorHandler.handleEmptyError())) compositeSubscription.add(adapter.getDeleteMessageFlowable().subscribe({ this.showDeleteConfirmationDialog(it) }, RxErrorHandler.handleEmptyError()))
compositeSubscription.add(adapter.getFlagMessageClickFlowable().subscribe(Consumer { this.showFlagConfirmationDialog(it) }, RxErrorHandler.handleEmptyError())) compositeSubscription.add(adapter.getFlagMessageClickFlowable().subscribe({ this.showFlagConfirmationDialog(it) }, RxErrorHandler.handleEmptyError()))
compositeSubscription.add(adapter.getCopyMessageFlowable().subscribe(Consumer { this.copyMessageToClipboard(it) }, RxErrorHandler.handleEmptyError())) compositeSubscription.add(adapter.getCopyMessageFlowable().subscribe({ this.copyMessageToClipboard(it) }, RxErrorHandler.handleEmptyError()))
} }
})) }, RxErrorHandler.handleEmptyError()))
binding?.chatBarView?.sendAction = { sendMessage(it) } binding?.chatBarView?.sendAction = { sendMessage(it) }
binding?.chatBarView?.maxChatLength = configManager.maxChatLength() binding?.chatBarView?.maxChatLength = configManager.maxChatLength()

View file

@ -10,6 +10,7 @@ import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.habitrpg.android.habitica.R import com.habitrpg.android.habitica.R
import com.habitrpg.android.habitica.databinding.ChatItemBinding import com.habitrpg.android.habitica.databinding.ChatItemBinding
import com.habitrpg.android.habitica.databinding.TavernChatIntroItemBinding
import com.habitrpg.android.habitica.extensions.dpToPx import com.habitrpg.android.habitica.extensions.dpToPx
import com.habitrpg.android.habitica.extensions.getAgoString import com.habitrpg.android.habitica.extensions.getAgoString
import com.habitrpg.android.habitica.extensions.setScaledPadding import com.habitrpg.android.habitica.extensions.setScaledPadding
@ -23,7 +24,7 @@ import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers import io.reactivex.schedulers.Schedulers
import com.habitrpg.android.habitica.models.members.Member import com.habitrpg.android.habitica.models.members.Member
open class ChatRecyclerViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {} open class ChatRecyclerViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView)
class ChatRecyclerIntroViewHolder(itemView: View, replyToUUID: String) : ChatRecyclerViewHolder(itemView) { class ChatRecyclerIntroViewHolder(itemView: View, replyToUUID: String) : ChatRecyclerViewHolder(itemView) {
private val binding = TavernChatIntroItemBinding.bind(itemView) private val binding = TavernChatIntroItemBinding.bind(itemView)
@ -40,7 +41,7 @@ class ChatRecyclerIntroViewHolder(itemView: View, replyToUUID: String) : ChatRec
binding.avatarView.setAvatar(member) binding.avatarView.setAvatar(member)
binding.displayNameTextview.username = member.displayName binding.displayNameTextview.username = member.displayName
binding.displayNameTextview.tier = member.contributor?.level ?: 0 binding.displayNameTextview.tier = member.contributor?.level ?: 0
binding.sublineTextview.text = "@" + member.username binding.sublineTextview.text = member.formattedUsername
} }
} }

View file

@ -40,7 +40,6 @@ class HabitViewHolder(itemView: View, scoreTaskFunc: ((Task, TaskDirection) -> U
btnPlusCircleView.background = drawable btnPlusCircleView.background = drawable
this.btnPlus.visibility = View.VISIBLE this.btnPlus.visibility = View.VISIBLE
this.btnPlus.isClickable = true this.btnPlus.isClickable = true
//btnPlusIconView.background.alpha = 255
} else { } else {
this.btnPlusWrapper.setBackgroundResource(R.color.habit_inactive_gray) this.btnPlusWrapper.setBackgroundResource(R.color.habit_inactive_gray)
val plusIcon = ContextCompat.getDrawable(context, R.drawable.habit_plus) val plusIcon = ContextCompat.getDrawable(context, R.drawable.habit_plus)
@ -50,7 +49,6 @@ class HabitViewHolder(itemView: View, scoreTaskFunc: ((Task, TaskDirection) -> U
btnPlusCircleView.background = ContextCompat.getDrawable(context, R.drawable.habit_circle_disabled) btnPlusCircleView.background = ContextCompat.getDrawable(context, R.drawable.habit_circle_disabled)
this.btnPlus.visibility = View.GONE this.btnPlus.visibility = View.GONE
this.btnPlus.isClickable = false this.btnPlus.isClickable = false
btnPlusIconView.background.alpha = 0
} }
if (data.down == true) { if (data.down == true) {
@ -66,7 +64,6 @@ class HabitViewHolder(itemView: View, scoreTaskFunc: ((Task, TaskDirection) -> U
btnMinusCircleView.background = drawable btnMinusCircleView.background = drawable
this.btnMinus.visibility = View.VISIBLE this.btnMinus.visibility = View.VISIBLE
this.btnMinus.isClickable = true this.btnMinus.isClickable = true
//btnMinusIconView.background.alpha = 255
} else { } else {
this.btnMinusWrapper.setBackgroundResource(R.color.habit_inactive_gray) this.btnMinusWrapper.setBackgroundResource(R.color.habit_inactive_gray)
val minusIcon = ContextCompat.getDrawable(context, R.drawable.habit_minus) val minusIcon = ContextCompat.getDrawable(context, R.drawable.habit_minus)
@ -76,7 +73,6 @@ class HabitViewHolder(itemView: View, scoreTaskFunc: ((Task, TaskDirection) -> U
btnMinusCircleView.background = ContextCompat.getDrawable(context, R.drawable.habit_circle_disabled) btnMinusCircleView.background = ContextCompat.getDrawable(context, R.drawable.habit_circle_disabled)
this.btnMinus.visibility = View.GONE this.btnMinus.visibility = View.GONE
this.btnMinus.isClickable = false this.btnMinus.isClickable = false
btnMinusIconView.background.alpha = 0
} }

View file

@ -97,13 +97,10 @@ private class MessagesDataSource(val socialRepository: SocialRepository, var rec
if (recipientID?.isNotBlank() != true) { return@launch } if (recipientID?.isNotBlank() != true) { return@launch }
val page = ceil(params.startPosition.toFloat() / params.loadSize.toFloat()).toInt() val page = ceil(params.startPosition.toFloat() / params.loadSize.toFloat()).toInt()
socialRepository.retrieveInboxMessages(recipientID ?: "", page) socialRepository.retrieveInboxMessages(recipientID ?: "", page)
.subscribe(Consumer { .subscribe( {
if (it.size < 10) { if (it.size < 10) {
lastFetchWasEnd = true lastFetchWasEnd = true
if (footer != null) callback.onResult(it)
callback.onResult(it.plusElement(footer!!))
else
callback.onResult(it)
} }
else else
callback.onResult(it) callback.onResult(it)
@ -130,7 +127,7 @@ private class MessagesDataSource(val socialRepository: SocialRepository, var rec
Flowable.just(it) Flowable.just(it)
} }
} }
.subscribe(Consumer { .subscribe( {
if (it.size < 10 && footer != null) if (it.size < 10 && footer != null)
callback.onResult(it.plusElement(footer!!), 0) callback.onResult(it.plusElement(footer!!), 0)
else else

View file

@ -13,6 +13,7 @@ import com.habitrpg.android.habitica.extensions.dpToPx
import com.habitrpg.android.habitica.extensions.getThemeColor import com.habitrpg.android.habitica.extensions.getThemeColor
import com.habitrpg.android.habitica.extensions.isUsingNightModeResources import com.habitrpg.android.habitica.extensions.isUsingNightModeResources
import com.habitrpg.android.habitica.extensions.layoutInflater import com.habitrpg.android.habitica.extensions.layoutInflater
import com.habitrpg.android.habitica.ui.helpers.DataBindingUtils
import java.math.RoundingMode import java.math.RoundingMode
import java.text.NumberFormat import java.text.NumberFormat
@ -31,6 +32,24 @@ class ValueBar(context: Context, attrs: AttributeSet?) : FrameLayout(context, at
private var currentValue: Double = 0.0 private var currentValue: Double = 0.0
private var maxValue: Double = 0.0 private var maxValue: Double = 0.0
var barForegroundColor: Int
get() = binding.progressBar.barForegroundColor
set(value) {
binding.progressBar.barForegroundColor = value
}
var barPendingColor: Int
get() = binding.progressBar.barPendingColor
set(value) {
binding.progressBar.barPendingColor = value
}
var barBackgroundColor: Int
get() = binding.progressBar.barBackgroundColor
set(value) {
binding.progressBar.barBackgroundColor = value
}
var pendingValue: Double = 0.0 var pendingValue: Double = 0.0
set(value) { set(value) {
if (field != value) { if (field != value) {

View file

@ -73,14 +73,6 @@ class TaskFilterDialog(context: Context, component: UserComponent?) : HabiticaAl
taskFilters.setOnCheckedChangeListener(this) taskFilters.setOnCheckedChangeListener(this)
this.setButton(BUTTON_POSITIVE, context.getString(R.string.done)) { _, _ ->
if (isEditing) {
stopEditing()
}
listener?.onFilterCompleted(filterType, activeTags)
this.dismiss()
}
clearButton = addButton(R.string.clear, false, false, false) { _, _ -> clearButton = addButton(R.string.clear, false, false, false) { _, _ ->
if (isEditing) { if (isEditing) {
stopEditing() stopEditing()
@ -89,7 +81,13 @@ class TaskFilterDialog(context: Context, component: UserComponent?) : HabiticaAl
setActiveTags(null) setActiveTags(null)
} }
addButton(R.string.done, false) addButton(R.string.done, false) { _, _ ->
if (isEditing) {
stopEditing()
}
listener?.onFilterCompleted(filterType, activeTags)
this.dismiss()
}
buttonAxis = LinearLayout.HORIZONTAL buttonAxis = LinearLayout.HORIZONTAL
tagsEditButton.setOnClickListener { editButtonClicked() } tagsEditButton.setOnClickListener { editButtonClicked() }

View file

@ -33,6 +33,7 @@ class TaskDifficultyButtons @JvmOverloads constructor(
override fun onAttachedToWindow() { override fun onAttachedToWindow() {
super.onAttachedToWindow() super.onAttachedToWindow()
removeAllViews()
addAllButtons() addAllButtons()
} }

View file

@ -118,11 +118,14 @@ class YesterdailyDialog private constructor(context: Context, private val userRe
val completed = !task.isDisplayedActive val completed = !task.isDisplayedActive
val checkmark = taskView.findViewById<View>(R.id.checkmark) val checkmark = taskView.findViewById<View>(R.id.checkmark)
val checkboxHolder = taskView.findViewById<View>(R.id.checkBoxHolder) val checkboxHolder = taskView.findViewById<View>(R.id.checkBoxHolder)
var checkboxBackground = taskView.findViewById<View>(R.id.checkbox_background)
checkmark?.visibility = if (completed) View.VISIBLE else View.GONE checkmark?.visibility = if (completed) View.VISIBLE else View.GONE
if (completed) { if (completed) {
checkboxHolder.setBackgroundResource(R.color.window_background) checkboxHolder.setBackgroundResource(R.color.window_background)
checkboxBackground.setBackgroundResource(R.drawable.daily_checked)
} else { } else {
checkboxHolder.setBackgroundResource(task.lightTaskColor) checkboxHolder.setBackgroundResource(task.lightTaskColor)
checkboxBackground.setBackgroundResource(R.drawable.daily_unchecked)
} }
val emojiView = taskView.findViewById<View>(R.id.text_view) as? HabiticaEmojiTextView val emojiView = taskView.findViewById<View>(R.id.text_view) as? HabiticaEmojiTextView

View file

@ -11,7 +11,7 @@
"type": "SINGLE", "type": "SINGLE",
"filters": [], "filters": [],
"properties": [], "properties": [],
"versionCode": 2551, "versionCode": 2554,
"versionName": "3.0", "versionName": "3.0",
"enabled": true, "enabled": true,
"outputFile": "Habitica-staff-release.apk" "outputFile": "Habitica-staff-release.apk"