ruby_native 0.10.11 → 0.10.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/ruby_native/helper.rb +13 -0
- data/lib/ruby_native/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a0c3d95e45afd32971cc8dc042ae37411aae04748b7b49cde8e9b94c9bc60a15
|
|
4
|
+
data.tar.gz: 047153c52db88fca1315f83ee8447509cc5ff28cb11abd802d9ad368a5864dff
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1fe808f45eeff4c420ce915bb53b1267f39e5139c0b9626e0e0d1ac2829e169136b8248f1665de5bfb88251617949c570b293475324b4b254582e535bef51b79
|
|
7
|
+
data.tar.gz: 9ae961899223792d3936309e098dbd3caa3e4bc6f09b0877fa88029973a5d582807cab250bedc10577b8790f8b7e2a80c23e2601ea7207c76e2c2a68704a1c39
|
data/lib/ruby_native/helper.rb
CHANGED
|
@@ -126,6 +126,19 @@ module RubyNative
|
|
|
126
126
|
end
|
|
127
127
|
end
|
|
128
128
|
|
|
129
|
+
# Adds a segment to the nav bar. On iOS the segments render as a centered
|
|
130
|
+
# segmented control (the same control the App Store uses for Apps/Games).
|
|
131
|
+
# Mark the current page's segment `selected: true`. Tapping a segment
|
|
132
|
+
# navigates to its `href` (or clicks the `click` selector), replacing
|
|
133
|
+
# history so the back button doesn't walk back through segment switches.
|
|
134
|
+
def segment(title, href: nil, click: nil, selected: false)
|
|
135
|
+
data = { native_segment: "", native_title: title }
|
|
136
|
+
data[:native_href] = href if href
|
|
137
|
+
data[:native_click] = click if click
|
|
138
|
+
data[:native_selected] = "" if selected
|
|
139
|
+
@items << @context.tag.div(data: data)
|
|
140
|
+
end
|
|
141
|
+
|
|
129
142
|
# Adds a native share button to the nav bar. Tapping it opens the
|
|
130
143
|
# platform share sheet for `url:` (defaults to the current page on the
|
|
131
144
|
# web side) so it works even where embedded web views don't support
|
data/lib/ruby_native/version.rb
CHANGED