Animation View to Highlight particular Views 🎯 for Android

Overview

TargetView

Animation View to Highlight particular Views 🎯 for Android, it can be Used with Views that you see important (Like CountDownTimer), And also to attract the user's attention to something interesting.

minSdkVersion=11

Size ~ 12 Kb

Android Arsenal

Preview


Usage

add this line to build.gradle

dependencies {
	    compile 'com.github.anastr:targetviewlib:1.0.3'
}

in layout

<com.github.anastr.targetviewlib.TargetView
        android:id="@+id/mTargetView"
        android:layout_width="200dp"
        android:layout_height="200dp"
        app:targetWidth="10"
        app:targetColor="#6b75ff"
        app:rotateDuration="2000"
        app:targetMode="Target1"
        app:withBackgroundEffect="true"
        app:backgroundEffectColor="#aa3fff1e"
        app:backgroundEffectDuration="500"
        app:rotateSide="Left">
           
           <!-- TODO  add your views here -->
           
    </com.github.anastr.targetviewlib.TargetView>

Methods (code)

start and stop Animation

// Animation starting by defoult
TargetView mTargetView = (TargetView) findViewById(R.id.mTargetView);

// to stop Animation
mTargetView.stopAnimation();

// to start Animation agin
mTargetView.startAnimation();

// check Animation
if (mTargetView.isAnimationRunning() ){
  ....
}

Another Methods

// Change target color
mTargetView.setTargetColor(Color.parseColor(#aa009900));

// Change target Width
mTargetView.setTargetWidth(15);

// Change Background Effect Color
mTargetView.setBackgroundEffectColor(Color.RED);

in New Version

  • you can change the point of rotation of the targetView (see last Attribute).
  • more save memory.

Attributes (in xml)

app:targetWidth="10"

in pixel defoult : 10

app:targetColor="#6b75ff"

defoult : BLACK

app:rotateDuration="2000"

defoult : 2000 milliSeconds

app:withBackgroundEffect="true"

defoult : true

app:backgroundEffectColor="#AA3fff1e"

defoult : Color.CYAN

It is advisable to use alpha

app:backgroundEffectDuration="500"

defoult : 500 milliSeconds

app:rotateSide="Left"

defoult : Right.

enum (Left, Right).

app:targetMode="Target1"

defoult : Target1.

enum (Target1, Target2, Target3, Target4, Target5, Target6, Target7, Target8).

targetMode note screenshot
Target1 ---
Target2 ---
Target3 set targetWidth="80" or more
Target4 ---
Target5 ---
Target6 set targetWidth="10" or less
Target7 ---
Target8 set targetWidth="15" or less


Copyright 2016 Anas ALtair

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.

You might also like...
Customizable bounce animation for any view like in Clash Royale app
Customizable bounce animation for any view like in Clash Royale app

Bounceview-Android Customizable bounce animation for any view updation Getting Started In your build.gradle dependencies { implementation 'hari.bo

A customised EditText view serving the purpose of taking numeric One Time Password from a user. With stunning animation, and high customizability.
A customised EditText view serving the purpose of taking numeric One Time Password from a user. With stunning animation, and high customizability.

PassCodeText A customised EditText view serving the purpose of taking numeric One Time Password from a user. With stunning animation, and high customi

FadingToolbar is an animation library which fades out your footer view in a ScrollView/RecyclerView and fades in a toolbar title
FadingToolbar is an animation library which fades out your footer view in a ScrollView/RecyclerView and fades in a toolbar title

FadingToolbar is an animation library which fades out your footer view in a ScrollView/RecyclerView and fades in a toolbar title (analogue of the LargeTitle animation in iOS)

Android L Ripple effect wrapper for Views
Android L Ripple effect wrapper for Views

Material Ripple Layout Ripple effect wrapper for Android Views Including in your project compile 'com.balysv:material-ripple:1.0.2' Check for latest v

[] Easily have blurred and transparent background effect on your Android views.
[] Easily have blurred and transparent background effect on your Android views.

##[DEPRECATED] BlurBehind Easily have blurred and transparent background effect on your Android views. Before API level 14 there was a Window flag cal

Simple way to animate your views on Android with Rx 🚀
Simple way to animate your views on Android with Rx 🚀

This is an Android library to make a simple way to animate your views on Android with Rx.

explosive dust effect for views
explosive dust effect for views

ExplosionField explosive dust effect for views Getting started In your build.gradle: dependencies { compile 'tyrantgit:explosionfield:1.0.1' } Ex

Glass-break effect for views

BrokenView Glass-break effect for views. Demo Download APK Usage Android Studio dependencies { compile 'com.zys:brokenview:1.0.3' } Eclipse Just pu

Beautiful and smooth custom loading views
Beautiful and smooth custom loading views

mkloader Beautiful and smooth custom loading views Usage com.tuyenmonkey.mkloader.MKLoader android:layout_width="wrap_content" an

Owner
Anas Altair
Dentist, Android Developer.
Anas Altair
FadeOutParticle is an animation for disappearing views like TextViews

FadeOutParticle is an animation for disappearing views like TextViews

Hooman Mohammadi 50 Dec 28, 2022
💳 Bank Card View is a simple and elegant card view with Flip animation.

Visualização de cartão bancário ?? Bank Card View é uma visualização de cartão simples e elegante com animação Flip. Versões Selecione a língua : Engl

Geovani Amaral 10 Dec 12, 2022
💳 Bank Card View is a simple and elegant card view with Flip animation.

Visualização de cartão bancário ?? Bank Card View é uma visualização de cartão simples e elegante com animação Flip. Versões Selecione a língua : Engl

Geovani Amaral 9 Aug 26, 2022
Android Animation Easing Functions. Let's make animation more real!

Android Easing Functions This project is originally from my another project, AndroidViewAnimation, which is an animation collection, to help you make

代码家 2.5k Jan 4, 2023
💳 A quick and easy flip view through which you can create views with two sides like credit cards, poker cards etc.

The article on how this library was created is now published. You can read it on this link here. →. ?? EasyFlipView Built with ❤︎ by Wajahat Karim and

Wajahat Karim 1.3k Dec 14, 2022
Custom-view-animated-file-downloader - Custom Views, Animations, Broadcast Receivers, Notifications

Downloader App Custom views , Drawing with Canvas, Animations (with motionlayout

null 2 Jun 24, 2022
Deprecated in favour of https://developer.android.com/reference/android/support/v4/view/animation/PathInterpolatorCompat.html

Deprecated: use https://developer.android.com/reference/android/support/v4/view/animation/PathInterpolatorCompat.html instead. android-cubic-bezier-in

Codesoup 161 Jan 1, 2023
Android Library to create Lottie animation view dialog easily with a lot of customization

LottieDialog Android Library to create Lottie animation view dialog easily with a lot of customization Why you should use Lottie Dialog You have no li

Amr Hesham 39 Oct 7, 2022
Android Library to create Lottie animation view dialog easily with a lot of customization

Android Library to create Lottie animation view dialog easily with a lot of customization

Amr Hesham 39 Oct 7, 2022
Cute view animation collection.

Android View Animations One day, I saw an iOS library, which is a view shaker, it's very beautiful. I think Android also need one, and should be bette

代码家 12.2k Jan 1, 2023