Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gl-react-native-v2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Jira
Jira
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
ym
gl-react-native-v2
Commits
a78e1c71
Commit
a78e1c71
authored
Jun 12, 2016
by
Gaëtan Renaudeau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify code
parent
0877cc44
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
15 deletions
+7
-15
example/src/Animated/index.js
example/src/Animated/index.js
+7
-15
No files found.
example/src/Animated/index.js
View file @
a78e1c71
import
React
,
{
Component
}
from
"
react
"
;
import
React
,
{
Component
}
from
"
react
"
;
import
{
View
,
Animated
}
from
"
react-native
"
;
import
{
View
,
Animated
}
from
"
react-native
"
;
import
{
AnimatedSurface
}
from
"
gl-react-native
"
;
import
{
AnimatedSurface
}
from
"
gl-react-native
"
;
import
GL
from
"
gl-react
"
;
import
GL
from
"
gl-react
"
;
import
Dimensions
from
"
Dimensions
"
;
const
{
width
:
viewportW
,
height
:
viewportH
}
=
Dimensions
.
get
(
"
window
"
);
export
default
class
Tests
extends
Component
{
export
default
class
AnimatedExample
extends
Component
{
state
=
{
state
=
{
heightValue
:
new
Animated
.
Value
(
200
)
heightValue
:
new
Animated
.
Value
(
200
)
,
};
};
componentWillMount
()
{
componentWillMount
()
{
let
i
=
0
;
let
i
=
0
;
this
.
interval
=
setInterval
(()
=>
{
this
.
interval
=
setInterval
(()
=>
Animated
.
spring
(
this
.
state
.
heightValue
,
{
Animated
.
spring
(
this
.
state
.
heightValue
,
{
toValue
:
++
i
%
2
?
500
:
200
,
toValue
:
++
i
%
2
?
500
:
200
,
}).
start
();
}).
start
(),
1000
);
},
1000
);
}
}
componentWillUnmount
()
{
componentWillUnmount
()
{
clearInterval
(
this
.
interval
);
clearInterval
(
this
.
interval
);
}
}
render
()
{
render
()
{
const
{
heightValue
}
=
this
.
state
;
const
{
heightValue
}
=
this
.
state
;
return
<
View
style
=
{{
return
<
View
style
=
{{
paddingTop
:
60
,
alignItems
:
"
center
"
}}
>
backgroundColor
:
"
#000
"
,
flex
:
1
,
paddingTop
:
60
,
alignItems
:
"
center
"
}}
>
<
AnimatedSurface
<
AnimatedSurface
width
=
{
200
}
width
=
{
200
}
height
=
{
heightValue
}
>
height
=
{
heightValue
}
>
<
GL
.
Node
shader
=
{{
<
GL
.
Node
shader
=
{{
// inline example
frag
:
`
frag
:
`
precision highp float;
precision highp float;
varying vec2 uv;
varying vec2 uv;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment