Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Anti-censorship
Pluggable Transports
Snowflake Mobile
Commits
0156264f
Verified
Commit
0156264f
authored
Aug 12, 2020
by
HashikD
Browse files
Changed animation slide
parent
a21d9123
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/org/torproject/snowflake/MainActivity.java
View file @
0156264f
...
...
@@ -89,24 +89,9 @@ public class MainActivity extends AppCompatActivity implements MainFragmentCallb
Log
.
d
(
TAG
,
"startFragment: "
+
currentFragment
);
//////Animation
Slide
slideTransition
;
//This defines how the fragment moves. Either from left to right or right to left.
int
gravity
=
transitionToggle
?
Gravity
.
END
:
Gravity
.
START
;
transitionToggle
=
!
transitionToggle
;
if
(
Build
.
VERSION
.
SDK_INT
>
21
)
{
slideTransition
=
new
Slide
(
gravity
);
}
else
{
slideTransition
=
new
Slide
(
GravityCompat
.
getAbsoluteGravity
(
gravity
,
getResources
().
getConfiguration
().
getLayoutDirection
()));
}
slideTransition
.
setDuration
(
400
);
fragment
.
setEnterTransition
(
slideTransition
);
//////
getSupportFragmentManager
()
.
beginTransaction
()
.
setCustomAnimations
(
R
.
anim
.
frag_entry_slide
,
R
.
anim
.
frag_exit_slide
)
.
replace
(
R
.
id
.
fragment_container
,
fragment
,
Integer
.
toString
(
currentFragment
)).
commit
();
}
...
...
app/src/main/res/anim/frag_entry_slide.xml
0 → 100644
View file @
0156264f
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shareInterpolator=
"false"
>
<translate
android:duration=
"@android:integer/config_mediumAnimTime"
android:fromXDelta=
"-100%"
android:fromYDelta=
"0%"
android:toXDelta=
"0%"
android:toYDelta=
"0%"
/>
</set>
\ No newline at end of file
app/src/main/res/anim/frag_exit_slide.xml
0 → 100644
View file @
0156264f
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shareInterpolator=
"false"
>
<translate
android:duration=
"@android:integer/config_mediumAnimTime"
android:fromXDelta=
"0%"
android:fromYDelta=
"0%"
android:toXDelta=
"100%"
android:toYDelta=
"0%"
/>
</set>
\ No newline at end of file
Write
Preview
Supports
Markdown
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