Custom ImageView for moving image around the screen (Android)

Overview

MovingImageView

Android Arsenal

Create a custom ImageView for moving image around the screen.

Demo Screenshot 1 Demo Screenshot 2

Usage

To use MovingImageView, add the module into your project and start to build xml or java.

XML

    <net.grobas.view.MovingImageView
        android:layout_width="match_parent"
        android:layout_height="250dp"
        android:src="@drawable/image"
        app:miv_load_on_create="true"
        app:miv_max_relative_size="3"
        app:miv_min_relative_offset="0.2"
        app:miv_start_delay="1000"
        app:miv_repetitions="-1"
        app:miv_speed="100" />
Properties:
  • app:miv_load_on_create (boolean) -> default true
  • app:miv_max_relative_size (float) -> default 3.0f
  • app:miv_min_relative_offset (float) -> default 0.2f
  • app:miv_start_delay (integer) -> default 0
  • app:miv_repetitions (integer) -> default -1
  • app:miv_speed (integer) -> default 50

JAVA

    MovingImageView image = (MovingImageView) findViewById(R.id.image);
    image.getMovingAnimator().setInterpolator(new BounceInterpolator());
    image.getMovingAnimator().setSpeed(100);
    image.getMovingAnimator().addCustomMovement().
            addDiagonalMoveToDownRight().
            addHorizontalMoveToLeft().
            addDiagonalMoveToUpRight().
            addVerticalMoveToDown().
            addHorizontalMoveToLeft().
            addVerticalMoveToUp().
            start();

License

Copyright 2014 Albert Grobas

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • Sample Missing Images

    Sample Missing Images

    The sample application is missing the images in it's res directory

    :sample:processDebugResources Position 18:26-48 : No resource found that matches the given name (at 'src' with value '@drawable/anotherworld').

    When "anotherworld is added":

    /workspace/MovingImageView/sample/src/main/java/net/grobas/movingimageview/sample/SampleActivity.java:18: error: cannot find symbol
      int[] imageList = {R.drawable.anotherworld, R.drawable.futurecity, R.drawable.spacecargo, R.drawable.city};
                                                            ^
      symbol:   variable futurecity
      location: class drawable
    /workspace/MovingImageView/sample/src/main/java/net/grobas/movingimageview/sample/SampleActivity.java:18: error: cannot find symbol
      int[] imageList = {R.drawable.anotherworld, R.drawable.futurecity, R.drawable.spacecargo, R.drawable.city};
                                                                                   ^
      symbol:   variable spacecargo
      location: class drawable
    /workspace/MovingImageView/sample/src/main/java/net/grobas/movingimageview/sample/SampleActivity.java:18: error: cannot find symbol
      int[] imageList = {R.drawable.anotherworld, R.drawable.futurecity, R.drawable.spacecargo, R.drawable.city};
                                                                                                          ^
      symbol:   variable city
      location: class drawable
    3 errors
    :sample:compileDebugJava FAILED
    
    FAILURE: Build failed with an exception.
    
    bug 
    opened by robertoestivill 1
  • Fix broken headings in Markdown files

    Fix broken headings in Markdown files

    GitHub changed the way Markdown headings are parsed, so this change fixes it.

    See bryant1410/readmesfix for more information.

    Tackles bryant1410/readmesfix#1

    opened by bryant1410 0
  • Start from center

    Start from center

    Hi! I want to use MovingImageView in combination with a simple ImageView. The imageview has scale type CenterCrop and so i want to start MovingImageView from a CenterCrop situation. Is possible?

    question 
    opened by FunnyDevs 2
  • Having issues changing the size

    Having issues changing the size

    I am trying to change the size of the zoom property. Not sure what it called. How would I go about that? If it doesn't make sense to you I will try and be more specific.

    enhancement 
    opened by EugeneHoran 3
  • NineOldAndroids is deprecated

    NineOldAndroids is deprecated

    opened by AlbertGrobas 0
  • AnimatorSet listeners error

    AnimatorSet listeners error

    Well Animatorset doesnt has a repeat or reverse mode, so I use this solution:

     private Animator.AnimatorListener repeatAnimatorListener = new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(final Animator animation) {
                //super.onAnimationEnd(animation);
                //View always in UI threat!
                mView.post((new Runnable() {
                    public void run() {
                        if (isRunning) {
                            if (infiniteRepetition) {
                                mAnimatorSet.start();
                                if (animatorListener != null)
                                    animatorListener.onAnimationRepeat(animation);
                            } else {
                                currentLoop--;
                                if (currentLoop > 0) {
                                    mAnimatorSet.start();
                                    if (animatorListener != null)
                                        animatorListener.onAnimationRepeat(animation);
                                }
                            }
                        }
                    }
                }));
            }
        };
    

    But it has a little problem:

    Calls end and start from all listeners!

    bug 
    opened by AlbertGrobas 0
Owner
Albert Grobas
Android Developer in Movetia
Albert Grobas
Custom ImageView to generate captcha image.

CaptchaImageView Custom ImageView to generate captcha image. Add CaptchaImageView to your layout <test.jinesh.captchaimageviewlib.CaptchaImageView

Jinesh Francis 610 Oct 18, 2022
Big image viewer supporting pan and zoom, with very little memory usage and full featured image loading choices. Powered by Subsampling Scale Image View, Fresco, Glide, and Picasso. Even with gif and webp support! 🍻

BigImageViewer Big image viewer supporting pan and zoom, with very little memory usage and full featured image loading choices. Powered by Subsampling

Piasy 3.9k Dec 30, 2022
Android ImageView replacement which allows image loading from URLs or contact address book, with caching

Smart Image View for Android SmartImageView is a drop-in replacement for Android’s standard ImageView which additionally allows images to be loaded fr

James Smith 1.3k Dec 24, 2022
Flickable ImageView for Android. It's like a view of twitter's detail image.

FlickableView Flickable ImageView for Android. It's like a view of twitter's detail image. It's possible that other views animate with FlickableView.

goka 153 Nov 14, 2022
A library for Android provides blurred drop shadows to ImageView similar to iOS image backdrop shadows

A library for Android provides blurred drop shadows to ImageView similar to iOS image backdrop shadows.Provides fast canvas draw as no renderscript needed .The similar shadow blurred effects can also be seen in iOS Music App.

Vivek Verma 163 Dec 31, 2022
Custom ImageView for android with polygon shape (Android)

PolygonImageView Create a custom ImageView with polygonal forms. Usage To use PolygonImageView, add the module into your project and start to build xm

Albert Grobas 531 Dec 25, 2022
Custom shaped android imageview components

Shape Image View Provides a set of custom shaped android imageview components, and a framework to define more shapes. Implements both shader and bitma

Siyamed SINIR 2.6k Mar 29, 2021
Customizable Android full screen image viewer for Fresco library supporting "pinch to zoom" and "swipe to dismiss" gestures. Made by Stfalcon

This project is no longer supported. If you're able to switch from Fresco to any other library that works with the Android's ImageView, please migrate

Stfalcon LLC 1.8k Dec 19, 2022
Image Picker with Customizable UI for Android, Pick an image from Gallery

Image Picker A Image Picker Library for Android (Supports Android 12) with fully

null 2 May 29, 2022
Slider-Gallery-Zoom: image slider for android supporting indicator and auto scroll with clicking on image

image slider supporting indicator and auto scroll with clicking on image to open full screen image slider swipe and pinch zoom gestures like gallery,just pass your images and the position of the current image.

Mahmoud Elian 3 May 28, 2022
Implementation of ImageView for Android that supports zooming, by various touch gestures.

PhotoView PhotoView aims to help produce an easily usable implementation of a zooming Android ImageView. [ Dependency Add this in your root build.grad

Baseflow 18.4k Dec 30, 2022
A circular ImageView for Android

CircleImageView A fast circular ImageView perfect for profile images. This is based on RoundedImageView from Vince Mi which itself is based on techniq

Henning Dodenhof 13.8k Mar 29, 2021
Adds touch functionality to Android ImageView.

TouchImageView for Android Capabilities TouchImageView extends ImageView and supports all of ImageView’s functionality. In addition, TouchImageView ad

Michael Ortiz 2.4k Mar 28, 2021
Android ImageView widget with zoom and pan capabilities

ImageViewTouch for Android ImageViewTouch is an android ImageView widget with zoom and pan capabilities. This is an implementation of the ImageView wi

Alessandro Crugnola 1.9k Jan 4, 2023
Implements pinch-zoom, rotate, pan as an ImageView for Android 2.1+

GestureImageView This is a simple Android View class which provides basic pinch and zoom capability for images. Can be used as a replacement for a sta

Jason 1.1k Nov 10, 2022
Android ImageView that handles animated GIF images

GifImageView Android ImageView that handles Animated GIF images Usage In your build.gradle file: dependencies { compile 'com.felipecsl:gifimageview:

Felipe Lima 1.1k Mar 9, 2021
Android ImageView that supports different radii on each corner.

SelectableRoundedImageView Note that this project is no longer maintained. Android ImageView that supports different radii on each corner. It also sup

Joonho Kim 1.1k Mar 17, 2021
ImageView with a tag on android

SimpleTagImageView ImageView with a tag in android. So it's a ImageView. Demo ####Warning:When you set the round radius,the simpletagimageview scale t

null 944 Nov 10, 2022