Fix a bunch of crashes

This commit is contained in:
Phillip Thelen 2021-05-18 10:41:05 +02:00
parent 2c4ec1f192
commit b828f7c37e
32 changed files with 112 additions and 77 deletions

View file

@ -149,7 +149,7 @@ android {
buildConfigField "String", "TESTING_LEVEL", "\"production\""
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 2943
versionCode 2946
versionName "3.2.3"
}

View file

@ -2,4 +2,5 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<size android:height="4dp" android:width="8dp" />
<solid android:color="@color/background_blue" />
<corners android:radius="1dp" />
</shape>

View file

@ -2,4 +2,5 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<size android:height="4dp" android:width="8dp" />
<solid android:color="@color/brand_400" />
<corners android:radius="1dp" />
</shape>

View file

@ -2,4 +2,5 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<size android:height="4dp" android:width="8dp" />
<solid android:color="@color/background_red" />
<corners android:radius="1dp" />
</shape>

View file

@ -2,4 +2,5 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<size android:height="4dp" android:width="8dp" />
<solid android:color="@color/background_yellow" />
<corners android:radius="1dp" />
</shape>

View file

@ -48,13 +48,13 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:hintTextAppearance="@style/TextAppearance.AppCompat"
android:hint="@string/new_challenge_title"
android:id="@+id/create_challenge_title_input_layout">
<EditText
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="fill_horizontal"
android:hint="@string/new_challenge_title"
android:id="@+id/create_challenge_title"
tools:text="Get in shape"
@ -66,12 +66,12 @@
android:layout_height="wrap_content"
app:hintTextAppearance="@style/TextAppearance.AppCompat"
android:layout_marginBottom="12dp"
android:hint="@string/description_optional"
android:layout_marginTop="12dp">
<EditText
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/description_optional"
android:inputType="textMultiLine"
android:id="@+id/create_challenge_description"
android:maxLines="5"
@ -185,14 +185,14 @@
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:id="@+id/create_challenge_tag_input_layout"
android:hint="@string/identify_your_challenge_with_a_tag"
app:hintTextAppearance="@style/TextAppearance.AppCompat">
<EditText
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/create_challenge_tag"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/identify_your_challenge_with_a_tag"
android:maxLines="1"
android:textColor="@color/text_secondary"
android:textColorHint="@color/text_ternary" />

View file

@ -45,13 +45,13 @@
android:layout_marginTop="@dimen/spacing_small"
android:layout_marginStart="@dimen/spacing_large"
android:layout_marginEnd="@dimen/spacing_large"
android:hint="@string/name"
android:textColorHint="@color/text_primary">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/group_name_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:hint="@string/name"
android:inputType="textCapSentences"
android:paddingStart="@dimen/spacing_large"
android:paddingEnd="@dimen/spacing_large"
@ -66,6 +66,7 @@
android:layout_marginTop="@dimen/spacing_large"
android:layout_marginStart="@dimen/spacing_large"
android:layout_marginEnd="@dimen/spacing_large"
android:hint="@string/description"
android:textColorHint="@color/text_primary">
<com.google.android.material.textfield.TextInputEditText
@ -73,7 +74,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:hint="@string/description"
android:inputType="textCapSentences|textMultiLine"
android:textColorHint="@color/text_primary"
android:gravity="top"

View file

@ -120,15 +120,13 @@
android:id="@+id/overlayFrameLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:minHeight="60dp"
android:layout_gravity="bottom|center_horizontal">
<FrameLayout
android:id="@+id/snackbar_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="158dp"
android:layout_height="400dp"
android:layout_alignParentBottom="true"
android:paddingBottom="68dp"/>
android:paddingBottom="50dp"/>
<com.habitrpg.android.habitica.ui.views.navigation.HabiticaBottomNavigationView
android:id="@+id/bottom_navigation"
android:layout_width="match_parent"

View file

@ -103,13 +103,13 @@
android:theme="@style/TextInputLayoutAppearanceTheme"
style="@style/TextInputLayoutAppearance"
android:layout_marginTop="@dimen/spacing_large"
android:hint="@string/reason_for_report"
android:layout_marginBottom="@dimen/spacing_large">
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/additional_info_edittext"
android:overScrollMode="always"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/reason_for_report"
android:textColor="@color/text_primary"
android:paddingBottom="34dp"
android:paddingTop="16dp"

View file

@ -49,12 +49,12 @@
app:boxStrokeColor="?attr/colorPrimary"
app:hintTextColor="?colorPrimaryText"
android:backgroundTint="?attr/colorPrimaryText"
android:hint="@string/task_title"
android:alpha="0.75">
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/text_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/task_title"
android:textColor="?attr/colorPrimaryText"
android:inputType="textCapSentences|textAutoCorrect"/>
</com.google.android.material.textfield.TextInputLayout>
@ -66,13 +66,13 @@
app:boxStrokeColor="?attr/colorPrimary"
android:backgroundTint="?attr/colorPrimaryText"
app:hintTextColor="?colorPrimaryText"
android:hint="@string/notes"
android:layout_marginTop="@dimen/spacing_large"
android:alpha="0.75">
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/notes_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/notes"
android:minLines="3"
android:gravity="top"
android:textColor="?attr/colorPrimaryText"
@ -163,12 +163,12 @@
style="@style/TextInputLayoutAppearance"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="@string/positive_habit_form"
android:layout_weight="1">
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/habit_adjust_positive_streak_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/positive_habit_form"
android:inputType="number" />
</com.google.android.material.textfield.TextInputLayout>
<Space
@ -178,12 +178,12 @@
style="@style/TextInputLayoutAppearance"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="@string/negative_habit_form"
android:layout_weight="1">
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/habit_adjust_negative_streak_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/negative_habit_form"
android:inputType="number"/>
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>

View file

@ -25,6 +25,7 @@
android:layout_height="wrap_content"
android:minHeight="72dp"
android:layout_weight="1"
android:hint="@string/write_message"
app:hintTextAppearance="@style/TextAppearance.AppCompat">
<androidx.appcompat.widget.AppCompatEditText
@ -32,7 +33,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:hint="@string/write_message"
android:textColor="@android:color/black"
android:inputType="textCapSentences|textMultiLine" />

View file

@ -1068,7 +1068,7 @@ Die Quest-Schriftrolle wird an den Quest-Besitzer zurückgegeben.</string>
<string name="keep_x_tasks">%d Aufgaben behalten</string>
<string name="broken_challenge_description">Dies ist eine von %d Aufgaben, die Teil einer Herausforderung sind, die nicht mehr existiert. Wie möchtest Du mit den übrig gebliebenen Aufgaben verfahren\?</string>
<string name="leave_delete_x_tasks">Verlassen &amp; %d Aufgaben löschen</string>
<string name="delete_challenge_task_description">Dies ist eine von %d Aufgaben, die Teil der “%s” Herausforderung sind. Du musst die Herausforderung verlassen, um diese Aufgabe zu löschen.</string>
<string name="delete_challenge_task_description">Dies ist eine von %1$d Aufgaben, die Teil der “%2$s” Herausforderung sind. Du musst die Herausforderung verlassen, um diese Aufgabe zu löschen.</string>
<string name="delete_challenge_task_title">Herausforderungsaufgabe löschen\?</string>
<string name="use_saddle">Magischen Sattel benutzen</string>
<string name="unhatched_pet">Nicht ausgebrütetes Haustier</string>

View file

@ -1024,7 +1024,7 @@
<string name="leave_delete_x_tasks">Leave &amp; Delete %d Tasks</string>
<string name="leave_delete_task">Leave &amp; Delete Task</string>
<string name="delete_challenge_task_title">Delete Challenge Task\?</string>
<string name="delete_challenge_task_description">This is one of %d tasks that are part of the “%s” Challenge. You must leave the Challenge to delete this task.</string>
<string name="delete_challenge_task_description">This is one of %1$d tasks that are part of the “%2$s” Challenge. You must leave the Challenge to delete this task.</string>
<string name="hatch">Hatch</string>
<string name="hatch_your_pet">Hatch your Pet</string>
<string name="use_saddle">Use Saddle</string>

View file

@ -918,7 +918,7 @@
<string name="hatchedPetTitle">Eclosionaste una mascota</string>
<string name="completedTaskTitle">Completaste una tarea</string>
<string name="createdTaskTitle">Creaste tu primera tarea</string>
<string name="delete_challenge_task_description">Esta es una de las %d Tareas que forman parte del Desafío “%s”. Tienes que salir del Desafío para eliminar esta Tarea.</string>
<string name="delete_challenge_task_description">Esta es una de las %1$d Tareas que forman parte del Desafío “%2$s”. Tienes que salir del Desafío para eliminar esta Tarea.</string>
<string name="use_saddle">Usar Silla de Montar</string>
<string name="magic_potion">Poción mágica</string>
<string name="magic_potions">Pociones mágicas</string>

View file

@ -1027,7 +1027,7 @@
<string name="broken_challenge_description">Cette tâche est l\'une des %d tâches qui composent un défi qui n\'existe plus. Que voudriez-vous faire des tâches restantes \?</string>
<string name="broken_challenge">Défi cassé</string>
<string name="leave_delete_x_tasks">Quitter &amp; supprimer %d tâches</string>
<string name="delete_challenge_task_description">Cette tâche appartient aux %d tâches qui composent le défi “%s”. Vous devez quitter ce défi pour supprimer cette tâche.</string>
<string name="delete_challenge_task_description">Cette tâche appartient aux %1$d tâches qui composent le défi “%2$s”. Vous devez quitter ce défi pour supprimer cette tâche.</string>
<string name="delete_challenge_task_title">Supprimer la tâche du défi \?</string>
<string name="hatch">Faire éclore</string>
<string name="hatch_your_pet">Faites éclore votre familier</string>

View file

@ -1054,7 +1054,7 @@
<string name="broken_challenge">Sfida mancante</string>
<string name="leave_delete_x_tasks">Lascia e rimuovi le %d attività</string>
<string name="leave_delete_task">Lascia e rimuovi le attività</string>
<string name="delete_challenge_task_description">Questa è una delle %d attività che fanno parte della sfida \"%s\". Devi abbandonare la sfida per eliminare questa attività.</string>
<string name="delete_challenge_task_description">Questa è una delle %1$d attività che fanno parte della sfida \"%2$s\". Devi abbandonare la sfida per eliminare questa attività.</string>
<string name="delete_challenge_task_title">Eliminare le attività della sfida\?</string>
<string name="hatch">Schiudi</string>
<string name="hatch_your_pet">Schiudi il tuo animale</string>

View file

@ -1048,7 +1048,7 @@
<string name="broken_challenge">チャレンジのリンク切れ</string>
<string name="leave_delete_x_tasks">やめる、%dタスクを削除する</string>
<string name="leave_delete_task">やめる、タスクも削除する</string>
<string name="delete_challenge_task_description">このタスクは「%s」チャレンジの%dタスクの一部です。このタスクを削除するにはチャレンジを止めてください。</string>
<string name="delete_challenge_task_description">このタスクは「%2$s」チャレンジの%1$dタスクの一部です。このタスクを削除するにはチャレンジを止めてください。</string>
<string name="can_hatch_pet">%sのたまごと%sたまごがえしの薬を融合させてこのペットを孵化させましょう</string>
<string name="suggest_pet_hatch_missing_potion">このペットの孵化には%sたまごがえしの薬が必要です</string>
<string name="suggest_pet_hatch_missing_both">このペットの孵化には%sのたまごと%sたまごがえしの薬が必要です</string>

View file

@ -1018,7 +1018,7 @@
<string name="broken_challenge">Desafio quebrado</string>
<string name="leave_delete_x_tasks">Sair &amp; Remover %d tarefas</string>
<string name="leave_delete_task">Sair &amp; Remover tarefa</string>
<string name="delete_challenge_task_description">Esta é uma de %d tarefas que são parte do Desafio “%s”. Você precisa sair do Desafio para remover essa tarefa.</string>
<string name="delete_challenge_task_description">Esta é uma de %1$d tarefas que são parte do Desafio “%2$s”. Você precisa sair do Desafio para remover essa tarefa.</string>
<string name="delete_challenge_task_title">Deletar Tarefa do Desafio\?</string>
<string name="hatch">Chocar</string>
<string name="hatch_your_pet">Chocar seu Mascote</string>

View file

@ -1010,7 +1010,7 @@
<string name="keep_x_tasks">%d Görevi Koru</string>
<string name="broken_challenge_description">Bu, artık var olmayan bir Meydan Okumanın parçası olan %d görevden biridir. Bu kalan görevlerle ne yapmak istersiniz\?</string>
<string name="broken_challenge">Bozulmuş Mücadele</string>
<string name="delete_challenge_task_description">Bu, \"%s\" Meydan Okumasının parçası olan %d görevden biridir. Bu görevi silmek için Meydan Okumadan ayrılmalısınız.</string>
<string name="delete_challenge_task_description">Bu, “%2$s” Meydan Okumasının parçası olan %1$d görevden biridir. Bu görevi silmek için Meydan Okumadan ayrılmalısınız.</string>
<string name="hatch">Yumurtadan Çıkar</string>
<string name="hatch_your_pet">Evcil Hayvanınızı Yumurtadan Çıkarın</string>
<string name="magic_potions">Sihirli İksirler</string>

View file

@ -1139,7 +1139,7 @@
<string name="broken_challenge">Провалене випробування</string>
<string name="leave_delete_x_tasks">Покинути і видалити завдання: %d</string>
<string name="leave_delete_task">Покинути &amp; видалити завдання</string>
<string name="delete_challenge_task_description">Це одне з %d завдань що входять до складу “%s” випробування. Ви повинні покинути випробування щоб видалити це завдання.</string>
<string name="delete_challenge_task_description">Це одне з %1$d завдань що входять до складу “%2$s” випробування. Ви повинні покинути випробування щоб видалити це завдання.</string>
<string name="hatch_your_pet">Вилупити вашу тварину</string>
<string name="magic_potion">Магічний еліксир</string>
<string name="magic_potions">Магічні еліксири</string>

View file

@ -1021,7 +1021,7 @@
<string name="broken_challenge">Thử thách Bị hủy</string>
<string name="leave_delete_x_tasks">Rời &amp; Xóa %d Công việc</string>
<string name="leave_delete_task">Rời &amp; Xóa Công việc</string>
<string name="delete_challenge_task_description">Đây là một trong %d công việc là phần của Thử thách \"%s\". Bạn phải rời Thử thách để xóa công việc này.</string>
<string name="delete_challenge_task_description">Đây là một trong %1$d công việc là phần của Thử thách “%2$s”. Bạn phải rời Thử thách để xóa công việc này.</string>
<string name="delete_challenge_task_title">Xóa Công việc của Thử thách\?</string>
<string name="hatch">Ấp</string>
<string name="hatch_your_pet">Ấp thú cưng của bạn</string>

View file

@ -734,7 +734,7 @@
<string name="not_participating">你沒有參加這個副本</string>
<string name="login_incentive_short">定期登錄Habitica</string>
<string name="party_invite_short">邀請朋友</string>
<string name="login_incentive_count">通過在Habitica簽到d次來解鎖。</string>
<string name="login_incentive_count">通過在Habitica簽到%d次來解鎖。</string>
<string name="remaining_1hour">剩餘1小時</string>
<string name="remaining_hours">剩餘%dh小時</string>
<string name="remaining_minutes">剩餘%dm分鐘</string>
@ -753,18 +753,18 @@
<string name="authentication_error_body">你的用戶名和/或密碼不正確。</string>
<string name="network_error_no_network_body">你沒有連接到互聯網。</string>
<string name="transfer_ownership_confirm">轉讓所有權?</string>
<string name="transferred_ownership">領導權已轉移到s</string>
<string name="transferred_ownership">領導權已轉移到%s</string>
<string name="send_message">發送私信</string>
<string name="remove_member">刪除會員</string>
<string name="transfer_ownership">轉讓所有權</string>
<string name="remove">去掉</string>
<string name="inbox_messages_title_nosender">你收到了 d 條消息</string>
<string name="inbox_messages_title">你收到了 1$d 條消息來自 2$s</string>
<string name="sent_card">你發送了s</string>
<string name="inbox_messages_title_nosender">你收到了 %d 條消息</string>
<string name="inbox_messages_title">你收到了 %1$d 條消息來自 %2$s</string>
<string name="sent_card">你發送了%s</string>
<string name="app_theme">應用主題</string>
<string name="share_challenge_with">分享挑戰與</string>
<string name="details">細節</string>
<string name="create_task">創建s</string>
<string name="create_task">創建%s</string>
<string name="new_task">新任務</string>
<string name="confirm_deletion">確認刪除</string>
<string name="switch_to_grid_view">切換到網格視圖</string>
@ -779,8 +779,8 @@
<string name="transfer_ownership_confirm_message">%s會變成新的隊長</string>
<string name="remove_member_confirm">你想將%s從隊伍中移除嗎</string>
<string name="transfer">轉讓</string>
<string name="removed_member">s已從群組中刪除</string>
<string name="mystery_item_received">你打開包裝盒並收到一個s</string>
<string name="removed_member">%s已從群組中刪除</string>
<string name="mystery_item_received">你打開包裝盒並收到一個%s</string>
<string name="see_what_s_new">來看新聞</string>
<string name="view_achievements">看成就</string>
<string name="achievement_title">你得到了成就!</string>
@ -848,7 +848,7 @@
<string name="copy_userid">複製用戶ID</string>
<string name="id_copied">已將用戶ID複製到剪貼板</string>
<string name="copy_username">複製用戶名</string>
<string name="password_too_short">您的密碼長度至少為d個字符</string>
<string name="password_too_short">您的密碼長度至少為%d個字符</string>
<string name="invitation_title">%s邀請你加入他們的小組%s</string>
<string name="someone">有人</string>
<string name="authentication_methods">認證方式</string>
@ -866,7 +866,7 @@
<string name="resubscribe">重新訂閱</string>
<string name="resubscribe_description">要繼續用您的訂閱增值?您可以在現在的訂閱結束前開始新的訂閱,就能繼續使用。</string>
<string name="gifted">贈送了</string>
<string name="save_20">節省20</string>
<string name="save_20">節省20%</string>
<string name="subscription_credit">訂閱獎金</string>
<string name="group_plan">團隊計劃</string>
<string name="cancel_subscription_group_plan">你免費訂閱,因為您是擁有團隊計劃的隊伍或公會的成員。如果你離開了小組,或擁有者取消團隊計劃,訂閱便會被取消。你購買的訂閱會加在團隊計劃後。</string>
@ -1024,7 +1024,7 @@
<string name="hatch_your_pet">孵化寵物</string>
<string name="hatch">孵化</string>
<string name="delete_challenge_task_title">刪除挑戰任務?</string>
<string name="delete_challenge_task_description">這是%d個挑戰任務之一屬於“%s”挑戰。你必須先退出挑戰才能刪除這個任務。</string>
<string name="delete_challenge_task_description">這是%1$d個挑戰任務之一屬於“%2$s”挑戰。你必須先退出挑戰才能刪除這個任務。</string>
<string name="leave_delete_task">退出挑戰並刪除任務</string>
<string name="leave_delete_x_tasks">退出挑戰並刪除%d個任務</string>
<string name="broken_challenge">已損壞的挑戰</string>

View file

@ -764,25 +764,25 @@
<string name="partyUpTitle">举行派对</string>
<string name="achievement_title">你得到了成就!</string>
<string name="view_achievements">看成就</string>
<string name="mystery_item_received">你打开包装盒并收到一个s</string>
<string name="removed_member">s已从群组中删除</string>
<string name="mystery_item_received">你打开包装盒并收到一个%s</string>
<string name="removed_member">%s已从群组中删除</string>
<string name="see_what_s_new">来看新闻</string>
<string name="transfer">转让</string>
<string name="remove_member_confirm">你想将%s从队伍中移除吗</string>
<string name="transfer_ownership_confirm_message">%s会变成新的队长</string>
<string name="transfer_ownership_confirm">转让所有权?</string>
<string name="transferred_ownership">领导权已转移到s</string>
<string name="transferred_ownership">领导权已转移到%s</string>
<string name="send_message">发送私信</string>
<string name="remove_member">删除会员</string>
<string name="transfer_ownership">转让所有权</string>
<string name="remove">去掉</string>
<string name="inbox_messages_title_nosender">你收到了 d 条消息</string>
<string name="inbox_messages_title">你收到了 1$d 条消息来自 2$s</string>
<string name="sent_card">你发送了s</string>
<string name="inbox_messages_title_nosender">你收到了 %d 条消息</string>
<string name="inbox_messages_title">你收到了 %1$d 条消息来自 %2$s</string>
<string name="sent_card">你发送了%s</string>
<string name="app_theme">应用主题</string>
<string name="share_challenge_with">分享挑战与</string>
<string name="details">细节</string>
<string name="create_task">创建s</string>
<string name="create_task">创建%s</string>
<string name="new_task">新任务</string>
<string name="confirm_deletion">确认删除</string>
<string name="switch_to_grid_view">切换到网格视图</string>
@ -828,7 +828,7 @@
<string name="preference_push_unjoined_guild_mention">来自未加入的公会的提醒</string>
<string name="copy_userid">复制用户ID</string>
<string name="id_copied">已将用户ID复制到剪贴板</string>
<string name="password_too_short">您的密码长度至少为d个字符</string>
<string name="password_too_short">您的密码长度至少为%d个字符</string>
<string name="copy_username">复制用户名</string>
<string name="invitation_title">%s邀请你加入他们的小组%s</string>
<string name="someone">有人</string>
@ -846,7 +846,7 @@
<string name="renew_subscription">更新订阅</string>
<string name="resubscribe">重新订阅</string>
<string name="resubscribe_description">要继续用您的订阅增值?您可以在现在的订阅结束前开始新的订阅,就能继续使用。</string>
<string name="save_20">节省20</string>
<string name="save_20">节省20%</string>
<string name="gifted">赠送了</string>
<string name="gift_confirmation_text_gems">你送给%s一些宝石。</string>
<string name="gift_confirmation_text_sub">你送给%s一个%s个月的Habitica订阅。</string>
@ -903,7 +903,7 @@
<string name="login_incentive_short_count">签到%d次</string>
<string name="login_incentive_short">定期登录Habitica</string>
<string name="party_invite_short">邀请朋友</string>
<string name="login_incentive_count">通过在Habitica签到d次来解锁。</string>
<string name="login_incentive_count">通过在Habitica签到%d次来解锁。</string>
<string name="remaining_1hour">剩余1小时</string>
<string name="remaining_hours">剩余%dh小时</string>
<string name="remaining_1Minute">剩余1分钟</string>
@ -1067,7 +1067,7 @@
<string name="broken_challenge">已损坏的挑战</string>
<string name="leave_delete_x_tasks">退出挑战并删除%d个任务</string>
<string name="leave_delete_task">退出挑战并删除任务</string>
<string name="delete_challenge_task_description">这是%d个挑战任务之一属于“%s”挑战。你必须先退出挑战才能删除这个任务。</string>
<string name="delete_challenge_task_description">这是%1$d个挑战任务之一属于“%2$s”挑战。你必须先退出挑战才能删除这个任务。</string>
<string name="delete_challenge_task_title">删除挑战任务?</string>
<string name="hatch">孵化</string>
<string name="hatch_your_pet">孵化宠物</string>

View file

@ -1078,7 +1078,7 @@
<string name="hatch_your_pet">Hatch your Pet</string>
<string name="hatch">Hatch</string>
<string name="delete_challenge_task_title">Delete Challenge Task?</string>
<string name="delete_challenge_task_description">This is one of %d tasks that are part of the “%s” Challenge. You must leave the Challenge to delete this task.</string>
<string name="delete_challenge_task_description">This is one of %1$d tasks that are part of the “%2$s” Challenge. You must leave the Challenge to delete this task.</string>
<string name="leave_delete_task">Leave &amp; Delete Task</string>
<string name="leave_delete_x_tasks">Leave &amp; Delete %d Tasks</string>
<string name="broken_challenge">Broken Challenge</string>

View file

@ -21,7 +21,7 @@ constructor(private val soundManager: SoundManager, threadExecutor: ThreadExecut
override fun buildUseCaseObservable(requestValues: RequestValues): Flowable<Void> {
return Flowable.defer {
val data = requestValues.data
var snackbarText = StringBuilder(data?.drop?.dialog ?: "")
val snackbarText = StringBuilder(data?.drop?.dialog ?: "")
if (data?.questItemsFound ?: 0 > 0 && requestValues.showQuestItems) {
if (snackbarText.isNotEmpty())
@ -32,7 +32,7 @@ constructor(private val soundManager: SoundManager, threadExecutor: ThreadExecut
if (snackbarText.isNotEmpty()) {
Handler().postDelayed({
HabiticaSnackbar.showSnackbar(requestValues.snackbarTargetView,
snackbarText, HabiticaSnackbar.SnackbarDisplayType.DROP)
snackbarText, HabiticaSnackbar.SnackbarDisplayType.DROP, true)
soundManager.loadAndPlayAudio(SoundManager.SoundItemDrop)
}, 3000L)
}

View file

@ -96,7 +96,7 @@ class ChallengeFormActivity : BaseActivity() {
if (groupID != null) {
c.groupId = groupID
} else {
if (locationAdapter.count > locationPos) {
if (locationAdapter.count > locationPos && locationPos >= 0) {
val locationGroup = locationAdapter.getItem(locationPos)
if (locationGroup != null) {
c.groupId = locationGroup.id

View file

@ -29,10 +29,7 @@ import com.google.android.gms.auth.GoogleAuthException
import com.google.android.gms.auth.GoogleAuthUtil
import com.google.android.gms.auth.GooglePlayServicesAvailabilityException
import com.google.android.gms.auth.UserRecoverableAuthException
import com.google.android.gms.common.ConnectionResult
import com.google.android.gms.common.GoogleApiAvailability
import com.google.android.gms.common.GooglePlayServicesUtil
import com.google.android.gms.common.Scopes
import com.google.android.gms.common.*
import com.google.firebase.analytics.FirebaseAnalytics
import com.habitrpg.android.habitica.BuildConfig
import com.habitrpg.android.habitica.HabiticaBaseApplication
@ -421,6 +418,9 @@ class LoginActivity : BaseActivity(), Consumer<UserAuthResponse> {
} catch (e: GoogleAuthException) {
throw Exceptions.propagate(e)
}
catch (e: UserRecoverableException) {
return@defer Flowable.empty()
}
}
.subscribeOn(Schedulers.io())
.flatMap { token -> apiClient.connectSocial("google", googleEmail ?: "", token) }

View file

@ -185,6 +185,7 @@ class TaskFormActivity : BaseActivity() {
taskId != null -> {
isCreating = false
compositeSubscription.add(taskRepository.getUnmanagedTask(taskId).firstElement().subscribe({
if (!it.isValid) return@subscribe
task = it
//tintColor = ContextCompat.getColor(this, it.mediumTaskColor)
fillForm(it)

View file

@ -189,8 +189,10 @@ class ChallengeDetailFragment: BaseMainFragment<FragmentChallengeDetailBinding>(
val uriUrl = "https://habitica.com/challenges/${challengeID}".toUri()
val launchBrowser = Intent(Intent.ACTION_VIEW, uriUrl)
val l = context.packageManager.queryIntentActivities(launchBrowser, PackageManager.MATCH_DEFAULT_ONLY)
val notHabitica = l.first { !it.activityInfo.processName.contains("habitica") }
launchBrowser.setPackage(notHabitica.activityInfo.processName)
val notHabitica = l.firstOrNull { !it.activityInfo.processName.contains("habitica") }
if (notHabitica != null) {
launchBrowser.setPackage(notHabitica.activityInfo.processName)
}
startActivity(launchBrowser)
}
dialog.addCloseButton()

View file

@ -101,8 +101,8 @@ class AutocompleteAdapter(val context: Context, val socialRepository: SocialRepo
} ?: View(context)
}
override fun getItem(position: Int): Any {
return if (isAutocompletingUsers) userResults[position] else emojiResults[position]
override fun getItem(position: Int): Any? {
return if (isAutocompletingUsers) userResults.getOrNull(position) else emojiResults.getOrNull(position)
}
override fun getItemId(position: Int): Long {

View file

@ -1,18 +1,19 @@
package com.habitrpg.android.habitica.ui.views
import android.graphics.drawable.Drawable
import android.view.Gravity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
import android.view.animation.AccelerateInterpolator
import android.widget.*
import androidx.annotation.ColorInt
import androidx.core.content.ContextCompat
import androidx.core.view.ViewCompat
import com.google.android.material.snackbar.BaseTransientBottomBar
import com.google.android.material.snackbar.Snackbar
import com.habitrpg.android.habitica.R
import com.plattysoft.leonids.ParticleSystem
class HabiticaSnackbar
/**
@ -117,24 +118,24 @@ private constructor(parent: ViewGroup, content: View, callback: ContentViewCallb
}
fun showSnackbar(container: ViewGroup, content: CharSequence?, displayType: SnackbarDisplayType) {
showSnackbar(container, null, null, content, null, null, 0, null, displayType)
fun showSnackbar(container: ViewGroup, content: CharSequence?, displayType: SnackbarDisplayType, isCelebratory: Boolean = false) {
showSnackbar(container, null, null, content, null, null, 0, null, displayType, isCelebratory)
}
fun showSnackbar(container: ViewGroup, leftImage: Drawable, title: CharSequence?, content: CharSequence?, displayType: SnackbarDisplayType) {
showSnackbar(container, leftImage, title, content, null, null, 0, null, displayType)
fun showSnackbar(container: ViewGroup, leftImage: Drawable, title: CharSequence?, content: CharSequence?, displayType: SnackbarDisplayType, isCelebratory: Boolean = false) {
showSnackbar(container, leftImage, title, content, null, null, 0, null, displayType, isCelebratory)
}
fun showSnackbar(container: ViewGroup, title: CharSequence?, content: CharSequence?, rightIcon: Drawable, rightTextColor: Int, rightText: String, displayType: SnackbarDisplayType) {
showSnackbar(container, null, title, content, null, rightIcon, rightTextColor, rightText, displayType)
fun showSnackbar(container: ViewGroup, title: CharSequence?, content: CharSequence?, rightIcon: Drawable, rightTextColor: Int, rightText: String, displayType: SnackbarDisplayType, isCelebratory: Boolean = false) {
showSnackbar(container, null, title, content, null, rightIcon, rightTextColor, rightText, displayType, isCelebratory)
}
fun showSnackbar(container: ViewGroup, title: CharSequence?, content: CharSequence?, specialView: View?, displayType: SnackbarDisplayType) {
showSnackbar(container, null, title, content, specialView, null, 0, null, displayType)
fun showSnackbar(container: ViewGroup, title: CharSequence?, content: CharSequence?, specialView: View?, displayType: SnackbarDisplayType, isCelebratory: Boolean = false) {
showSnackbar(container, null, title, content, specialView, null, 0, null, displayType, isCelebratory)
}
fun showSnackbar(container: ViewGroup, leftImage: Drawable?, title: CharSequence?, content: CharSequence?, specialView: View?, rightIcon: Drawable?, rightTextColor: Int, rightText: String?, displayType: SnackbarDisplayType) {
fun showSnackbar(container: ViewGroup, leftImage: Drawable?, title: CharSequence?, content: CharSequence?, specialView: View?, rightIcon: Drawable?, rightTextColor: Int, rightText: String?, displayType: SnackbarDisplayType, isCelebratory: Boolean = false) {
val snackbar = make(container, Snackbar.LENGTH_LONG)
.setTitle(title)
.setText(content)
@ -150,6 +151,35 @@ private constructor(parent: ViewGroup, content: View, callback: ContentViewCallb
}
snackbar.show()
if (isCelebratory) {
container.postDelayed({
ParticleSystem(container, 30, ContextCompat.getDrawable(container.context, R.drawable.confetti_blue), 6000)
.setAcceleration(0.00020f, 90)
.setRotationSpeed(144f)
.setSpeedByComponentsRange(-0.15f, 0.15f, -0.15f, -0.45f)
.setFadeOut(200, AccelerateInterpolator())
.emitWithGravity(container, Gravity.BOTTOM, 7, 2000)
ParticleSystem(container, 30, ContextCompat.getDrawable(container.context, R.drawable.confetti_red), 6000)
.setAcceleration(0.00030f, 90)
.setRotationSpeed(144f)
.setSpeedByComponentsRange(-0.15f, 0.15f, -0.15f, -0.45f)
.setFadeOut(200, AccelerateInterpolator())
.emitWithGravity(container, Gravity.BOTTOM, 7, 2000)
ParticleSystem(container, 30, ContextCompat.getDrawable(container.context, R.drawable.confetti_yellow), 6000)
.setAcceleration(0.00020f, 90)
.setRotationSpeed(144f)
.setSpeedByComponentsRange(-0.15f, 0.15f, -0.15f, -0.45f)
.setFadeOut(200, AccelerateInterpolator())
.emitWithGravity(container, Gravity.BOTTOM, 7, 2000)
ParticleSystem(container, 30, ContextCompat.getDrawable(container.context, R.drawable.confetti_purple), 6000)
.setAcceleration(0.00030f, 90)
.setRotationSpeed(144f)
.setSpeedByComponentsRange(-0.15f, 0.15f, -0.15f, -0.45f)
.setFadeOut(200, AccelerateInterpolator())
.emitWithGravity(container, Gravity.BOTTOM, 7, 2000)
}, 500)
}
}
}
}

View file

@ -278,7 +278,7 @@ open class HabiticaAlertDialog(context: Context) : AlertDialog(context, R.style.
}
}
window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN)
}
companion object {
@ -292,7 +292,7 @@ open class HabiticaAlertDialog(context: Context) : AlertDialog(context, R.style.
if ((dialogQueue[0].context as? Activity)?.isFinishing != true) {
GlobalScope.launch(context = Dispatchers.Main) {
delay(500L)
if (dialogQueue.size > 0 && (dialogQueue[0].context as? Activity)?.isFinishing != true) {
if (dialogQueue.size > 0 && (dialogQueue[0].context as? Activity)?.isFinishing == false) {
dialogQueue[0].show()
}
}