TargetView


Source link: https://github.com/anastr/SimpleTargetView

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

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.  

Resources

IntelliJ plugin for supporting PermissionsDispatcher.

PermissionsDispatcher is wonderful library for Runtime Permissions. However, it asks developers "attach annotations" and "delegate to generated class" and then after that "rebuild". It's hard to follow all steps correctly. This plugin generates the skeleton of methods for "attach annotations" and "delegate to generated class" using GUI.

RecyclerViewHelper provides the most common functions around recycler view like Swipe to dismiss, Drag and Drop, Divider in the ui, events for when item selected and when not selected, on-click listener for items.

Reactive Billing is a lightweight reactive wrapper around In App Billing API v3 for Android.

Easy splash screen library allows you to generate beautiful and customizable Splash screens with less effort.

A library that allows you to enable/disable features and/or part of code regarding a Context.

Adapter library for RecyclerView to display your app's OSS dependencies.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes