Added initial layout for Power list
This commit is contained in:
parent
5cdb4b2932
commit
9ca863a607
8 changed files with 89 additions and 45 deletions
|
@ -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.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.text.InputType;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
|
@ -22,7 +23,7 @@ import android.widget.TextView;
|
|||
import com.nispok.snackbar.Snackbar;
|
||||
import com.nispok.snackbar.SnackbarManager;
|
||||
|
||||
public class MainActivity extends ActionBarActivity{
|
||||
public class MainActivity extends ActionBarActivity {
|
||||
|
||||
public static final int CURRENT_PG = 1, NULL = 0;
|
||||
|
||||
|
@ -35,11 +36,14 @@ public class MainActivity extends ActionBarActivity{
|
|||
private Button pgCurrent;
|
||||
private TextView currentPg, currentXp, currentCurativeEfforts, lvl;
|
||||
private SharedPreferences p;
|
||||
private Toolbar toolbar;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
p = getSharedPreferences("basics", MODE_PRIVATE);
|
||||
|
|
Reference in a new issue