Commit c72c2884 authored by Kevin Whitaker's avatar Kevin Whitaker

Update gradle and realm to latest versions.

parent cd4820e1
......@@ -5,7 +5,7 @@
<GradleProjectSettings>
<option name="distributionType" value="LOCAL" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleHome" value="$APPLICATION_HOME_DIR$/gradle/gradle-2.10" />
<option name="gradleHome" value="$APPLICATION_HOME_DIR$/gradle/gradle-2.14.1" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
......
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
}
}
apply plugin: 'com.android.application'
apply plugin: 'realm-android'
repositories {
jcenter()
......@@ -39,7 +32,6 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'io.realm:realm-android:0.87.0'
compile 'uk.co.chrisjenx:calligraphy:2.0.2'
compile 'com.android.support:recyclerview-v7:22.0.+'
compile 'com.android.support:cardview-v7:22.0.+'
......
......@@ -55,9 +55,9 @@ public class CampaignAdapter extends RecyclerView.Adapter<CampaignViewHolder> {
}
MiceAndMysticsApplication.getRealmInstance().beginTransaction();
for(Achievement achievement:campaign.getPartyStoryAchievements()) {
achievement.removeFromRealm();
achievement.deleteFromRealm();
}
campaign.removeFromRealm();
campaign.deleteFromRealm();
MiceAndMysticsApplication.getRealmInstance().commitTransaction();
fullRefresh();
}
......
......@@ -88,17 +88,17 @@ public class CampaignDetailsAdapter extends RecyclerView.Adapter<RecyclerView.Vi
public static void removeCharacterFromDB(Character character) {
removeItemsAndAbilities(character);
MiceAndMysticsApplication.getRealmInstance().beginTransaction();
character.removeFromRealm();
character.deleteFromRealm();
MiceAndMysticsApplication.getRealmInstance().commitTransaction();
}
private static void removeItemsAndAbilities(Character character) {
MiceAndMysticsApplication.getRealmInstance().beginTransaction();
for(Ability ability:character.getAbilities()) {
ability.removeFromRealm();
ability.deleteFromRealm();
}
for(BackpackItem item:character.getStoredItems()) {
item.removeFromRealm();
item.deleteFromRealm();
}
MiceAndMysticsApplication.getRealmInstance().commitTransaction();
}
......@@ -115,7 +115,7 @@ public class CampaignDetailsAdapter extends RecyclerView.Adapter<RecyclerView.Vi
public void removeAchievement(Achievement achievement) {
MiceAndMysticsApplication.getRealmInstance().beginTransaction();
achievement.removeFromRealm();
achievement.deleteFromRealm();
MiceAndMysticsApplication.getRealmInstance().commitTransaction();
fullRefresh();
}
......
......@@ -92,7 +92,7 @@ public class CharacterDetailsAdapter extends RecyclerView.Adapter<RecyclerView.V
public void removeItem(String itemUuid) {
BackpackItem item = MiceAndMysticsApplication.getRealmInstance().where(BackpackItem.class).equalTo("uuid",itemUuid).findFirst();
MiceAndMysticsApplication.getRealmInstance().beginTransaction();
item.removeFromRealm();
item.deleteFromRealm();
MiceAndMysticsApplication.getRealmInstance().commitTransaction();
notifyDataSetChanged();
}
......@@ -100,7 +100,7 @@ public class CharacterDetailsAdapter extends RecyclerView.Adapter<RecyclerView.V
public void removeAbility(String abilityUuid) {
Ability ability = MiceAndMysticsApplication.getRealmInstance().where(Ability.class).equalTo("uuid",abilityUuid).findFirst();
MiceAndMysticsApplication.getRealmInstance().beginTransaction();
ability.removeFromRealm();
ability.deleteFromRealm();
MiceAndMysticsApplication.getRealmInstance().commitTransaction();
notifyDataSetChanged();
}
......
......@@ -61,7 +61,7 @@ public class PlayerManagerAdapter extends RecyclerView.Adapter<PlayerViewHolder>
CampaignDetailsAdapter.removeCharacterFromDB((Character) iter.next());
}
MiceAndMysticsApplication.getRealmInstance().beginTransaction();
MiceAndMysticsApplication.getRealmInstance().where(Player.class).equalTo("playerName", playerName).findFirst().removeFromRealm();
MiceAndMysticsApplication.getRealmInstance().where(Player.class).equalTo("playerName", playerName).findFirst().deleteFromRealm();
MiceAndMysticsApplication.getRealmInstance().commitTransaction();
notifyDataSetChanged();
}
......@@ -81,7 +81,7 @@ public class PlayerManagerAdapter extends RecyclerView.Adapter<PlayerViewHolder>
@Override
public void onClick(DialogInterface dialogInterface, int i) {
MiceAndMysticsApplication.getRealmInstance().beginTransaction();
MiceAndMysticsApplication.getRealmInstance().where(Player.class).equalTo("playerName",playerName).findFirst().removeFromRealm();
MiceAndMysticsApplication.getRealmInstance().where(Player.class).equalTo("playerName",playerName).findFirst().deleteFromRealm();
MiceAndMysticsApplication.getRealmInstance().commitTransaction();
notifyDataSetChanged();
}
......
......@@ -5,7 +5,8 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.android.tools.build:gradle:2.1.3'
classpath "io.realm:realm-gradle-plugin:1.1.1"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
......
#Wed Apr 10 15:27:10 PDT 2013
#Tue Aug 16 18:39:03 EDT 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment