-
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.
Photoshop style blend mode for each layer (#10)
What's new? - Photoshop style blend mode for each layer - Demo app updated to include support for blend mode - Demo app UI updated - Fixed bug: Exporting without layer was producing artifacts
- Loading branch information
1 parent
1c74353
commit 3c8becb
Showing
55 changed files
with
1,286 additions
and
375 deletions.
There are no files selected for viewing
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions
33
editor/src/main/java/com/suhel/imagine/editor/extensions/ImagineBlendModeExtensions.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,33 @@ | ||
package com.suhel.imagine.editor.extensions | ||
|
||
import com.suhel.imagine.core.types.ImagineBlendMode | ||
|
||
val ImagineBlendMode.displayText: String | ||
get() = when (this) { | ||
ImagineBlendMode.Normal -> "Normal" | ||
ImagineBlendMode.Darken -> "Darken" | ||
ImagineBlendMode.Multiply -> "Multiply" | ||
ImagineBlendMode.ColorBurn -> "Color burn" | ||
ImagineBlendMode.LinearBurn -> "Linear burn" | ||
ImagineBlendMode.DarkerColor -> "Darker color" | ||
ImagineBlendMode.Lighten -> "Lighten" | ||
ImagineBlendMode.Screen -> "Screen" | ||
ImagineBlendMode.ColorDodge -> "Color dodge" | ||
ImagineBlendMode.LinearDodge -> "Linear dodge" | ||
ImagineBlendMode.LighterColor -> "Lighter color" | ||
ImagineBlendMode.Overlay -> "Overlay" | ||
ImagineBlendMode.SoftLight -> "Soft light" | ||
ImagineBlendMode.HardLight -> "Hard light" | ||
ImagineBlendMode.VividLight -> "Vivid light" | ||
ImagineBlendMode.LinearLight -> "Linear light" | ||
ImagineBlendMode.PinLight -> "Pin light" | ||
ImagineBlendMode.HardMix -> "Hard mix" | ||
ImagineBlendMode.Difference -> "Difference" | ||
ImagineBlendMode.Exclusion -> "Exclusion" | ||
ImagineBlendMode.Subtract -> "Subtract" | ||
ImagineBlendMode.Divide -> "Divide" | ||
ImagineBlendMode.Hue -> "Hue" | ||
ImagineBlendMode.Saturation -> "Saturation" | ||
ImagineBlendMode.Color -> "Color" | ||
ImagineBlendMode.Luminosity -> "Luminosity" | ||
} |
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
78 changes: 0 additions & 78 deletions
78
editor/src/main/java/com/suhel/imagine/editor/helper/DragSwipeCallback.kt
This file was deleted.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
editor/src/main/java/com/suhel/imagine/editor/helper/ReorderItemsCallback.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,27 @@ | ||
package com.suhel.imagine.editor.helper | ||
|
||
import androidx.recyclerview.widget.ItemTouchHelper | ||
import androidx.recyclerview.widget.RecyclerView | ||
|
||
class ReorderItemsCallback( | ||
private val onItemMove: (Int, Int) -> Boolean, | ||
) : ItemTouchHelper.SimpleCallback( | ||
ItemTouchHelper.UP or ItemTouchHelper.DOWN, | ||
0, | ||
) { | ||
|
||
override fun onMove( | ||
recyclerView: RecyclerView, | ||
viewHolder: RecyclerView.ViewHolder, | ||
target: RecyclerView.ViewHolder | ||
): Boolean = onItemMove(viewHolder.adapterPosition, target.adapterPosition) | ||
|
||
override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) { | ||
// Do nothing | ||
} | ||
|
||
override fun isLongPressDragEnabled(): Boolean = false | ||
|
||
override fun isItemViewSwipeEnabled(): Boolean = false | ||
|
||
} |
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
Oops, something went wrong.