app_mobile.go 618 B

12345678910111213141516171819202122232425
  1. //go:build !ci && (android || ios || mobile)
  2. // +build !ci
  3. // +build android ios mobile
  4. package app
  5. import (
  6. "fyne.io/fyne/v2"
  7. "fyne.io/fyne/v2/internal/driver/mobile"
  8. )
  9. var systemTheme fyne.ThemeVariant
  10. // NewWithID returns a new app instance using the appropriate runtime driver.
  11. // The ID string should be globally unique to this app.
  12. func NewWithID(id string) fyne.App {
  13. d := mobile.NewGoMobileDriver()
  14. a := newAppWithDriver(d, id)
  15. d.(mobile.ConfiguredDriver).SetOnConfigurationChanged(func(c *mobile.Configuration) {
  16. systemTheme = c.SystemTheme
  17. a.Settings().(*settings).setupTheme()
  18. })
  19. return a
  20. }