Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2014
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.18 KB | None | 0 0
  1. itemList = new ArrayList<PostList>();
  2. applianceList = (ListView)findViewById(R.id.listView1);
  3. Button add = new Button(this);
  4. add.setBackgroundResource(R.drawable.add_button);
  5. applianceList.addFooterView(add);
  6.  
  7. itemAdapter = new PostAdapterList(MainActivity.this, itemList);
  8. applianceList.setAdapter(itemAdapter);
  9.  
  10. applianceList.setOnItemClickListener(new OnItemClickListener() {
  11.  
  12. @Override
  13. public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
  14. long arg3) {
  15. // TODO Auto-generated method stub
  16. Toast.makeText(getBaseContext(), "here", Toast.LENGTH_LONG).show();
  17. }
  18. });
  19.  
  20. <?xml version="1.0" encoding="utf-8"?>
  21. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  22. android:orientation="vertical"
  23. android:layout_width="match_parent"
  24. android:layout_height="match_parent"
  25. android:background="@drawable/background"
  26. android:id="@+id/main_activity"
  27. >
  28.  
  29. <RelativeLayout
  30. android:layout_width="wrap_content"
  31. android:layout_height="wrap_content" >
  32.  
  33. <fragment
  34. android:id="@+id/fragment1"
  35. android:name="com.example.thesis.Appliance"
  36. android:layout_width="225dp"
  37. android:layout_height="225dp"
  38. android:layout_alignParentRight="true"
  39. android:layout_below="@+id/TextView01"
  40. android:layout_marginRight="25dp"
  41. android:layout_marginTop="15dp" />
  42.  
  43. <ListView
  44. android:id="@+id/listView1"
  45. android:layout_width="60dp"
  46. android:layout_height="fill_parent"
  47. android:layout_alignParentBottom="true"
  48. android:layout_alignTop="@+id/fragment1"
  49. android:layout_marginLeft="25dp"
  50. android:layout_marginRight="25dp"
  51. android:background="#3D76AD" >
  52. </ListView>
  53.  
  54. <TextView
  55. android:id="@+id/fill"
  56. android:layout_width="60dp"
  57. android:layout_height="wrap_content"
  58. android:layout_alignLeft="@+id/listView1"
  59. android:layout_below="@+id/TextView01"
  60. android:background="#3D76AD" />
  61.  
  62. <TextView
  63. android:id="@+id/fill2"
  64. android:layout_width="60dp"
  65. android:layout_height="30dp"
  66. android:layout_alignLeft="@+id/fill"
  67. android:layout_alignParentTop="true"
  68. android:background="#3D76AD" />
  69.  
  70. <TextView
  71. android:id="@+id/TextView01"
  72. android:layout_width="match_parent"
  73. android:layout_height="wrap_content"
  74. android:layout_alignParentLeft="true"
  75. android:layout_below="@+id/fill2"
  76. android:background="#3D76AD"
  77. android:paddingLeft="10dp"
  78. android:text="Profile"
  79. android:textColor="#000000"
  80. android:textSize="30dp" />
  81.  
  82. </RelativeLayout>
  83.  
  84. </LinearLayout>
  85.  
  86. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  87. android:layout_height="wrap_content"
  88. android:gravity="center"
  89. android:layout_width="wrap_content"
  90. android:paddingLeft="5dp">
  91.  
  92. <ImageView
  93. android:id="@+id/appliance_icon"
  94. android:layout_width="50dp"
  95. android:layout_height="50dp"
  96. android:layout_alignParentLeft="true"
  97. android:layout_alignParentTop="true"
  98. android:src="@drawable/defaultimage" />
  99.  
  100. </RelativeLayout>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement