Advertisement
Guest User

Untitled

a guest
May 2nd, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.76 KB | None | 0 0
  1. <TableRow
  2. android:layout_width="wrap_content"
  3. android:layout_height="wrap_content"
  4. android:layout_marginLeft="10dp"
  5. android:layout_marginRight="10dp"
  6. android:layout_marginTop="10dp">
  7.  
  8. <Button
  9. android:id="@+id/button4"
  10. android:layout_width="match_parent"
  11. android:text="@string/r1960"
  12. android:textColor="#ffffff"
  13. android:textSize="@dimen/loptatext"
  14. android:shadowColor="#000000"
  15. android:shadowRadius="7"
  16. android:layout_weight="1"
  17. android:background="@drawable/tlacitko_stav" />
  18.  
  19. <Button
  20. android:id="@+id/button5"
  21. android:layout_width="match_parent"
  22. android:text="@string/r1964"
  23. android:textColor="#ffffff"
  24. android:textSize="@dimen/loptatext"
  25. android:shadowColor="#000000"
  26. android:shadowRadius="7"
  27. android:layout_weight="1"
  28. android:background="@drawable/tlacitko_stav" />
  29.  
  30. <Button
  31. android:id="@+id/button6"
  32. android:layout_width="match_parent"
  33. android:text="@string/r1968"
  34. android:textColor="#ffffff"
  35. android:textSize="@dimen/loptatext"
  36. android:shadowColor="#000000"
  37. android:shadowRadius="7"
  38. android:layout_weight="1"
  39. android:background="@drawable/tlacitko_stav" />
  40.  
  41. <Button
  42. android:id="@+id/button7"
  43. android:layout_width="match_parent"
  44. android:text="@string/r1972"
  45. android:textColor="#ffffff"
  46. android:textSize="@dimen/loptatext"
  47. android:shadowColor="#000000"
  48. android:shadowRadius="7"
  49. android:layout_weight="1"
  50. android:background="@drawable/tlacitko_stav" />
  51. </TableRow>
  52.  
  53. public class SquareButton extends Button {
  54. public SquareButton(Context context) {
  55. super(context);
  56. }
  57.  
  58. public SquareButton(Context context, AttributeSet attrs) {
  59. super(context, attrs);
  60. }
  61.  
  62. public SquareButton(Context context, AttributeSet attrs, int defStyleAttr) {
  63. super(context, attrs, defStyleAttr);
  64. }
  65.  
  66. @TargetApi(Build.VERSION_CODES.LOLLIPOP)
  67. public SquareButton(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
  68. super(context, attrs, defStyleAttr, defStyleRes);
  69. }
  70.  
  71. @Override
  72. protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
  73. int size = Math.min(widthMeasureSpec, heightMeasureSpec);
  74. super.onMeasure(size, size);
  75. }
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement