An elegant way to show your menu or messages.

Overview

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.

Comments
  • Crash when BlurLayout is 0dp height.

    Crash when BlurLayout is 0dp height.

    My xml in this part is roughly like this:

     <com.daimajia.androidviewhover.BlurLayout
            android:id="@+id/blur_layout"
            android:layout_width="wrap_content"
            android:layout_height="0dp"
            android:layout_weight="1">
    
            <FrameLayout
                android:id="@+id/fragment_container"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="1"
                />
        </com.daimajia.androidviewhover.BlurLayout>
    

    And I want to through the menu key to showHover (), the results originally expected is this: I press the Menu key, then Hover out, covering my entire FrameLayout. The result is not, and the error (key information) as follows:

    Caused by: java.lang.NullPointerException
                at com.daimajia.androidviewhover.tools.Blur.apply(Blur.java:19)
                at com.daimajia.androidviewhover.tools.Blur.apply(Blur.java:15)
                at com.daimajia.androidviewhover.BlurLayout.addBlurImage(BlurLayout.java:178)
                at com.daimajia.androidviewhover.BlurLayout.hover(BlurLayout.java:119)
                at com.daimajia.androidviewhover.BlurLayout.showHover(BlurLayout.java:105)
                at com.daimajia.androidviewhover.BlurLayout.toggleHover(BlurLayout.java:164)
                at me.drakeet.testhover.ui.MainActivity.onCreate(MainActivity.java:85)
                at android.app.Activity.performCreate(Activity.java:5242)
                at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
                at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2151)
                at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2236)
                at android.app.ActivityThread.access$800(ActivityThread.java:138)
                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1199)
                at android.os.Handler.dispatchMessage(Handler.java:102)
                at android.os.Looper.loop(Looper.java:136)
                at android.app.ActivityThread.main(ActivityThread.java:5034)
                at java.lang.reflect.Method.invokeNative(Native Method)
                at java.lang.reflect.Method.invoke(Method.java:515)
    

    So ask: under BlurLayout in the layout file has one and only ImageView? I put a FrameLayout, and want the buttons to control Hover‘s toggle, but it seems not, could help? Thank you very much!

    bug 
    opened by drakeet 10
  • Error when import using Eclipse

    Error when import using Eclipse

    mSampleLayout.addChildAppearAnimator(hover, R.id.heart, Techniques.FlipInX);在addChildAppearAnimator方法中都提示:The method addChildAppearAnimator(View, int, Techniques) from the type BlurLayout refers to the missing type Techniques。 好像说缺失Techniques类型,但是确实我什么也没有改呀。

    opened by android12345 8
  • Blur behaves weird

    Blur behaves weird

    I've been trying to add this library to my project but I'm either too dumb to use it or there is a bug that seems to only affect my project...

    This is my Code to show the HoverView:

    View newView = mInflater.inflate(R.layout.card_back, null); BlurLayout oldView = (BlurLayout) mNowLayout.findViewById(id); oldView.setHoverView(newView); oldView.setBlurDuration(500); //Adding Animations oldView.showHover();

    My actual problem is visible in the attached picture. As you can see there is the blurred version of the text & images underneath an unblurred version of the text & images. It might just be me doing something wrong but if that is the case I'm absolutely clueless about what I'm doing wrong.

    screenshot_2014-09-20-15-18-29

    opened by ghost 6
  • Problem on LG G3 with android 5.0

    Problem on LG G3 with android 5.0

    I recently finished my app using AndroidViewHover which shows icons over a CardView. I test it on android 2.3, 4.0 and 4.4 and works fine. But one of my customer complaining that icons dont show up on LG G3 using android 5.0

    Any idea?

    opened by arashmidos 2
  • dismissHover(). when does it finish?

    dismissHover(). when does it finish?

    Is there a way to know when dismissHover Animation Completes? I really need something like onDismissHoverAnimationComplete If there is a way please show it to me. Thanks.

    opened by mr-sarsarabi 1
  • Use the library in a fragment

    Use the library in a fragment

    Hello, I'm beginner in Android Development, I can use perfect your library in a simple activity, but a want to use it in a fragment. I attached the fragment .java file. I get java null pointer exception when start the fragment. I try a lot a thing but I can't do it.

    I attached the hover xml and one another xml what i use in the fragment.

    PicturesFragment.txt hover_sample.txt fragment_pictures.txt

    opened by HerczegDaniel 1
  • Can i exclude nineolddroid in my build??

    Can i exclude nineolddroid in my build??

    @daimajia can i exclude nineolddroid from my build gradle file as i wont require it because my project is API14 and above.If i does not include it,shows a error as class cast exception cannot inflate blur layout.Help!

    opened by goonerDroid 1
  • More accessors and options

    More accessors and options

    Allow for changes to the blur radius. Allow us to disable the touch event so that we can have it trigger via a button or other event. Recycle the bitmap.

    opened by nicorichard 1
  • I want to use LongClick

    I want to use LongClick

    I want to use OnLongClickListener.

    I put an imageview inside the cardview and applied a blurview.

    I applied longclick to Cardview. But when I clicked on the imageview, longclick didn't work.

    I want to make longclick work when I hit the area of ​​Cardview. However, imageview has blurview, so it does not work in imageview area.

    So I tried applying OnLongClickListener to the imageview to solve this.

    But when I use OnLongClickListener for imageview, blurview doesn't work.

    Please tell me the solution.

    opened by ryu884 1
  • FATAL EXCEPTION

    FATAL EXCEPTION

    Hey I used API 24 try using API 23 but got this error when I click

    FATAL EXCEPTION: main Process: com.example.johnj_000.hovericons, PID: 2881 java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v8/renderscript/RenderScript; at com.daimajia.androidviewhover.tools.Blur.apply(Blur.java:20) at com.daimajia.androidviewhover.BlurLayout.addBlurImage(BlurLayout.java:182) at com.daimajia.androidviewhover.BlurLayout.hover(BlurLayout.java:120) at com.daimajia.androidviewhover.BlurLayout.access$000(BlurLayout.java:29) at com.daimajia.androidviewhover.BlurLayout$BlurLayoutDetector.onSingleTapUp(BlurLayout.java:98) at android.view.GestureDetector.onTouchEvent(GestureDetector.java:635) at com.daimajia.androidviewhover.BlurLayout.onTouchEvent(BlurLayout.java:84)

    opened by johnjake 2
  • Shrink bitmap before blur,then zoom bitmap after blured

    Shrink bitmap before blur,then zoom bitmap after blured

    在对图片进行高斯模糊处理的Blur.java文件中,进行模糊之前先将要模糊的图片尺寸缩小,再对缩小的图片进行模糊处理,最后将图片放大,这样相比之前对图片处理的时间会缩小一半,而且模糊效果也会更加明显,理论上说ScriptIntrinsicBlur进行模糊的范围只能从0~25,而使用图片的尺寸缩放后进行模糊处理能突破这个范围的限制。

    opened by RosesJack 0
  • Gradle build problem

    Gradle build problem

    Error:Execution failed for task ':app:processDebugManifest'.

    Manifest merger failed : Attribute application@icon value=(@mipmap/ic_launcher) from AndroidManifest.xml:22:9-43 is also present at [com.daimajia.easing:library:1.0.0] AndroidManifest.xml:13:9-45 value=(@drawable/ic_launcher) Suggestion: add 'tools:replace="android:icon"' to element at AndroidManifest.xml:19:5-72:19 to override

    Please remove all ic_launcher in your com.daimajia.easing:library

    opened by mrThinBone 3
Owner
代码家
Zhenfund Associate, bp [email protected]
代码家
An elegant context-care loading placeholder for Android

FiftyShadesOf An elegant context-care loading placeholder for Android Usage FiftyShadesOf.with(context) .on(view1, view2, view3)

Florent CHAMPIGNY 1.1k Nov 21, 2022
It's a flip way to show share widget.

What's FlipShare ? It's a cool way to show share widget. Demo Usage step 1. Confirm your parentView to locate the share widget, and then you can custo

巴掌 630 Sep 5, 2022
Bubbles for Android is an Android library to provide chat heads capabilities on your apps. With a fast way to integrate with your development.

Bubbles for Android Bubbles for Android is an Android library to provide chat heads capabilities on your apps. With a fast way to integrate with your

Txus Ballesteros 1.5k Jan 2, 2023
Pinterest like awesome menu control for Android

Pinterest like awesome menu control for Android DEMO NOTE Any pull request is available. HOW TO USE /** * PinterestView'layoutPar

Bruce too 421 Nov 21, 2022
This library provides a simple way to add a draggable sliding up panel (popularized by Google Music and Google Maps) to your Android application. Brought to you by Umano.

Note: we are not actively responding to issues right now. If you find a bug, please submit a PR. Android Sliding Up Panel This library provides a simp

Umano: News Read To You 9.4k Dec 31, 2022
Show triangle view.

TriangleLabelView Show triangle view. How to Use To see how the TriangleLabelView are added to your xml layouts, check the sample project. <jp.shts.an

Shota Saito 877 Dec 6, 2022
ExpandableSelector is an Android library created to show a list of Button/ImageButton widgets inside a animated container which can be collapsed or expanded.

ExpandableSelector ExpandableSelector is an Android library created to show a list of Button/ImageButton widgets inside a animated container which can

Karumi 699 Nov 19, 2022
A view to show bling bling stars when you touch it.

AndroidGlitterView A view to show bling bling stars when you touch it. Demo Dependency compile('com.liangfeizc:glitterview:1.0.0@aar') Attributes name

Fei Liang 177 Nov 10, 2022
FogView is a android library that can show fog on any layout and the fog removes when user rubs it.

Fog View Android Library Min SDK 8 (Android 2.2–2.2.3 Froyo) Screnshots How to use If you want use this library, you can download project and import i

Chetan Kaushik 631 Dec 31, 2022
WindView is an Android Library to show Weather's Wind & pressure Status

WindView WindView is an Android Library to show Weather's Wind & pressure Status Screenshot Demo demo.apk Setup Step 1: Add it as a Dependency in Your

Ahmad Nemati 209 Nov 18, 2022
[] A simple way to "badge" any given Android view at runtime without having to cater for it in layout

Android ViewBadger A simple way to "badge" any given Android view at runtime without having to cater for it in layout. Note: If your aim is to replica

Jeff Gilfelt 3k Nov 28, 2022
TourGuide is an Android library that aims to provide an easy way to add pointers with animations over a desired Android View

TourGuide TourGuide is an Android library. It lets you add pointer, overlay and tooltip easily, guiding users on how to use your app. Refer to the exa

Tan Jun Rong 2.6k Jan 5, 2023
SwipeBack for Android Activities to do pretty the same as the android "back-button" will do, but in a really intuitive way by using a swipe gesture

SwipeBack SwipeBack is for Android Activities to do pretty the same as the android "back-button" will do, but in a really intuitive way by using a swi

Hannes Dorfmann 697 Dec 14, 2022
Just a Wheel——A easy way to setEmptyView to ListView、GridView or RecyclerView etc..

中文说明在这里 TEmptyView Just a Wheel—— A easier way to setEmptyView. Without having to write xml file every time. It supports AdapterView(ListView,GridView

Barry 454 Jan 9, 2023
Display code with syntax highlighting :sparkles: in native way.

CodeView (Android) CodeView helps to show code content with syntax highlighting in native way. Description CodeView contains 3 core parts to implement

Kirill Biakov 827 Dec 22, 2022
NumberPickerView - Custom Android View to provide a user friendly way of picking numbers. 🧪

?? Custom view for Android which provides a modern design and gestures for picking numbers in a user friendly way.

Mirkamal 6 Feb 16, 2022
A set of Android-UI components to make it easier to request permission in a user friendly way.

Permission UI A set of Android-UI components to make it easier to request permission in a user friendly way. Access background location A jetpack comp

Stefan Wärting 54 Nov 3, 2022
Make your native android Toasts Fancy. A library that takes the standard Android toast to the next level with a variety of styling options. Style your toast from code.

FancyToast-Android Prerequisites Add this in your root build.gradle file (not your module build.gradle file): allprojects { repositories { ... ma

Shashank Singhal 1.2k Dec 26, 2022