mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-19 12:18:59 +00:00
Merge branch 'develop' of https://github.com/HabitRPG/habitrpg-android into apply_tranformations
Conflicts: Habitica/res/values/strings.xml
This commit is contained in:
commit
c5452523a2
26 changed files with 301 additions and 218 deletions
|
|
@ -2,8 +2,8 @@
|
|||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.habitrpg.android.habitica"
|
||||
android:versionCode="120"
|
||||
android:versionName="0.0.34"
|
||||
android:versionCode="125"
|
||||
android:versionName="0.0.34.1"
|
||||
android:screenOrientation="portrait"
|
||||
android:installLocation="auto" >
|
||||
|
||||
|
|
@ -210,7 +210,7 @@
|
|||
<meta-data android:name="android.appwidget.provider"
|
||||
android:resource="@xml/habit_button_widget_info" />
|
||||
</receiver>
|
||||
<service android:name=".widget.AvatarStatsWidgetService"/>
|
||||
|
||||
<service
|
||||
android:name=".widget.DailiesWidgetService"
|
||||
android:permission="android.permission.BIND_REMOTEVIEWS" />
|
||||
|
|
|
|||
|
|
@ -384,6 +384,7 @@
|
|||
<string name="add_todo">Добавяне на задача</string>
|
||||
<string name="add_reward">Добавяне на награда</string>
|
||||
<string name="all_dailies_completed">Изпълнихте всичките си ежедневни задачи. Добра работа!</string>
|
||||
<string name="widget_habit_button">Положителен навик в Хаибитика</string>
|
||||
<string name="widget_dailies">Ежедневни задачи в Хабитика</string>
|
||||
<string name="widget_add_task">Добавяне на задача в Хабитика</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -12,10 +12,14 @@
|
|||
<string name="SP_userID_summary">Deine Benutzer-ID</string>
|
||||
<string name="SP_APIToken_title">API-Token</string>
|
||||
<string name="SP_APIToken_summary">Dein API-Token</string>
|
||||
<string name="Language_title">Sprache</string>
|
||||
<string name="Language_summary">Habitica\'s Sprache ändern</string>
|
||||
<string name="SP_user_qr_code">Dein QR Code</string>
|
||||
<string name="PS_contact_title">Kontaktiere mich</string>
|
||||
<string name="unknown_error">Ein Fehler ist aufgetreten...</string>
|
||||
<string name="pref_account_header">Konto</string>
|
||||
<string name="pref_first_day_of_the_week_title">Erster Tag der Woche</string>
|
||||
<string name="pref_first_day_of_the_week_summary">Erster Tag der Woche in allen Kalendern</string>
|
||||
<string name="pref_reminder_header">Tägliche Erinnerung</string>
|
||||
<string name="pref_reminder_checkbox">Erinnerung aktivieren</string>
|
||||
<string name="pref_reminder_picker">Erinnerungszeit einstellen</string>
|
||||
|
|
@ -371,5 +375,16 @@ Für den Anfang: Welche Bereiche Deines Lebens möchtest Du verbessern?</string>
|
|||
<string name="choose_recipient_title">Nachrichtenempfänger auswählen</string>
|
||||
<string name="action_continue">Weiter</string>
|
||||
<string name="scan_qr_code">QR Code scannen</string>
|
||||
<string name="enter_recipient_uuid">ID des Empfängers eingeben</string>
|
||||
<string name="invited_to_party">Du wurdest in eine Gruppe eingeladen!</string>
|
||||
<string name="stats_widget_label">Habitica: Avatar</string>
|
||||
<string name="add_task">Neue Aufgabe</string>
|
||||
<string name="add_habit">Neue Gewohnheit</string>
|
||||
<string name="add_daily">Neue Tägliche Aufgabe</string>
|
||||
<string name="add_todo">Neue To-Do</string>
|
||||
<string name="add_reward">Neue Belohnung</string>
|
||||
<string name="all_dailies_completed">Du hast alle deine täglichen Aufgaben erledigt. Gut gemacht!</string>
|
||||
<string name="widget_habit_button">Habitica: Gewohnheit</string>
|
||||
<string name="widget_dailies">Habitica: Tägliche Aufgaben</string>
|
||||
<string name="widget_add_task">Habitica: Neue Aufgabe</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -375,5 +375,16 @@ Pour commencer, quels aspects de votre vie souhaitez-vous améliorer ?</string>
|
|||
<string name="choose_recipient_title">Choisissez un destinataire</string>
|
||||
<string name="action_continue">Continuer</string>
|
||||
<string name="scan_qr_code">Scanner le QR code</string>
|
||||
<string name="enter_recipient_uuid">Saisissez l\'identifiant du destinataire</string>
|
||||
<string name="invited_to_party">Vous avez été invité·e à rejoindre une équipe !</string>
|
||||
<string name="stats_widget_label">Statistiques d\'Habitica</string>
|
||||
<string name="add_task">Ajouter une tâche</string>
|
||||
<string name="add_habit">Ajouter une habitude</string>
|
||||
<string name="add_daily">Ajouter une quotidienne</string>
|
||||
<string name="add_todo">Ajouter une tâche à faire</string>
|
||||
<string name="add_reward">Ajouter une récompense</string>
|
||||
<string name="all_dailies_completed">Vous avez accompli toutes vos quotidiennes. Bravo !</string>
|
||||
<string name="widget_habit_button">Réaliser une tâche Habitica</string>
|
||||
<string name="widget_dailies">Quotidiennes Habitica</string>
|
||||
<string name="widget_add_task">Ajouter une tâche Habitica</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -376,6 +376,7 @@ Le Dailies mancate e le cattive Habit non li danneggiano molto, e hanno sempre m
|
|||
<string name="choose_recipient_title">Scegli destinatario messaggio</string>
|
||||
<string name="action_continue">Continua</string>
|
||||
<string name="scan_qr_code">Rileva codice QR</string>
|
||||
<string name="enter_recipient_uuid">Inserisci ID Utente destinatario</string>
|
||||
<string name="invited_to_party">Hai ricevuto un invito per unirti a una squadra!</string>
|
||||
<string name="stats_widget_label">Statistiche Habitica</string>
|
||||
<string name="add_task">Aggiungi Attività</string>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<resources>
|
||||
<string name="tutorial_habits">좋은 습관을 달성하고 골드와 경험치를 얻으세요! 나쁜 습관은 당신의 아바타를 다치게하니, 일상생활을 열심히 하세요!</string>
|
||||
<string name="tutorial_habits">좋은 습관을 달성하고 골드와 경험치를 얻으세요! 나쁜 습관은 당신의 아바타를 다치게 하니, 일상생활을 열심히 하세요!</string>
|
||||
<string name="tutorial_dailies">골드와 경험치를 위해 일일과제를 달성하세요. 주의할 점! 일일과제는 제때 끝내지 못하면 당신의 아바타를 다치게 만들어요.</string>
|
||||
<string name="tutorial_todos">일상생활을 할일을 달성함으로써 골드와 경험치를 얻으세요. 경험치와 골드로 새로운 보상과 기능을 여세요!</string>
|
||||
<string name="tutorial_rewards">이것들은 당신의 보상들이에요! 습관, 일일과제, 해야할 일들을 일상생활에서 달성하면 골드를 모을 수 있어요. 이 골드를 게임의 보상들이나 스스로 설정한 보상을 구입하는데 사용하세요!</string>
|
||||
|
|
|
|||
|
|
@ -7,15 +7,19 @@
|
|||
<string name="ERR_pb_barcode">데이터를 가져오지 못했습니다</string>
|
||||
<!--Prefs-->
|
||||
<string name="PS_settings_title">설정</string>
|
||||
<string name="SP_address_hint">당신의 개인서버</string>
|
||||
<string name="SP_userID_title">유저 ID</string>
|
||||
<string name="SP_userID_summary">당신의 유저ID</string>
|
||||
<string name="SP_address_hint">당신의 사용자 지정 서버</string>
|
||||
<string name="SP_userID_title">사용자 ID</string>
|
||||
<string name="SP_userID_summary">당신의 사용자 ID</string>
|
||||
<string name="SP_APIToken_title">API 토큰</string>
|
||||
<string name="SP_APIToken_summary">당신의 API 토큰</string>
|
||||
<string name="Language_title">언어</string>
|
||||
<string name="Language_summary">Habitica의 언어 바꾸기</string>
|
||||
<string name="SP_user_qr_code">당신의 QR코드</string>
|
||||
<string name="PS_contact_title">연락처</string>
|
||||
<string name="unknown_error">오류가 발생했습니다...</string>
|
||||
<string name="pref_account_header">계정</string>
|
||||
<string name="pref_first_day_of_the_week_title">주의 첫날</string>
|
||||
<string name="pref_first_day_of_the_week_summary">모든 캘린더에서 주의 첫날</string>
|
||||
<string name="pref_reminder_header">매일 알림</string>
|
||||
<string name="pref_reminder_checkbox">알림 활성화</string>
|
||||
<string name="pref_reminder_picker">알림 시간 설정</string>
|
||||
|
|
@ -24,6 +28,11 @@
|
|||
<string name="preference_push_you_won_challenge">도전 기회를 얻었습니다.</string>
|
||||
<string name="preference_push_received_a_private_message">개인 메시지를 받았습니다.</string>
|
||||
<string name="preference_push_gifted_gems">선물받은 젬</string>
|
||||
<string name="preference_push_gifted_subscription">선물 받은 구독</string>
|
||||
<string name="preference_push_invited_to_party">파티에 초대 받음</string>
|
||||
<string name="preference_push_invited_to_guild">길드에 초대 받음</string>
|
||||
<string name="preference_push_your_quest_has_begun">퀘스트가 시작되었음</string>
|
||||
<string name="preference_push_invited_to_quest">퀘스트에 초대를 받았음</string>
|
||||
<!--Adding tasks-->
|
||||
<string name="task_value">값</string>
|
||||
<string name="new_todo">새로운 할 일</string>
|
||||
|
|
@ -235,6 +244,7 @@
|
|||
<string name="privacy">사생활 보호</string>
|
||||
<string name="write_message">메세지 작성</string>
|
||||
<string name="post">게시</string>
|
||||
<string name="guild_search_hint">길드 검색</string>
|
||||
<string name="todo_due" formatted="false">만기: %s</string>
|
||||
<string name="daily_streak" formatted="false">연속 달성: %d</string>
|
||||
<string name="todo_has_duedate">과제가 만기일이 있습니다</string>
|
||||
|
|
@ -242,7 +252,7 @@
|
|||
<string name="costume">의상</string>
|
||||
<string name="outfit_head">머리</string>
|
||||
<string name="outfit_headAccessory">머리 장식</string>
|
||||
<string name="outfit_eyewear">안경휴</string>
|
||||
<string name="outfit_eyewear">안경</string>
|
||||
<string name="outfit_armor">갑옷</string>
|
||||
<string name="outfit_back">뒤</string>
|
||||
<string name="outfit_body">몸</string>
|
||||
|
|
@ -337,5 +347,32 @@
|
|||
<string name="open_in_store">플레이스토어로 열기</string>
|
||||
<string name="change_class_confirmation">보석 3개를 사용하여 클레스를 바꾸시겠습니까? </string>
|
||||
<string name="leaderMessage" formatted="false">%1$s로부터 온 메세지</string>
|
||||
<string name="confirm">확인</string>
|
||||
<string name="market">시장</string>
|
||||
<string name="timeTravelers">시간 여행자들</string>
|
||||
<string name="seasonalShop">계절 상점</string>
|
||||
<string name="empty_inbox">받은 편지함 메시지가 없습니다. 공개 채팅 메시지를 통해 사용자에게 새 메시지를 보낼 수 있습니다!</string>
|
||||
<string name="party_invite">친구를 초대하여 잠금 해제하기</string>
|
||||
<string name="no_gold">골드가 충분하지 않음</string>
|
||||
<string name="no_potion">체력 물약을 살 필요가 없음</string>
|
||||
<string name="successful_purchase" formatted="false">%1$s을(를) 성공적으로 구매했음</string>
|
||||
<string name="purchase_confirmation_title">구매 확인</string>
|
||||
<string name="confirm_purchase_text" formatted="false">%1$s을(를) %2$s %3$s(으)로 구매함</string>
|
||||
<string name="gem">보석</string>
|
||||
<string name="hourglass">모래시계</string>
|
||||
<string name="hourglasses">모래시계</string>
|
||||
<string name="gold_singular">골드</string>
|
||||
<string name="gold_plural">골드</string>
|
||||
<string name="chat_message_copied">메시지를 클립보드에 복사했음</string>
|
||||
<string name="copy_chat_message">클립보드로 복사함</string>
|
||||
<string name="edit_tag_title">태그 편집</string>
|
||||
<string name="edit_tag_btn_edit">편집</string>
|
||||
<string name="edit_tag_btn_done">완료</string>
|
||||
<string name="edit_tag_btn_delete">삭제</string>
|
||||
<string name="confirm_delete_tag_title">정말이요?</string>
|
||||
<string name="confirm_delete_tag_message">정말 삭제할까요?</string>
|
||||
<string name="filter_drawer_edit_tags">태그 편집</string>
|
||||
<string name="filter_drawer_filter_tags">태그로 정렬</string>
|
||||
<!--QR Strings-->
|
||||
<string name="qr_dialogue_title">나의 QR 코드</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
<string name="preference_push_gifted_gems">Edelstenen geschonken</string>
|
||||
<string name="preference_push_gifted_subscription">Abonnement geschonken</string>
|
||||
<string name="preference_push_invited_to_party">Uitgenodigd voor groep</string>
|
||||
<string name="preference_push_invited_to_guild">Uitgenodigd voor gilde</string>
|
||||
<string name="preference_push_your_quest_has_begun">Je queeste is begonnen</string>
|
||||
<string name="preference_push_invited_to_quest">Uitgenodigd voor queeste</string>
|
||||
<!--Adding tasks-->
|
||||
|
|
@ -374,10 +375,12 @@ Om te beginnen, welke delen van je leven wil je verbeteren?</string>
|
|||
<string name="choose_recipient_title">Kies een ontvanger voor het bericht</string>
|
||||
<string name="action_continue">Ga verder</string>
|
||||
<string name="scan_qr_code">Scan QR code</string>
|
||||
<string name="enter_recipient_uuid">Voer ontvanger\'s Gebruikers ID in</string>
|
||||
<string name="invited_to_party">Je bent uitgenodigd voor een groep!</string>
|
||||
<string name="add_task">Voeg taak toe</string>
|
||||
<string name="add_habit">Voeg Gewoonte toe</string>
|
||||
<string name="add_daily">Voeg Dagelijkse taak toe</string>
|
||||
<string name="add_todo">To-Do toevoegen</string>
|
||||
<string name="add_reward">Voeg Beloning toe</string>
|
||||
<string name="all_dailies_completed">Je hebt al je Dagelijkse taken voltooid. Goed gedaan!</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -12,10 +12,14 @@
|
|||
<string name="SP_userID_summary">Twój identyfikator</string>
|
||||
<string name="SP_APIToken_title">Token API</string>
|
||||
<string name="SP_APIToken_summary">Twój Token API</string>
|
||||
<string name="Language_title">Język</string>
|
||||
<string name="Language_summary">Zmień język Habitici</string>
|
||||
<string name="SP_user_qr_code">Twój kod QR</string>
|
||||
<string name="PS_contact_title">Skontaktuj się ze mną</string>
|
||||
<string name="unknown_error">Wystąpił błąd...</string>
|
||||
<string name="pref_account_header">Konto</string>
|
||||
<string name="pref_first_day_of_the_week_title">Pierwszy Dzień Tygodnia</string>
|
||||
<string name="pref_first_day_of_the_week_summary">Pierwszy dzień tygodnia we wszystkich kalendarzach</string>
|
||||
<string name="pref_reminder_header">Przypominienie</string>
|
||||
<string name="pref_reminder_checkbox">Aktywuj przypomnienie</string>
|
||||
<string name="pref_reminder_picker">Ustaw czas przypomnienia</string>
|
||||
|
|
@ -372,4 +376,10 @@ Od czego chcesz zacząć poprawiać swoje życie?</string>
|
|||
<string name="action_continue">Kontynuuj</string>
|
||||
<string name="scan_qr_code">Przeskanuj kod QR</string>
|
||||
<string name="invited_to_party">Zostałeś zaproszony do drużyny!</string>
|
||||
<string name="add_task">Dodaj Zadanie</string>
|
||||
<string name="add_habit">Dodaj Nawyk</string>
|
||||
<string name="add_daily">Dodaj Codzienne</string>
|
||||
<string name="add_todo">Dodaj Do-Zrobienia</string>
|
||||
<string name="add_reward">Dodaj Nagrodę</string>
|
||||
<string name="all_dailies_completed">Wykonałeś wszystkie codzienne. Brawo!</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -414,6 +414,7 @@ To start, which parts of your life do you want to improve?</string>
|
|||
<string name="widget_habit_button">Habitica Do Habit</string>
|
||||
<string name="widget_dailies">Habitica Dailies</string>
|
||||
<string name="widget_add_task">Habitica Add Task</string>
|
||||
<string name="google_services_missing">Google play services could not be found.</string>
|
||||
<string name="skill_transformation_use">use</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:initialLayout="@layout/widget_dailies"
|
||||
android:minHeight="180dp"
|
||||
android:minWidth="180dp"
|
||||
android:minHeight="120dp"
|
||||
android:minWidth="120dp"
|
||||
android:updatePeriodMillis="1800000"
|
||||
android:resizeMode="horizontal|vertical">
|
||||
|
||||
|
|
|
|||
|
|
@ -313,7 +313,9 @@ public class HabiticaApplication extends MultiDexApplication {
|
|||
|
||||
@Override
|
||||
public File getDatabasePath(String name) {
|
||||
return new File(getExternalFilesDir(null), "HabiticaDatabase/" + name);
|
||||
File dbFile = new File(getExternalFilesDir(null), "HabiticaDatabase/" + name);
|
||||
Crashlytics.setString("Database File", dbFile.getAbsolutePath());
|
||||
return dbFile;
|
||||
}
|
||||
|
||||
private void createBillingAndCheckout() {
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ import com.habitrpg.android.habitica.ui.fragments.social.party.PartyInviteFragme
|
|||
import com.habitrpg.android.habitica.ui.fragments.social.party.PartyMemberListFragment;
|
||||
import com.habitrpg.android.habitica.ui.fragments.tasks.TaskRecyclerViewFragment;
|
||||
import com.habitrpg.android.habitica.ui.fragments.tasks.TasksFragment;
|
||||
import com.habitrpg.android.habitica.widget.AvatarStatsWidgetService;
|
||||
import com.habitrpg.android.habitica.widget.AvatarStatsWidgetProvider;
|
||||
import com.habitrpg.android.habitica.widget.DailiesWidgetProvider;
|
||||
import com.habitrpg.android.habitica.widget.HabitButtonWidgetProvider;
|
||||
import com.habitrpg.android.habitica.widget.HabitButtonWidgetService;
|
||||
|
|
@ -67,7 +67,6 @@ import dagger.Component;
|
|||
@Singleton
|
||||
@Component(modules = {AppModule.class, ApiModule.class})
|
||||
public interface AppComponent {
|
||||
void inject(AvatarStatsWidgetService target);
|
||||
|
||||
void inject(ClassSelectionActivity classSelectionActivity);
|
||||
|
||||
|
|
@ -180,4 +179,6 @@ public interface AppComponent {
|
|||
void inject(HabitButtonWidgetActivity habitButtonWidgetActivity);
|
||||
|
||||
void inject(HabitButtonWidgetProvider habitButtonWidgetProvider);
|
||||
|
||||
void inject(AvatarStatsWidgetProvider avatarStatsWidgetProvider);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ import org.json.JSONObject;
|
|||
|
||||
import android.accounts.AccountManager;
|
||||
import android.app.Dialog;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Color;
|
||||
|
|
@ -45,6 +46,7 @@ import android.net.Uri;
|
|||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.support.v7.preference.PreferenceManager;
|
||||
import android.text.SpannableString;
|
||||
import android.text.style.UnderlineSpan;
|
||||
|
|
@ -401,7 +403,7 @@ public class LoginActivity extends BaseActivity
|
|||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (this.isRegistering || userAuthResponse.getNewUser()) {
|
||||
if (userAuthResponse.getNewUser()) {
|
||||
this.startSetupActivity();
|
||||
} else {
|
||||
AmplitudeManager.sendEvent("login", AmplitudeManager.EVENT_CATEGORY_BEHAVIOUR, AmplitudeManager.EVENT_HITTYPE_EVENT);
|
||||
|
|
@ -414,7 +416,16 @@ public class LoginActivity extends BaseActivity
|
|||
String[] accountTypes = new String[]{"com.google"};
|
||||
Intent intent = AccountPicker.newChooseAccountIntent(null, null,
|
||||
accountTypes, false, null, null, null, null);
|
||||
startActivityForResult(intent, REQUEST_CODE_PICK_ACCOUNT);
|
||||
try {
|
||||
startActivityForResult(intent, REQUEST_CODE_PICK_ACCOUNT);
|
||||
} catch (ActivityNotFoundException e) {
|
||||
Dialog dialog = new AlertDialog.Builder(this)
|
||||
.setTitle(R.string.authentication_error_title)
|
||||
.setMessage(R.string.google_services_missing)
|
||||
.setNegativeButton(R.string.close, (dialogInterface, i) -> dialogInterface.dismiss())
|
||||
.create();
|
||||
dialog.show();
|
||||
}
|
||||
}
|
||||
|
||||
private void handleGoogleLoginResult() {
|
||||
|
|
@ -423,18 +434,15 @@ public class LoginActivity extends BaseActivity
|
|||
Observable.defer(() -> {
|
||||
try {
|
||||
return Observable.just(GoogleAuthUtil.getToken(LoginActivity.this, googleEmail, scopes));
|
||||
} catch (IOException e) {
|
||||
throw Exceptions.propagate(e);
|
||||
} catch (GoogleAuthException e) {
|
||||
} catch (IOException | GoogleAuthException e) {
|
||||
throw Exceptions.propagate(e);
|
||||
}
|
||||
|
||||
})
|
||||
.flatMap(token -> apiHelper.connectSocial("google", googleEmail, token))
|
||||
.compose(apiHelper.configureApiCallObserver())
|
||||
.subscribe(LoginActivity.this, throwable -> {
|
||||
hideProgress();
|
||||
if (GoogleAuthException.class.isAssignableFrom(throwable.getCause().getClass())) {
|
||||
if (throwable.getCause() != null && GoogleAuthException.class.isAssignableFrom(throwable.getCause().getClass())) {
|
||||
handleGoogleAuthException((GoogleAuthException)throwable.getCause());
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.habitrpg.android.habitica.ui.fragments.setup;
|
||||
|
||||
import com.habitrpg.android.habitica.APIHelper;
|
||||
import com.habitrpg.android.habitica.R;
|
||||
import com.habitrpg.android.habitica.components.AppComponent;
|
||||
import com.habitrpg.android.habitica.ui.AvatarView;
|
||||
|
|
@ -23,6 +24,8 @@ import android.view.ViewGroup;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
|
||||
|
|
@ -39,6 +42,9 @@ public class AvatarSetupFragment extends BaseFragment {
|
|||
GridLayoutManager layoutManager;
|
||||
private HabitRPGUser user;
|
||||
|
||||
@Inject
|
||||
APIHelper apiHelper;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
|
|
@ -96,12 +102,17 @@ public class AvatarSetupFragment extends BaseFragment {
|
|||
|
||||
Where<Customization> select = new Select()
|
||||
.from(Customization.class)
|
||||
.where(Condition.CombinedCondition.begin(Condition.column("purchased").eq(true))
|
||||
.or(Condition.column("price").eq(0))
|
||||
.where(Condition.CombinedCondition.begin(Condition.column("price").eq(0))
|
||||
.or(Condition.column("price").isNull())
|
||||
);
|
||||
|
||||
List<Customization> customizations = select.queryList();
|
||||
if (customizations.size() == 0) {
|
||||
this.apiHelper.getContent().compose(this.apiHelper.configureApiCallObserver())
|
||||
.subscribe(contentResult -> {
|
||||
this.loadCustomizations();
|
||||
}, throwable -> {});
|
||||
}
|
||||
this.adapter.setCustomizationList(customizations);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ public class GroupInformationFragment extends BaseFragment {
|
|||
QrCodeManager qrCodeManager = new QrCodeManager(this.getContext());
|
||||
qrCodeManager.setUpView(qrLayout);
|
||||
|
||||
if (user.getInvitations().getParty() != null && user.getInvitations().getParty().getId() != null) {
|
||||
if (user != null && user.getInvitations().getParty() != null && user.getInvitations().getParty().getId() != null) {
|
||||
viewBinding.setInvitation(user.getInvitations().getParty());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,16 +84,6 @@ public class PartyFragment extends BaseMainFragment {
|
|||
});
|
||||
}, throwable -> {
|
||||
});
|
||||
} else {
|
||||
// AlertDialog.Builder builder = new AlertDialog.Builder(activity)
|
||||
// .setMessage(activity.getString(R.string.no_party_message))
|
||||
// .setNeutralButton(android.R.string.ok, (dialog, which) -> {
|
||||
// activity.getSupportFragmentManager().popBackStackImmediate();
|
||||
// });
|
||||
// builder.show();
|
||||
// if (tabLayout != null) {
|
||||
// tabLayout.removeAllTabs();
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -112,13 +102,17 @@ public class PartyFragment extends BaseMainFragment {
|
|||
}
|
||||
|
||||
private void updateGroupUI() {
|
||||
viewPagerAdapter.notifyDataSetChanged();
|
||||
if (viewPagerAdapter != null) {
|
||||
viewPagerAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
if (group == null) {
|
||||
tabLayout.setVisibility(View.GONE);
|
||||
return;
|
||||
} else {
|
||||
tabLayout.setVisibility(View.VISIBLE);
|
||||
if (tabLayout != null) {
|
||||
if (group == null) {
|
||||
tabLayout.setVisibility(View.GONE);
|
||||
return;
|
||||
} else {
|
||||
tabLayout.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
if (partyMemberListFragment != null) {
|
||||
|
|
@ -135,7 +129,7 @@ public class PartyFragment extends BaseMainFragment {
|
|||
|
||||
PartyFragment.this.activity.supportInvalidateOptionsMenu();
|
||||
|
||||
if (group.quest != null && group.quest.key != null && !group.quest.key.isEmpty()) {
|
||||
if (group != null && group.quest != null && group.quest.key != null && !group.quest.key.isEmpty()) {
|
||||
contentCache.GetQuestContent(group.quest.key, content -> {
|
||||
if (groupInformationFragment != null) {
|
||||
groupInformationFragment.setQuestContent(content);
|
||||
|
|
|
|||
|
|
@ -484,25 +484,33 @@ public class TasksFragment extends BaseMainFragment implements OnCheckedChangeLi
|
|||
if(this.editingTags) {
|
||||
items.add(new EditTagsSectionDrawer().withEditing(this.editingTags).withName(getString(R.string.filter_drawer_edit_tags)));
|
||||
items.add(new EditTextDrawer());
|
||||
for (Tag t : tagList) {
|
||||
items.add(new EditTagsDrawerItem()
|
||||
.withName(t.getName())
|
||||
.withTag(t)
|
||||
);
|
||||
if (tagList != null) {
|
||||
for (Tag t : tagList) {
|
||||
items.add(new EditTagsDrawerItem()
|
||||
.withName(t.getName())
|
||||
.withTag(t)
|
||||
);
|
||||
}
|
||||
}
|
||||
if (isAdded()) {
|
||||
this.activity.fillFilterDrawer(items);
|
||||
}
|
||||
this.activity.fillFilterDrawer(items);
|
||||
}else {
|
||||
items.add(new EditTagsSectionDrawer().withEditing(this.editingTags).withName(getString(R.string.filter_drawer_filter_tags)));
|
||||
items.add(new EditTextDrawer());
|
||||
for (Tag t : tagList) {
|
||||
items.add(new SwitchDrawerItem()
|
||||
.withName(t.getName())
|
||||
.withTag(t)
|
||||
.withChecked(this.tagsHelper.isTagChecked(t.getId()))
|
||||
.withOnCheckedChangeListener(this)
|
||||
);
|
||||
if (tagList != null) {
|
||||
for (Tag t : tagList) {
|
||||
items.add(new SwitchDrawerItem()
|
||||
.withName(t.getName())
|
||||
.withTag(t)
|
||||
.withChecked(this.tagsHelper.isTagChecked(t.getId()))
|
||||
.withOnCheckedChangeListener(this)
|
||||
);
|
||||
}
|
||||
}
|
||||
if (isAdded()) {
|
||||
this.activity.fillFilterDrawer(items);
|
||||
}
|
||||
this.activity.fillFilterDrawer(items);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,48 +1,58 @@
|
|||
package com.habitrpg.android.habitica.widget;
|
||||
|
||||
import com.habitrpg.android.habitica.APIHelper;
|
||||
import com.habitrpg.android.habitica.HabiticaApplication;
|
||||
import com.habitrpg.android.habitica.HostConfig;
|
||||
import com.habitrpg.android.habitica.R;
|
||||
import com.habitrpg.android.habitica.ui.AvatarView;
|
||||
import com.habitrpg.android.habitica.ui.activities.MainActivity;
|
||||
import com.magicmicky.habitrpgwrapper.lib.models.HabitRPGUser;
|
||||
import com.magicmicky.habitrpgwrapper.lib.models.Stats;
|
||||
import com.raizlabs.android.dbflow.runtime.transaction.BaseTransaction;
|
||||
import com.raizlabs.android.dbflow.runtime.transaction.TransactionListener;
|
||||
import com.raizlabs.android.dbflow.sql.builder.Condition;
|
||||
import com.raizlabs.android.dbflow.sql.language.Select;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.PendingIntent;
|
||||
import android.appwidget.AppWidgetManager;
|
||||
import android.appwidget.AppWidgetProvider;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.RemoteViews;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
public class AvatarStatsWidgetProvider extends BaseWidgetProvider {
|
||||
private static final String LOG = AvatarStatsWidgetProvider.class.getName();
|
||||
private AppWidgetManager appWidgetManager;
|
||||
|
||||
@Override
|
||||
public int layoutResourceId() {
|
||||
return R.layout.widget_avatar_stats;
|
||||
}
|
||||
|
||||
@Inject
|
||||
APIHelper apiHelper;
|
||||
@Inject
|
||||
HostConfig hostConfig;
|
||||
|
||||
private void setUp(Context context) {
|
||||
if (apiHelper == null) {
|
||||
HabiticaApplication application = HabiticaApplication.getInstance(context);
|
||||
application.getComponent().inject(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
|
||||
// Get all ids
|
||||
ComponentName thisWidget = new ComponentName(context,
|
||||
AvatarStatsWidgetProvider.class);
|
||||
int[] allWidgetIds = appWidgetManager.getAppWidgetIds(thisWidget);
|
||||
this.setUp(context);
|
||||
this.appWidgetManager = appWidgetManager;
|
||||
this.context = context;
|
||||
|
||||
if (Build.VERSION.SDK_INT >= 16) {
|
||||
for (int widgetId : allWidgetIds) {
|
||||
Bundle options = appWidgetManager.getAppWidgetOptions(widgetId);
|
||||
appWidgetManager.partiallyUpdateAppWidget(widgetId,
|
||||
sizeRemoteViews(context, options, widgetId));
|
||||
}
|
||||
}
|
||||
|
||||
// Build the intent to call the service
|
||||
Intent intent = new Intent(context.getApplicationContext(),
|
||||
AvatarStatsWidgetService.class);
|
||||
intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, allWidgetIds);
|
||||
|
||||
context.startService(intent);
|
||||
new Select().from(HabitRPGUser.class).where(Condition.column("id").eq(hostConfig.getUser())).async().querySingle(userTransactionListener);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -64,4 +74,75 @@ public class AvatarStatsWidgetProvider extends BaseWidgetProvider {
|
|||
|
||||
return remoteViews;
|
||||
}
|
||||
|
||||
private TransactionListener<HabitRPGUser> userTransactionListener = new TransactionListener<HabitRPGUser>() {
|
||||
@Override
|
||||
public void onResultReceived(HabitRPGUser habitRPGUser) {
|
||||
updateData(habitRPGUser);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onReady(BaseTransaction<HabitRPGUser> baseTransaction) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasResult(BaseTransaction<HabitRPGUser> baseTransaction, HabitRPGUser habitRPGUser) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
private void updateData(HabitRPGUser user) {
|
||||
if (user == null || user.getStats() == null) {
|
||||
return;
|
||||
}
|
||||
Stats stats = user.getStats();
|
||||
ComponentName thisWidget = new ComponentName(context, AvatarStatsWidgetProvider.class);
|
||||
int[] allWidgetIds = appWidgetManager.getAppWidgetIds(thisWidget);
|
||||
String healthValueString = "" + stats.getHp().intValue() + "/" + stats.getMaxHealth();
|
||||
String expValueString = "" + stats.getExp().intValue() + "/" + stats.getToNextLevel();
|
||||
String mpValueString = "" + stats.getMp().intValue() + "/" + stats.getMaxMP();
|
||||
|
||||
for (int widgetId : allWidgetIds) {
|
||||
RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget_avatar_stats);
|
||||
|
||||
remoteViews.setTextViewText(R.id.TV_hp_value, healthValueString);
|
||||
remoteViews.setTextViewText(R.id.exp_TV_value, expValueString);
|
||||
remoteViews.setTextViewText(R.id.mp_TV_value, mpValueString);
|
||||
|
||||
remoteViews.setProgressBar(R.id.hp_bar, stats.getMaxHealth(), stats.getHp().intValue(), false);
|
||||
remoteViews.setProgressBar(R.id.exp_bar, stats.getToNextLevel(), stats.getExp().intValue(), false);
|
||||
remoteViews.setProgressBar(R.id.mp_bar, stats.getMaxMP(), stats.getMp().intValue(), false);
|
||||
remoteViews.setViewVisibility(R.id.mp_wrapper, (stats.get_class() == null || stats.getLvl() < 10 || user.getPreferences().getDisableClasses()) ? View.GONE : View.VISIBLE);
|
||||
|
||||
int gp = (stats.getGp().intValue());
|
||||
int sp = (int) ((stats.getGp() - gp) * 100);
|
||||
remoteViews.setTextViewText(R.id.gold_tv, String.valueOf(gp));
|
||||
remoteViews.setTextViewText(R.id.silver_tv, String.valueOf(sp));
|
||||
remoteViews.setTextViewText(R.id.gems_tv, String.valueOf((int) (user.getBalance() * 4)));
|
||||
remoteViews.setTextViewText(R.id.lvl_tv, context.getString(R.string.user_level, user.getStats().getLvl().toString()));
|
||||
|
||||
AvatarView avatarView = new AvatarView(context, true, true, true);
|
||||
;
|
||||
avatarView.setUser(user);
|
||||
RemoteViews finalRemoteViews = remoteViews;
|
||||
avatarView.onAvatarImageReady(bitmap -> {
|
||||
finalRemoteViews.setImageViewBitmap(R.id.avatar_view, bitmap);
|
||||
appWidgetManager.partiallyUpdateAppWidget(allWidgetIds, finalRemoteViews);
|
||||
});
|
||||
|
||||
//If user click on life and xp: open the app
|
||||
Intent openAppIntent = new Intent(context.getApplicationContext(), MainActivity.class);
|
||||
PendingIntent openApp = PendingIntent.getActivity(context, 0, openAppIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
remoteViews.setOnClickPendingIntent(R.id.widget_main_view, openApp);
|
||||
|
||||
|
||||
if (Build.VERSION.SDK_INT >= 16) {
|
||||
Bundle options = appWidgetManager.getAppWidgetOptions(widgetId);
|
||||
remoteViews = sizeRemoteViews(context, options, widgetId);
|
||||
}
|
||||
|
||||
appWidgetManager.updateAppWidget(widgetId, remoteViews);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,110 +0,0 @@
|
|||
package com.habitrpg.android.habitica.widget;
|
||||
|
||||
import android.app.PendingIntent;
|
||||
import android.app.Service;
|
||||
import android.appwidget.AppWidgetManager;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Intent;
|
||||
import android.os.IBinder;
|
||||
import android.view.View;
|
||||
import android.widget.RemoteViews;
|
||||
|
||||
import com.habitrpg.android.habitica.HabiticaApplication;
|
||||
import com.habitrpg.android.habitica.HostConfig;
|
||||
import com.habitrpg.android.habitica.R;
|
||||
import com.habitrpg.android.habitica.ui.AvatarView;
|
||||
import com.habitrpg.android.habitica.ui.activities.MainActivity;
|
||||
import com.magicmicky.habitrpgwrapper.lib.models.HabitRPGUser;
|
||||
import com.magicmicky.habitrpgwrapper.lib.models.Stats;
|
||||
import com.raizlabs.android.dbflow.runtime.transaction.BaseTransaction;
|
||||
import com.raizlabs.android.dbflow.runtime.transaction.TransactionListener;
|
||||
import com.raizlabs.android.dbflow.sql.builder.Condition;
|
||||
import com.raizlabs.android.dbflow.sql.language.Select;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
public class AvatarStatsWidgetService extends Service {
|
||||
private static final String LOG = ".avatarwidget.service";
|
||||
@Inject
|
||||
public HostConfig hostConfig;
|
||||
private AppWidgetManager appWidgetManager;
|
||||
|
||||
|
||||
@Override
|
||||
public int onStartCommand(final Intent intent, int flags, int startId) {
|
||||
HabiticaApplication application = (HabiticaApplication) getApplication();
|
||||
application.getComponent().inject(this);
|
||||
this.appWidgetManager = AppWidgetManager.getInstance(this);
|
||||
|
||||
new Select().from(HabitRPGUser.class).where(Condition.column("id").eq(hostConfig.getUser())).async().querySingle(userTransactionListener);
|
||||
|
||||
stopSelf();
|
||||
|
||||
return START_STICKY;
|
||||
}
|
||||
|
||||
private TransactionListener<HabitRPGUser> userTransactionListener = new TransactionListener<HabitRPGUser>() {
|
||||
@Override
|
||||
public void onResultReceived(HabitRPGUser habitRPGUser) {
|
||||
updateData(habitRPGUser);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onReady(BaseTransaction<HabitRPGUser> baseTransaction) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasResult(BaseTransaction<HabitRPGUser> baseTransaction, HabitRPGUser habitRPGUser) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
private void updateData(HabitRPGUser user) {
|
||||
if (user == null || user.getStats() == null) {
|
||||
return;
|
||||
}
|
||||
Stats stats = user.getStats();
|
||||
ComponentName thisWidget = new ComponentName(this, AvatarStatsWidgetProvider.class);
|
||||
int[] allWidgetIds = appWidgetManager.getAppWidgetIds(thisWidget);
|
||||
String healthValueString = "" + stats.getHp().intValue() + "/" + stats.getMaxHealth();
|
||||
String expValueString = "" + stats.getExp().intValue() + "/" + stats.getToNextLevel();
|
||||
String mpValueString = "" + stats.getMp().intValue() + "/" + stats.getMaxMP();
|
||||
|
||||
RemoteViews remoteViews = new RemoteViews(this.getPackageName(), R.layout.widget_avatar_stats);
|
||||
|
||||
remoteViews.setTextViewText(R.id.TV_hp_value, healthValueString);
|
||||
remoteViews.setTextViewText(R.id.exp_TV_value, expValueString);
|
||||
remoteViews.setTextViewText(R.id.mp_TV_value, mpValueString);
|
||||
|
||||
remoteViews.setProgressBar(R.id.hp_bar, stats.getMaxHealth(), stats.getHp().intValue(), false);
|
||||
remoteViews.setProgressBar(R.id.exp_bar, stats.getToNextLevel(), stats.getExp().intValue(), false);
|
||||
remoteViews.setProgressBar(R.id.mp_bar, stats.getMaxMP(), stats.getMp().intValue(), false);
|
||||
remoteViews.setViewVisibility(R.id.mp_wrapper, (stats.get_class() == null || stats.getLvl() < 10 || user.getPreferences().getDisableClasses()) ? View.GONE : View.VISIBLE);
|
||||
|
||||
int gp = (stats.getGp().intValue());
|
||||
int sp = (int) ((stats.getGp() - gp) * 100);
|
||||
remoteViews.setTextViewText(R.id.gold_tv, String.valueOf(gp));
|
||||
remoteViews.setTextViewText(R.id.silver_tv, String.valueOf(sp));
|
||||
remoteViews.setTextViewText(R.id.gems_tv, String.valueOf((int)(user.getBalance() * 4)));
|
||||
remoteViews.setTextViewText(R.id.lvl_tv, getString(R.string.user_level, user.getStats().getLvl()));
|
||||
|
||||
AvatarView avatarView = new AvatarView(this, true, true, true);;
|
||||
avatarView.setUser(user);
|
||||
avatarView.onAvatarImageReady(bitmap -> {
|
||||
remoteViews.setImageViewBitmap(R.id.avatar_view, bitmap);
|
||||
appWidgetManager.partiallyUpdateAppWidget(allWidgetIds, remoteViews);
|
||||
});
|
||||
|
||||
//If user click on life and xp: open the app
|
||||
Intent openAppIntent = new Intent(this.getApplicationContext(), MainActivity.class);
|
||||
PendingIntent openApp = PendingIntent.getActivity(this, 0, openAppIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
remoteViews.setOnClickPendingIntent(R.id.widget_main_view, openApp);
|
||||
appWidgetManager.partiallyUpdateAppWidget(allWidgetIds, remoteViews);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -45,7 +45,9 @@ public class DailiesListProvider implements RemoteViewsService.RemoteViewsFactor
|
|||
taskList = tasks;
|
||||
this.reloadData = false;
|
||||
AppWidgetManager.getInstance(context).notifyAppWidgetViewDataChanged(widgetId, R.id.list_view);
|
||||
}, throwable -> {});
|
||||
}, throwable -> {
|
||||
this.reloadData = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -94,7 +94,9 @@ public class DailiesWidgetProvider extends BaseWidgetProvider {
|
|||
PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
rv.setPendingIntentTemplate(R.id.list_view, toastPendingIntent);
|
||||
|
||||
appWidgetManager.partiallyUpdateAppWidget(appWidgetIds[i], rv);
|
||||
appWidgetManager.updateAppWidget(appWidgetIds[i], rv);
|
||||
|
||||
AppWidgetManager.getInstance(context).notifyAppWidgetViewDataChanged(appWidgetIds[i], R.id.list_view);
|
||||
}
|
||||
super.onUpdate(context, appWidgetManager, appWidgetIds);
|
||||
}
|
||||
|
|
@ -108,4 +110,4 @@ public class DailiesWidgetProvider extends BaseWidgetProvider {
|
|||
public RemoteViews configureRemoteViews(RemoteViews remoteViews, int widgetId, int columns, int rows) {
|
||||
return remoteViews;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -79,26 +79,27 @@ public class HabitButtonWidgetService extends Service {
|
|||
|
||||
private void updateData(Task task) {
|
||||
RemoteViews remoteViews = new RemoteViews(this.getPackageName(), R.layout.widget_habit_button);
|
||||
remoteViews.setTextViewText(R.id.habit_title, task.text);
|
||||
if (task != null) {
|
||||
remoteViews.setTextViewText(R.id.habit_title, task.text);
|
||||
|
||||
if (!task.getUp()) {
|
||||
remoteViews.setViewVisibility(R.id.btnPlusWrapper, View.GONE);
|
||||
remoteViews.setOnClickPendingIntent(R.id.btnPlusWrapper, null);
|
||||
} else {
|
||||
remoteViews.setViewVisibility(R.id.btnPlusWrapper, View.VISIBLE);
|
||||
remoteViews.setInt(R.id.btnPlus, "setBackgroundColor", resources.getColor(task.getLightTaskColor()));
|
||||
remoteViews.setOnClickPendingIntent(R.id.btnPlusWrapper, getPendingIntent(task.getId(), TaskDirection.up.toString(), taskMapping.get(task.getId())));
|
||||
if (!task.getUp()) {
|
||||
remoteViews.setViewVisibility(R.id.btnPlusWrapper, View.GONE);
|
||||
remoteViews.setOnClickPendingIntent(R.id.btnPlusWrapper, null);
|
||||
} else {
|
||||
remoteViews.setViewVisibility(R.id.btnPlusWrapper, View.VISIBLE);
|
||||
remoteViews.setInt(R.id.btnPlus, "setBackgroundColor", resources.getColor(task.getLightTaskColor()));
|
||||
remoteViews.setOnClickPendingIntent(R.id.btnPlusWrapper, getPendingIntent(task.getId(), TaskDirection.up.toString(), taskMapping.get(task.getId())));
|
||||
}
|
||||
if (!task.getDown()) {
|
||||
remoteViews.setViewVisibility(R.id.btnMinusWrapper, View.GONE);
|
||||
remoteViews.setOnClickPendingIntent(R.id.btnMinusWrapper, null);
|
||||
} else {
|
||||
remoteViews.setViewVisibility(R.id.btnMinusWrapper, View.VISIBLE);
|
||||
remoteViews.setInt(R.id.btnMinus, "setBackgroundColor", resources.getColor(task.getMediumTaskColor()));
|
||||
remoteViews.setOnClickPendingIntent(R.id.btnMinusWrapper, getPendingIntent(task.getId(), TaskDirection.down.toString() , taskMapping.get(task.getId())));
|
||||
}
|
||||
appWidgetManager.updateAppWidget(taskMapping.get(task.getId()), remoteViews);
|
||||
}
|
||||
if (!task.getDown()) {
|
||||
remoteViews.setViewVisibility(R.id.btnMinusWrapper, View.GONE);
|
||||
remoteViews.setOnClickPendingIntent(R.id.btnMinusWrapper, null);
|
||||
} else {
|
||||
remoteViews.setViewVisibility(R.id.btnMinusWrapper, View.VISIBLE);
|
||||
remoteViews.setInt(R.id.btnMinus, "setBackgroundColor", resources.getColor(task.getMediumTaskColor()));
|
||||
remoteViews.setOnClickPendingIntent(R.id.btnMinusWrapper, getPendingIntent(task.getId(), TaskDirection.down.toString() , taskMapping.get(task.getId())));
|
||||
}
|
||||
|
||||
appWidgetManager.updateAppWidget(taskMapping.get(task.getId()), remoteViews);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -213,6 +213,9 @@ public class Preferences extends BaseModel {
|
|||
|
||||
@Override
|
||||
public void save() {
|
||||
if (user_id == null) {
|
||||
return;
|
||||
}
|
||||
hair.userId = user_id;
|
||||
|
||||
if (suppressModals != null)
|
||||
|
|
|
|||
|
|
@ -27,23 +27,24 @@ public class TaskTagDeserializer implements JsonDeserializer<List<TaskTag>> {
|
|||
allTags = new ArrayList<>();
|
||||
}
|
||||
|
||||
for (JsonElement tagElement : json.getAsJsonArray()) {
|
||||
String tagId = tagElement.getAsString();
|
||||
TaskTag taskTag = new TaskTag();
|
||||
for (Tag tag : allTags) {
|
||||
if (tag.getId().equals(tagId)) {
|
||||
taskTag.setTag(tag);
|
||||
if (json.isJsonArray()) {
|
||||
for (JsonElement tagElement : json.getAsJsonArray()) {
|
||||
String tagId = tagElement.getAsString();
|
||||
TaskTag taskTag = new TaskTag();
|
||||
for (Tag tag : allTags) {
|
||||
if (tag.getId().equals(tagId)) {
|
||||
taskTag.setTag(tag);
|
||||
|
||||
if (!alreadyContainsTag(taskTags, tagId)) {
|
||||
taskTags.add(taskTag);
|
||||
if (!alreadyContainsTag(taskTags, tagId)) {
|
||||
taskTags.add(taskTag);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return taskTags;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<resources>
|
||||
<string name="store_short_description">게임처럼 당신의 인생을 치료 동기 부여 및 조직 유지 합니다!</string>
|
||||
<string name="store_short_description">인생을 게임처럼 다루어서 동기를 부여하고 체계를 잡으세요!</string>
|
||||
<string name="store_description">HabitRPG 에서NEW 앱 ! 부드러운 경험과 더 features.
|
||||
|
||||
에 대해 처음부터 다시 작성
|
||||
|
|
|
|||
Loading…
Reference in a new issue