mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-07-14 18:21:57 +00:00
remove unneeded code
This commit is contained in:
parent
21f52e89e9
commit
86c54b5e6b
6 changed files with 0 additions and 224 deletions
|
|
@ -1,37 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical" android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingLeft="24dp"
|
||||
android:paddingRight="24dp"
|
||||
android:paddingBottom="25dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Report NAME for violation:" />
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/border_1f000000"
|
||||
android:textColor="@color/gray_300"
|
||||
android:padding="@dimen/spacing_medium"
|
||||
android:text="This is the message that is reported" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/report_explanation"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/gray_200"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
|
@ -10,15 +10,11 @@ import com.habitrpg.android.habitica.models.Tag;
|
|||
import com.habitrpg.android.habitica.models.TutorialStep;
|
||||
import com.habitrpg.android.habitica.models.WorldState;
|
||||
import com.habitrpg.android.habitica.models.inventory.Customization;
|
||||
import com.habitrpg.android.habitica.models.inventory.Egg;
|
||||
import com.habitrpg.android.habitica.models.inventory.Equipment;
|
||||
import com.habitrpg.android.habitica.models.inventory.Food;
|
||||
import com.habitrpg.android.habitica.models.inventory.HatchingPotion;
|
||||
import com.habitrpg.android.habitica.models.inventory.Mount;
|
||||
import com.habitrpg.android.habitica.models.inventory.Pet;
|
||||
import com.habitrpg.android.habitica.models.inventory.Quest;
|
||||
import com.habitrpg.android.habitica.models.inventory.QuestCollect;
|
||||
import com.habitrpg.android.habitica.models.inventory.QuestContent;
|
||||
import com.habitrpg.android.habitica.models.inventory.QuestDropItem;
|
||||
import com.habitrpg.android.habitica.models.members.Member;
|
||||
import com.habitrpg.android.habitica.models.responses.FeedResponse;
|
||||
|
|
@ -47,13 +43,9 @@ import com.habitrpg.android.habitica.utils.FeedResponseDeserializer;
|
|||
import com.habitrpg.android.habitica.utils.FindUsernameResultDeserializer;
|
||||
import com.habitrpg.android.habitica.utils.GroupSerialization;
|
||||
import com.habitrpg.android.habitica.utils.MemberSerialization;
|
||||
import com.habitrpg.android.habitica.utils.MountListDeserializer;
|
||||
import com.habitrpg.android.habitica.utils.MountMapDeserializer;
|
||||
import com.habitrpg.android.habitica.utils.OwnedItemListDeserializer;
|
||||
import com.habitrpg.android.habitica.utils.OwnedMountListDeserializer;
|
||||
import com.habitrpg.android.habitica.utils.OwnedPetListDeserializer;
|
||||
import com.habitrpg.android.habitica.utils.PetListDeserializer;
|
||||
import com.habitrpg.android.habitica.utils.PetMapDeserializer;
|
||||
import com.habitrpg.android.habitica.utils.PurchasedDeserializer;
|
||||
import com.habitrpg.android.habitica.utils.QuestCollectDeserializer;
|
||||
import com.habitrpg.android.habitica.utils.QuestDeserializer;
|
||||
|
|
@ -83,10 +75,6 @@ public class GSonFactoryCreator {
|
|||
Type tutorialStepListType = new TypeToken<RealmList<TutorialStep>>() {}.getType();
|
||||
Type faqArticleListType = new TypeToken<RealmList<FAQArticle>>() {}.getType();
|
||||
Type itemDataListType = new TypeToken<RealmList<Equipment>>() {}.getType();
|
||||
Type petMapType = new TypeToken<Map<String, Pet>>() {}.getType();
|
||||
Type mountMapType = new TypeToken<Map<String, Mount>>() {}.getType();
|
||||
Type petListType = new TypeToken<RealmList<Pet>>() {}.getType();
|
||||
Type mountListType = new TypeToken<RealmList<Mount>>() {}.getType();
|
||||
Type questCollectListType = new TypeToken<RealmList<QuestCollect>>() {}.getType();
|
||||
Type chatMessageListType = new TypeToken<RealmList<ChatMessage>>() {}.getType();
|
||||
Type challengeListType = new TypeToken<List<Challenge>>() {}.getType();
|
||||
|
|
@ -111,10 +99,6 @@ public class GSonFactoryCreator {
|
|||
.registerTypeAdapter(Group.class, new GroupSerialization())
|
||||
.registerTypeAdapter(Date.class, new DateDeserializer())
|
||||
.registerTypeAdapter(itemDataListType, new EquipmentListDeserializer())
|
||||
.registerTypeAdapter(petListType, new PetListDeserializer())
|
||||
.registerTypeAdapter(mountListType, new MountListDeserializer())
|
||||
.registerTypeAdapter(petMapType, new PetMapDeserializer())
|
||||
.registerTypeAdapter(mountMapType, new MountMapDeserializer())
|
||||
.registerTypeAdapter(ChatMessage.class, new ChatMessageDeserializer())
|
||||
.registerTypeAdapter(Task.class, new TaskSerializer())
|
||||
.registerTypeAdapter(ContentResult.class, new ContentDeserializer())
|
||||
|
|
|
|||
|
|
@ -1,39 +0,0 @@
|
|||
package com.habitrpg.android.habitica.utils;
|
||||
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParseException;
|
||||
import com.habitrpg.android.habitica.models.inventory.Mount;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import io.realm.Realm;
|
||||
import io.realm.RealmList;
|
||||
|
||||
public class MountListDeserializer implements JsonDeserializer<RealmList<Mount>> {
|
||||
|
||||
@Override
|
||||
public RealmList<Mount> deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
|
||||
RealmList<Mount> vals = new RealmList<>();
|
||||
if (json.isJsonObject()) {
|
||||
|
||||
for (Map.Entry<String, JsonElement> entry : json.getAsJsonObject().entrySet()) {
|
||||
Mount mount = new Mount();
|
||||
mount.setKey(entry.getKey());
|
||||
mount.setAnimal(entry.getKey().split("-")[0]);
|
||||
mount.setColor(entry.getKey().split("-")[1]);
|
||||
vals.add(mount);
|
||||
}
|
||||
} else {
|
||||
for (JsonElement item : json.getAsJsonArray()) {
|
||||
vals.add(context.deserialize(item.getAsJsonObject(), Mount.class));
|
||||
}
|
||||
}
|
||||
|
||||
return vals;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
package com.habitrpg.android.habitica.utils;
|
||||
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParseException;
|
||||
import com.habitrpg.android.habitica.models.inventory.Mount;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import io.realm.Realm;
|
||||
|
||||
public class MountMapDeserializer implements JsonDeserializer<Map<String, Mount>> {
|
||||
@Override
|
||||
public Map<String, Mount> deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
|
||||
HashMap<String, Mount> vals = new HashMap<>();
|
||||
if (json.isJsonObject()) {
|
||||
JsonObject object = json.getAsJsonObject();
|
||||
|
||||
Realm realm = Realm.getDefaultInstance();
|
||||
List<Mount> existingItems = realm.copyFromRealm(realm.where(Mount.class).findAll());
|
||||
realm.close();
|
||||
|
||||
for (Mount mount : existingItems) {
|
||||
if (object.has(mount.getKey())) {
|
||||
vals.put(mount.getKey(), mount);
|
||||
object.remove(mount.getKey());
|
||||
}
|
||||
}
|
||||
|
||||
for (Map.Entry<String, JsonElement> entry : json.getAsJsonObject().entrySet()) {
|
||||
Mount mount;
|
||||
mount = new Mount();
|
||||
mount.setKey(entry.getKey());
|
||||
mount.setAnimal(entry.getKey().split("-")[0]);
|
||||
mount.setColor(entry.getKey().split("-")[1]);
|
||||
vals.put(mount.getKey(), mount);
|
||||
}
|
||||
}
|
||||
|
||||
return vals;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
package com.habitrpg.android.habitica.utils;
|
||||
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParseException;
|
||||
import com.habitrpg.android.habitica.models.inventory.Food;
|
||||
import com.habitrpg.android.habitica.models.inventory.Pet;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import io.realm.Realm;
|
||||
import io.realm.RealmList;
|
||||
|
||||
public class PetListDeserializer implements JsonDeserializer<RealmList<Pet>> {
|
||||
@Override
|
||||
public RealmList<Pet> deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
|
||||
RealmList<Pet> vals = new RealmList<>();
|
||||
if (json.isJsonObject()) {
|
||||
for (Map.Entry<String, JsonElement> entry : json.getAsJsonObject().entrySet()) {
|
||||
Pet pet = new Pet();
|
||||
pet.setKey(entry.getKey());
|
||||
pet.setAnimal(entry.getKey().split("-")[0]);
|
||||
pet.setColor(entry.getKey().split("-")[1]);
|
||||
vals.add(pet);
|
||||
}
|
||||
} else {
|
||||
for (JsonElement item : json.getAsJsonArray()) {
|
||||
vals.add(context.deserialize(item.getAsJsonObject(), Food.class));
|
||||
}
|
||||
}
|
||||
|
||||
return vals;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
package com.habitrpg.android.habitica.utils;
|
||||
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParseException;
|
||||
import com.habitrpg.android.habitica.models.inventory.Pet;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import io.realm.Realm;
|
||||
|
||||
public class PetMapDeserializer implements JsonDeserializer<Map<String, Pet>> {
|
||||
@Override
|
||||
public Map<String, Pet> deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
|
||||
HashMap<String, Pet> vals = new HashMap<>();
|
||||
if (json.isJsonObject()) {
|
||||
JsonObject object = json.getAsJsonObject();
|
||||
|
||||
Realm realm = Realm.getDefaultInstance();
|
||||
List<Pet> existingItems = realm.copyFromRealm(realm.where(Pet.class).findAll());
|
||||
realm.close();
|
||||
|
||||
for (Pet pet : existingItems) {
|
||||
if (object.has(pet.getKey())) {
|
||||
vals.put(pet.getKey(), pet);
|
||||
object.remove(pet.getKey());
|
||||
}
|
||||
}
|
||||
|
||||
for (Map.Entry<String, JsonElement> entry : json.getAsJsonObject().entrySet()) {
|
||||
Pet pet;
|
||||
pet = new Pet();
|
||||
pet.setKey(entry.getKey());
|
||||
pet.setAnimal(entry.getKey().split("-")[0]);
|
||||
pet.setColor(entry.getKey().split("-")[1]);
|
||||
vals.put(pet.getKey(), pet);
|
||||
}
|
||||
}
|
||||
|
||||
return vals;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue