-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
234 lines (148 loc) · 5.56 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
//import { StatusBar } from 'expo-status-bar';
import React, { Component, createRef ,RefObject} from 'react';
import {ARTText,TouchableHighlight,PanResponder, Animated, Easing,ScrollView,TouchableOpacity, StyleSheet, Text, View, Platform,StatusBar, TextInput, FlatList, Image, Modal, Switch,AsyncStorage, Alert, AlertButton, ProgressBarAndroid, ColorPropType, VirtualizedList, Picker, Dimensions } from 'react-native';
/* import {createAppContainer} from "react-navigation"
import { createStackNavigator } from "react-navigation-stack";
*/
//i
import FfmpegTaskDialog from "./FfmpegNewTask"
import MainPanel from "./MainPanel"
import InputPanel from "./InputPanel"
import Getter from "./Getter"
import Output from "./Output"
import Header from "./Header"
import DiskInfo from "./DiskInfo"
import TaskCard from "./TaskCard"
// import swipeable from ""
import Swipeable, { Swip } from './Swipeable';
import { ButtonPretty } from './ButtonPretty';
import SvgMi, { st } from './SvgMi';
import MiSwipeable from './MiSwipeable';
import { Palette } from './theme';
import react from 'react';
import Pressable from 'react-native/Libraries/Components/Pressable/Pressable';
import { verbo } from './GeneralUtils';
import SplashScreen from 'react-native-splash-screen'
let t = new Alert
const FunctionalText = (str,title)=>(<Text style={{color:"white",marginVertical:4}}>{title+str} </Text>)
FunctionalText.defaultProps = {str:"default text here",title:"defTitle: "}
export class App extends Component {
constructor(props){
super(props)
this.state={
selectedWebsiteIx : 1 ,
scrollXAnimated:new Animated.Value(0)
}
this.handleWebsiteChange=this.handleWebsiteChange.bind(this)
this.handleSearchPressed=this.handleSearchPressed.bind(this)
this.handleMenuPressed=this.handleMenuPressed.bind(this)
this.onObtainedHeaderRef=this.onObtainedHeaderRef.bind(this)
this.onObtainedMainPanelRef=this.onObtainedMainPanelRef.bind(this)
}
mainPanelRef = {}
headerRef = {}
componentDidMount(){
setTimeout(() => {
SplashScreen.hide()
}, 200);
//todo this delay works around the awkward white screen that shows up in
/**
* between the dark#050505 splashscreen and the dark#050505 app
* that's becquse there seems to be a delay between componentDidmount and the time the app is
* actuallly rendered
* consider the folowing two solutions:
* make that intermidiate screen itself dark #050505 through some native theme configuring if possible
* this will look like the logo disapearing before the app elemnts show app which is nice
* second move this hide call to another sort of event where t's garanteed that the app is visible
*/
}
handleWebsiteChange(ix){
this.props
// this.setState({selectedWebsiteIx:ix})
}
handleSearchPressed(){
alert("search dev")
}
handleMenuPressed(){
alert("menu dev")
}
bothRefsObtained(){
this.headerRef&&this.headerRef.pushAnimatedRef(this.mainPanelRef?.state?.scrollXAnimated?.interpolate({inputRange:[0,340],
outputRange:[0,1]}))
//this.setState({scrollXAnimated:this.mainPanelRef?.state?.scrollXAnimated})
}
hasObtainedHeaderRef=false
hasObtainedMPRef=false
onObtainedMainPanelRef(ref){
this.mainPanelRef=ref
if(this.hasObtainedHeaderRef){
this.bothRefsObtained()
}
this.hasObtainedMPRef=true
}
onObtainedHeaderRef(ref){
this.headerRef = ref
if(this.hasObtainedMPRef){
this.bothRefsObtained()
}
this.hasObtainedHeaderRef=true
}
render(){
return (
<View style={ styles.container}>
<Header opacAnime={this.state.scrollXAnimated.interpolate({inputRange:[0,300],
outputRange:[0,1],easing:Easing.ease})} searchPressed={this.handleSearchPressed}
ref={(ref)=>{this.onObtainedHeaderRef(ref)}}
menuPressed={this.handleMenuPressed} onAddTask={this.onHandleAddTask} ></Header>
<MainPanel ref={(ref)=>{this.onObtainedMainPanelRef(ref)}} />
{/* <MiSwipeable child_width={Dimensions.get("screen").width} style= {{width:Dimensions.get("screen").width*0.7}}>
<TaskCard>
</TaskCard>
</MiSwipeable> */}
{ // <FfmpegTaskDialog presetslist={[{name:"instagramify",inputs:['image',"image"]},{"name":"trim"}]} ></FfmpegTaskDialog>
}
<Text style={styles.oneliner_footer}>te v0.2.3</Text>
{/* <Text style={{backgroundColor:"green",height:45,marginVertical:25}} >te5455 </Text>
<Text style={{backgroundColor:"green",height:45,marginVertical:25}} >te54552 </Text>
<Text style={{backgroundColor:"green",height:45,marginVertical:25}} >te5455 3</Text>
<Text style={{backgroundColor:"green",height:45,marginVertical:25}} >te5455 4</Text>
*/}
<StatusBar style="auto" />
</View>
)}
}
const styles = StyleSheet.create({
container: {
flex:1,
flexDirection:"column",
backgroundColor: Palette.appBackground,
margin:0,
width:"100%", maxWidth:"100%",minWidth:"100%",
maxHeight:"100%",
alignContent:"flex-start",
justifyContent:"flex-start",
alignItems: 'center',
...Platform.select({
ios: { paddingTop: 20 },
android: { paddingTop: StatusBar.currentHeight }
}),
padding:0,
paddingTop:0
},
text:{
color: "#ffffff",
},
oneliner_footer:{
color: "#556689",
fontSize:9,
marginBottom:2,
position:'absolute',
bottom:0
},
go_button:{
marginTop: 5,
marginEnd: 3,
fontSize:8
},
}
);