diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 0000000..6aa10e9
--- /dev/null
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml
new file mode 100644
index 0000000..3b31283
--- /dev/null
+++ b/.idea/inspectionProfiles/profiles_settings.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/pmv02/ppr/yuichi10/github/com/joinevents/Home.java b/app/src/main/java/pmv02/ppr/yuichi10/github/com/joinevents/Home.java
index 6098bcd..a88e472 100644
--- a/app/src/main/java/pmv02/ppr/yuichi10/github/com/joinevents/Home.java
+++ b/app/src/main/java/pmv02/ppr/yuichi10/github/com/joinevents/Home.java
@@ -1,22 +1,59 @@
package pmv02.ppr.yuichi10.github.com.joinevents;
import android.app.Activity;
+import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.ListAdapter;
+import android.widget.ListView;
import android.widget.TextView;
+import java.util.List;
+
/**
* Created by yuichi on 8/20/15.
*/
-public class Home extends Activity{
+public class Home extends Activity {
+ ArrayAdapter adapter;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.home);
Log.d("Intent", "success");
Intent intent = getIntent();
+ adapter = new ArrayAdapter(this, R.layout.colmun_home_list);
+ getGroups();
+ ListView listView = (ListView)this.findViewById(R.id.homeList);
+ getListMountHeight(listView);
+ listView.setAdapter(adapter);
+ }
+
+ public void getListMountHeight(ListView lv){
+ ListAdapter la = lv.getAdapter();
+ if (la == null)
+ {
+ return;
+ }
+ int height = 0;
+
+ for(int i=0; i < la.getCount(); i++){
+ View item = la.getView(i, null, lv);
+ item.measure(0,0);
+ height += item.getHeight();
+ }
+ ViewGroup.LayoutParams p = lv.getLayoutParams();
+ p.height = height + (lv.getDividerHeight() * (la.getCount() - 1));
+ lv.setLayoutParams(p);
+ }
- TextView tv = (TextView)findViewById(R.id.homeText);
+ //get groups from server
+ public void getGroups(){
+ for(int i=0; i < 10; ++i){
+ adapter.add("aaaaaaa" + i);
+ }
}
}
diff --git a/app/src/main/res/layout/colmun_home_list b/app/src/main/res/layout/colmun_home_list
new file mode 100644
index 0000000..f617591
--- /dev/null
+++ b/app/src/main/res/layout/colmun_home_list
@@ -0,0 +1,7 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/home.xml b/app/src/main/res/layout/home.xml
index 4e4bc94..9026b46 100644
--- a/app/src/main/res/layout/home.xml
+++ b/app/src/main/res/layout/home.xml
@@ -3,10 +3,21 @@
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
-
+
+
+
+
+
+
\ No newline at end of file