|  | 
| 7 | 7 |  android:layout_height="match_parent" | 
| 8 | 8 |  tools:context="cn.intret.lab.loadingtogglebutton.MainActivity"> | 
| 9 | 9 | 
 | 
|  | 10 | + <!--toggle1--> | 
| 10 | 11 |  <cn.intret.lab.library.LoadingToggleButton | 
| 11 |  | - android:id="@+id/toggle" | 
| 12 |  | - app:layout_constraintLeft_toLeftOf="parent" | 
| 13 |  | - app:layout_constraintTop_toTopOf="parent" | 
| 14 |  | - android:layout_marginLeft="16dp" | 
| 15 |  | - android:layout_marginTop="16dp" | 
|  | 12 | + android:id="@+id/toggle1" | 
| 16 | 13 |  android:layout_width="50dp" | 
| 17 | 14 |  android:layout_height="25dp" | 
| 18 |  | - app:ltbChecked="true" | 
| 19 |  | - app:ltbBackgroundRadius="5dp" | 
| 20 |  | - app:ltbToggleRadius="4dp" | 
|  | 15 | + android:layout_marginLeft="16dp" | 
|  | 16 | + android:layout_marginTop="16dp" | 
|  | 17 | + app:layout_constraintLeft_toLeftOf="parent" | 
|  | 18 | + app:layout_constraintTop_toTopOf="parent" | 
| 21 | 19 |  app:ltbBackgroundCheckedColor="@color/colorAccent" | 
|  | 20 | + app:ltbBackgroundRadius="5dp" | 
| 22 | 21 |  app:ltbBackgroundUncheckedColor="@android:color/darker_gray" | 
|  | 22 | + | 
|  | 23 | + app:ltbChecked="true" | 
|  | 24 | + app:ltbDuration="300" | 
| 23 | 25 |  app:ltbToggleCheckedColor="@android:color/white" | 
|  | 26 | + app:ltbToggleRadius="4dp" | 
| 24 | 27 |  app:ltbToggleUncheckedColor="@android:color/white" | 
| 25 |  | - app:ltbDuration="300" | 
| 26 |  | - /> | 
|  | 28 | + /> | 
|  | 29 | + | 
|  | 30 | + <TextView | 
|  | 31 | + android:id="@+id/log1" | 
|  | 32 | + android:layout_width="wrap_content" | 
|  | 33 | + android:layout_height="wrap_content" | 
|  | 34 | + android:layout_marginLeft="16dp" | 
|  | 35 | + android:gravity="center_vertical" | 
|  | 36 | + app:layout_constraintBottom_toBottomOf="@+id/toggle1" | 
|  | 37 | + app:layout_constraintLeft_toRightOf="@+id/toggle1" | 
|  | 38 | + app:layout_constraintTop_toTopOf="@+id/toggle1" | 
|  | 39 | + tools:text="it's on"/> | 
| 27 | 40 | 
 | 
|  | 41 | + <!--toggle2--> | 
| 28 | 42 |  <cn.intret.lab.library.LoadingToggleButton | 
| 29 | 43 |  android:id="@+id/toggle2" | 
| 30 |  | - app:layout_constraintLeft_toLeftOf="parent" | 
| 31 |  | - app:layout_constraintTop_toBottomOf="@id/toggle" | 
| 32 |  | - android:layout_marginLeft="16dp" | 
| 33 |  | - android:layout_marginTop="16dp" | 
| 34 | 44 |  android:layout_width="50dp" | 
| 35 | 45 |  android:layout_height="25dp" | 
| 36 |  | - app:ltbChecked="false" | 
| 37 |  | - app:ltbBackgroundRadius="5dp" | 
| 38 |  | - app:ltbToggleRadius="4dp" | 
|  | 46 | + android:layout_marginLeft="16dp" | 
|  | 47 | + android:layout_marginTop="16dp" | 
|  | 48 | + app:layout_constraintLeft_toLeftOf="parent" | 
|  | 49 | + app:layout_constraintTop_toBottomOf="@+id/toggle1" | 
|  | 50 | + | 
| 39 | 51 |  app:ltbBackgroundCheckedColor="@color/colorAccent" | 
|  | 52 | + app:ltbBackgroundRadius="5dp" | 
| 40 | 53 |  app:ltbBackgroundUncheckedColor="@android:color/darker_gray" | 
|  | 54 | + app:ltbChecked="false" | 
|  | 55 | + app:ltbDuration="300" | 
| 41 | 56 |  app:ltbToggleCheckedColor="@android:color/white" | 
|  | 57 | + app:ltbToggleRadius="4dp" | 
| 42 | 58 |  app:ltbToggleUncheckedColor="@android:color/white" | 
| 43 |  | - app:ltbDuration="300" | 
| 44 | 59 |  /> | 
| 45 | 60 | 
 | 
| 46 | 61 |  <cn.intret.lab.library.LoadingToggleButton | 
| 47 | 62 |  android:id="@+id/toggle_round" | 
| 48 |  | - app:layout_constraintLeft_toLeftOf="parent" | 
| 49 |  | - app:layout_constraintTop_toBottomOf="@id/toggle2" | 
| 50 |  | - android:layout_marginLeft="16dp" | 
| 51 |  | - android:layout_marginTop="16dp" | 
| 52 | 63 |  android:layout_width="50dp" | 
| 53 | 64 |  android:layout_height="25dp" | 
| 54 |  | - app:ltbChecked="false" | 
|  | 65 | + android:layout_marginLeft="16dp" | 
|  | 66 | + android:layout_marginTop="16dp" | 
|  | 67 | + app:layout_constraintLeft_toLeftOf="parent" | 
|  | 68 | + app:layout_constraintTop_toBottomOf="@id/toggle2" | 
| 55 | 69 |  app:ltbBackgroundCheckedColor="@android:color/holo_purple" | 
| 56 | 70 |  app:ltbBackgroundUncheckedColor="@android:color/darker_gray" | 
|  | 71 | + app:ltbChecked="false" | 
|  | 72 | + app:ltbDuration="300" | 
| 57 | 73 |  app:ltbToggleCheckedColor="@android:color/white" | 
| 58 | 74 |  app:ltbToggleUncheckedColor="@android:color/white" | 
| 59 |  | - app:ltbDuration="300" | 
| 60 | 75 |  /> | 
| 61 | 76 | 
 | 
| 62 | 77 |  <cn.intret.lab.library.LoadingToggleButton | 
| 63 | 78 |  android:id="@+id/toggle_round2" | 
| 64 |  | - app:layout_constraintLeft_toLeftOf="parent" | 
| 65 |  | - app:layout_constraintTop_toBottomOf="@id/toggle_round" | 
| 66 |  | - android:layout_marginLeft="16dp" | 
| 67 |  | - android:layout_marginTop="16dp" | 
| 68 | 79 |  android:layout_width="50dp" | 
| 69 | 80 |  android:layout_height="25dp" | 
| 70 |  | - app:ltbChecked="true" | 
|  | 81 | + android:layout_marginLeft="16dp" | 
|  | 82 | + android:layout_marginTop="16dp" | 
|  | 83 | + app:layout_constraintLeft_toLeftOf="parent" | 
|  | 84 | + app:layout_constraintTop_toBottomOf="@id/toggle_round" | 
| 71 | 85 |  app:ltbBackgroundCheckedColor="@android:color/holo_purple" | 
| 72 | 86 |  app:ltbBackgroundUncheckedColor="@android:color/darker_gray" | 
|  | 87 | + app:ltbChecked="true" | 
| 73 | 88 | 
 | 
|  | 89 | + app:ltbDuration="300" | 
| 74 | 90 |  app:ltbToggleCheckedColor="@android:color/white" | 
| 75 |  | - app:ltbToggleUncheckedColor="@android:color/white" | 
| 76 |  | - app:ltbToggleIndicatorVisibility="show" | 
| 77 | 91 |  app:ltbToggleIndicatorHeight="8dp" | 
|  | 92 | + app:ltbToggleIndicatorVisibility="show" | 
| 78 | 93 |  app:ltbToggleIndicatorWidth="2dp" | 
| 79 |  | - app:ltbDuration="300" | 
|  | 94 | + app:ltbToggleUncheckedColor="@android:color/white" | 
| 80 | 95 |  /> | 
| 81 | 96 | 
 | 
| 82 | 97 |  <cn.intret.lab.library.LoadingToggleButton | 
| 83 | 98 |  android:id="@+id/toggle_round3" | 
| 84 |  | - app:layout_constraintLeft_toLeftOf="parent" | 
| 85 |  | - app:layout_constraintTop_toBottomOf="@id/toggle_round2" | 
| 86 |  | - android:layout_marginLeft="16dp" | 
| 87 |  | - android:layout_marginTop="16dp" | 
| 88 | 99 |  android:layout_width="50dp" | 
| 89 | 100 |  android:layout_height="25dp" | 
| 90 |  | - app:ltbChecked="true" | 
|  | 101 | + android:layout_marginLeft="16dp" | 
|  | 102 | + android:layout_marginTop="16dp" | 
|  | 103 | + app:layout_constraintLeft_toLeftOf="parent" | 
|  | 104 | + app:layout_constraintTop_toBottomOf="@id/toggle_round2" | 
| 91 | 105 |  app:ltbBackgroundCheckedColor="@android:color/holo_purple" | 
| 92 | 106 |  app:ltbBackgroundUncheckedColor="@android:color/darker_gray" | 
| 93 |  | - app:ltbToggleIndicatorVisibility="show" | 
|  | 107 | + app:ltbChecked="true" | 
|  | 108 | + app:ltbDuration="300" | 
| 94 | 109 |  app:ltbToggleCheckedColor="@android:color/white" | 
| 95 |  | - app:ltbToggleUncheckedColor="@android:color/white" | 
| 96 | 110 |  app:ltbToggleIndicatorHeight="2dp" | 
|  | 111 | + app:ltbToggleIndicatorVisibility="show" | 
| 97 | 112 |  app:ltbToggleIndicatorWidth="8dp" | 
| 98 |  | - app:ltbDuration="300" | 
|  | 113 | + app:ltbToggleUncheckedColor="@android:color/white" | 
| 99 | 114 |  /> | 
| 100 | 115 | 
 | 
| 101 | 116 | </android.support.constraint.ConstraintLayout> | 
0 commit comments