turbo-native-initializer 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b53ab2cde5fe6c5047f4cc6cfa2c8a21e217c2b226a245ba117cc110019b80ec
4
- data.tar.gz: 7b510f82816f0ed55f4e41fc272715f14f2cc25eb44577cf9db36d0c77056504
3
+ metadata.gz: 893bf3c34e0baf61bb3ee5b7ce006ce9946bddc156bb8d95ea9a255d01c93d7e
4
+ data.tar.gz: 8d9677132ab1956eba6332539cddec223b6f66ffac6e5ed9b766553d104344bc
5
5
  SHA512:
6
- metadata.gz: e1360efb27d8f42574fab4dcb862367a8d236f4f4c9ab9ffb452024d8a9abc8d97f99a6a5b8813e5124056828bdfed21ce9140868ac1ecb41465e78c7346a949
7
- data.tar.gz: 62c9cfa365fcdff7053d0c7b09c148fd2d6b098113f7655801d01ee8ef39d3df4a94613fc4150ad9f875905b250a32d9770e4c205678b7b5229e19d8633e4e7c
6
+ metadata.gz: b25e7862afa00d50783f259dceb567a439b807832e2f73984033f80aef10de767e13fc3c6f75b764ba32651a5974d5ebed19cacf368d3c37283f7bb329649c23
7
+ data.tar.gz: eeaccd07971c2472b78a2b4f1eaff2828f25f23fecad3043d2047de013d636a17ebfc2f7691d45c8acd45a3b7335966b9953530512f7e92010150f641aee40c0
data/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
1
  ## [Unreleased]
2
2
 
3
- ## [0.0.5] - 2023-09-10
3
+ ## [0.0.6] - 2023-09-09
4
+
5
+ - Fix android template imports
6
+
7
+ ## [0.0.5] - 2023-09-09
4
8
 
5
9
  - Added android custom error screen
6
10
 
@@ -1,9 +1,11 @@
1
1
  package <%= package_name %>.features.web
2
2
 
3
+ import android.view.View
3
4
  import <%= package_name %>.base.NavDestination
4
5
  import <%= package_name %>.util.SIGN_IN_URL
5
6
  import dev.hotwire.turbo.fragments.TurboWebFragment
6
7
  import dev.hotwire.turbo.nav.TurboNavGraphDestination
8
+ import <%= package_name %>.R
7
9
  import dev.hotwire.turbo.visit.TurboVisitAction.REPLACE
8
10
  import dev.hotwire.turbo.visit.TurboVisitOptions
9
11
 
@@ -18,5 +20,5 @@ open class WebFragment : TurboWebFragment(), NavDestination {
18
20
 
19
21
  override fun createErrorView(statusCode: Int): View {
20
22
  return layoutInflater.inflate(R.layout.error_web, null)
21
- }
23
+ }
22
24
  }
@@ -5,8 +5,8 @@
5
5
  { "patterns": ["/refresh_historical_location"], "properties": { "presentation": "refresh" } },
6
6
  { "patterns": ["/recede_historical_location"], "properties": { "presentation": "pop" } },
7
7
  { "patterns": ["/resume_historical_location"], "properties": { "presentation": "none" } },
8
- { "patterns": ["^/$"], "properties": { "uri": "turbo://fragment/web/home", "presentation": "replace_all" } },
9
- { "patterns": ["/new$", "/edit$", "/signin$"], "properties": { "context": "modal", "uri": "turbo://fragment/web/modal" } },
8
+ { "patterns": ["^/$", "/signin$"], "properties": { "uri": "turbo://fragment/web/home", "presentation": "replace_all" } },
9
+ { "patterns": ["/new$", "/edit$"], "properties": { "context": "modal", "uri": "turbo://fragment/web/modal" } },
10
10
  { "patterns": ["/numbers$"], "properties": { "uri": "turbo://fragment/numbers", "title": "Numbers" } }
11
11
  ]
12
12
  }
@@ -1,8 +1,10 @@
1
1
  package <%= package_name %>.features.web
2
2
 
3
+ import android.view.View
3
4
  import <%= package_name %>.base.NavDestination
4
5
  import dev.hotwire.turbo.fragments.TurboWebFragment
5
6
  import dev.hotwire.turbo.nav.TurboNavGraphDestination
7
+ import <%= package_name %>.R
6
8
 
7
9
  @TurboNavGraphDestination(uri = "turbo://fragment/web")
8
10
  open class WebFragment : TurboWebFragment(), NavDestination {
@@ -4,8 +4,8 @@
4
4
  { "patterns": ["/refresh_historical_location"], "properties": { "presentation": "refresh", "visitable": false } },
5
5
  { "patterns": ["/recede_historical_location"], "properties": { "presentation": "pop", "visitable": false } },
6
6
  { "patterns": ["/resume_historical_location"], "properties": { "presentation": "none", "visitable": false } },
7
- { "patterns": ["^/$"], "properties": { "presentation": "replace-all" } },
8
- { "patterns": ["/new$", "/edit$", "/signin$"], "properties": { "presentation": "modal" } },
7
+ { "patterns": ["^/$", "/signin$"], "properties": { "presentation": "replace-all" } },
8
+ { "patterns": ["/new$", "/edit$"], "properties": { "presentation": "modal" } },
9
9
  { "patterns": ["/numbers$"], "properties": { "view-controller": "numbers" } }
10
10
  ]
11
11
  }
@@ -38,10 +38,6 @@ extension TurboNavigationController {
38
38
  return properties["presentation"] as? String == "modal"
39
39
  }
40
40
 
41
- private func isClearAll(_ properties: PathProperties) -> Bool {
42
- return properties["presentation"] as? String == "clear-all"
43
- }
44
-
45
41
  private func isPop(_ properties: PathProperties) -> Bool {
46
42
  return properties["presentation"] as? String == "pop"
47
43
  }
@@ -54,6 +50,10 @@ extension TurboNavigationController {
54
50
  return properties["presentation"] as? String == "none"
55
51
  }
56
52
 
53
+ private func isClearAll(_ properties: PathProperties) -> Bool {
54
+ return properties["presentation"] as? String == "clear-all"
55
+ }
56
+
57
57
  private func isReplaceAll(_ properties: PathProperties) -> Bool {
58
58
  return properties["presentation"] as? String == "replace-all"
59
59
  }
@@ -5,16 +5,18 @@ final class ViewController: VisitableViewController, ErrorPresenter {
5
5
  override func viewDidLoad() {
6
6
  super.viewDidLoad()
7
7
 
8
- view.backgroundColor = .systemBackground
9
-
10
- navigationItem.backButtonDisplayMode = .minimal
8
+ navigationItem.backButtonTitle = "Back"
11
9
 
12
10
  if presentingViewController != nil {
13
- navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(dismissModal))
11
+ navigationItem.leftBarButtonItem = dismissModalButton
14
12
  }
15
13
  }
16
14
 
17
- @objc func dismissModal() {
15
+ private lazy var dismissModalButton = {
16
+ UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(dismissModal))
17
+ }()
18
+
19
+ @objc private func dismissModal() {
18
20
  dismiss(animated: true)
19
21
  }
20
22
  }
@@ -38,10 +38,6 @@ extension TurboNavigationController {
38
38
  return properties["presentation"] as? String == "modal"
39
39
  }
40
40
 
41
- private func isClearAll(_ properties: PathProperties) -> Bool {
42
- return properties["presentation"] as? String == "clear-all"
43
- }
44
-
45
41
  private func isPop(_ properties: PathProperties) -> Bool {
46
42
  return properties["presentation"] as? String == "pop"
47
43
  }
@@ -54,6 +50,10 @@ extension TurboNavigationController {
54
50
  return properties["presentation"] as? String == "none"
55
51
  }
56
52
 
53
+ private func isClearAll(_ properties: PathProperties) -> Bool {
54
+ return properties["presentation"] as? String == "clear-all"
55
+ }
56
+
57
57
  private func isReplaceAll(_ properties: PathProperties) -> Bool {
58
58
  return properties["presentation"] as? String == "replace-all"
59
59
  }
@@ -5,16 +5,18 @@ final class ViewController: VisitableViewController, ErrorPresenter {
5
5
  override func viewDidLoad() {
6
6
  super.viewDidLoad()
7
7
 
8
- view.backgroundColor = .systemBackground
9
-
10
- navigationItem.backButtonDisplayMode = .minimal
8
+ navigationItem.backButtonTitle = "Back"
11
9
 
12
10
  if presentingViewController != nil {
13
- navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(dismissModal))
11
+ navigationItem.leftBarButtonItem = dismissModalButton
14
12
  }
15
13
  }
16
14
 
17
- @objc func dismissModal() {
15
+ private lazy var dismissModalButton = {
16
+ UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(dismissModal))
17
+ }()
18
+
19
+ @objc private func dismissModal() {
18
20
  dismiss(animated: true)
19
21
  }
20
22
  }
@@ -1,3 +1,3 @@
1
1
  module TurboNativeInitializer
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turbo-native-initializer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nixon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-09-09 00:00:00.000000000 Z
11
+ date: 2023-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor