Guest User

Untitled

a guest
Aug 6th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.09 KB | None | 0 0
  1. benefits.setOnClickListener(new View.OnClickListener() {
  2. @Override
  3. public void onClick(View v) {
  4. AlertDialog ad = new AlertDialog.Builder(Panchgavya.this).create();
  5. ad.setCancelable(false); // This blocks the 'BACK' button
  6. ad.setMessage(getString(R.string.benefits));
  7. ad.setTitle("Benefits");
  8. ad.setButton("OK", new DialogInterface.OnClickListener() {
  9. @Override
  10. public void onClick(DialogInterface dialog, int which) {
  11. dialog.dismiss();
  12. }
  13. });
  14.  
  15. ad.show();
  16. TextView textView = (TextView) ad.findViewById(android.R.id.message);
  17.  
  18. textView.setScroller(new Scroller(Panchgavya.this));
  19. textView.setVerticalScrollBarEnabled(true);
  20. textView.setMovementMethod(new ScrollingMovementMethod());
  21.  
  22.  
  23. }
  24. });
  25.  
  26. <?xml version="1.0" encoding="utf-8"?>
  27.  
  28. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  29. xmlns:app="http://schemas.android.com/apk/res-auto"
  30. xmlns:tools="http://schemas.android.com/tools"
  31. android:layout_width="match_parent"
  32. android:layout_height="match_parent"
  33. tools:context=".Design.Panchgavya"
  34. android:orientation="vertical">
  35.  
  36. <android.support.v7.widget.Toolbar
  37. android:layout_width="match_parent"
  38. android:layout_height="wrap_content"
  39. android:layout_alignParentTop="true"
  40. android:background="@color/Green"
  41. android:minHeight="?attr/actionBarSize"
  42. android:theme="@style/ThemeOverlay.AppCompat.ActionBar">
  43.  
  44. <TextView
  45. android:layout_width="wrap_content"
  46. android:layout_height="wrap_content"
  47. android:layout_gravity="center"
  48. android:text="Panchgavya"
  49. android:textColor="@color/white"/>
  50.  
  51. </android.support.v7.widget.Toolbar>
  52. <LinearLayout
  53. android:layout_width="match_parent"
  54. android:layout_height="0dp"
  55. android:layout_weight="6"
  56. android:orientation="vertical">
  57. <TextView
  58. android:layout_marginTop="10dp"
  59. android:layout_width="match_parent"
  60. android:layout_height="match_parent"
  61. android:ellipsize="end"
  62. android:text="@string/panchgavya"/>
  63. </LinearLayout>
  64. <LinearLayout
  65. android:layout_width="match_parent"
  66. android:layout_height="0dp"
  67. android:layout_weight="3"
  68. android:orientation="vertical">
  69. <TextView
  70. android:id="@+id/panchgavya_tv_cow_dung"
  71. android:layout_width="wrap_content"
  72. android:layout_height="wrap_content"
  73. android:text="Cow Dung"
  74. android:textAppearance="@style/Base.TextAppearance.AppCompat.Medium"
  75. android:textStyle="bold"
  76. android:textColor="@color/black"/>
  77. <TextView
  78. android:id="@+id/panchgavya_tv_cow_urine"
  79. android:layout_width="wrap_content"
  80. android:layout_height="wrap_content"
  81. android:layout_marginTop="5dp"
  82. android:text="Cow Urine"
  83. android:textStyle="bold"
  84. android:textAppearance="@style/Base.TextAppearance.AppCompat.Medium"
  85. android:textColor="@color/black"/>
  86. <TextView
  87. android:id="@+id/panchgavya_tv_cow_milk"
  88. android:layout_width="wrap_content"
  89. android:layout_height="wrap_content"
  90. android:layout_marginTop="5dp"
  91. android:text="Cow Milk"
  92. android:textStyle="bold"
  93. android:textAppearance="@style/Base.TextAppearance.AppCompat.Medium"
  94. android:textColor="@color/black"/>
  95. <TextView
  96. android:id="@+id/panchgavya_tv_ghee"
  97. android:layout_width="wrap_content"
  98. android:layout_height="wrap_content"
  99. android:layout_marginTop="5dp"
  100. android:textAppearance="@style/Base.TextAppearance.AppCompat.Medium"
  101. android:text="Ghee"
  102. android:textStyle="bold"
  103. android:textColor="@color/black"/>
  104. <TextView
  105. android:id="@+id/panchgavya_tv_dahi"
  106. android:layout_width="wrap_content"
  107. android:layout_height="wrap_content"
  108. android:layout_marginTop="5dp"
  109. android:textAppearance="@style/Base.TextAppearance.AppCompat.Medium"
  110. android:text="Dahi"
  111. android:textStyle="bold"
  112. android:textColor="@color/black"/>
  113. </LinearLayout>
  114.  
  115. <LinearLayout
  116. android:layout_width="match_parent"
  117. android:layout_height="0dp"
  118. android:layout_weight="1"
  119. android:orientation="vertical"
  120. android:scrollbars="vertical"
  121. android:scrollbarAlwaysDrawVerticalTrack="true">
  122. <Button
  123. android:id="@+id/panchgavya_btn_benefits"
  124. android:layout_width="match_parent"
  125. android:layout_height="match_parent"
  126. android:text="Benefits"
  127. android:background="@color/Green"
  128. android:textColor="@color/white"
  129. />
  130. </LinearLayout>
  131.  
  132.  
  133. </LinearLayout>
Add Comment
Please, Sign In to add comment