Skip to content

Commit

Permalink
Remove undoStackCount and redoStackCount from PhotoEditor
Browse files Browse the repository at this point in the history
  • Loading branch information
wasky authored and burhanrashid52 committed Jul 23, 2024
1 parent 4b7978a commit fd78586
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,19 +186,12 @@ interface PhotoEditor {
*/
fun undo(): Boolean

/**
* How many undo operations are available.
*
* @return size of undo stack
*/
val undoStackCount: Int

/**
* Returns whether any undo operation is available.
*
* @return `true` if no undo operations available, `false` otherwise
*/
val isUndoAvailable get() = undoStackCount > 0
val isUndoAvailable: Boolean

/**
* Redo the last operation perform on the [PhotoEditor]
Expand All @@ -207,19 +200,12 @@ interface PhotoEditor {
*/
fun redo(): Boolean

/**
* How many redo operations are available.
*
* @return size of redo stack
*/
val redoStackCount: Int

/**
* Returns whether any redo operation is available.
*
* @return `true` if no redo operations available, `false` otherwise
*/
val isRedoAvailable get() = redoStackCount > 0
val isRedoAvailable: Boolean

/**
* Removes all the edited operations performed [PhotoEditorView]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,13 @@ internal class PhotoEditorImpl @SuppressLint("ClickableViewAccessibility") const
return mGraphicManager.undoView()
}

override val undoStackCount: Int get() = viewState.addedViewsCount
override val isUndoAvailable get() = viewState.addedViewsCount > 0

override fun redo(): Boolean {
return mGraphicManager.redoView()
}

override val redoStackCount: Int get() = mGraphicManager.redoStackCount
override val isRedoAvailable get() = mGraphicManager.redoStackCount > 0

override fun clearAllViews() {
mBoxHelper.clearAllViews(drawingView)
Expand Down

0 comments on commit fd78586

Please sign in to comment.