mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-04-14 19:56:32 +00:00
fix various minor crashes
This commit is contained in:
parent
e2fba6c6e4
commit
377ff8dbc3
36 changed files with 114 additions and 101 deletions
BIN
Habitica/res/drawable-hdpi/ic_info_outline_black_24dp.png
Normal file
BIN
Habitica/res/drawable-hdpi/ic_info_outline_black_24dp.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 566 B |
BIN
Habitica/res/drawable-mdpi/ic_info_outline_black_24dp.png
Normal file
BIN
Habitica/res/drawable-mdpi/ic_info_outline_black_24dp.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 365 B |
BIN
Habitica/res/drawable-xhdpi/ic_info_outline_black_24dp.png
Normal file
BIN
Habitica/res/drawable-xhdpi/ic_info_outline_black_24dp.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 769 B |
BIN
Habitica/res/drawable-xxhdpi/ic_info_outline_black_24dp.png
Normal file
BIN
Habitica/res/drawable-xxhdpi/ic_info_outline_black_24dp.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
|
|
@ -1,4 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:viewportHeight="24.0" android:viewportWidth="24.0" android:width="24dp">
|
||||
<path android:fillColor="#000000" android:pathData="M11,17h2v-6h-2v6zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM11,9h2L13,7h-2v2z"/>
|
||||
</vector>
|
||||
|
|
@ -163,7 +163,7 @@
|
|||
android:layout_height="20dp"
|
||||
android:layout_marginTop="39dp"
|
||||
android:drawablePadding="12dp"
|
||||
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
|
||||
android:drawableRight="@drawable/ic_info_outline_black_24dp"
|
||||
android:drawableTint="@color/brand_300"
|
||||
android:gravity="center"
|
||||
android:text="Tag"
|
||||
|
|
|
|||
|
|
@ -438,18 +438,25 @@ public class ApiClientImpl implements Action1<Throwable>, ApiClient {
|
|||
|
||||
@Override
|
||||
public Observable<Items> equipItem(String type, String itemKey) {
|
||||
if (itemKey == null) {
|
||||
return Observable.just(null);
|
||||
}
|
||||
return apiService.equipItem(type, itemKey).compose(configureApiCallObserver());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Observable<BuyResponse> buyItem(String itemKey) {
|
||||
|
||||
if (itemKey == null) {
|
||||
return Observable.just(null);
|
||||
}
|
||||
return apiService.buyItem(itemKey).compose(configureApiCallObserver());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Observable<Void> purchaseItem(String type, String itemKey) {
|
||||
|
||||
if (itemKey == null) {
|
||||
return Observable.just(null);
|
||||
}
|
||||
return apiService.purchaseItem(type, itemKey).compose(configureApiCallObserver());
|
||||
}
|
||||
|
||||
|
|
@ -465,22 +472,33 @@ public class ApiClientImpl implements Action1<Throwable>, ApiClient {
|
|||
|
||||
@Override
|
||||
public Observable<Void> purchaseHourglassItem(String type, String itemKey) {
|
||||
|
||||
if (itemKey == null) {
|
||||
return Observable.just(null);
|
||||
}
|
||||
return apiService.purchaseHourglassItem(type, itemKey).compose(configureApiCallObserver());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Observable<Void> purchaseMysterySet(String itemKey) {
|
||||
if (itemKey == null) {
|
||||
return Observable.just(null);
|
||||
}
|
||||
return apiService.purchaseMysterySet(itemKey).compose(configureApiCallObserver());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Observable<Void> purchaseQuest(String key) {
|
||||
if (key == null) {
|
||||
return Observable.just(null);
|
||||
}
|
||||
return apiService.purchaseQuest(key).compose(configureApiCallObserver());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Observable<User> sellItem(String itemType, String itemKey) {
|
||||
if (itemKey == null) {
|
||||
return Observable.just(null);
|
||||
}
|
||||
return apiService.sellItem(itemType, itemKey).compose(configureApiCallObserver());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,12 +31,9 @@ abstract class ContentRepositoryImpl<T extends ContentLocalRepository> extends B
|
|||
public Observable<ContentResult> retrieveContent(boolean forced) {
|
||||
if (forced || this.lastSync == null || (new Date().getTime() - this.lastSync.getTime()) > 3600000) {
|
||||
lastSync = new Date();
|
||||
return apiClient.getContent()
|
||||
.doOnNext(localRepository::saveContent);
|
||||
return apiClient.getContent().doOnNext(localRepository::saveContent);
|
||||
} else {
|
||||
return Observable.just(null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import java.util.Map;
|
|||
import io.realm.RealmResults;
|
||||
import rx.Observable;
|
||||
import rx.functions.Action1;
|
||||
import rx.functions.Func2;
|
||||
|
||||
|
||||
public class SocialRepositoryImpl extends BaseRepositoryImpl<SocialLocalRepository> implements SocialRepository {
|
||||
|
|
@ -90,22 +91,20 @@ public class SocialRepositoryImpl extends BaseRepositoryImpl<SocialLocalReposito
|
|||
|
||||
@Override
|
||||
public Observable<Group> retrieveGroup(String id) {
|
||||
return apiClient.getGroup(id)
|
||||
.map(group -> {
|
||||
for (ChatMessage message : group.chat) {
|
||||
message.groupId = group.id;
|
||||
}
|
||||
return group;
|
||||
})
|
||||
.doOnNext(group -> {
|
||||
localRepository.save(group);
|
||||
localRepository.getGroup(group.id)
|
||||
.first()
|
||||
.subscribe(group1 -> {
|
||||
group.isMember = group1.isMember;
|
||||
localRepository.save(group);
|
||||
}, RxErrorHandler.handleEmptyError());
|
||||
});
|
||||
Observable<Group> observable = apiClient.getGroup(id);
|
||||
if (!"party".equals(id)) {
|
||||
observable = observable.withLatestFrom(localRepository.getGroup(id)
|
||||
.first(), (newGroup, oldGroup) -> {
|
||||
newGroup.isMember = oldGroup.isMember;
|
||||
return newGroup;
|
||||
});
|
||||
}
|
||||
return observable.map(group -> {
|
||||
for (ChatMessage message : group.chat) {
|
||||
message.groupId = group.id;
|
||||
}
|
||||
return group;
|
||||
}).doOnNext(localRepository::save);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ public class UserRepositoryImpl extends BaseRepositoryImpl<UserLocalRepository>
|
|||
}
|
||||
});
|
||||
} else {
|
||||
return Observable.just(null);
|
||||
return getUser();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -79,9 +79,10 @@ public class PushNotificationManager {
|
|||
}
|
||||
|
||||
public void removePushDeviceUsingStoredToken() {
|
||||
apiClient.deletePushDevice(this.refreshedToken)
|
||||
|
||||
.subscribe(aVoid -> {}, RxErrorHandler.handleEmptyError());
|
||||
if (this.refreshedToken == null) {
|
||||
return;
|
||||
}
|
||||
apiClient.deletePushDevice(this.refreshedToken).subscribe(aVoid -> {}, RxErrorHandler.handleEmptyError());
|
||||
}
|
||||
|
||||
private Boolean userHasPushDevice() {
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ public class NotifyUserUseCase extends UseCase<NotifyUserUseCase.RequestValues,
|
|||
|
||||
if (requestValues.hasLeveledUp) {
|
||||
return levelUpUseCase.observable(new LevelUpUseCase.RequestValues(requestValues.user, requestValues.context))
|
||||
.flatMap(aVoid -> userRepository.retrieveUser(false))
|
||||
.flatMap(aVoid -> userRepository.retrieveUser(true))
|
||||
.map(User::getStats);
|
||||
} else {
|
||||
Pair<SpannableStringBuilder, SnackbarDisplayType> pair = getNotificationAndAddStatsToUser(requestValues.context, requestValues.xp, requestValues.hp, requestValues.gold, requestValues.mp);
|
||||
|
|
|
|||
|
|
@ -438,9 +438,7 @@ public class CreateChallengeActivity extends BaseActivity {
|
|||
|
||||
checkPrizeAndMinimumForTavern();
|
||||
|
||||
challengeRepository.getChallengeTasks(challengeId).subscribe(tasks -> {
|
||||
tasks.tasks.forEach((s, task) -> addOrUpdateTaskInList(task));
|
||||
}, Throwable::printStackTrace, () -> {
|
||||
challengeRepository.getChallengeTasks(challengeId).subscribe(tasks -> tasks.tasks.forEach((s, task) -> addOrUpdateTaskInList(task)), RxErrorHandler.handleEmptyError(), () -> {
|
||||
// activate editMode to track taskChanges
|
||||
editMode = true;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import android.view.LayoutInflater;
|
|||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.ScrollView;
|
||||
|
|
@ -187,7 +188,7 @@ public class FullProfileActivity extends BaseActivity {
|
|||
final AlertDialog addMessageDialog = new AlertDialog.Builder(this)
|
||||
.setPositiveButton(android.R.string.ok, (dialogInterface, i) -> {
|
||||
socialRepository.postPrivateMessage(userId, emojiEditText.getText().toString())
|
||||
.subscribe(postChatMessageResult -> showSnackbar(FullProfileActivity.this, FullProfileActivity.this.fullprofile_scrollview,
|
||||
.subscribe(postChatMessageResult -> showSnackbar(FullProfileActivity.this, (ViewGroup) FullProfileActivity.this.fullprofile_scrollview.getChildAt(0),
|
||||
String.format(getString(R.string.profile_message_sent_to), userName), SnackbarDisplayType.NORMAL), RxErrorHandler.handleEmptyError());
|
||||
|
||||
UiUtils.dismissKeyboard(HabiticaApplication.currentActivity);
|
||||
|
|
|
|||
|
|
@ -741,7 +741,7 @@ public class MainActivity extends BaseActivity implements TutorialView.OnTutoria
|
|||
return;
|
||||
}
|
||||
|
||||
if (this.faintDialog == null) {
|
||||
if (this.faintDialog == null && !this.isFinishing()) {
|
||||
|
||||
View customView = View.inflate(this, R.layout.dialog_faint, null);
|
||||
if (customView != null) {
|
||||
|
|
|
|||
|
|
@ -984,6 +984,9 @@ public class TaskFormActivity extends BaseActivity implements AdapterView.OnItem
|
|||
}
|
||||
|
||||
private void populate(Task task) {
|
||||
if (!task.isValid()) {
|
||||
return;
|
||||
}
|
||||
taskText.setText(task.text);
|
||||
taskNotes.setText(task.notes);
|
||||
taskValue.setText(String.format(Locale.getDefault(), "%.2f", task.value));
|
||||
|
|
@ -1328,6 +1331,10 @@ public class TaskFormActivity extends BaseActivity implements AdapterView.OnItem
|
|||
if (currentFocus != null) {
|
||||
imm.hideSoftInputFromWindow(currentFocus.getWindowToken(), 0);
|
||||
}
|
||||
if (popup != null) {
|
||||
popup.dismiss();
|
||||
popup = null;
|
||||
}
|
||||
}
|
||||
|
||||
private class DateEditTextListener implements View.OnClickListener, DatePickerDialog.OnDateSetListener {
|
||||
|
|
|
|||
|
|
@ -41,10 +41,9 @@ public class NewsFragment extends BaseMainFragment {
|
|||
|
||||
@Override
|
||||
public String customTitle() {
|
||||
if (isAdded()) {
|
||||
return getString(R.string.sidebar_news);
|
||||
} else {
|
||||
if (!isAdded()) {
|
||||
return "";
|
||||
}
|
||||
return getString(R.string.sidebar_news);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,6 +67,9 @@ public class FAQOverviewFragment extends BaseMainFragment {
|
|||
|
||||
@Override
|
||||
public String customTitle() {
|
||||
if (!isAdded()) {
|
||||
return "";
|
||||
}
|
||||
return getString(R.string.FAQ);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -165,10 +165,9 @@ public class AvatarOverviewFragment extends BaseMainFragment implements AdapterV
|
|||
|
||||
@Override
|
||||
public String customTitle() {
|
||||
if (isAdded()) {
|
||||
return getString(R.string.sidebar_avatar);
|
||||
} else {
|
||||
if (!isAdded()) {
|
||||
return "";
|
||||
}
|
||||
return getString(R.string.sidebar_avatar);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -156,11 +156,10 @@ public class EquipmentOverviewFragment extends BaseMainFragment {
|
|||
|
||||
@Override
|
||||
public String customTitle() {
|
||||
if (isAdded()) {
|
||||
return getString(R.string.sidebar_equipment);
|
||||
} else {
|
||||
if (!isAdded()) {
|
||||
return "";
|
||||
}
|
||||
return getString(R.string.sidebar_equipment);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -128,10 +128,9 @@ public class ItemsFragment extends BaseMainFragment {
|
|||
|
||||
@Override
|
||||
public String customTitle() {
|
||||
if (isAdded()) {
|
||||
return getString(R.string.sidebar_items);
|
||||
} else {
|
||||
if (!isAdded()) {
|
||||
return "";
|
||||
}
|
||||
return getString(R.string.sidebar_items);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,11 +100,10 @@ public class ShopsFragment extends BaseMainFragment {
|
|||
|
||||
@Override
|
||||
public String customTitle() {
|
||||
if (isAdded()) {
|
||||
return getString(R.string.sidebar_shops);
|
||||
} else {
|
||||
if (!isAdded()) {
|
||||
return "";
|
||||
}
|
||||
return getString(R.string.sidebar_shops);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,10 +109,9 @@ public class MountDetailRecyclerFragment extends BaseMainFragment {
|
|||
|
||||
@Override
|
||||
public String customTitle() {
|
||||
if (isAdded()) {
|
||||
return getString(R.string.mounts);
|
||||
} else {
|
||||
if (!isAdded()) {
|
||||
return "";
|
||||
}
|
||||
return getString(R.string.mounts);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,10 +132,9 @@ public class PetDetailRecyclerFragment extends BaseMainFragment {
|
|||
|
||||
@Override
|
||||
public String customTitle() {
|
||||
if (isAdded()) {
|
||||
return getString(R.string.pets);
|
||||
} else {
|
||||
if (!isAdded()) {
|
||||
return "";
|
||||
}
|
||||
return getString(R.string.pets);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,10 +88,9 @@ public class StableFragment extends BaseMainFragment {
|
|||
|
||||
@Override
|
||||
public String customTitle() {
|
||||
if (isAdded()) {
|
||||
return getString(R.string.sidebar_stable);
|
||||
} else {
|
||||
if (!isAdded()) {
|
||||
return "";
|
||||
}
|
||||
return getString(R.string.sidebar_stable);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -201,6 +201,10 @@ public class SkillsFragment extends BaseMainFragment {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String customTitle() { return getString(R.string.sidebar_skills); }
|
||||
|
||||
public String customTitle() {
|
||||
if (!isAdded()) {
|
||||
return "";
|
||||
}
|
||||
return getString(R.string.sidebar_skills);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,8 +53,6 @@ public class GroupInformationFragment extends BaseFragment {
|
|||
@Nullable
|
||||
private User user;
|
||||
private QuestContent quest;
|
||||
private ValueBar bossHpBar;
|
||||
private ValueBar bossRageBar;
|
||||
|
||||
public GroupInformationFragment() {
|
||||
|
||||
|
|
@ -90,9 +88,6 @@ public class GroupInformationFragment extends BaseFragment {
|
|||
|
||||
unbinder = ButterKnife.bind(this, view);
|
||||
|
||||
bossHpBar = (ValueBar) view.findViewById(R.id.bossHpBar);
|
||||
bossRageBar = (ValueBar) view.findViewById(R.id.bossRageBar);
|
||||
|
||||
if (this.group == null) {
|
||||
QrCodeManager qrCodeManager = new QrCodeManager(userRepository, this.getContext());
|
||||
qrCodeManager.setUpView(qrLayout);
|
||||
|
|
@ -151,17 +146,6 @@ public class GroupInformationFragment extends BaseFragment {
|
|||
return;
|
||||
}
|
||||
|
||||
boolean showHpBar = (quest.boss != null && quest.boss.hp > 0);
|
||||
bossHpBar.setVisibility(showHpBar ? View.VISIBLE : View.GONE);
|
||||
if (showHpBar) {
|
||||
bossHpBar.set(group.quest.getProgress().hp, quest.boss.hp);
|
||||
}
|
||||
boolean showRageBar = (quest.boss != null && quest.boss.rage_value > 0);
|
||||
bossRageBar.setVisibility(showRageBar ? View.VISIBLE : View.GONE);
|
||||
if (showRageBar) {
|
||||
bossHpBar.set(group.quest.getProgress().rage, quest.boss.rage_value);
|
||||
}
|
||||
|
||||
if (group.quest.members == null) {
|
||||
viewBinding.setHideParticipantCard(true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -258,10 +258,9 @@ public class GuildFragment extends BaseMainFragment implements Action1<Group> {
|
|||
|
||||
@Override
|
||||
public String customTitle() {
|
||||
if (isAdded()) {
|
||||
return getString(R.string.guild);
|
||||
} else {
|
||||
if (!isAdded()) {
|
||||
return "";
|
||||
}
|
||||
return getString(R.string.guild);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -211,10 +211,9 @@ public class InboxFragment extends BaseMainFragment
|
|||
|
||||
@Override
|
||||
public String customTitle() {
|
||||
if (isAdded()) {
|
||||
return getString(R.string.sidebar_inbox);
|
||||
} else {
|
||||
if (!isAdded()) {
|
||||
return "";
|
||||
}
|
||||
return getString(R.string.sidebar_inbox);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -120,10 +120,9 @@ public class PublicGuildsFragment extends BaseMainFragment implements SearchView
|
|||
|
||||
@Override
|
||||
public String customTitle() {
|
||||
if (isAdded()) {
|
||||
return getString(R.string.public_guilds);
|
||||
} else {
|
||||
if (!isAdded()) {
|
||||
return "";
|
||||
}
|
||||
return getString(R.string.public_guilds);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -159,10 +159,9 @@ public class TavernFragment extends BaseMainFragment {
|
|||
|
||||
@Override
|
||||
public String customTitle() {
|
||||
if (isAdded()) {
|
||||
return getString(R.string.sidebar_tavern);
|
||||
} else {
|
||||
if (!isAdded()) {
|
||||
return "";
|
||||
}
|
||||
return getString(R.string.sidebar_tavern);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,6 +130,9 @@ public class ChallengeListFragment extends BaseMainFragment implements SwipeRefr
|
|||
|
||||
@Override
|
||||
public String customTitle() {
|
||||
if (!isAdded()) {
|
||||
return "";
|
||||
}
|
||||
return getString(R.string.sidebar_challenges);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -126,6 +126,9 @@ public class ChallengesOverviewFragment extends BaseMainFragment {
|
|||
|
||||
@Override
|
||||
public String customTitle() {
|
||||
if (!isAdded()) {
|
||||
return "";
|
||||
}
|
||||
return getString(R.string.challenges);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.habitrpg.android.habitica.ui.fragments.social.party;
|
|||
|
||||
import android.app.AlertDialog;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.widget.SwipeRefreshLayout;
|
||||
import android.view.LayoutInflater;
|
||||
|
|
@ -9,7 +10,6 @@ import android.view.View;
|
|||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ListView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.facebook.drawee.view.SimpleDraweeView;
|
||||
|
|
@ -32,11 +32,15 @@ import com.habitrpg.android.habitica.ui.helpers.DataBindingUtils;
|
|||
import com.habitrpg.android.habitica.ui.helpers.MarkdownParser;
|
||||
import com.habitrpg.android.habitica.ui.views.social.QuestProgressView;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.OnClick;
|
||||
import rx.Observable;
|
||||
import rx.android.schedulers.AndroidSchedulers;
|
||||
|
||||
|
||||
public class PartyDetailFragment extends BaseFragment {
|
||||
|
|
@ -146,9 +150,10 @@ public class PartyDetailFragment extends BaseFragment {
|
|||
newQuestButton.setVisibility(View.GONE);
|
||||
questDetailButton.setVisibility(View.VISIBLE);
|
||||
questImageWrapper.setVisibility(View.VISIBLE);
|
||||
getActivity().runOnUiThread(() -> inventoryRepository.getQuestContent(quest.getKey())
|
||||
Handler mainHandler = new Handler(getContext().getMainLooper());
|
||||
mainHandler.postDelayed(() -> inventoryRepository.getQuestContent(quest.getKey())
|
||||
.first()
|
||||
.subscribe(this::updateQuestContent, RxErrorHandler.handleEmptyError()));
|
||||
.subscribe(PartyDetailFragment.this::updateQuestContent, RxErrorHandler.handleEmptyError()), 500);
|
||||
} else {
|
||||
newQuestButton.setVisibility(View.VISIBLE);
|
||||
questDetailButton.setVisibility(View.GONE);
|
||||
|
|
@ -186,9 +191,10 @@ public class PartyDetailFragment extends BaseFragment {
|
|||
}
|
||||
|
||||
private void updateQuestContent(QuestContent questContent) {
|
||||
if (questTitleView != null) {
|
||||
questTitleView.setText(questContent.getText());
|
||||
if (questTitleView == null) {
|
||||
return;
|
||||
}
|
||||
questTitleView.setText(questContent.getText());
|
||||
DataBindingUtils.loadImage(questScrollImageView, "inventory_quest_scroll_"+questContent.getKey());
|
||||
DataBindingUtils.loadImage(questImageView, "quest_"+questContent.getKey());
|
||||
if (isQuestActive()) {
|
||||
|
|
|
|||
|
|
@ -348,11 +348,10 @@ public class PartyFragment extends BaseMainFragment {
|
|||
|
||||
@Override
|
||||
public String customTitle() {
|
||||
if (isAdded()) {
|
||||
return getString(R.string.sidebar_party);
|
||||
} else {
|
||||
if (!isAdded()) {
|
||||
return "";
|
||||
}
|
||||
return getString(R.string.sidebar_party);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,7 +68,13 @@ public class PartyMemberListFragment extends BaseFragment {
|
|||
}
|
||||
|
||||
private void refreshMembers() {
|
||||
socialRepository.retrieveGroupMembers(partyId, true).subscribe(users -> refreshLayout.setRefreshing(false), RxErrorHandler.handleEmptyError());
|
||||
socialRepository.retrieveGroupMembers(partyId, true).subscribe(users -> setRefreshing(false), RxErrorHandler.handleEmptyError());
|
||||
}
|
||||
|
||||
private void setRefreshing(boolean isRefreshing) {
|
||||
if (refreshLayout != null) {
|
||||
refreshLayout.setRefreshing(isRefreshing);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPartyId(String id) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue