-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
900 lines (741 loc) · 37.9 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
import { View, Text, Vibration, StatusBar, Dimensions, StyleSheet, ToastAndroid, useColorScheme } from 'react-native'
import React, { useMemo, useRef, useState, useEffect } from 'react'
import { Button, IconButton, Modal, Provider, Switch, TouchableRipple } from 'react-native-paper'
import CircularProgress, { CircularProgressBase } from 'react-native-circular-progress-indicator';
import { Picker } from '@react-native-picker/picker';
import Slider from '@react-native-community/slider';
import AsyncStorage from '@react-native-async-storage/async-storage';
import { BottomSheetModal, BottomSheetModalProvider, BottomSheetScrollView } from '@gorhom/bottom-sheet';
import ColorPicker, { Swatches, Preview, HueSlider, Panel3, SaturationSlider, BrightnessSlider } from 'reanimated-color-picker';
import { If, If_Setting } from './src/components/conditionalRendering';
import * as Progress from 'react-native-progress';
import SplashScreen from 'react-native-splash-screen';
import { BannerAd, BannerAdSize, TestIds, useRewardedAd, } from "react-native-google-mobile-ads";
// import { createDrawerNavigator, DrawerContentScrollView } from '@react-navigation/drawer';
// import { NavigationContainer, useNavigation, useTheme } from '@react-navigation/native';
const Home = ({ navigation }) => {
useEffect(() => {
SplashScreen.hide()
}, [])
let dark = useColorScheme() === 'dark'
let colors = dark ? {
primary: '#03a073',
background: '#151515',
card: "#000000",
border: '#5e5e5e',
mainText: '#c7c7c7',
subMainText: '#8f8f8f',
smallBoxCenter: '#4d4d4d'
} : {
primary: '#03a073',
background: "#f3f4f6",
card: "#ffffff",
border: '#c7c7c7',
mainText: '#1f1f1f',
subMainText: '#474747',
smallBoxCenter: "#b2d7d7"
}
const [value, setValue] = useState(0)
const [targetValue, setTargetValue] = useState(33)
const [roundedProgress, setRoundedProgress] = useState({
showPressMe: true,
isDashedOn: false,
clockwiseRotation: false,
strokeRotation: 0,
strokeLinecap: 'round',
activeStrokeColor: colors.primary,
activeStrokeColor2: colors.primary,
activeStrokeWidth: 30,
inActiveStrokeColor: colors.border,
inActiveStrokeWidth: 10,
solidStrokeWidth: 5,
newlook: 'default'
})
let width = Dimensions.get('screen').width
// bottom sheet modal
const bottomSheetModalRef = useRef(null);
const snapPoints = useMemo(() => ['25%', '60%'], []);
// for colors pickers
let [showModal, setShowModal] = useState({
modal1: false,
modal2: false,
modal3: false,
})
// all styles values
const styles = StyleSheet.create({
dialerView: {
flex: 1, justifyContent: 'center', alignItems: 'center'
},
counterValuePicker: {
borderRadius: 20, overflow: 'scroll', backgroundColor: colors.card, flex: 1
},
pressMeView: {
flex: 1, justifyContent: 'center', alignItems: 'center'
},
pressMeText: {
color: colors.mainText + 50, fontSize: 20, fontWeight: 'bold'
},
//Bottom Sheet Modeal
settingView: {
alignItems: 'center', flexDirection: 'row', paddingHorizontal: 10
},
settingText: {
flex: 1, fontWeight: 'bold', fontSize: 25, marginVertical: 5, color: colors.mainText
},
//Enable / Disable dashed rounded bar
dashedRipple: {
marginHorizontal: 5, marginVertical: 5, borderRadius: 10
},
dashedView: {
flexDirection: 'row', alignItems: 'center', padding: 10, backgroundColor: colors.background
},
// Enable two dialer / new look
twoDialer: {
marginHorizontal: 5, marginVertical: 5, borderRadius: 10
},
twoDialerView: {
flexDirection: 'row', alignItems: 'center', padding: 10, backgroundColor: colors.background
},
// Enable / Disable RTL / clockwiserotation
RTLripple: {
marginHorizontal: 5, marginVertical: 5, borderRadius: 10
},
RTLView: {
flexDirection: 'row', alignItems: 'center', padding: 10, backgroundColor: colors.background
},
// Rotate Dialer
rotateDialerView: {
marginHorizontal: 5, marginVertical: 5, padding: 10, borderRadius: 10, backgroundColor: colors.background
},
rotateDialerView2: {
backgroundColor: colors.card, borderRadius: 10, marginTop: 5
},
// Stroke line cap
strokeLinecapView: {
marginHorizontal: 5, marginVertical: 5, padding: 10, borderRadius: 10, backgroundColor: colors.background
},
strokeLinecapView2: {
backgroundColor: colors.card, borderRadius: 10, marginTop: 5
},
// Active / inActive stroke width
activeStrokeWidth: {
marginHorizontal: 5, marginVertical: 5, padding: 10, borderRadius: 10, backgroundColor: colors.background
},
// activeStrokeColor button / select color
activeStrokeColorView: {
marginHorizontal: 5, marginVertical: 5, borderRadius: 10, padding: 10, paddingRight: 30, backgroundColor: colors.background
},
activeStrokeColorShowView: {
aspectRatio: 1, width: 30, borderRadius: 30, backgroundColor: roundedProgress.activeStrokeColor
},
// activeStrokeColor2 / gradient button / select color
activeStrokeColorViewGradient: {
marginHorizontal: 5, marginVertical: 5, borderRadius: 10, padding: 10, paddingRight: 30, backgroundColor: colors.background
},
activeStrokeColorShowViewGradient: {
aspectRatio: 1, width: 30, borderRadius: 30, backgroundColor: roundedProgress.activeStrokeColor2
},
// inactiveStrokeColor button / select color
inActiveStrokeColorView: {
marginHorizontal: 5, marginVertical: 5, borderRadius: 10, backgroundColor: colors.background, padding: 10, paddingRight: 30
},
inActiveStrokeColorShowView: {
aspectRatio: 1, width: 30, borderRadius: 30, backgroundColor: roundedProgress.inActiveStrokeColor
}
})
// get and save all setting values when change and every render
const [changingValue, setChangingValue] = useState(false)
useEffect(() => {
AsyncStorage.getItem('setting_values').then(val => {
if (val == null) {
AsyncStorage.setItem('setting_values', JSON.stringify(roundedProgress))
} else {
setRoundedProgress(JSON.parse(val))
}
})
}, [])
useEffect(() => {
AsyncStorage.setItem('setting_values', JSON.stringify(roundedProgress))
}, [changingValue])
// Banner Ad
const bannerID = __DEV__ ? TestIds.BANNER : 'ca-app-pub-4551497516413603/9779893962'
return (
<BottomSheetModalProvider >
<View style={{ flex: 1, backgroundColor: colors.background }}>
<Provider >
<View style={{ flex: 1, }}>
<StatusBar animated translucent backgroundColor={'transparent'} barStyle={dark ? 'light-content' : "dark-content"} />
{/* <IconButton icon={'clock-time-three-outline'} iconColor={colors.mainText + 'd7'} mode='contained'
style={{ backgroundColor: colors.card, position: 'absolute', marginTop: StatusBar.currentHeight + 10, left: 10, zIndex: 1111 }}
onPress={() => {
navigation.openDrawer()
}} /> */}
<IconButton icon={'cog'} iconColor={colors.mainText + 'd7'} mode='contained'
style={{ backgroundColor: colors.card, position: 'absolute', marginTop: StatusBar.currentHeight + 10, right: 10, zIndex: 1111 }}
onPress={() => {
bottomSheetModalRef.current.present()
}} />
<TouchableRipple borderless disabled={roundedProgress.showPressMe || value === targetValue ? true : false} rippleColor="#0000000a" style={styles.dialerView} onPress={() => { Vibration.vibrate(50), setValue(value + 1) }}>
<View style={styles.dialerView}>
<If
condition1={roundedProgress.newlook === 'longbar'}
// longbar (longbar)
firstComponent={
<View style={{ alignItems: 'flex-start' }}>
<Text style={{ fontSize: 15, color: colors.mainText + 99 }}>{value} / {targetValue}</Text>
<Progress.Bar progress={value / targetValue} borderColor={roundedProgress.activeStrokeColor} color={roundedProgress.activeStrokeColor} width={width * 0.5} />
</View>
}
condition2={roundedProgress.newlook === 'rounded2'}
// 2 progress bar (rounded2)
secondComponent={<CircularProgressBase
radius={width * 0.3}
duration={300}
maxValue={targetValue}
rotation={roundedProgress.strokeRotation}
clockwise={roundedProgress.clockwiseRotation}
value={value}
activeStrokeColor={roundedProgress.activeStrokeColor}
activeStrokeSecondaryColor={roundedProgress.activeStrokeColor2}
activeStrokeWidth={roundedProgress.activeStrokeWidth}
inActiveStrokeColor={roundedProgress.inActiveStrokeColor}
inActiveStrokeWidth={roundedProgress.inActiveStrokeWidth}
inActiveStrokeOpacity={0.2}
strokeLinecap={roundedProgress.strokeLinecap}
progressValueStyle={{ fontWeight: 'bold', fontSize: 30 }}
progressValueColor={roundedProgress.activeStrokeColor}
dashedStrokeConfig={{
count: roundedProgress.isDashedOn ? 40 : 0,
width: 8
}}>
<CircularProgressBase
radius={70}
duration={300}
maxValue={targetValue}
rotation={roundedProgress.strokeRotation}
clockwise={!roundedProgress.clockwiseRotation}
value={value}
activeStrokeColor={roundedProgress.activeStrokeColor}
activeStrokeSecondaryColor={roundedProgress.activeStrokeColor2}
activeStrokeWidth={roundedProgress.activeStrokeWidth}
inActiveStrokeColor={roundedProgress.inActiveStrokeColor}
inActiveStrokeWidth={roundedProgress.inActiveStrokeWidth}
inActiveStrokeOpacity={0.2}
strokeLinecap={roundedProgress.strokeLinecap}
progressValueStyle={{ fontWeight: 'bold', fontSize: 30 }}
progressValueColor={roundedProgress.activeStrokeColor}
dashedStrokeConfig={{
count: roundedProgress.isDashedOn ? 40 : 0,
width: 8
}}>
<Text style={{ fontWeight: 'bold', fontSize: 20, color: colors.mainText }}>{value} / {targetValue}</Text>
</CircularProgressBase>
</CircularProgressBase>}
// solid (solid)
condition3={roundedProgress.newlook === 'solid'}
thirdComponent={
<View style={{ justifyContent: 'center', alignItems: 'center', }}>
<Progress.Pie progress={value / targetValue} borderWidth={roundedProgress.solidStrokeWidth} borderColor={roundedProgress.activeStrokeColor} color={roundedProgress.activeStrokeColor} size={width * 0.5} />
<View style={{ position: 'absolute' }}>
<Text style={{ fontSize: 25, color: colors.mainText }}>{value} / {targetValue}</Text>
</View>
</View>
}
// single progress bar (default)
forthComponent={<CircularProgress
radius={width * 0.3}
duration={300}
maxValue={targetValue}
rotation={roundedProgress.strokeRotation}
clockwise={!roundedProgress.clockwiseRotation}
value={value}
// valuePrefix={'$'}
valueSuffix={` / ${targetValue}`}
// initialValue={10}
// demimal value convert krny ka liay
// progressFormatter={(value) => {
// 'worklet';
// return value.toFixed(2); // 2 decimal places
// }}
activeStrokeColor={roundedProgress.activeStrokeColor}
activeStrokeSecondaryColor={roundedProgress.activeStrokeColor2}
activeStrokeWidth={roundedProgress.activeStrokeWidth}
inActiveStrokeColor={roundedProgress.inActiveStrokeColor}
inActiveStrokeWidth={roundedProgress.inActiveStrokeWidth}
inActiveStrokeOpacity={0.2}
strokeLinecap={roundedProgress.strokeLinecap}
progressValueStyle={{ fontWeight: 'bold', fontSize: 30 }}
progressValueColor={roundedProgress.activeStrokeColor}
// circleBackgroundColor={'#333'}
// dashed lines ka liay
// multicolor stock
// strokeColorConfig={[
// { color: 'red', value: 0 },
// { color: 'skyblue', value: targetValue },
// { color: 'yellowgreen', value: targetValue },
// ]}
// title={'Counter'}
// subtitle={targetValue}
// titleFontSize={16}
// titleColor={'white'}
// titleStyle={{ fontWeight: 'bold' }}
dashedStrokeConfig={{
count: roundedProgress.isDashedOn ? 40 : 0,
width: 8,
}}
/>}
/>
</View>
</TouchableRipple>
<View style={{ width: width - 20, flexDirection: 'row', marginHorizontal: 10, marginBottom: roundedProgress.showPressMe ? 0 : 10 }}>
<View style={styles.counterValuePicker}>
<Picker
selectedValue={targetValue}
onValueChange={(itemValue, itemIndex) => setTargetValue(itemValue)}
prompt='Select Count Number'
mode='dropdown'
style={{ color: colors.mainText, }}
dropdownIconColor={colors.mainText}
dropdownIconRippleColor={colors.primary}
>
<Picker.Item color={colors.mainText} label="33" value={33} />
<Picker.Item color={colors.mainText} label="66" value={66} />
<Picker.Item color={colors.mainText} label="100" value={100} />
<Picker.Item color={colors.mainText} label="200" value={200} />
<Picker.Item color={colors.mainText} label="300" value={300} />
<Picker.Item color={colors.mainText} label="400" value={400} />
<Picker.Item color={colors.mainText} label="500" value={500} />
</Picker>
</View>
<Button icon={'restart'} mode='elevated'
style={{ justifyContent: 'center', marginLeft: 10, shadowColor: 'transparent', borderRadius: 20 }}
textColor={colors.mainText} buttonColor={colors.card} onPress={() => { Vibration.vibrate(40), setValue(0) }}
>Reset</Button>
</View>
{roundedProgress.showPressMe && <TouchableRipple
borderless
disabled={value === targetValue ? true : false}
rippleColor="#0000000a"
style={styles.pressMeView}
onPress={() => { Vibration.vibrate(50), setValue(value + 1) }}
>
<Text style={styles.pressMeText}>Press me</Text>
</TouchableRipple>}
</View>
<BottomSheetModal
ref={bottomSheetModalRef}
index={1}
snapPoints={snapPoints}
// onChange={handleSheetChanges}
handleIndicatorStyle={{ backgroundColor: colors.border, borderRadius: 100 }}
backgroundStyle={{ backgroundColor: colors.card }}
style={{ flex: 1 }}
>
<View style={{ flex: 1 }}>
<View style={styles.settingView}>
<Text style={styles.settingText}>Setting</Text>
<IconButton icon={'close-thick'} iconColor={colors.mainText} mode='contained'
onPress={() => { bottomSheetModalRef.current.close() }} style={{ backgroundColor: colors.border + 90 }} />
</View>
<BottomSheetScrollView>
{/* enable/disable PressMe Text */}
<TouchableRipple borderless rippleColor={colors.border} style={styles.dashedRipple}
onPress={() => {
setRoundedProgress(prev => ({ ...prev, showPressMe: !roundedProgress.showPressMe }))
setChangingValue(!changingValue)
}}>
<View style={styles.dashedView}>
<Text style={{ color: colors.mainText, flex: 1 }}>Disable PressMe Text</Text>
<Switch color={colors.primary} value={!roundedProgress.showPressMe} onValueChange={() => {
setRoundedProgress(prev => ({ ...prev, showPressMe: !roundedProgress.showPressMe }))
setChangingValue(!changingValue)
}} />
</View>
</TouchableRipple>
{/* Enable / Disable dashed rounded bar */}
<If_Setting condition1={roundedProgress.newlook === 'default'} condition2={roundedProgress.newlook === 'rounded2'}
firstComponent={<TouchableRipple borderless rippleColor={colors.border} style={styles.dashedRipple}
onPress={() => {
setRoundedProgress(prev => ({ ...prev, isDashedOn: !roundedProgress.isDashedOn }))
setChangingValue(!changingValue)
}}>
<View style={styles.dashedView}>
<Text style={{ color: colors.mainText, flex: 1 }}>Enable Dashed Rounded Bar</Text>
<Switch color={colors.primary} value={roundedProgress.isDashedOn} onValueChange={() => {
setRoundedProgress(prev => ({ ...prev, isDashedOn: !roundedProgress.isDashedOn }))
setChangingValue(!changingValue)
}} />
</View>
</TouchableRipple>}
/>
{/* Enable new look */}
<View style={styles.rotateDialerView}>
<Text style={{ color: colors.mainText }}>Change Dialer Style</Text>
<View style={styles.rotateDialerView2}>
<Picker
selectedValue={roundedProgress.newlook}
onValueChange={(itemValue, itemIndex) => {
setRoundedProgress(prev => ({ ...prev, newlook: itemValue }))
setChangingValue(!changingValue)
}}
prompt='Select Count Number'
mode='dropdown'
style={{ color: colors.mainText, }}
dropdownIconColor={colors.mainText}
dropdownIconRippleColor={colors.primary}
>
<Picker.Item color={colors.mainText} label="Default" value={'default'} />
<Picker.Item color={colors.mainText} label="Rounded with 2 dial" value={'rounded2'} />
<Picker.Item color={colors.mainText} label="Solid" value={'solid'} />
<Picker.Item color={colors.mainText} label="Long bar" value={'longbar'} />
</Picker>
</View>
</View>
{/* Enable / Disable RTL / clockwiserotation */}
<If_Setting condition1={roundedProgress.newlook === 'default'} condition2={roundedProgress.newlook === 'rounded2'}
firstComponent={
<>
<TouchableRipple borderless rippleColor={colors.border} style={styles.RTLripple}
onPress={() => {
setRoundedProgress(prev => ({ ...prev, clockwiseRotation: !roundedProgress.clockwiseRotation }))
setChangingValue(!changingValue)
}}>
<View style={styles.RTLView}>
<Text style={{ color: colors.mainText, flex: 1 }}>Enable RTL Dialer</Text>
<Switch color={colors.primary} value={roundedProgress.clockwiseRotation} onValueChange={() => {
setRoundedProgress(prev => ({ ...prev, clockwiseRotation: !roundedProgress.clockwiseRotation }))
setChangingValue(!changingValue)
}} />
</View>
</TouchableRipple>
{/* Rotate Dialer */}
<View style={styles.rotateDialerView}>
<Text style={{ color: colors.mainText }}>Rotate Dialer</Text>
<View style={styles.rotateDialerView2}>
<Picker
selectedValue={roundedProgress.strokeRotation}
onValueChange={(itemValue, itemIndex) => {
setRoundedProgress(prev => ({ ...prev, strokeRotation: itemValue }))
setChangingValue(!changingValue)
}}
prompt='Select Count Number'
mode='dropdown'
style={{ color: colors.mainText, }}
dropdownIconColor={colors.mainText}
dropdownIconRippleColor={colors.primary}
>
<Picker.Item color={colors.mainText} label="0" value={0} />
<Picker.Item color={colors.mainText} label="45" value={45} />
<Picker.Item color={colors.mainText} label="90" value={90} />
<Picker.Item color={colors.mainText} label="135" value={135} />
<Picker.Item color={colors.mainText} label="180" value={180} />
<Picker.Item color={colors.mainText} label="225" value={225} />
<Picker.Item color={colors.mainText} label="270" value={270} />
<Picker.Item color={colors.mainText} label="315" value={315} />
<Picker.Item color={colors.mainText} label="360" value={360} />
</Picker>
</View>
</View>
{/* Stroke line cap */}
<View style={styles.strokeLinecapView}>
<Text style={{ color: colors.mainText }}>Stroke Line Cap</Text>
<View style={styles.strokeLinecapView2}>
<Picker
selectedValue={roundedProgress.strokeLinecap}
onValueChange={(itemValue, itemIndex) => {
setRoundedProgress(prev => ({ ...prev, strokeLinecap: itemValue }))
setChangingValue(!changingValue)
}}
prompt='Select Count Number'
mode='dropdown'
style={{ color: colors.mainText, }}
dropdownIconColor={colors.mainText}
dropdownIconRippleColor={colors.primary}
>
<Picker.Item color={colors.mainText} label="round" value={'round'} />
<Picker.Item color={colors.mainText} label="square" value={'square'} />
<Picker.Item color={colors.mainText} label="butt" value={'butt'} />
</Picker>
</View>
</View>
</>}
/>
{/* Active / inActive stroke width */}
<View style={styles.activeStrokeWidth}>
{/* Solid dialer stroke width */}
<If condition1={roundedProgress.newlook === 'solid'}
firstComponent={
<>
<Text style={{ color: colors.mainText }}>Solid Dialer Stroke Width</Text>
<Slider
style={{ width: '100%', height: 40 }}
step={1}
value={roundedProgress.solidStrokeWidth}
minimumValue={0}
maximumValue={50}
minimumTrackTintColor="#03a073"
maximumTrackTintColor="#03a0737c"
thumbTintColor='#03a073'
onSlidingComplete={(e) => {
setChangingValue(!changingValue)
}}
onValueChange={(e) => {
setRoundedProgress(prev => ({ ...prev, solidStrokeWidth: e }))
Vibration.vibrate(25)
}}
/>
</>}
/>
{/* Active stroke width */}
<If_Setting
condition1={roundedProgress.newlook === 'default'} condition2={roundedProgress.newlook === 'rounded2'}
firstComponent={
<>
{/* Active stroke width */}
<Text style={{ color: colors.mainText }}>Acitve Stoke width</Text>
<Slider
style={{ width: '100%', height: 40 }}
step={5}
value={roundedProgress.activeStrokeWidth}
minimumValue={5}
maximumValue={100}
minimumTrackTintColor="#03a073"
maximumTrackTintColor="#03a0737c"
thumbTintColor='#03a073'
onSlidingComplete={(e) => {
setChangingValue(!changingValue)
}}
onValueChange={(e) => {
setRoundedProgress(prev => ({ ...prev, activeStrokeWidth: e }))
Vibration.vibrate(25)
}}
/>
{/* inActive stroke width */}
<Text style={{ color: colors.mainText }}>In-Acitve Stoke Width</Text>
<Slider
style={{ width: '100%', height: 40 }}
step={1}
value={roundedProgress.inActiveStrokeWidth}
minimumValue={1}
maximumValue={50}
minimumTrackTintColor="#03a073"
maximumTrackTintColor="#03a0737c"
thumbTintColor='#03a073'
onSlidingComplete={(e) => {
setChangingValue(!changingValue)
}}
onValueChange={(e) => {
setRoundedProgress(prev => ({ ...prev, inActiveStrokeWidth: e }))
Vibration.vibrate(25)
}}
/>
</>}
/>
</View>
{/* activeStrokeColor button */}
<TouchableRipple borderless rippleColor={colors.border} style={styles.activeStrokeColorView}
onPress={() => { bottomSheetModalRef.current.close(), setShowModal(prev => ({ ...prev, modal1: !showModal.modal1 })) }}>
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
<Text style={{ flex: 1, color: colors.mainText }}>Active Stroke Color</Text>
<View style={styles.activeStrokeColorShowView} />
</View>
</TouchableRipple>
{/* activeStrokeColor2 & inactivecolor button */}
<If_Setting
condition1={roundedProgress.newlook === 'default'} condition2={roundedProgress.newlook === 'rounded2'}
firstComponent={<>
{/* activeStrokeColor2 button */}
<TouchableRipple borderless rippleColor={colors.border} style={styles.activeStrokeColorViewGradient}
onPress={() => { bottomSheetModalRef.current.close(), setShowModal(prev => ({ ...prev, modal3: !showModal.modal3 })) }}>
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
<Text style={{ flex: 1, color: colors.mainText }}>Active Stroke Color 2 (use this for gradient color)</Text>
<View style={styles.activeStrokeColorShowViewGradient} />
</View>
</TouchableRipple>
{/* inactiveStrokeColor button */}
<TouchableRipple borderless rippleColor={colors.border} style={styles.inActiveStrokeColorView}
onPress={() => { bottomSheetModalRef.current.close(), setShowModal(prev => ({ ...prev, modal2: !showModal.modal2 })) }}>
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
<Text style={{ flex: 1, color: colors.mainText }}>In-Active Stroke Color</Text>
<View style={styles.inActiveStrokeColorShowView} />
</View>
</TouchableRipple>
</>}
/>
{/* Clear All Button */}
<TouchableRipple borderless rippleColor={colors.border} style={{ marginHorizontal: 5, marginVertical: 5, borderRadius: 10, }}
onPress={async () => {
setRoundedProgress(prev => ({
isDashedOn: false,
clockwiseRotation: false,
strokeRotation: 0,
strokeLinecap: 'round',
activeStrokeColor: colors.primary,
activeStrokeColor2: colors.primary,
activeStrokeWidth: 30,
inActiveStrokeColor: colors.border,
inActiveStrokeWidth: 10,
solidStrokeWidth: 5,
newlook: 'default',
showPressMe: true
}))
await AsyncStorage.removeItem('setting_values').then(val => ToastAndroid.show('Setting Cleared', ToastAndroid.SHORT))
setChangingValue(!changingValue)
}}>
<View style={{ alignItems: 'center', padding: 10, backgroundColor: '#ff000090', }}>
<Text style={{ color: colors.mainText, flex: 1, fontWeight: 'bold', textTransform: 'uppercase' }}>Clear All Setting</Text>
</View>
</TouchableRipple>
</BottomSheetScrollView>
</View>
<View style={{ alignItems: 'center', backgroundColor: colors.background }}>
<BannerAd size={BannerAdSize.BANNER} unitId={bannerID} />
</View>
</BottomSheetModal>
</Provider >
{/* Active Stroke Color */}
<Modal visible={showModal.modal1} animationType='slide' style={{ backgroundColor: colors.background }} contentContainerStyle={{ flex: 1 }} >
<ColorPicker style={{ width: '60%' }} value={roundedProgress.activeStrokeColor}
onComplete={(e) => {
setRoundedProgress(prev => ({ ...prev, activeStrokeColor: e.hex, activeStrokeColor2: e.hex }))
setChangingValue(!changingValue)
}}>
<Preview />
<Panel3 />
<HueSlider thumbShape='circle' />
<SaturationSlider thumbShape='circle' />
<BrightnessSlider thumbShape='circle' />
<Swatches />
</ColorPicker>
<Button onPress={() => { bottomSheetModalRef.current.present(), setShowModal(prev => ({ ...prev, modal1: false })) }} buttonColor={colors.primary} textColor={colors.mainText} style={{ borderRadius: 0 }} >Done</Button>
</Modal>
{/* Active Stroke Color 2 */}
<Modal visible={showModal.modal3} animationType='slide' style={{ backgroundColor: colors.background }} contentContainerStyle={{ flex: 1 }} >
<ColorPicker style={{ width: '60%' }} value={roundedProgress.activeStrokeColor2}
onComplete={(e) => {
setRoundedProgress(prev => ({ ...prev, activeStrokeColor2: e.hex }))
setChangingValue(!changingValue)
}}>
<Preview />
<Panel3 />
<HueSlider thumbShape='circle' />
<SaturationSlider thumbShape='circle' />
<BrightnessSlider thumbShape='circle' />
<Swatches />
</ColorPicker>
<Button onPress={() => { bottomSheetModalRef.current.present(), setShowModal(prev => ({ ...prev, modal3: false })) }} buttonColor={colors.primary} textColor={colors.mainText} style={{ borderRadius: 0 }} >Done</Button>
</Modal>
{/*InActive Stroke Color */}
<Modal visible={showModal.modal2} animationType='slide' style={{ backgroundColor: colors.background }} contentContainerStyle={{ flex: 1 }} >
<ColorPicker style={{ width: '60%' }} value={roundedProgress.inActiveStrokeColor}
onComplete={(e) => {
setRoundedProgress(prev => ({ ...prev, inActiveStrokeColor: e.hex }))
setChangingValue(!changingValue)
}}>
<Preview />
<Panel3 />
<HueSlider thumbShape='circle' />
<SaturationSlider thumbShape='circle' />
<BrightnessSlider thumbShape='circle' />
<Swatches />
</ColorPicker>
<Button onPress={() => { bottomSheetModalRef.current.present(), setShowModal(prev => ({ ...prev, modal2: false })) }} buttonColor={colors.primary} textColor={colors.mainText} style={{ borderRadius: 0 }} >Done</Button>
</Modal>
</View>
<View style={{ alignItems: 'center', backgroundColor: colors.background }}>
<BannerAd size={BannerAdSize.BANNER} unitId={bannerID} />
</View>
</BottomSheetModalProvider >
)
}
// const DrawerTab = createDrawerNavigator();
// const App = () => {
// function CustomDrawerContent() {
// const { navigate } = useNavigation()
// let dark = useColorScheme() === 'dark'
// let colors = dark ? {
// primary: '#03a073',
// background: '#151515',
// card: "#000000",
// border: '#5e5e5e',
// mainText: '#c7c7c7',
// subMainText: '#8f8f8f',
// smallBoxCenter: '#4d4d4d'
// } : {
// primary: '#03a073',
// background: "#f3f4f6",
// card: "#ffffff",
// border: '#c7c7c7',
// mainText: '#1f1f1f',
// subMainText: '#474747',
// smallBoxCenter: "#b2d7d7"
// }
// const [subActive, setSubActive] = useState('')
// const [value, setValue] = useState([])
// let drawerSectionSub = (label, otherUse, icontype, icon, size, color) => {
// return (
// <Drawer.Item
// label={label}
// icon={() => icontype === 'icon' ? <IconButton icon={icon} size={30} iconColor={color} /> : null}
// theme={{
// colors: {
// onSecondaryContainer: color,
// onSurfaceVariant: colors.mainText,
// secondaryContainer: color + 20,
// }, roundness: 100
// }}
// style={{ marginTop: 10 }}
// active={subActive === otherUse}
// onPress={() => {
// setSubActive(otherUse)
// navigate(otherUse)
// }}
// />
// )
// }
// useEffect(() => {
// AsyncStorage.getItem('setting_values').then(val => {
// let v = []
// v.push(JSON.parse(val))
// setValue(v)
// // console.log(v)
// })
// }, [])
// return (
// <DrawerContentScrollView showsVerticalScrollIndicator={false}>
// <TouchableOpacity style={{ flex: 1, marginHorizontal: 10, borderRadius: 20, backgroundColor: colors.border, height: 50 }}>
// <IconButton icon={'plus'} size={30} iconColor={colors.mainText} />
// </TouchableOpacity>
// <FlatList
// data={value}
// renderItem={({ item }) => {
// return (
// <>
// <Text>{(item.isDashedOn).toString()}</Text>
// </>
// )
// }}
// />
// <StatusBar animated backgroundColor={'transparent'} barStyle={dark ? 'light-content' : 'dark-content'} />
// {/* {drawerSectionSub('Authentication', "Authentication", 'icon', 'account-multiple-outline', '', '#9f1aa6')}
// {drawerSectionSub('Sign In with Email', "EmailAuth", 'icon', 'email-variant', '', '#00A699')}
// {drawerSectionSub('Forget Password', "ForgetPasswordAuth", 'icon', 'form-textbox-password', '', '#00A4EF')}
// {drawerSectionSub('SignUp with Email', "SignUpAuth", 'icon', 'account-arrow-right', '', '#FFB900')}
// {drawerSectionSub('Phone', "PhoneAuth", 'icon', 'phone-message', '', '#78C257')}
// {drawerSectionSub('Google', "GoogleAuth", 'icon', 'google', '', '#DB4437')}
// {drawerSectionSub('Facebook', "FacebookAuth", 'icon', 'facebook', '', '#4267B2')}
// {drawerSectionSub('Twitter', "TwitterAuth", 'icon', 'twitter', '', '#1DA1F2')} */}
// </DrawerContentScrollView >
// );
// }
// return (
// <NavigationContainer >
// <DrawerTab.Navigator
// // drawerContent={(props) => <CustomDrawerContent {...props} />}
// >
// <DrawerTab.Screen name="Home" component={Home} options={{ headerShown: false }} />
// </DrawerTab.Navigator>
// </NavigationContainer>
// )
// }
export default Home