Added initial layout for Power list
This commit is contained in:
parent
5cdb4b2932
commit
9ca863a607
8 changed files with 89 additions and 45 deletions
|
@ -3,7 +3,7 @@
|
||||||
<component name="EntryPointsManager">
|
<component name="EntryPointsManager">
|
||||||
<entry_points version="2.0" />
|
<entry_points version="2.0" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" assert-keyword="true" jdk-15="true" project-jdk-name="1.7" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -86,11 +86,11 @@
|
||||||
<orderEntry type="jdk" jdkName="Android API 21 Platform" jdkType="Android SDK" />
|
<orderEntry type="jdk" jdkName="Android API 21 Platform" jdkType="Android SDK" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
<orderEntry type="library" exported="" name="appcompat-v7-21.0.3" level="project" />
|
<orderEntry type="library" exported="" name="appcompat-v7-21.0.3" level="project" />
|
||||||
<orderEntry type="library" exported="" name="recyclerview-v7-22.0.0" level="project" />
|
|
||||||
<orderEntry type="library" exported="" name="support-v4-22.0.0" level="project" />
|
<orderEntry type="library" exported="" name="support-v4-22.0.0" level="project" />
|
||||||
<orderEntry type="library" exported="" name="snackbar-2.10.6" level="project" />
|
<orderEntry type="library" exported="" name="snackbar-2.10.6" level="project" />
|
||||||
<orderEntry type="library" exported="" name="cardview-v7-21.0.3" level="project" />
|
|
||||||
<orderEntry type="library" exported="" name="support-annotations-22.0.0" level="project" />
|
<orderEntry type="library" exported="" name="support-annotations-22.0.0" level="project" />
|
||||||
|
<orderEntry type="library" exported="" name="cardview-v7-21.0.3" level="project" />
|
||||||
|
<orderEntry type="library" exported="" name="recyclerview-v7-22.0.0" level="project" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.kauron.dungeonmanager;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
|
||||||
|
class AttackAdapter extends ArrayAdapter<Power> {
|
||||||
|
AttackAdapter(Context context, Power[] powers) {
|
||||||
|
super(context, R.layout.attack_row, powers);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View getView(int position, View convertView, ViewGroup parent) {
|
||||||
|
LayoutInflater mInflater = LayoutInflater.from(getContext());
|
||||||
|
View mView = mInflater.inflate(R.layout.attack_row, parent, false);
|
||||||
|
|
||||||
|
Power attack = getItem(position);
|
||||||
|
return mView;
|
||||||
|
}
|
||||||
|
}
|
|
@ -9,6 +9,7 @@ import android.graphics.PorterDuff;
|
||||||
import android.support.v7.app.ActionBarActivity;
|
import android.support.v7.app.ActionBarActivity;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
|
import android.support.v7.widget.Toolbar;
|
||||||
import android.text.InputType;
|
import android.text.InputType;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
@ -22,7 +23,7 @@ import android.widget.TextView;
|
||||||
import com.nispok.snackbar.Snackbar;
|
import com.nispok.snackbar.Snackbar;
|
||||||
import com.nispok.snackbar.SnackbarManager;
|
import com.nispok.snackbar.SnackbarManager;
|
||||||
|
|
||||||
public class MainActivity extends ActionBarActivity{
|
public class MainActivity extends ActionBarActivity {
|
||||||
|
|
||||||
public static final int CURRENT_PG = 1, NULL = 0;
|
public static final int CURRENT_PG = 1, NULL = 0;
|
||||||
|
|
||||||
|
@ -35,11 +36,14 @@ public class MainActivity extends ActionBarActivity{
|
||||||
private Button pgCurrent;
|
private Button pgCurrent;
|
||||||
private TextView currentPg, currentXp, currentCurativeEfforts, lvl;
|
private TextView currentPg, currentXp, currentCurativeEfforts, lvl;
|
||||||
private SharedPreferences p;
|
private SharedPreferences p;
|
||||||
|
private Toolbar toolbar;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
|
|
||||||
p = getSharedPreferences("basics", MODE_PRIVATE);
|
p = getSharedPreferences("basics", MODE_PRIVATE);
|
||||||
|
|
|
@ -1,15 +1,23 @@
|
||||||
<FrameLayout
|
<LinearLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_marginBottom="@dimen/activity_vertical_margin"
|
|
||||||
android:layout_marginTop="@dimen/activity_vertical_margin"
|
|
||||||
android:layout_marginLeft="@dimen/activity_horizontal_margin"
|
|
||||||
android:layout_marginRight="@dimen/activity_horizontal_margin"
|
|
||||||
tools:context=".MainActivity">
|
tools:context=".MainActivity">
|
||||||
|
<android.support.v7.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
android:minHeight="?attr/actionBarSize"
|
||||||
|
android:background="@color/primary"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
</android.support.v7.widget.Toolbar>
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
|
android:layout_marginBottom="@dimen/activity_vertical_margin"
|
||||||
|
android:layout_marginTop="@dimen/activity_vertical_margin"
|
||||||
|
android:layout_marginLeft="@dimen/activity_horizontal_margin"
|
||||||
|
android:layout_marginRight="@dimen/activity_horizontal_margin"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
@ -402,4 +410,4 @@
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</FrameLayout>
|
</LinearLayout>
|
|
@ -1,4 +1,4 @@
|
||||||
<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"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
@ -9,45 +9,22 @@
|
||||||
tools:context="com.kauron.dungeonmanager.Welcome"
|
tools:context="com.kauron.dungeonmanager.Welcome"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/new_character"
|
||||||
|
android:id="@+id/newCharacter"
|
||||||
|
android:onClick="onNewClick"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_alignParentEnd="true" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/load_character"
|
android:text="@string/load_character"
|
||||||
android:id="@+id/loadCharacter"
|
android:id="@+id/loadCharacter"
|
||||||
android:onClick="onLoadClick"
|
android:onClick="onLoadClick"
|
||||||
android:layout_below="@+id/relativeLayout"
|
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
android:layout_alignParentStart="true" />
|
android:layout_alignParentStart="true" />
|
||||||
|
|
||||||
<RelativeLayout
|
</LinearLayout>
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:elevation="3dp"
|
|
||||||
android:id="@+id/relativeLayout"
|
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_alignParentEnd="true">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
|
||||||
android:text="Medium Text"
|
|
||||||
android:id="@+id/textView"
|
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:layout_alignParentStart="true" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/new_character"
|
|
||||||
android:id="@+id/newCharacter"
|
|
||||||
android:onClick="onNewClick"
|
|
||||||
android:layout_below="@+id/textView"
|
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_alignParentEnd="true" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
33
app/src/main/res/layout/attack_row.xml
Normal file
33
app/src/main/res/layout/attack_row.xml
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="fill_parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
tools:text="Name"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
|
android:id="@+id/name" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
tools:text="Extra info"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
|
android:id="@+id/extra" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
tools:image="@drawable/delete"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/imageView" />
|
||||||
|
</LinearLayout>
|
|
@ -1,7 +1,7 @@
|
||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<!-- Base application theme. -->
|
<!-- Base application theme. -->
|
||||||
<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
|
<style name="AppTheme" parent="Theme.AppCompat.NoActionBar">
|
||||||
<!-- Customize your theme here. -->
|
<!-- Customize your theme here. -->
|
||||||
<item name="colorPrimaryDark">@color/primary_dark</item>
|
<item name="colorPrimaryDark">@color/primary_dark</item>
|
||||||
<item name="colorPrimary">@color/primary</item>
|
<item name="colorPrimary">@color/primary</item>
|
||||||
|
|
Reference in a new issue