Skip to content

Commit

Permalink
Merge pull request #17 from ozgurg/dev
Browse files Browse the repository at this point in the history
release: 3.2.0
  • Loading branch information
ozgurg authored Jun 22, 2023
2 parents 55c77b6 + 0db923b commit 2188546
Show file tree
Hide file tree
Showing 18 changed files with 142 additions and 11 deletions.
Binary file modified .github/preview/rounded/PlayPause.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .github/preview/rounded/SoundOnOff.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .github/preview/sharp/AirplaneModeOnOff.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .github/preview/sharp/FlashOnOff.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .github/preview/sharp/PlayPause.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/preview/sharp/Refresh.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .github/preview/sharp/SoundOnOff.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ dependencyResolutionManagement {
```gradle
// App level build.gradle
dependencies {
implementation "com.github.ozgurg:ToggleIconView:3.1.1"
implementation "com.github.ozgurg:ToggleIconView:3.2.0"
}
```

Expand Down Expand Up @@ -102,6 +102,7 @@ _All icons have the same duration (`@android:integer/config_shortAnimTime`) and
| ![](https://raw.githubusercontent.com/ozgurg/ToggleIconView/master/.github/preview/sharp/FlashOnOff.gif) | [Sharp] FlashOnOff<br />`og.android.lib.toggleiconview.sharp.FlashOnOff` |
| ![](https://raw.githubusercontent.com/ozgurg/ToggleIconView/master/.github/preview/sharp/AirplaneModeOnOff.gif) | [Sharp] AirplaneModeOnOff<br />`og.android.lib.toggleiconview.sharp.AirplaneModeOnOff` |
| ![](https://raw.githubusercontent.com/ozgurg/ToggleIconView/master/.github/preview/sharp/CameraSwitch.gif) | [Sharp] CameraSwitch<br />`og.android.lib.toggleiconview.sharp.CameraSwitch` |
| ![](https://raw.githubusercontent.com/ozgurg/ToggleIconView/master/.github/preview/sharp/Refresh.gif) | [Sharp] Refresh<br />`og.android.lib.toggleiconview.sharp.Refresh` |

## How do you create your custom icon?

Expand All @@ -120,7 +121,6 @@ package [PACKAGE_NAME]

import android.content.Context
import android.util.AttributeSet
import og.android.lib.toggleiconview.R
import og.android.lib.toggleiconview.ToggleIconView

class [NAME_YOUR_ICON] @JvmOverloads constructor(
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "com.android.application" version "8.0.1" apply false
id "com.android.library" version "8.0.1" apply false
id "com.android.application" version "8.0.2" apply false
id "com.android.library" version "8.0.2" apply false
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
}

Expand Down
2 changes: 1 addition & 1 deletion lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ afterEvaluate {

groupId = "com.github.ozgurg"
artifactId = "toggle-icon-view"
version = "3.1.1"
version = "3.2.0"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ class CameraSwitch @JvmOverloads constructor(
) :
ToggleIconView(
context, attrs, defStyleAttr,
R.drawable.camera_switch,
R.drawable.camera_switch
R.drawable.sharp_camera_switch,
R.drawable.sharp_camera_switch
)
17 changes: 17 additions & 0 deletions lib/src/main/java/og/android/lib/toggleiconview/sharp/Refresh.kt
Original file line number Diff line number Diff line change
@@ -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 Refresh @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) :
ToggleIconView(
context, attrs, defStyleAttr,
R.drawable.sharp_refresh,
R.drawable.sharp_refresh
)
File renamed without changes.
31 changes: 31 additions & 0 deletions lib/src/main/res/drawable/sharp_refresh.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt">
<aapt:attr name="android:drawable">
<vector
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<group
android:name="group"
android:pivotX="12"
android:pivotY="12">
<path
android:fillColor="@android:color/black"
android:pathData="M 17.65 6.35 C 16.2 4.9 14.21 4 12 4 C 7.58 4 4.01 7.58 4.01 12 C 4.01 16.42 7.58 20 12 20 C 15.73 20 18.84 17.45 19.73 14 L 17.65 14 C 16.83 16.33 14.61 18 12 18 C 8.69 18 6 15.31 6 12 C 6 8.69 8.69 6 12 6 C 13.66 6 15.14 6.69 16.22 7.78 L 13 11 L 20 11 L 20 4 L 17.65 6.35 Z" />
</group>
</vector>
</aapt:attr>

<target android:name="group">
<aapt:attr name="android:animation">
<objectAnimator
android:duration="@android:integer/config_shortAnimTime"
android:interpolator="@android:interpolator/fast_out_slow_in"
android:propertyName="rotation"
android:valueFrom="0"
android:valueTo="360"
android:valueType="floatType" />
</aapt:attr>
</target>
</animated-vector>
4 changes: 2 additions & 2 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ plugins {
}

android {
compileSdk 33
compileSdk 34
defaultConfig {
applicationId "og.android.sample.toggleiconview"
minSdk 21
targetSdk 33
targetSdk 34
versionCode 1
versionName "1.0"
}
Expand Down
32 changes: 32 additions & 0 deletions sample/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -219,5 +219,37 @@
</LinearLayout>
</LinearLayout>
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="24dp">

<TextView
style="@style/DemoPrimaryTitle"
android:text="Refresh" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:baselineAligned="false"
android:orientation="horizontal">

<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">

<TextView
style="@style/DemoSecondaryTitle"
android:text="Sharp" />

<og.android.lib.toggleiconview.sharp.Refresh style="@style/DemoIcon" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"layers": {
"vectorLayer": {
"id": "123",
"name": "cameraswitch",
"name": "sharp_camera_switch",
"type": "vector",
"width": 24,
"height": 24,
Expand Down Expand Up @@ -62,4 +62,4 @@
]
}
}
}
}
51 changes: 51 additions & 0 deletions shapeshifter/sharp_refresh.shapeshifter
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"version": 1,
"layers": {
"vectorLayer": {
"id": "20",
"name": "sharp_refresh",
"type": "vector",
"width": 24,
"height": 24,
"children": [
{
"id": "21",
"name": "group",
"type": "group",
"pivotX": 12,
"pivotY": 12,
"children": [
{
"id": "22",
"name": "path",
"type": "path",
"pathData": "M 17.65 6.35 C 16.2 4.9 14.21 4 12 4 C 7.58 4 4.01 7.58 4.01 12 C 4.01 16.42 7.58 20 12 20 C 15.73 20 18.84 17.45 19.73 14 L 17.65 14 C 16.83 16.33 14.61 18 12 18 C 8.69 18 6 15.31 6 12 C 6 8.69 8.69 6 12 6 C 13.66 6 15.14 6.69 16.22 7.78 L 13 11 L 20 11 L 20 4 L 17.65 6.35 Z",
"fillColor": "#000000"
}
]
}
]
},
"hiddenLayerIds": []
},
"timeline": {
"animation": {
"id": "23",
"name": "anim",
"duration": 300,
"blocks": [
{
"id": "24",
"layerId": "21",
"propertyName": "rotation",
"startTime": 0,
"endTime": 300,
"interpolator": "FAST_OUT_SLOW_IN",
"type": "number",
"fromValue": 0,
"toValue": 360
}
]
}
}
}

0 comments on commit 2188546

Please sign in to comment.