Skip to content

Commit

Permalink
Add placeholder clipboard file for mobile driver to avoid crashes if …
Browse files Browse the repository at this point in the history
…it was accidentally called.
  • Loading branch information
andydotxyz committed Nov 20, 2019
1 parent 9eac4d7 commit 46399cb
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
22 changes: 22 additions & 0 deletions internal/driver/gomobile/clipboard.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package gomobile

import (
"fyne.io/fyne"
)

// Declare conformity with Clipboard interface
var _ fyne.Clipboard = (*mobileClipboard)(nil)

// mobileClipboard represents the system mobileClipboard
type mobileClipboard struct {
}

// Content returns the mobileClipboard content
func (c *mobileClipboard) Content() string {
return "" // TODO implement ticket #414
}

// SetContent sets the mobileClipboard content
func (c *mobileClipboard) SetContent(content string) {
// TODO implement ticket #414
}
7 changes: 3 additions & 4 deletions internal/driver/gomobile/window.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,9 @@ func (w *window) Canvas() fyne.Canvas {
}

func (w *window) Clipboard() fyne.Clipboard {
//if w.clipboard == nil {
// w.clipboard = &mobileClipboard{window: w.viewport}
//}
// TODO add clipboard support
if w.clipboard == nil {
w.clipboard = &mobileClipboard{}
}
return w.clipboard
}

Expand Down

0 comments on commit 46399cb

Please sign in to comment.