diff --git a/.github/preview/sharp/CameraSwitch.gif b/.github/preview/sharp/CameraSwitch.gif new file mode 100644 index 0000000..7102937 Binary files /dev/null and b/.github/preview/sharp/CameraSwitch.gif differ diff --git a/README.md b/README.md index b703a54..19f0460 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,7 @@ _All icons have the same duration (`@android:integer/config_shortAnimTime`) and | ![](https://raw.githubusercontent.com/ozgurg/ToggleIconView/master/.github/preview/sharp/SoundOnOff.gif) | [Sharp] SoundOnOff
`og.android.lib.toggleiconview.sharp.SoundOnOff` | | ![](https://raw.githubusercontent.com/ozgurg/ToggleIconView/master/.github/preview/sharp/FlashOnOff.gif) | [Sharp] FlashOnOff
`og.android.lib.toggleiconview.sharp.FlashOnOff` | | ![](https://raw.githubusercontent.com/ozgurg/ToggleIconView/master/.github/preview/sharp/AirplaneModeOnOff.gif) | [Sharp] AirplaneModeOnOff
`og.android.lib.toggleiconview.sharp.AirplaneModeOnOff` | +| ![](https://raw.githubusercontent.com/ozgurg/ToggleIconView/master/.github/preview/sharp/CameraSwitch.gif) | [Sharp] CameraSwitch
`og.android.lib.toggleiconview.sharp.CameraSwitch` | ## How do you create your custom icon? diff --git a/lib/src/main/java/og/android/lib/toggleiconview/sharp/CameraSwitch.kt b/lib/src/main/java/og/android/lib/toggleiconview/sharp/CameraSwitch.kt new file mode 100644 index 0000000..3dd204a --- /dev/null +++ b/lib/src/main/java/og/android/lib/toggleiconview/sharp/CameraSwitch.kt @@ -0,0 +1,17 @@ +package og.android.lib.toggleiconview.sharp + +import android.content.Context +import android.util.AttributeSet +import og.android.lib.toggleiconview.R +import og.android.lib.toggleiconview.ToggleIconView + +class CameraSwitch @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null, + defStyleAttr: Int = 0 +) : + ToggleIconView( + context, attrs, defStyleAttr, + R.drawable.camera_switch, + R.drawable.camera_switch + ) diff --git a/lib/src/main/res/drawable/camera_switch.xml b/lib/src/main/res/drawable/camera_switch.xml new file mode 100644 index 0000000..5e8ce0b --- /dev/null +++ b/lib/src/main/res/drawable/camera_switch.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + diff --git a/sample/src/main/res/layout/activity_main.xml b/sample/src/main/res/layout/activity_main.xml index df3e3a8..b374574 100644 --- a/sample/src/main/res/layout/activity_main.xml +++ b/sample/src/main/res/layout/activity_main.xml @@ -187,5 +187,37 @@ + + + + + + + + + + + + + + + - \ No newline at end of file + diff --git a/shapeshifter/camera_switch.shapeshifter b/shapeshifter/camera_switch.shapeshifter new file mode 100644 index 0000000..dd33f99 --- /dev/null +++ b/shapeshifter/camera_switch.shapeshifter @@ -0,0 +1,65 @@ +{ + "version": 1, + "layers": { + "vectorLayer": { + "id": "123", + "name": "cameraswitch", + "type": "vector", + "width": 24, + "height": 24, + "children": [ + { + "id": "124", + "name": "group", + "type": "group", + "pivotX": 12, + "pivotY": 12, + "children": [ + { + "id": "851", + "name": "path1", + "type": "path", + "pathData": "M 16 7 L 15 7 L 14 6 L 10 6 L 9 7 L 8 7 C 6.9 7 6 7.9 6 9 L 6 15 C 6 16.1 6.9 17 8 17 L 16 17 C 17.1 17 18 16.1 18 15 L 18 9 C 18 7.9 17.1 7 16 7 Z M 12 14 C 10.9 14 10 13.1 10 12 C 10 10.9 10.9 10 12 10 C 13.1 10 14 10.9 14 12 C 14 13.1 13.1 14 12 14 Z", + "fillColor": "#000000" + }, + { + "id": "876", + "name": "path2", + "type": "path", + "pathData": "M 8.57 0.51 L 13.05 4.99 L 13.05 2.04 C 17.77 2.51 21.53 6.27 22 10.99 C 22 10.99 24 10.99 24 10.99 C 23.34 3.02 15.49 -1.59 8.57 0.51 Z", + "fillColor": "#000000" + }, + { + "id": "886", + "name": "path3", + "type": "path", + "pathData": "M 10.95 21.96 C 6.23 21.49 2.47 17.73 2 13.01 C 2 13.01 0 13.01 0 13.01 C 0.66 20.98 8.51 25.59 15.43 23.49 L 10.95 19.01 L 10.95 21.96 Z", + "fillColor": "#000000" + } + ] + } + ] + }, + "hiddenLayerIds": [] + }, + "timeline": { + "animation": { + "id": "126", + "name": "anim", + "duration": 300, + "blocks": [ + { + "id": "128", + "layerId": "124", + "propertyName": "rotation", + "startTime": 0, + "endTime": 300, + "interpolator": "FAST_OUT_SLOW_IN", + "type": "number", + "fromValue": 0, + "toValue": 360 + } + ] + } + } +} \ No newline at end of file