-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from ozgurg/dev
release: v2.2.0
- Loading branch information
Showing
8 changed files
with
177 additions
and
2 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
lib/src/main/java/og/android/lib/toggleiconview/sharp/SoundOnOff.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 SoundOnOff @JvmOverloads constructor( | ||
context: Context, | ||
attrs: AttributeSet? = null, | ||
defStyleAttr: Int = 0 | ||
) : | ||
ToggleIconView( | ||
context, attrs, defStyleAttr, | ||
R.drawable.sharp_sound_on_to_off, | ||
R.drawable.sharp_sound_off_to_on | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<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"> | ||
<path | ||
android:name="path" | ||
android:fillColor="@android:color/black" | ||
android:pathData="M 2 4.27 L 3.27 3 L 3.27 3 L 2 4.27 Z" /> | ||
<clip-path | ||
android:name="mask" | ||
android:pathData="M 0 0 L 24 0 L 24 24 L 0 24 L 0 0 Z M 4.54 1.73 L 3.27 3 L 3.27 3 L 4.54 1.73 Z" /> | ||
<path | ||
android:fillColor="@android:color/black" | ||
android:pathData="M 3 9 L 3 15 L 7 15 L 12 20 L 12 4 L 7 9 L 3 9 Z M 16.5 12 C 16.5 10.23 15.48 8.71 14 7.97 L 14 16.02 C 15.48 15.29 16.5 13.77 16.5 12 Z M 14 3.23 L 14 5.29 C 16.89 6.15 19 8.83 19 12 C 19 15.17 16.89 17.85 14 18.71 L 14 20.77 C 18.01 19.86 21 16.28 21 12 C 21 7.72 18.01 4.14 14 3.23 Z" /> | ||
</vector> | ||
</aapt:attr> | ||
|
||
<target android:name="path"> | ||
<aapt:attr name="android:animation"> | ||
<objectAnimator | ||
android:duration="@android:integer/config_shortAnimTime" | ||
android:interpolator="@android:interpolator/fast_out_slow_in" | ||
android:propertyName="pathData" | ||
android:valueFrom="M 19.73 22 L 21 20.73 L 3.27 3 L 2 4.27 Z" | ||
android:valueTo="M 2 4.27 L 3.27 3 L 3.27 3 L 2 4.27 Z" | ||
android:valueType="pathType" /> | ||
</aapt:attr> | ||
</target> | ||
|
||
<target android:name="mask"> | ||
<aapt:attr name="android:animation"> | ||
<objectAnimator | ||
android:duration="@android:integer/config_shortAnimTime" | ||
android:interpolator="@android:interpolator/fast_out_slow_in" | ||
android:propertyName="pathData" | ||
android:valueFrom="M 0 0 L 24 0 L 24 24 L 0 24 L 0 0 Z M 4.54 1.73 L 3.27 3 L 21 20.73 L 22.27 19.46 Z" | ||
android:valueTo="M 0 0 L 24 0 L 24 24 L 0 24 L 0 0 Z M 4.54 1.73 L 3.27 3 L 3.27 3 L 4.54 1.73 Z" | ||
android:valueType="pathType" /> | ||
</aapt:attr> | ||
</target> | ||
</animated-vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<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"> | ||
<path | ||
android:name="path" | ||
android:fillColor="@android:color/black" | ||
android:pathData="M 2 4.27 L 3.27 3 L 3.27 3 L 2 4.27 Z" /> | ||
<clip-path | ||
android:name="mask" | ||
android:pathData="M 0 0 L 24 0 L 24 24 L 0 24 L 0 0 Z M 4.54 1.73 L 3.27 3 L 3.27 3 L 4.54 1.73 Z" /> | ||
<path | ||
android:fillColor="@android:color/black" | ||
android:pathData="M 3 9 L 3 15 L 7 15 L 12 20 L 12 4 L 7 9 L 3 9 Z M 16.5 12 C 16.5 10.23 15.48 8.71 14 7.97 L 14 16.02 C 15.48 15.29 16.5 13.77 16.5 12 Z M 14 3.23 L 14 5.29 C 16.89 6.15 19 8.83 19 12 C 19 15.17 16.89 17.85 14 18.71 L 14 20.77 C 18.01 19.86 21 16.28 21 12 C 21 7.72 18.01 4.14 14 3.23 Z" /> | ||
</vector> | ||
</aapt:attr> | ||
|
||
<target android:name="path"> | ||
<aapt:attr name="android:animation"> | ||
<objectAnimator | ||
android:duration="@android:integer/config_shortAnimTime" | ||
android:interpolator="@android:interpolator/fast_out_slow_in" | ||
android:propertyName="pathData" | ||
android:valueFrom="M 2 4.27 L 3.27 3 L 3.27 3 L 2 4.27 Z" | ||
android:valueTo="M 19.73 22 L 21 20.73 L 3.27 3 L 2 4.27 Z" | ||
android:valueType="pathType" /> | ||
</aapt:attr> | ||
</target> | ||
|
||
<target android:name="mask"> | ||
<aapt:attr name="android:animation"> | ||
<objectAnimator | ||
android:duration="@android:integer/config_shortAnimTime" | ||
android:interpolator="@android:interpolator/fast_out_slow_in" | ||
android:propertyName="pathData" | ||
android:valueFrom="M 0 0 L 24 0 L 24 24 L 0 24 L 0 0 Z M 4.54 1.73 L 3.27 3 L 3.27 3 L 4.54 1.73 Z" | ||
android:valueTo="M 0 0 L 24 0 L 24 24 L 0 24 L 0 0 Z M 4.54 1.73 L 3.27 3 L 21 20.73 L 22.27 19.46 Z" | ||
android:valueType="pathType" /> | ||
</aapt:attr> | ||
</target> | ||
</animated-vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:gravity="center" | ||
android:orientation="vertical"> | ||
|
||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:padding="16dp" | ||
android:text="Sharp: Sound On/Off" | ||
android:textAllCaps="true" | ||
android:textAppearance="@style/TextAppearance.AppCompat.Headline" | ||
android:textStyle="bold" /> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="0dp" | ||
android:layout_weight="1" | ||
android:gravity="center" | ||
android:orientation="horizontal"> | ||
|
||
<og.android.lib.toggleiconview.sharp.SoundOnOff | ||
android:id="@+id/muteUnmute24" | ||
android:layout_width="24dp" | ||
android:layout_height="24dp" | ||
android:background="?android:attr/selectableItemBackgroundBorderless" | ||
android:tint="#f00" /> | ||
|
||
<com.google.android.material.divider.MaterialDivider | ||
android:layout_width="1dp" | ||
android:layout_height="64dp" | ||
android:layout_marginHorizontal="24dp" /> | ||
|
||
<og.android.lib.toggleiconview.sharp.SoundOnOff | ||
android:id="@+id/muteUnmute48" | ||
android:layout_width="48dp" | ||
android:layout_height="48dp" | ||
android:background="?android:attr/selectableItemBackgroundBorderless" | ||
android:tint="#000" | ||
app:checked="true" /> | ||
|
||
<com.google.android.material.divider.MaterialDivider | ||
android:layout_width="1dp" | ||
android:layout_height="64dp" | ||
android:layout_marginHorizontal="24dp" /> | ||
|
||
<og.android.lib.toggleiconview.sharp.SoundOnOff | ||
android:id="@+id/muteUnmute96" | ||
android:layout_width="96dp" | ||
android:layout_height="96dp" | ||
android:background="?android:attr/selectableItemBackgroundBorderless" | ||
android:tint="#00f" /> | ||
</LinearLayout> | ||
</LinearLayout> |