mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-22 05:38:55 +00:00
fix several fragments
This commit is contained in:
parent
ebdfe62f65
commit
6ae64daaf6
9 changed files with 17 additions and 16 deletions
|
|
@ -332,7 +332,7 @@ startActivity(i);
|
|||
} else {
|
||||
JSONObject eventProperties = new JSONObject();
|
||||
try {
|
||||
eventProperties.put("eventAction", "lofin");
|
||||
eventProperties.put("eventAction", "login");
|
||||
eventProperties.put("eventCategory", "behaviour");
|
||||
eventProperties.put("hitType", "event");
|
||||
} catch (JSONException exception) {
|
||||
|
|
|
|||
|
|
@ -617,7 +617,6 @@ public class MainActivity extends BaseActivity implements HabitRPGUserCallback.O
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ public class ItemRecyclerAdapter extends RecyclerView.Adapter<ItemRecyclerAdapte
|
|||
} else {
|
||||
petKey = hatchingItem.getKey() + "-" + item.getKey();
|
||||
}
|
||||
return ownedPets.containsKey(petKey) && ownedPets.get(petKey) != null;
|
||||
return ownedPets != null && ownedPets.containsKey(petKey) && ownedPets.get(petKey) > 0;
|
||||
}
|
||||
|
||||
public void bind(Item item) {
|
||||
|
|
|
|||
|
|
@ -47,14 +47,12 @@ public class ChatRecyclerViewAdapter extends RecyclerView.Adapter<ChatRecyclerVi
|
|||
private static final int TYPE_MESSAGE = 2;
|
||||
|
||||
private List<ChatMessage> messages;
|
||||
private Context viewContext;
|
||||
private String uuid;
|
||||
private String groupId;
|
||||
private boolean isTavern;
|
||||
|
||||
public ChatRecyclerViewAdapter(List<ChatMessage> messages, Context viewContext, String uuid, String groupId, boolean isTavern) {
|
||||
public ChatRecyclerViewAdapter(List<ChatMessage> messages, String uuid, String groupId, boolean isTavern) {
|
||||
this.messages = messages;
|
||||
this.viewContext = viewContext;
|
||||
this.uuid = uuid;
|
||||
this.groupId = groupId;
|
||||
this.isTavern = isTavern;
|
||||
|
|
@ -94,7 +92,7 @@ public class ChatRecyclerViewAdapter extends RecyclerView.Adapter<ChatRecyclerVi
|
|||
View view = LayoutInflater.from(parent.getContext())
|
||||
.inflate(rLayout, parent, false);
|
||||
|
||||
return new ChatRecyclerViewHolder(view, viewType, viewContext, uuid, groupId);
|
||||
return new ChatRecyclerViewHolder(view, viewType, uuid, groupId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -174,7 +172,7 @@ public class ChatRecyclerViewAdapter extends RecyclerView.Adapter<ChatRecyclerVi
|
|||
Context context;
|
||||
Resources res;
|
||||
|
||||
public ChatRecyclerViewHolder(View itemView, int layoutType, Context viewContext, String currentUserId, String groupId) {
|
||||
public ChatRecyclerViewHolder(View itemView, int layoutType, String currentUserId, String groupId) {
|
||||
super(itemView);
|
||||
this.layoutType = layoutType;
|
||||
this.uuid = currentUserId;
|
||||
|
|
@ -182,7 +180,7 @@ public class ChatRecyclerViewAdapter extends RecyclerView.Adapter<ChatRecyclerVi
|
|||
|
||||
ButterKnife.bind(this, itemView);
|
||||
|
||||
context = viewContext;
|
||||
context = itemView.getContext();
|
||||
|
||||
res = context.getResources();
|
||||
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ public class AvatarCustomizationFragment extends BaseMainFragment {
|
|||
if (this.category != null) {
|
||||
select = select.and(Condition.column("category").eq(this.category));
|
||||
}
|
||||
if (this.type.equals("background")) {
|
||||
if (this.type != null && this.type.equals("background")) {
|
||||
select.orderBy(OrderBy.columns("customizationSetName").descending());
|
||||
} else {
|
||||
select.orderBy(true, "customizationSet");
|
||||
|
|
|
|||
|
|
@ -75,6 +75,10 @@ public class AvatarOverviewFragment extends BaseMainFragment implements AdapterV
|
|||
super.onCreateView(inflater, container, savedInstanceState);
|
||||
View v = inflater.inflate(R.layout.fragment_avatar_overview, container, false);
|
||||
|
||||
if (this.user == null) {
|
||||
return v;
|
||||
}
|
||||
|
||||
viewBinding = DataBindingUtil.bind(v);
|
||||
viewBinding.setPreferences(this.user.getPreferences());
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ public class AvatarSetupFragment extends BaseFragment {
|
|||
}
|
||||
});
|
||||
this.recyclerView.setLayoutManager(this.layoutManager);
|
||||
this.recyclerView.addItemDecoration(new MarginDecoration(this.activity));
|
||||
this.recyclerView.addItemDecoration(new MarginDecoration(getActivity()));
|
||||
|
||||
this.recyclerView.setAdapter(this.adapter);
|
||||
this.loadCustomizations();
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ public class ChatListFragment extends BaseFragment implements SwipeRefreshLayout
|
|||
mRecyclerView.setLayoutManager(layoutManager);
|
||||
}
|
||||
|
||||
ChatRecyclerViewAdapter tavernAdapter = new ChatRecyclerViewAdapter(new ArrayList<ChatMessage>(), ctx, userId, groupId, isTavern);
|
||||
ChatRecyclerViewAdapter tavernAdapter = new ChatRecyclerViewAdapter(new ArrayList<ChatMessage>(), userId, groupId, isTavern);
|
||||
|
||||
mRecyclerView.setAdapter(tavernAdapter);
|
||||
|
||||
|
|
@ -157,7 +157,7 @@ public class ChatListFragment extends BaseFragment implements SwipeRefreshLayout
|
|||
currentChatMessages = chatMessages;
|
||||
|
||||
//Load unparsed messages first
|
||||
ChatRecyclerViewAdapter tavernAdapter = new ChatRecyclerViewAdapter(chatMessages, ctx, userId, groupId, isTavern);
|
||||
ChatRecyclerViewAdapter tavernAdapter = new ChatRecyclerViewAdapter(chatMessages, userId, groupId, isTavern);
|
||||
|
||||
if(mRecyclerView != null) {
|
||||
mRecyclerView.setAdapter(tavernAdapter);
|
||||
|
|
@ -325,7 +325,7 @@ public class ChatListFragment extends BaseFragment implements SwipeRefreshLayout
|
|||
}
|
||||
|
||||
protected void onPostExecute(Void result) {
|
||||
ChatRecyclerViewAdapter tavernAdapter = new ChatRecyclerViewAdapter(chatMessages, ctx, userId, groupId, isTavern);
|
||||
ChatRecyclerViewAdapter tavernAdapter = new ChatRecyclerViewAdapter(chatMessages, userId, groupId, isTavern);
|
||||
|
||||
if(mRecyclerView != null) {
|
||||
mRecyclerView.setAdapter(tavernAdapter);
|
||||
|
|
|
|||
|
|
@ -15,13 +15,13 @@ public abstract class PlayerMinStats extends BasicStats {
|
|||
@ForeignKey(references = {@ForeignKeyReference(columnName = "trainingstats_id",
|
||||
columnType = String.class,
|
||||
foreignColumnName = "id")})
|
||||
public BasicStats training;//stats.training
|
||||
public BasicStats training;
|
||||
|
||||
@Column
|
||||
@ForeignKey(references = {@ForeignKeyReference(columnName = "buffs_id",
|
||||
columnType = String.class,
|
||||
foreignColumnName = "id")})
|
||||
public Buffs buffs;//stats.buffs
|
||||
public Buffs buffs;
|
||||
|
||||
@Column
|
||||
public int points, lvl;
|
||||
|
|
|
|||
Loading…
Reference in a new issue