Skip to content

Instantly share code, notes, and snippets.

Ruslan Urmeev russelarms

Block or report user

Report or block russelarms

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View OffsetAnimator_listing_8.java
.createAnimation(ocean.getY(), ocean.getY() - dipToPx(120))
View OffsetAnimator_listing_6.java
public void prepare() {
submarine.setY(screenDimensions.y + dipToPx(50));
submarine.setX(screenDimensions.x);
fishLeftBottom.setY(screenDimensions.y);
}
View OffsetAnimator_listing_5.java
public class AnimatorScene extends RelativeLayout {
private Scene scene;
...
private void init() {
inflate(getContext(), R.layout.scene_layout, this);
ButterKnife.bind(this);
View OffsetAnimator_listing_4.xml
<?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"/>
View OffsetAnimator_listing_3.xml
<?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"
View OffsetAnimator_listing_2.java
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;
View OffsetAnimator_listing_1.java
public class MainActivity extends AppCompatActivity {
@BindView(R.id.view_pager)
ViewPager viewPager;
PagerAdapter pagerAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
You can’t perform that action at this time.