Commit 9e3a796b authored by Kevin Whitaker's avatar Kevin Whitaker

Work on basic theme/style.

parent e36e497d
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectCodeStyleSettingsManager">
<option name="PER_PROJECT_SETTINGS">
<value>
<XML>
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
</XML>
</value>
</option>
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default (1)" />
</component>
</project>
\ No newline at end of file
......@@ -23,7 +23,7 @@
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.7" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.7" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
......
......@@ -86,6 +86,7 @@
<orderEntry type="jdk" jdkName="Android API 21 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="support-v4-22.0.0" level="project" />
<orderEntry type="library" exported="" name="calligraphy-2.0.2" level="project" />
<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" />
......
......@@ -40,4 +40,5 @@ dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
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'
}
......@@ -6,6 +6,7 @@
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:name=".MiceAndMysticsApplication"
android:theme="@style/AppTheme" >
<activity
android:name=".CampaignActivity"
......
package com.eyecreate.miceandmystics.miceandmystics;
import android.content.Context;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import uk.co.chrisjenx.calligraphy.CalligraphyContextWrapper;
public class CampaignActivity extends ActionBarActivity {
......@@ -12,8 +14,14 @@ public class CampaignActivity extends ActionBarActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_campaign);
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setIcon(R.mipmap.ic_launcher);
}
@Override
protected void attachBaseContext(Context newBase) {
super.attachBaseContext(CalligraphyContextWrapper.wrap(newBase));
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
......@@ -30,7 +38,7 @@ public class CampaignActivity extends ActionBarActivity {
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
if (id == R.id.action_add_campaign) {
return true;
}
......
package com.eyecreate.miceandmystics.miceandmystics;
import android.app.Application;
import uk.co.chrisjenx.calligraphy.CalligraphyConfig;
public class MiceAndMysticsApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
//TODO:init realm here
CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
.setDefaultFontPath("Eadui.ttf")
.setFontAttrId(R.attr.fontPath)
.build()
);
}
}
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout 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"
......@@ -8,9 +8,5 @@
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".CampaignActivity">
<TextView
android:text="@string/hello_world"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</RelativeLayout>
</LinearLayout>
......@@ -2,8 +2,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".CampaignActivity">
<item android:id="@+id/action_settings"
android:title="@string/action_settings"
android:orderInCategory="100"
app:showAsAction="never"/>
<item android:id="@+id/action_add_campaign"
android:title="Add Campaign"
android:icon="@android:drawable/ic_menu_add"
app:showAsAction="always"/>
</menu>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="blood_red">#940008</color>
<color name="dark_red">#630808</color>
<color name="wood_brown">#663300</color>
<color name="parchment_yellow">#FBEDBE</color>
</resources>
\ No newline at end of file
<resources>
<string name="app_name">Mice and Mystics Campaign Tracker</string>
<string name="app_name">Mice and Mystics Tracker</string>
<string name="hello_world">Hello world!</string>
<string name="action_settings">Settings</string>
</resources>
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<style name="AppTheme" parent="Theme.AppCompat">
<item name="colorPrimary">@color/blood_red</item>
<item name="colorPrimaryDark">@color/dark_red</item>
<item name="android:windowBackground">@color/wood_brown</item>
<item name="colorAccent">@color/parchment_yellow</item>
<item name="android:textColorPrimary">@color/parchment_yellow</item>
<item name="actionBarPopupTheme">@style/popupMenu</item>
</style>
<style name="popupMenu" parent="Theme.AppCompat">
<item name="android:colorBackground">@color/blood_red</item>
</style>
</resources>
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