Fix lack of primary keys and start laying out more UI.
This commit is contained in:
@@ -90,5 +90,6 @@
|
||||
<orderEntry type="library" exported="" name="realm-android-0.80.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-annotations-22.0.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="appcompat-v7-22.0.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="recyclerview-v7-21.0.3" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -41,4 +41,5 @@ dependencies {
|
||||
compile 'com.android.support:appcompat-v7:22.0.0'
|
||||
compile 'io.realm:realm-android:0.80.1'
|
||||
compile 'uk.co.chrisjenx:calligraphy:2.0.2'
|
||||
compile 'com.android.support:recyclerview-v7:21.0.+'
|
||||
}
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
package="com.eyecreate.miceandmystics.miceandmystics" >
|
||||
|
||||
<application
|
||||
android:name=".MiceAndMysticsApplication"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:name=".MiceAndMysticsApplication"
|
||||
android:theme="@style/AppTheme" >
|
||||
<activity
|
||||
android:name=".CampaignActivity"
|
||||
@@ -17,6 +17,14 @@
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".CampaignDetailsActivity"
|
||||
android:label="@string/title_activity_campaign_details"
|
||||
android:parentActivityName=".CampaignActivity" >
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="com.eyecreate.miceandmystics.miceandmystics.CampaignActivity" />
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.eyecreate.miceandmystics.miceandmystics;
|
||||
|
||||
import android.support.v7.app.ActionBarActivity;
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
|
||||
|
||||
public class CampaignDetailsActivity extends ActionBarActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_campaign_details);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
// Inflate the menu; this adds items to the action bar if it is present.
|
||||
getMenuInflater().inflate(R.menu.menu_campaign_details, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle action bar item clicks here. The action bar will
|
||||
// automatically handle clicks on the Home/Up button, so long
|
||||
// as you specify a parent activity in AndroidManifest.xml.
|
||||
int id = item.getItemId();
|
||||
|
||||
//noinspection SimplifiableIfStatement
|
||||
if (id == R.id.action_settings) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.eyecreate.miceandmystics.miceandmystics.model;
|
||||
|
||||
import io.realm.RealmObject;
|
||||
import io.realm.annotations.PrimaryKey;
|
||||
|
||||
public class Ability extends RealmObject {
|
||||
@PrimaryKey
|
||||
private String abilityName;
|
||||
|
||||
public String getAbilityName() {
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.eyecreate.miceandmystics.miceandmystics.model;
|
||||
|
||||
import io.realm.RealmObject;
|
||||
import io.realm.annotations.PrimaryKey;
|
||||
|
||||
public class Achievement extends RealmObject {
|
||||
@PrimaryKey
|
||||
private String achievementName;
|
||||
|
||||
public String getAchievementName() {
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.eyecreate.miceandmystics.miceandmystics.model;
|
||||
|
||||
import io.realm.RealmObject;
|
||||
import io.realm.annotations.PrimaryKey;
|
||||
|
||||
public class BackpackItem extends RealmObject {
|
||||
//TODO:Look into seeing if it's worth hard coding these instead of manual entry.
|
||||
@PrimaryKey
|
||||
private String itemName;
|
||||
|
||||
public String getItemName() {
|
||||
|
||||
@@ -2,8 +2,11 @@ package com.eyecreate.miceandmystics.miceandmystics.model;
|
||||
|
||||
import io.realm.RealmList;
|
||||
import io.realm.RealmObject;
|
||||
import io.realm.annotations.PrimaryKey;
|
||||
|
||||
public class Campaign extends RealmObject {
|
||||
@PrimaryKey
|
||||
private String campaignName;
|
||||
private RealmList<Character> currentCharacters;
|
||||
private RealmList<Achievement> partyStoryAchievements;
|
||||
|
||||
@@ -22,4 +25,12 @@ public class Campaign extends RealmObject {
|
||||
public void setPartyStoryAchievements(RealmList<Achievement> partyStoryAchievements) {
|
||||
this.partyStoryAchievements = partyStoryAchievements;
|
||||
}
|
||||
|
||||
public String getCampaignName() {
|
||||
return campaignName;
|
||||
}
|
||||
|
||||
public void setCampaignName(String campaignName) {
|
||||
this.campaignName = campaignName;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,10 @@ package com.eyecreate.miceandmystics.miceandmystics.model;
|
||||
|
||||
import io.realm.RealmList;
|
||||
import io.realm.RealmObject;
|
||||
import io.realm.annotations.PrimaryKey;
|
||||
|
||||
public class Character extends RealmObject {
|
||||
@PrimaryKey
|
||||
private String characterName;
|
||||
private RealmList<Ability> abilities;
|
||||
private RealmList<BackpackItem> storedItems; //Not sure why I made this a list when rulebook says you can only have one xD
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.eyecreate.miceandmystics.miceandmystics.model;
|
||||
|
||||
import io.realm.RealmObject;
|
||||
import io.realm.annotations.PrimaryKey;
|
||||
|
||||
public class Player extends RealmObject {
|
||||
@PrimaryKey
|
||||
private String playerName;
|
||||
|
||||
public String getPlayerName() {
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
tools:context=".CampaignActivity">
|
||||
|
||||
<ListView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/campaign_list"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
tools:context="com.eyecreate.miceandmystics.miceandmystics.CampaignDetailsActivity">
|
||||
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -0,0 +1,9 @@
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:context="com.eyecreate.miceandmystics.miceandmystics.CampaignDetailsActivity">
|
||||
<item android:id="@+id/action_settings"
|
||||
android:title="@string/action_settings"
|
||||
android:orderInCategory="100"
|
||||
app:showAsAction="never"/>
|
||||
</menu>
|
||||
@@ -1,4 +1,8 @@
|
||||
<resources>
|
||||
<string name="app_name">Mice and Mystics Tracker</string>
|
||||
<string name="title_activity_campaign_details">CampaignDetailsActivity</string>
|
||||
|
||||
<string name="hello_world">Hello world!</string>
|
||||
<string name="action_settings">Settings</string>
|
||||
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user