Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View russelarms's full-sized avatar
:octocat:

Ruslan Urmeev russelarms

:octocat:
View GitHub Profile
.createAnimation(ocean.getY(), ocean.getY() - dipToPx(120))
public void prepare() {
submarine.setY(screenDimensions.y + dipToPx(50));
submarine.setX(screenDimensions.x);
fishLeftBottom.setY(screenDimensions.y);
}
public class AnimatorScene extends RelativeLayout {
private Scene scene;
...
private void init() {
inflate(getContext(), R.layout.scene_layout, this);
ButterKnife.bind(this);
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<com.russelarms.offsetanimatorsample.AnimatorScene
android:id="@+id/animator_scene"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:id="@+id/ocean"
android:layout_width="match_parent"
android:layout_height="match_parent"
public class AnimatorScene extends RelativeLayout {
private Point screenDimensions;
@BindView(R.id.ocean)
View ocean;
@BindView(R.id.fish_left)
View fishLeft;
@BindView(R.id.fish_left_bottom)
View fishLeftBottom;
public class MainActivity extends AppCompatActivity {
@BindView(R.id.view_pager)
ViewPager viewPager;
PagerAdapter pagerAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);