mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 21:03:54 +01:00
Add animations
This commit is contained in:
parent
4a3ef4892c
commit
7fe9696920
5 changed files with 65 additions and 1 deletions
|
|
@ -48,6 +48,10 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment {
|
||||||
private View transparentView;
|
private View transparentView;
|
||||||
private int currBottomSheetState;
|
private int currBottomSheetState;
|
||||||
private boolean isFabOpen=false;
|
private boolean isFabOpen=false;
|
||||||
|
private Animation rotate_backward;
|
||||||
|
private Animation fab_close;
|
||||||
|
private Animation fab_open;
|
||||||
|
private Animation rotate_forward;
|
||||||
|
|
||||||
public NearbyMapFragment() {
|
public NearbyMapFragment() {
|
||||||
}
|
}
|
||||||
|
|
@ -96,12 +100,17 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment {
|
||||||
bottomSheetDetails = getActivity().findViewById(R.id.bottom_sheet_details);
|
bottomSheetDetails = getActivity().findViewById(R.id.bottom_sheet_details);
|
||||||
bottomSheetDetailsBehavior = BottomSheetBehavior.from(bottomSheetDetails);
|
bottomSheetDetailsBehavior = BottomSheetBehavior.from(bottomSheetDetails);
|
||||||
bottomSheetDetailsBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
|
bottomSheetDetailsBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
|
||||||
//moreInfo = getActivity().findViewById(R.id.more_info_bar);
|
|
||||||
fabList = getActivity().findViewById(R.id.fab_list);
|
fabList = getActivity().findViewById(R.id.fab_list);
|
||||||
fabPlus = getActivity().findViewById(R.id.fab_plus);
|
fabPlus = getActivity().findViewById(R.id.fab_plus);
|
||||||
fabCamera = getActivity().findViewById(R.id.fab_camera);
|
fabCamera = getActivity().findViewById(R.id.fab_camera);
|
||||||
fabGallery = getActivity().findViewById(R.id.fab_galery);
|
fabGallery = getActivity().findViewById(R.id.fab_galery);
|
||||||
|
|
||||||
|
fab_open = AnimationUtils.loadAnimation(getActivity(), R.anim.fab_open);
|
||||||
|
fab_close = AnimationUtils.loadAnimation(getActivity(),R.anim.fab_close);
|
||||||
|
rotate_forward = AnimationUtils.loadAnimation(getActivity(),R.anim.rotate_forward);
|
||||||
|
rotate_backward = AnimationUtils.loadAnimation(getActivity(),R.anim.rotate_backward);
|
||||||
|
|
||||||
transparentView = getActivity().findViewById(R.id.transparentView);
|
transparentView = getActivity().findViewById(R.id.transparentView);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
17
app/src/main/res/anim/fab_close.xml
Normal file
17
app/src/main/res/anim/fab_close.xml
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:fillAfter="true">
|
||||||
|
<scale
|
||||||
|
android:duration="300"
|
||||||
|
android:fromXScale="0.8"
|
||||||
|
android:fromYScale="0.8"
|
||||||
|
android:interpolator="@android:anim/linear_interpolator"
|
||||||
|
android:toXScale="0.0"
|
||||||
|
android:pivotX="50%"
|
||||||
|
android:pivotY="50%"
|
||||||
|
android:toYScale="0.0" />
|
||||||
|
<alpha android:fromAlpha="1.0"
|
||||||
|
android:toAlpha="0.0"
|
||||||
|
android:interpolator="@android:anim/accelerate_interpolator"
|
||||||
|
android:duration="300"/>
|
||||||
|
</set>
|
||||||
18
app/src/main/res/anim/fab_open.xml
Normal file
18
app/src/main/res/anim/fab_open.xml
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:fillAfter="true">
|
||||||
|
<scale
|
||||||
|
android:duration="300"
|
||||||
|
android:fromXScale="0.0"
|
||||||
|
android:fromYScale="0.0"
|
||||||
|
android:interpolator="@android:anim/linear_interpolator"
|
||||||
|
android:toXScale="0.8"
|
||||||
|
android:pivotX="50%"
|
||||||
|
android:pivotY="50%"
|
||||||
|
android:toYScale="0.8" />
|
||||||
|
<alpha
|
||||||
|
android:fromAlpha="0.0"
|
||||||
|
android:toAlpha="1.0"
|
||||||
|
android:interpolator="@android:anim/accelerate_interpolator"
|
||||||
|
android:duration="300"/>
|
||||||
|
</set>
|
||||||
10
app/src/main/res/anim/rotate_backward.xml
Normal file
10
app/src/main/res/anim/rotate_backward.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:fillAfter="true" >
|
||||||
|
<rotate android:fromDegrees="45"
|
||||||
|
android:toDegrees="0"
|
||||||
|
android:pivotX="50%"
|
||||||
|
android:pivotY="50%"
|
||||||
|
android:duration="300"
|
||||||
|
android:interpolator="@android:anim/linear_interpolator"/>
|
||||||
|
</set>
|
||||||
10
app/src/main/res/anim/rotate_forward.xml
Normal file
10
app/src/main/res/anim/rotate_forward.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:fillAfter="true" >
|
||||||
|
<rotate android:fromDegrees="0"
|
||||||
|
android:toDegrees="45"
|
||||||
|
android:pivotX="50%"
|
||||||
|
android:pivotY="50%"
|
||||||
|
android:duration="300"
|
||||||
|
android:interpolator="@android:anim/linear_interpolator"/>
|
||||||
|
</set>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue