|
@@ -1,25 +1,37 @@
|
|
|
package app.mar.activities;
|
|
|
|
|
|
+import android.annotation.SuppressLint;
|
|
|
import android.app.Activity;
|
|
|
+import android.content.Intent;
|
|
|
+import android.graphics.Color;
|
|
|
+import android.graphics.Typeface;
|
|
|
+import android.support.v7.app.ActionBar;
|
|
|
+import android.support.v7.app.AppCompatActivity;
|
|
|
import android.os.Bundle;
|
|
|
+import android.os.Handler;
|
|
|
+import android.util.Log;
|
|
|
+import android.view.MotionEvent;
|
|
|
+import android.view.View;
|
|
|
+import android.view.ViewGroup;
|
|
|
+import android.widget.AdapterView;
|
|
|
+import android.widget.ArrayAdapter;
|
|
|
+import android.widget.Button;
|
|
|
+import android.widget.LinearLayout;
|
|
|
import android.widget.ListView;
|
|
|
-
|
|
|
+import android.widget.ScrollView;
|
|
|
+import android.widget.TextView;
|
|
|
import java.util.ArrayList;
|
|
|
-
|
|
|
-import app.mar.ui.ResourceArrayAdapter;
|
|
|
-import app.mar.utils.FontChangeCrawler;
|
|
|
-import app.mar.utils.app.brest.game.Game;
|
|
|
-import app.mar.utils.app.brest.game.Resource;
|
|
|
-
|
|
|
+import java.util.List;
|
|
|
+import app.mar.ui.*;
|
|
|
+import app.mar.utils.*;
|
|
|
+import app.mar.utils.game.*;
|
|
|
/**
|
|
|
* An example full-screen activity that shows and hides the system UI (i.e.
|
|
|
* status bar and navigation/system bar) with user interaction.
|
|
|
*/
|
|
|
public class ResourceListActivity extends Activity {
|
|
|
-
|
|
|
protected Game mGame;
|
|
|
protected ListView mList;
|
|
|
-
|
|
|
/*
|
|
|
protected void addStage(ArrayList<Object> ar, int stage)
|
|
|
{
|
|
@@ -32,12 +44,9 @@ public class ResourceListActivity extends Activity {
|
|
|
b.setTextColor(Color.rgb(0x33, 0xb5, 0xe5));
|
|
|
b.setTextSize(30);
|
|
|
b.setTypeface(null, Typeface.BOLD);
|
|
|
-
|
|
|
aa = new ResourceArrayAdapter(this, android.R.layout.simple_list_item_1, ar);
|
|
|
lv.setOnItemClickListener(aa);
|
|
|
-
|
|
|
lv.setAdapter(aa);
|
|
|
-
|
|
|
nl.setOrientation(LinearLayout.VERTICAL);
|
|
|
nl.addView(b);
|
|
|
nl.addView(sv);
|
|
@@ -45,7 +54,6 @@ public class ResourceListActivity extends Activity {
|
|
|
//lv.setLayoutParams(new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT));
|
|
|
mLayout.addView(nl);
|
|
|
}
|
|
|
-
|
|
|
protected void fill()
|
|
|
{
|
|
|
if(mGame!=null)
|
|
@@ -55,8 +63,6 @@ public class ResourceListActivity extends Activity {
|
|
|
addStage(resources.get(i), i);
|
|
|
}
|
|
|
}*/
|
|
|
-
|
|
|
-
|
|
|
protected void fill()
|
|
|
{
|
|
|
if(mGame!=null)
|
|
@@ -64,29 +70,23 @@ public class ResourceListActivity extends Activity {
|
|
|
ArrayList< ArrayList<Resource> > resources = mGame.getResourceByStage();
|
|
|
ArrayList<Object> obs = new ArrayList<Object>();
|
|
|
for(int i = 0; i< resources.size(); i++) {
|
|
|
- //obs.add("Étape "+i);
|
|
|
+ obs.add("Étape "+i);
|
|
|
for(int j=0; j<resources.get(i).size(); j++)
|
|
|
obs.add(resources.get(i).get(j));
|
|
|
}
|
|
|
ResourceArrayAdapter aa;
|
|
|
- aa = new ResourceArrayAdapter(this, R.layout.array_layout, obs);
|
|
|
-
|
|
|
- mList.setAdapter(aa);
|
|
|
+ aa = new ResourceArrayAdapter(this, android.R.layout.simple_list_item_1, obs);
|
|
|
mList.setOnItemClickListener(aa);
|
|
|
+ mList.setAdapter(aa);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
@Override
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
super.onCreate(savedInstanceState);
|
|
|
setContentView(R.layout.activity_resource_list);
|
|
|
+ FontChangeCrawler.setFont(this);
|
|
|
mGame = (Game)getIntent().getSerializableExtra("game");
|
|
|
-
|
|
|
mList = (ListView) findViewById(R.id.list_layout);
|
|
|
fill();
|
|
|
- FontChangeCrawler.setFont(this);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-}
|
|
|
+}
|