GithubHelp home page GithubHelp logo

androidviewhover's Introduction

Android View Hover Build Status

In my opinion, jumping to a new activity to show your menu is a kind of wasting time and life.

So,

I think, we need a hover view, to show menu, to show messages.

Demo

Watch HD in YouTube.

Download Apk

Usage

Step0

Set up RenderScript

  • Eclipse, please visit official tutorial.
  • Android Studio, add
             
             renderscriptTargetApi 19
         	renderscriptSupportMode true
    in build.gradle defaultConfig, here is a sample

Step1

Gradle

dependencies {
	compile "com.android.support:support-v4:20.+"
	compile 'com.nineoldandroids:library:2.4.0'
	compile 'com.daimajia.easing:library:1.0.0@aar'
	compile 'com.daimajia.androidanimations:library:1.1.2@aar'
	compile 'com.daimajia.androidviewhover:library:1.0.4@aar'
}

Maven

	<dependency>
	    <groupId>com.nineoldandroids</groupId>
	    <artifactId>library</artifactId>
	    <version>2.4.0</version>
	</dependency>
	<dependency>
	    <groupId>com.daimajia.androidanimation</groupId>
	    <artifactId>library</artifactId>
	    <version>1.1.2</version>
	    <type>apklib</type>
	</dependency>
	<dependency>
	    <groupId>com.daimajia.easing</groupId>
	    <artifactId>library</artifactId>
	    <version>1.0.0</version>
	    <type>apklib</type>
	</dependency>
	<dependency>
	    <groupId>com.daimajia.androidviewhover</groupId>
	    <artifactId>library</artifactId>
	    <version>1.0.4</version>
	    <type>apklib</type>
	</dependency>

Eclipse

Step2

  1. Create an original view, and make sure it was wrapped by BlurLayout

    for example:

    	<com.daimajia.androidviewhover.BlurLayout
    			android:id="@+id/sample"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content">
                <ImageView
                    android:layout_centerInParent="true"
                    android:scaleType="fitXY"
                    android:src="@drawable/kid"
                    android:layout_width="match_parent"/>
    	</com.daimajia.androidviewhover.BlurLayout>

    Note: BlurLayout is entended from RelativeLayout. You can use the RelativeLayout rules to layout your view.

  2. Create a hover view, there is no rules to obey. Just please remember that this view will be stretched as large as the original view you have created.

  3. Bind a hover view to BlurLayout

    	BlurLayout sampleLayout = (BlurLayout)findViewById(R.id.sample);
    	View hover = LayoutInflater.from(mContext).inflate(R.layout.hover, null);
    	sampleLayout.setHoverView(hover);

    and don't forget that you can add various animations just in one line code. For example:

    	//View (R.id.heart) appear animation.
    	sampleLayout.addChildAppearAnimator(hover, R.id.heart, Techniques.FlipInX);
    	//View (R.id.heart) disappear animation.
    	sampleLayout.addChildDisappearAnimator(hover, R.id.heart, Techniques.FlipOutX);

You can view the samples in my preset examples.

Animations

This project provides a lot of animations you can choose. Animations are from my another open-source project AndroidViewAnimations. And you can aslo using easing funcitons to make your animations more real. Please enjoy it.

Thanks

About me

A student in mainland China.

Welcome to offer me an internship. If you have any new idea about this project, feel free to contact me.

androidviewhover's People

Contributors

daimajia avatar donglua avatar milosjovac avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.