mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-22 13:48:55 +00:00
fix feedback on joining/leaving guild. Fixes #511
This commit is contained in:
parent
30dda364c5
commit
af7da65c0d
2 changed files with 12 additions and 15 deletions
|
|
@ -5,8 +5,7 @@
|
|||
<item
|
||||
android:id="@+id/menu.guild.edit"
|
||||
android:orderInCategory="1"
|
||||
app:showAsAction="ifRoom"
|
||||
android:title="@string/action_edit"
|
||||
abc:showAsAction="ifRoom"/>
|
||||
app:showAsAction="never"
|
||||
android:title="@string/action_edit" />
|
||||
|
||||
</menu>
|
||||
|
|
@ -91,9 +91,11 @@ public class GuildFragment extends BaseMainFragment implements Callback<Group> {
|
|||
switch (id) {
|
||||
case R.id.menu_guild_join:
|
||||
this.mAPIHelper.apiService.joinGroup(this.guild.id, this);
|
||||
this.isMember = true;
|
||||
return true;
|
||||
case R.id.menu_guild_leave:
|
||||
this.mAPIHelper.apiService.leaveGroup(this.guild.id, this);
|
||||
this.isMember = false;
|
||||
return true;
|
||||
case R.id.menu_guild_edit:
|
||||
this.displayEditForm();
|
||||
|
|
@ -236,21 +238,17 @@ public class GuildFragment extends BaseMainFragment implements Callback<Group> {
|
|||
|
||||
@Override
|
||||
public void success(Group group, Response response) {
|
||||
if (group == null) {
|
||||
this.tabLayout.removeAllTabs();
|
||||
return;
|
||||
}
|
||||
this.guild = group;
|
||||
if (group != null) {
|
||||
if (this.guildInformationFragment != null) {
|
||||
this.guildInformationFragment.setGroup(group);
|
||||
}
|
||||
|
||||
if (this.guildInformationFragment != null) {
|
||||
this.guildInformationFragment.setGroup(group);
|
||||
}
|
||||
if (this.chatListFragment != null) {
|
||||
this.chatListFragment.seenGroupId = group.id;
|
||||
}
|
||||
|
||||
if (this.chatListFragment != null) {
|
||||
this.chatListFragment.seenGroupId = group.id;
|
||||
this.guild = group;
|
||||
}
|
||||
|
||||
this.guild = group;
|
||||
this.activity.supportInvalidateOptionsMenu();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue