Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.81 KB | None | 0 0
  1. <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
  2. xmlns:app="http://schemas.android.com/apk/res-auto"
  3. xmlns:tools="http://schemas.android.com/tools"
  4. android:id="@+id/drawer_layout"
  5. android:layout_width="match_parent"
  6. android:layout_height="match_parent">
  7.  
  8. <RelativeLayout
  9. android:layout_width="match_parent"
  10. android:layout_height="match_parent">
  11. <LinearLayout
  12. android:id="@+id/container_toolbar"
  13. android:layout_width="match_parent"
  14. android:layout_height="wrap_content"
  15. android:layout_gravity="top"
  16. android:orientation="vertical">
  17.  
  18. <include
  19. android:id="@+id/toolbar"
  20. layout="@layout/toolbar" />
  21. </LinearLayout>
  22.  
  23. <FrameLayout
  24. android:id="@+id/container_top"
  25. android:layout_width="match_parent"
  26. android:layout_height="wrap_content"
  27. android:layout_below="@id/container_toolbar"/>
  28. <FrameLayout
  29. android:id="@+id/container_bottom"
  30. android:layout_width="match_parent"
  31. android:layout_height="wrap_content"
  32. android:layout_below="@id/container_bottom"/>
  33. </RelativeLayout>
  34.  
  35. <fragment
  36. android:id="@+id/fragment_navigation_drawer"
  37. android:name="activity.FragmentDrawer"
  38. android:layout_width="@dimen/nav_drawer_width"
  39. android:layout_height="match_parent"
  40. android:layout_gravity="start"
  41. app:layout="@layout/fragment_navigation_drawer"
  42. tools:layout="@layout/fragment_navigation_drawer" />
  43. </android.support.v4.widget.DrawerLayout>
  44.  
  45. <?xml version="1.0" encoding="utf-8"?>
  46. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  47. android:layout_width="match_parent"
  48. android:layout_height="wrap_content"
  49. style="@style/listview_row"
  50. android:background="@drawable/border_style"
  51. android:id="@+id/calclist">
  52. <TextView
  53. android:id="@+id/date_m_d"
  54. android:text="05.23"
  55. style="@style/listview_row_left_top"
  56. />
  57. <TextView
  58. android:id="@+id/title"
  59. android:layout_below="@id/date_m_d"
  60. style="@style/listview_row_left_bottom"
  61. />
  62. <TextView
  63. android:id="@+id/value"
  64. android:layout_toRightOf="@id/date_m_d"
  65. style="@style/listview_row_right_top" />
  66. <TextView
  67. android:id="@+id/value_detail"
  68. android:layout_below="@+id/value"
  69. android:layout_toRightOf="@id/date_m_d"
  70. style="@style/listview_row_right_bottom" />
  71. <TextView
  72. android:id="@+id/value_detail2"
  73. android:layout_below="@+id/value"
  74. android:layout_toRightOf="@id/value_detail"
  75. style="@style/listview_row_right_bottom_second" />
  76. </RelativeLayout>
  77.  
  78. <style name="listview_row">
  79. <item name="android:layout_width">match_parent</item>
  80. <item name="android:layout_height">wrap_content</item>
  81. </style>
  82.  
  83. @Override
  84. public void onCreate(Bundle savedInstanceState) {
  85. if (getArguments() != null) {
  86. pID = getArguments().getInt("id");
  87. }
  88. else {
  89. throw new IllegalArgumentException("Referenced without valid id");
  90. }
  91.  
  92. String[] selectArgs = {Integer.toString(pID)};
  93. super.query = "myqueryhere";
  94. super.queryArgs = myArgs;
  95.  
  96. SimpleCursorAdapter adapter=
  97. new SimpleCursorAdapter(getActivity(), R.layout.fragment_calculations_list, current,
  98. new String[] {
  99. "fielda","fieldb", "fieldc", "fieldd", "fielde"
  100. },
  101. new int[] {R.id.date_m_d, R.id.title, R.id.value, R.id.value_detail, R.id.value_detail2},
  102. 0);
  103.  
  104. setListAdapter(adapter);
  105.  
  106. if (current==null) {
  107. db = new DatabaseHelper(getActivity().getApplicationContext(), "my.db", 1);
  108. task=new LoadCursorTask().execute();
  109. }
  110. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement