File tree Expand file tree Collapse file tree 3 files changed +21
-1
lines changed
packages/react-native-carplay Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -630,6 +630,12 @@ - (void)updateItemImageWithURL:(CPListItem *)item imgUrl:(NSString *)imgUrlStrin
630
630
if (config[@" isPlaying" ]) {
631
631
[item setPlaying: [RCTConvert BOOL: config[@" isPlaying" ]]];
632
632
}
633
+ if (@available (iOS 14.0 , *) && config[@" playbackProgress" ]) {
634
+ [item setPlaybackProgress: [RCTConvert CGFloat: config[@" playbackProgress" ]]];
635
+ }
636
+ if (@available (iOS 14.0 , *) && config[@" accessoryImage" ]) {
637
+ [item setAccessoryImage: [RCTConvert UIImage: config[@" accessoryImage" ]]];
638
+ }
633
639
} else {
634
640
NSLog (@" Failed to find template %@ " , template);
635
641
}
@@ -983,6 +989,12 @@ - (void) applyConfigForMapTemplate:(CPMapTemplate*)mapTemplate templateId:(NSStr
983
989
if ([item objectForKey: @" isPlaying" ]) {
984
990
[_item setPlaying: [RCTConvert BOOL: [item objectForKey: @" isPlaying" ]]];
985
991
}
992
+ if (@available (iOS 14.0 , *) && [item objectForKey: @" playbackProgress" ]) {
993
+ [_item setPlaybackProgress: [RCTConvert CGFloat: [item objectForKey: @" playbackProgress" ]]];
994
+ }
995
+ if (@available (iOS 14.0 , *) && [item objectForKey: @" accessoryImage" ]) {
996
+ [_item setAccessoryImage: [RCTConvert UIImage: [item objectForKey: @" accessoryImage" ]]];
997
+ }
986
998
if (item[@" imgUrl" ]) {
987
999
NSString *imgUrlString = [RCTConvert NSString: item[@" imgUrl" ]];
988
1000
[self updateItemImageWithURL: _item imgUrl: imgUrlString];
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " react-native-carplay" ,
3
- "version" : " 2.3.3 " ,
3
+ "version" : " 2.3.4 " ,
4
4
"description" : " CarPlay for React Native" ,
5
5
"main" : " lib/index.js" ,
6
6
"react-native" : " src/index.ts" ,
Original file line number Diff line number Diff line change @@ -28,4 +28,12 @@ export interface ListItem {
28
28
* Is Playing flag.
29
29
*/
30
30
isPlaying ?: boolean ;
31
+ /**
32
+ * Value between 0.0 and 1.0 for progress bar of the list item cell.
33
+ */
34
+ playbackProgress ?: number ;
35
+ /**
36
+ * The image from file system displayed on the trailing edge of the list item cell.
37
+ */
38
+ accessoryImage ?: ImageSourcePropType ;
31
39
}
You can’t perform that action at this time.
0 commit comments