Advertisement
Guest User

Untitled

a guest
Aug 4th, 2015
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.70 KB | None | 0 0
  1. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  2. xmlns:tools="http://schemas.android.com/tools"
  3. android:layout_width="match_parent"
  4. android:layout_height="match_parent"
  5. android:orientation="horizontal"
  6. android:weightSum="1"
  7. tools:background="@color/black"
  8. android:id="@+id/dotw_list">
  9.  
  10. <ImageButton
  11. android:id="@+id/dotw_imageButton_1"
  12. android:layout_width="60dp"
  13. android:layout_height="60dp"
  14. android:layout_marginBottom="10dp"
  15. android:layout_marginLeft="10dp"
  16. android:layout_marginRight="10dp"
  17. android:layout_marginTop="10dp"
  18. android:adjustViewBounds="false"
  19. android:background="@drawable/layout_bg"
  20. android:padding="5dp"
  21. android:scaleType="centerInside"/>
  22.  
  23. <ImageButton
  24. android:id="@+id/dotw_imageButton_2"
  25. android:layout_width="60dp"
  26. android:layout_height="60dp"
  27. android:layout_marginBottom="10dp"
  28. android:layout_marginRight="10dp"
  29. android:layout_marginTop="10dp"
  30. android:adjustViewBounds="false"
  31. android:background="@drawable/layout_bg"
  32. android:padding="10dp"
  33. android:scaleType="centerInside"/>
  34.  
  35. <ImageButton
  36. android:id="@+id/dotw_imageButton_3"
  37. android:layout_width="60dp"
  38. android:layout_height="60dp"
  39. android:layout_marginBottom="10dp"
  40. android:layout_marginRight="10dp"
  41. android:layout_marginTop="10dp"
  42. android:adjustViewBounds="false"
  43. android:background="@drawable/layout_bg"
  44. android:padding="10dp"
  45. android:scaleType="centerInside"/>
  46.  
  47. <ImageButton
  48. android:id="@+id/dotw_imageButton_4"
  49. android:layout_width="60dp"
  50. android:layout_height="60dp"
  51. android:layout_marginBottom="10dp"
  52. android:layout_marginRight="10dp"
  53. android:layout_marginTop="10dp"
  54. android:adjustViewBounds="false"
  55. android:background="@drawable/layout_bg"
  56. android:padding="10dp"
  57. android:scaleType="centerInside"/>
  58.  
  59. <ImageButton
  60. android:id="@+id/dotw_imageButton_5"
  61. android:layout_width="60dp"
  62. android:layout_height="60dp"
  63. android:layout_marginBottom="10dp"
  64. android:layout_marginRight="10dp"
  65. android:layout_marginTop="10dp"
  66. android:adjustViewBounds="false"
  67. android:background="@drawable/layout_bg"
  68. android:padding="10dp"
  69. android:scaleType="centerInside"/>
  70. </LinearLayout>
  71.  
  72. private BroadcastReceiver mMessageReceiver = new BroadcastReceiver() {
  73. @Override
  74. public void onReceive(Context context, Intent intent) {
  75.  
  76. // Get extra data included in the Intent
  77. String message = intent.getStringExtra("network_response");
  78. Log.d("receiver", "Got message: " + message);
  79.  
  80. home = data.getHomeItem();
  81.  
  82.  
  83. try {
  84. for (int i = 0; i < home.dotwItemArray.size(); i++) {
  85. System.out.println("Size of DOTW Array for the home screen is " + home.dotwItemArray.size());
  86.  
  87. DotwItem dotwItem = home.dotwItemArray.get(i);
  88.  
  89. if (i == 0) {
  90. request.getImage(dotwItem.getThumbnailImageUrl(), button_dotw_1);
  91. System.out.println("dotwItem1 is set");
  92. }
  93. if (i == 1) {
  94. request.getImage(dotwItem.getThumbnailImageUrl(), button_dotw_2);
  95. System.out.println("dotwItem2 is set");
  96. }
  97. if (i == 2) {
  98. request.getImage(dotwItem.getThumbnailImageUrl(), button_dotw_3);
  99. System.out.println("dotwItem3 is set");
  100. }
  101. if (i == 3) {
  102. request.getImage(dotwItem.getThumbnailImageUrl(), button_dotw_4);
  103. System.out.println("dotwItem4 is set");
  104. }
  105. }
  106.  
  107. } catch (Exception e) {
  108. System.out.println("Error is: " + e + " - Exception is it: " + e.getStackTrace()[2].getLineNumber());
  109.  
  110. }
  111. }
  112. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement