Skip to content

Commit

Permalink
Merge develop for 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Sep 17, 2021
2 parents 1f05de7 + 15e2b5e commit 6e90820
Show file tree
Hide file tree
Showing 1,583 changed files with 97,762 additions and 43,024 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/mobile_tests.yml
Expand Up @@ -7,11 +7,11 @@ jobs:
strategy:
fail-fast: false
matrix:
go-version: [1.12.x, 1.15.x]
go-version: [1.14.x, 1.17.x]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: WillAbides/setup-go-faster@v1.6.0
with:
go-version: ${{ matrix.go-version }}

Expand Down
18 changes: 5 additions & 13 deletions .github/workflows/platform_tests.yml
Expand Up @@ -7,43 +7,35 @@ jobs:
strategy:
fail-fast: false
matrix:
go-version: [1.12.x, 1.15.x]
go-version: [1.14.x, 1.17.x]
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: WillAbides/setup-go-faster@v1.5.0
id: setup-go-faster
with:
go-version: ${{ matrix.go-version }}

- name: Get dependencies
run: sudo apt-get update && sudo apt-get install gcc libgl1-mesa-dev libegl1-mesa-dev libgles2-mesa-dev libx11-dev xorg-dev
if: ${{ runner.os == 'Linux' }}

#- name: Verify go modules
# run: |
# if [ "$GO111MODULE" == "on" ]
# then
# # For some reason `git diff-index HEAD` does not work properly if the following line is missing.
# git diff
# # check that go mod tidy does not change go.mod/go.sum
# go mod tidy && git diff-index --quiet HEAD -- || ( echo "go.mod/go.sum not up-to-date"; git diff-index HEAD --; false )
# fi

- name: Tests
run: go test -tags ci ./...

- name: Update coverage
run: |
GO111MODULE=off go get github.com/mattn/goveralls
set -e
go test -tags ci -covermode=atomic -coverprofile=coverage.out ./...
if [ $coverage -lt 69 ]; then echo "Test coverage lowered"; exit 1; fi
if: ${{ runner.os == 'Linux' }}

- name: Update PR Coverage
uses: shogo82148/actions-goveralls@v1
env:
GOROOT: ${{steps.setup-go-faster.outputs.GOROOT}}
with:
path-to-profile: coverage.out
if: ${{ runner.os == 'Linux' && github.event_name == 'push' }}
17 changes: 9 additions & 8 deletions .github/workflows/static_analysis.yml
Expand Up @@ -6,17 +6,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: WillAbides/setup-go-faster@v1.6.0
with:
go-version: '^1.15.x'
go-version: '1.16.x'

- name: Get dependencies
run: |
sudo apt-get update && sudo apt-get install gcc libgl1-mesa-dev libegl1-mesa-dev libgles2-mesa-dev libx11-dev xorg-dev
GO111MODULE=off go get golang.org/x/tools/cmd/goimports
GO111MODULE=off go get github.com/fzipp/gocyclo/cmd/gocyclo
GO111MODULE=off go get golang.org/x/lint/golint
GO111MODULE=off go get honnef.co/go/tools/cmd/staticcheck
go install golang.org/x/tools/cmd/goimports@latest
go install github.com/fzipp/gocyclo/cmd/gocyclo@latest
go install golang.org/x/lint/golint@latest
go install honnef.co/go/tools/cmd/staticcheck@v0.2.0
- name: Cleanup repository
run: rm -rf vendor/

Expand All @@ -27,10 +28,10 @@ jobs:
run: test -z $(goimports -e -d . | tee /dev/stderr)

- name: Gocyclo
run: gocyclo -over 50 .
run: gocyclo -over 30 .

- name: Golint
run: golint -set_exit_status $(go list -tags ci ./...)

- name: Staticcheck
run: CGO_ENABLED=1 staticcheck -f stylish ./...
run: staticcheck -go 1.14 ./...
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -13,6 +13,7 @@ cmd/hello/hello
cmd/hello/hello.apk
cmd/hello/hello.app
cmd/hello/hello.exe
fyne-cross

### Tests
**/testdata/failed
Expand Down
77 changes: 0 additions & 77 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions AUTHORS
Expand Up @@ -9,3 +9,4 @@ Storm Hess <stormhess@gloryskulls.com>
Stuart Scott <stuart.murray.scott@gmail.com>
Jacob Alzén <>
Charles A. Daniels <charles@cdaniels.net>
Pablo Fuentes <f.pablo1@hotmail.com>
67 changes: 67 additions & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,73 @@
This file lists the main changes with each version of the Fyne toolkit.
More detailed release notes can be found on the [releases page](https://github.com/fyne-io/fyne/releases).

## 2.1 - 17 September 2021

### Added

* DocTabs container for handling multiple open files
* Lifecycle API for handling foreground, background and other event
* Add RichText widget and Markdown parser
* Add TabWidth to TextStyle to specify tab size in spaces
* Add CheckGroup widget for multi-select
* Add FyneApp.toml metadata file to ease build commands
* Include http and https in standard repositories
* Add selection color to themes
* Include baseline information in driver font measurement
* Document storage API (App.Storage().Create() and others)
* Add "App Files" to file dialog for apps that use document storage
* Tab overflow on AppTabs
* Add URI and Unbound type to data bindings
* Add keyboard support for menus, pop-ups and buttons
* Add SimpleRenderer to help make simple widgets (#709)
* Add scroll functions for List, Table, Tree (#1892)
* Add selection and disabling to MenuItem
* Add Alignment to widget.Select (#2329)
* Expose ScanCode for keyboard events originating from hardware (#1523)
* Support macOS GPU switching (#2423)

### Changed

* Focusable widgets are no longer focused on tap, add canvas.Focus(obj) in Tapped handler if required
* Move to background based selection for List, Table and Tree
* Update fyne command line tool to use --posix style parameters
* Switch from gz to xz compression for unix packages
* Performance improvements with line, text and raster rendering
* Items not yet visible can no longer be focused
* Lines can now be drawn down to 1px (instead of 1dp) (#2298)
* Support multiple lines of text on button (#2378)
* Improved text layout speed by caching string size calculations
* Updated to require Go 1.14 so we can use some new features
* Window Resize request is now asynchronous
* Up/Down keys take cursor home/end when on first/last lines respectively

### Fixed

* Correctly align text tabs (#1791)
* Mobile apps theme does not match system (#472)
* Toolbar with widget.Label makes the ToolbarAction buttons higher (#2257)
* Memory leaks in renderers and canvases cache maps (#735)
* FileDialog SetFilter does not work on Android devices (#2353)
* Hover fix for List and Tree with Draggable objects
* Line resize can flip slope (#2208)
* Deadlocks when using widgets with data (#2348)
* Changing input type with keyboard visible would not update soft keyboards
* MainMenu() Close item does NOT call function defined in SetCloseIntercept (#2355)
* Entry cursor position with mouse is offset vertically by theme.SizeNameInputBorder (#2387)
* Backspace key is not working on Android AOSP (#1941)
* macOS: 'NSUserNotification' has been deprecated (#1833)
* macOS: Native menu would add new items if refreshed
* iOS builds fail since Go 1.16
* Re-add support for 32 bit iOS devices, if built with Go 1.14
* Android builds fail on Apple M1 (#2439)
* SetFullScreen(true) before ShowAndRun fails (#2446)
* Interacting with another app when window.SetFullScreen(true) will cause the application to hide itself. (#2448)
* Sequential writes to preferences does not save to file (#2449)
* Correct Android keyboard handling (#2447)
* MIUI-Android: The widget’s Hyperlink cannot open the URL (#1514)
* Improved performance of data binding conversions and text MinSize


## 2.0.4 - 6 August 2021

### Changed
Expand Down
13 changes: 6 additions & 7 deletions README.md
@@ -1,6 +1,6 @@
<p align="center">
<a href="https://pkg.go.dev/fyne.io/fyne/v2?tab=doc" title="Go API Reference" rel="nofollow"><img src="https://img.shields.io/badge/go-documentation-blue.svg?style=flat" alt="Go API Reference"></a>
<a href="https://github.com/fyne-io/fyne/releases/tag/v2.0.4" title="2.0.4 Release" rel="nofollow"><img src="https://img.shields.io/badge/version-2.0.4-blue.svg?style=flat" alt="2.0.4 release"></a>
<a href="https://github.com/fyne-io/fyne/releases/tag/v2.1.0" title="2.1.0 Release" rel="nofollow"><img src="https://img.shields.io/badge/version-2.1.0-blue.svg?style=flat" alt="2.1.0 release"></a>
<a href='http://gophers.slack.com/messages/fyne'><img src='https://img.shields.io/badge/join-us%20on%20slack-gray.svg?longCache=true&logo=slack&colorB=blue' alt='Join us on Slack' /></a>
<br />
<a href="https://goreportcard.com/report/fyne.io/fyne/v2"><img src="https://goreportcard.com/badge/fyne.io/fyne/v2" alt="Code Status" /></a>
Expand All @@ -14,12 +14,11 @@
It is designed to build applications that run on desktop and mobile devices with a
single codebase.

Version 2.0 is the current release of the Fyne API, this represented the first release since
1.0 that may break some API usage. It also added new features including data binding, animation,
storage repositories and a new more flexible theme API.
We also refreshed the default theme, adding animations, a focus colour and
redesigning the Entry, Select, SelectEntry, ProgressBar and ProgressBarInfinite widgets.
We are now working towards the next [big release](https://github.com/fyne-io/fyne/milestone/14)
Version 2.1 is the current release of the Fyne API, it introduced RichText
and the DocTabs container, as well as the document storage API and FyneApp.toml
metadata support.
We are now working towards the next big release, codenamed
[bowmore](https://github.com/fyne-io/fyne/milestone/15)
and more news will follow in our news feeds and GitHub project.

# Prerequisites
Expand Down
17 changes: 17 additions & 0 deletions app.go
Expand Up @@ -57,6 +57,9 @@ type App interface {

// Storage returns a storage handler specific to this application.
Storage() Storage

// Lifecycle returns a type that allows apps to hook in to lifecycle events.
Lifecycle() Lifecycle
}

var app App
Expand All @@ -80,3 +83,17 @@ func CurrentApp() App {
}
return app
}

// Lifecycle represents the various phases that an app can transition through.
//
// Since: 2.1
type Lifecycle interface {
// SetOnEnteredForeground hooks into the app becoming foreground and gaining focus.
SetOnEnteredForeground(func())
// SetOnExitedForeground hooks into the app losing input focus and going into the background.
SetOnExitedForeground(func())
// SetOnStarted hooks into an event that says the app is now running.
SetOnStarted(func())
// SetOnStopped hooks into an event that says the app is no longer running.
SetOnStopped(func())
}

0 comments on commit 6e90820

Please sign in to comment.