-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyleConst.js
More file actions
314 lines (290 loc) · 8.38 KB
/
styleConst.js
File metadata and controls
314 lines (290 loc) · 8.38 KB
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
import React, { useCallback } from 'react';
import {Platform, StyleSheet} from 'react-native';
import Constants from 'expo-constants';
import * as FileSystem from 'expo-file-system';
import {SQLite} from 'expo-sqlite';
import * as Localization from 'expo-localization';
import i18n from 'i18n-js';
export const itemHeight = Platform.OS === 'ios' ? 55: 51;
export const itemFontSize = Platform.OS === 'ios' ? 16: 14;
export const itemOffset = Platform.OS === 'ios' ? 8: 6;
export const global_debug = false;
export const TRACK_DIR = FileSystem.documentDirectory + 'tracks/';
export const db = SQLite.openDatabase("db.db");
export const color = {light_pup: '#cc7a9b',
dark_pup: '#c91860',
light_gre: '#9fd6bf',
light_pup2: 'rgba(204, 122, 155, 0.5)',
light_pup3: 'rgba(204, 122, 155, 0.2)',
light_grey: 'rgb(227, 227, 227)',
primary: 'rgb(67,136,214)',
primary2: 'rgba(67,136,214,0.3)',
light_pup_header: '#d993af',
}
export const flatlist_getItemLayout = (data, index) => (
{length: itemHeight, offset: itemHeight * index, index}
)
const en = {
ok_butt: 'OK',
cancel_butt: 'Cancel',
cloud: 'Cloud',
explore: 'Explore',
local: 'Local',
play: 'Play',
ladder: 'Ladder',
youtube: 'YouTube',
comfirm: 'Comfirm',
stream_music: 'Streaming Music',
check: 'Check',
success: 'Success',
download: 'Download',
delete: 'Delete',
add_success: 'Add Success',
delete_success: 'Delete Success',
header_back: 'Back',
signin: 'Sign In',
signingin: 'Signing In',
signin_success: 'Sign In Success',
set_new_pw: 'Set New Password',
username: 'Username',
password: 'Password',
new_password: 'New Password',
email: 'Email',
failed: 'Failed',
homeView_yh: 'Youtube Home',
homeView_so: 'Sign Out',
homeView_alr1: 'Download to Cloud?',
homeView_alr2_1: 'Invalid URL',
homeView_alr2_2: 'Cannot parse video ID',
homeView2_sy: 'Search Youtube',
homeView2_alr1: 'Empty Input!',
homeView2_alr2: 'Download"{{title}}"to Cloud?',
list_sr: 'Search Here...',
list_all: ' All ',
list_un: 'Undownload',
list_lo: 'Loading',
list_do: 'Downloaded',
list_date: 'Date↓',
list_size: 'Size↓',
list_name: 'Name↓',
list_alr1_1: 'Comfirm Download',
list_alr1_2: 'Download {{size}} track from cloud?',
list_alr2_1: 'Comfirm Delete',
list_alr2_2: 'Delete {{size}} track from cloud?',
list_alt4: 'Delete "{{title}}" from cloud?',
localView_at: 'All Tracks...',
localView_pl: 'Playlist:',
localView_dp: 'Delete Playlist',
localModal_ap: 'Add Playlist',
localModal_ap_ph: 'PlayList Name',
localModal_ap_alt1: 'Duplicate Playlist',
localModal_ap_mes: 'Playlist Added',
localModal_dp: 'Delete Playlist:',
localModal_dp_ck: 'Delete {{count}} tracks inside playlist',
localModal_dp_mes: 'Delete Success',
localList_atp: 'Add to Playlist',
localList_dt: 'Delete Track',
localList_at: 'Add To',
localList_alt: 'No track was selected!',
localModal_dt: 'Delete {{count}} Track(s)',
localModal_dt_ck: 'Delete tracks from local storage',
localModal_at_alt: 'No Playlist was selected!',
playing_ph: 'Please Select Songs from',
playing_music: 'Local Music',
utils_ds: '"{{song}}" is downloaded to cloud',
utils_df: 'Download Failed',
utils_df_mes1: '"{{song}}" is longer than 90 minutes',
utils_df_mes2: '"{{song}}" is already in the cloud',
utils_df_mes3: 'Maximum limit reached in the cloud, please try to delete some non-important tracks',
offline_use: 'Use Offline'
};
const zh = {
ok_butt: '确定',
cancel_butt: '取消',
cloud: '云端',
explore: '探索',
local: '本地',
play: '播放',
ladder: '梯子',
youtube: '油管',
comfirm: '确认',
stream_music: '在线播放',
check: '确认',
success: '成功',
download: '下载',
delete: '删除',
add_success: '添加成功',
delete_success: '删除成功',
header_back: '返回',
signin: '登入',
signingin: '登入中',
signin_success: '登入成功',
set_new_pw: '设置新密码',
username: '用户名',
password: '密码',
new_password: '新密码',
email: '邮箱',
failed: '失败',
homeView_yh: '回到首页',
homeView_so: '退出账号',
homeView_alr1: '下载到云端?',
homeView_alr2_1: '无效网址',
homeView_alr2_2: '无法获取视频信息',
homeView2_sy: '搜索 YouTube',
homeView2_alr1: '没有输入!',
homeView2_alr2: '下载“{{title}}”到云端?',
list_sr: '搜索...',
list_all: '全部',
list_un: '未下载',
list_lo: '下载中',
list_do: '已下载',
list_date: '日期↓',
list_size: '大小↓',
list_name: '名称↓',
list_alr1_1: '确认下载',
list_alr1_2: '从云端下载 {{size}} 首歌到本地?',
list_alr2_1: '确认删除',
list_alr2_2: '从云端删除 {{size}} 首歌?',
list_alt4: '从云端删除“{{title}}”?',
localView_at: '全部歌曲...',
localView_pl: '播放列表:',
localView_dp: '删除播放列表',
localModal_ap: '添加播放列表',
localModal_ap_ph: '列表名称',
localModal_ap_alt1: '播放列表重名',
localModal_ap_mes: '播放列表已添加',
localModal_dp: '删除播放列表:',
localModal_dp_ck: '删除播放列表中的 {{count}} 首歌',
localModal_dp_mes: '删除成功',
localList_atp: '添加到播放列表',
localList_dt: '删除歌曲',
localList_at: '添加到',
localList_alt: '无已选歌曲!',
localModal_dt: '删除 {{count}} 首歌',
localModal_dt_ck: '同时从本地删除歌曲',
localModal_at_alt: '没有选择播放列表!',
playing_ph: '请从这里选歌:',
playing_music: '播放',
utils_ds: '“{{song}}”成功下载到云端',
utils_df: '下载失败',
utils_df_mes1: '“{{song}}”长于90分钟',
utils_df_mes2: '“{{song}}”已经在云端',
utils_df_mes3: '云端存储已满,请尝试删除一些不需要的歌曲',
offline_use: '离线使用'
};
i18n.fallbacks = true;
i18n.translations = { zh, en };
i18n.locale = Localization.locale;
export const my_i18n = i18n
export const styles = StyleSheet.create({
allView: {
flex:1
},
statusBar: {
backgroundColor: color.light_pup_header,
height: Constants.statusBarHeight + 35,
justifyContent: 'flex-end',
alignItems: 'center',
paddingBottom: 7
},
afterStatus: {
flexGrow : 1,
alignItems: 'center',
alignSelf: 'stretch'
},
grayContainer: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: color.light_grey,
padding: 5
},
whiteTouchable: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'white',
height: itemHeight - itemFontSize,
borderRadius:4,
padding: 5
},
grayControl: {
flex: 1,
height: itemHeight,
padding: (itemFontSize)/2,
backgroundColor: color.light_grey,
},
graySeparator: {
alignSelf: 'stretch',
borderTopWidth:1,
borderColor: color.light_grey
},
pupContainer: {
flex: 1,
height:itemHeight-itemFontSize,
borderRadius:4,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'white',
marginLeft:itemFontSize-10,
},
pupSeparator: {
borderTopWidth: 1,
borderColor: color.light_pup,
alignSelf: 'stretch'
},
container: {
// borderTopWidth: 1,
// borderLeftWidth: 1,
// borderRightWidth: 1,
// borderBottomWidth: 1,
justifyContent: 'center',
alignItems: 'center',
padding: 10
},
containerRow: {
// borderBottomWidth:1,
// borderTopWidth:1,
// borderLeftWidth:1,
// borderRightWidth:1,
height: itemHeight,
// backgroundColor: 'powderblue',
flexDirection: 'row',
alignItems: 'center',
alignSelf: 'stretch'
},
wrapText:{
flex:1,
justifyContent: 'center',
alignSelf: 'stretch'
},
grayRow:{
alignSelf: 'stretch',
height: 30,
backgroundColor: color.light_grey
},
touchableRow:{
flexDirection: 'row',
height: itemHeight,
alignSelf:'stretch',
alignItems:'center',
paddingLeft:30
},
modalBack:{
flex: 1,
alignItems: 'center',
backgroundColor: 'rgba(0,0,0,0.4)'
},
modalInCenter:{
height: 250,
width:'80%',
backgroundColor:'white',
alignItems: 'center',
borderRadius: 10
},
modalTouchClose:{
width: '100%',
height: '100%',
position: 'absolute',
}
})