react-native-platform-components 0.1.1 → 0.3.2

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.
Files changed (29) hide show
  1. package/PlatformComponents.podspec +1 -1
  2. package/android/src/main/java/com/platformcomponents/PCDatePickerView.kt +5 -7
  3. package/android/src/main/java/com/platformcomponents/PCSelectionMenuView.kt +273 -146
  4. package/android/src/main/java/com/platformcomponents/PCSelectionMenuViewManager.kt +5 -4
  5. package/ios/PCDatePickerView.swift +2 -11
  6. package/ios/PCSelectionMenu.mm +0 -10
  7. package/ios/PCSelectionMenu.swift +145 -179
  8. package/lib/module/DatePicker.js +3 -1
  9. package/lib/module/DatePicker.js.map +1 -1
  10. package/lib/module/SelectionMenu.js +4 -10
  11. package/lib/module/SelectionMenu.js.map +1 -1
  12. package/lib/module/SelectionMenuNativeComponent.ts +0 -9
  13. package/lib/module/index.js +1 -1
  14. package/lib/module/index.js.map +1 -1
  15. package/lib/typescript/src/DatePicker.d.ts +2 -0
  16. package/lib/typescript/src/DatePicker.d.ts.map +1 -1
  17. package/lib/typescript/src/SelectionMenu.d.ts +6 -10
  18. package/lib/typescript/src/SelectionMenu.d.ts.map +1 -1
  19. package/lib/typescript/src/SelectionMenuNativeComponent.d.ts +0 -7
  20. package/lib/typescript/src/SelectionMenuNativeComponent.d.ts.map +1 -1
  21. package/package.json +22 -9
  22. package/src/DatePicker.tsx +5 -1
  23. package/src/SelectionMenu.tsx +8 -33
  24. package/src/SelectionMenuNativeComponent.ts +0 -9
  25. package/lib/module/SelectionMenu.web.js +0 -57
  26. package/lib/module/SelectionMenu.web.js.map +0 -1
  27. package/lib/typescript/src/SelectionMenu.web.d.ts +0 -19
  28. package/lib/typescript/src/SelectionMenu.web.d.ts.map +0 -1
  29. package/src/SelectionMenu.web.tsx +0 -93
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
11
11
  s.authors = package["author"]
12
12
 
13
13
  s.platforms = { :ios => min_ios_version_supported }
14
- s.source = { :git => "https://github.com/BearPeak-Technology-Group/react-native-platform-components.git", :tag => "#{s.version}" }
14
+ s.source = { :git => "https://github.com/JarX-Concepts/react-native-platform-components.git", :tag => "#{s.version}" }
15
15
 
16
16
  s.source_files = ["ios/**/*.{h,m,mm,swift,cpp}", "shared/**/*.{h,m,mm,swift,cpp}"]
17
17
  s.private_header_files = ["ios/**/*.h", "shared/**/*.h"]
@@ -6,6 +6,7 @@ import android.content.ContextWrapper
6
6
  import android.content.DialogInterface
7
7
  import android.os.Build
8
8
  import android.view.Gravity
9
+ import android.view.View
9
10
  import android.view.ViewGroup
10
11
  import android.widget.DatePicker
11
12
  import android.widget.FrameLayout
@@ -58,8 +59,6 @@ class PCDatePickerView(context: Context) : FrameLayout(context) {
58
59
  private var showingModal = false
59
60
 
60
61
  init {
61
- minimumHeight = 0
62
- minimumWidth = 0
63
62
  rebuildUI()
64
63
  }
65
64
 
@@ -171,7 +170,7 @@ class PCDatePickerView(context: Context) : FrameLayout(context) {
171
170
  // UI construction
172
171
  // -----------------------------
173
172
 
174
- private fun isInline(): Boolean = presentation == "inline"
173
+ private fun isInline(): Boolean = presentation == "inline" || presentation == "embedded"
175
174
 
176
175
  private fun rebuildUI() {
177
176
  removeAllViews()
@@ -185,19 +184,18 @@ class PCDatePickerView(context: Context) : FrameLayout(context) {
185
184
  }
186
185
 
187
186
  val container = LinearLayout(context).apply {
188
- layoutParams = LayoutParams(
187
+ layoutParams = FrameLayout.LayoutParams(
189
188
  ViewGroup.LayoutParams.MATCH_PARENT,
190
189
  ViewGroup.LayoutParams.WRAP_CONTENT
191
190
  )
192
191
  orientation = LinearLayout.VERTICAL
193
- gravity = Gravity.CENTER_VERTICAL
194
192
  }
195
193
 
196
194
  // date and/or time
197
195
  if (mode == "date" || mode == "dateAndTime") {
198
196
  val dp = DatePicker(context).apply {
199
197
  layoutParams = LinearLayout.LayoutParams(
200
- ViewGroup.LayoutParams.MATCH_PARENT,
198
+ ViewGroup.LayoutParams.WRAP_CONTENT,
201
199
  ViewGroup.LayoutParams.WRAP_CONTENT
202
200
  )
203
201
  calendarViewShown = true
@@ -215,7 +213,7 @@ class PCDatePickerView(context: Context) : FrameLayout(context) {
215
213
  if (mode == "time" || mode == "dateAndTime") {
216
214
  val tp = TimePicker(context).apply {
217
215
  layoutParams = LinearLayout.LayoutParams(
218
- ViewGroup.LayoutParams.MATCH_PARENT,
216
+ ViewGroup.LayoutParams.WRAP_CONTENT,
219
217
  ViewGroup.LayoutParams.WRAP_CONTENT
220
218
  )
221
219
  val is24 = android.text.format.DateFormat.is24HourFormat(context)