All Projects → samlss → Lighter

samlss / Lighter

Licence: apache-2.0
💡A highlight & guide library for android.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Lighter

Highlight Userguideview
用户指引提示view,新特性高亮指示 HighLight
Stars: ✭ 647 (+148.85%)
Mutual labels:  guide, highlight
Guideview
简单易用的高亮引导工具,可高度自定义。
Stars: ✭ 94 (-63.85%)
Mutual labels:  guide, highlight
guide
A new feature guide component by react 🧭
Stars: ✭ 597 (+129.62%)
Mutual labels:  guide, highlight
KoHighlights
KOHighlights is a utility for viewing KOReader's highlights and/or export them to simple text, csv or html files.
Stars: ✭ 62 (-76.15%)
Mutual labels:  highlight
rails-microservices-book
A guide to building distributed Ruby on Rails applications using Protocol Buffers, NATS and RabbitMQ
Stars: ✭ 23 (-91.15%)
Mutual labels:  guide
markee
Visual text selection
Stars: ✭ 22 (-91.54%)
Mutual labels:  highlight
laravel-markdown
A highly configurable markdown renderer and Blade component for Laravel
Stars: ✭ 159 (-38.85%)
Mutual labels:  highlight
rnn-from-scratch
A Recurrent Neural Network implemented from scratch (using only numpy) in Python.
Stars: ✭ 62 (-76.15%)
Mutual labels:  guide
Charles-Proxy-Mobile-Guide
The mobile hackers' guide to Charles Proxy 👍
Stars: ✭ 105 (-59.62%)
Mutual labels:  guide
Dell-S2716DGR-Calibration-Guide
Calibration guide for the Dell S2716DG and S2716DGR to get the best picture quality and colors
Stars: ✭ 33 (-87.31%)
Mutual labels:  guide
remark-highlight.js
Legacy plugin to highlight code blocks with highlight.js — please use `rehype-highlight` instead
Stars: ✭ 58 (-77.69%)
Mutual labels:  highlight
sre-playground
🎯 A set of Site Reliability Engineering notes & challenges
Stars: ✭ 24 (-90.77%)
Mutual labels:  guide
http-simple-cheatsheet
Simple HTTP status codes cheatsheet 🦄
Stars: ✭ 18 (-93.08%)
Mutual labels:  guide
Guide Vita
A complete guide to PS Vita (TV) custom firmware, from stock to HENkaku Ensō.
Stars: ✭ 59 (-77.31%)
Mutual labels:  guide
Coding-Standards
Coding Guidelines for C#
Stars: ✭ 125 (-51.92%)
Mutual labels:  guide
Fedora-KDE-Minimal-Install-Guide
Guide to install KDE Plasma desktop environment on a minimal Fedora installation
Stars: ✭ 125 (-51.92%)
Mutual labels:  guide
from-gms-to-hms
Complete guide to adding support for Huawei's mobile services and distribution platform into your apps that are already published on Google Play.
Stars: ✭ 30 (-88.46%)
Mutual labels:  guide
markdown
A reference (guide) on how to write good GitHub markdown for READMEs or any .md file!
Stars: ✭ 40 (-84.62%)
Mutual labels:  guide
archcheatsheet
The way of creating custom Arch dual-boot system without desktop environment with `no mouse` approach in mind.
Stars: ✭ 83 (-68.08%)
Mutual labels:  guide
beginner-windows-npm-gulp-webdev-tutorial
Beginner guide for users on web development with node.js/npm + gulp terminal commands. You'll learn how to use other terminal commands like git, gulp, bower, yarn, and more!
Stars: ✭ 40 (-84.62%)
Mutual labels:  guide

Lighter

Download Api reqeust Apache License 2.0 Blog 996.icu

中文

Support use in:

  • Android native layout(Such as RelativeLayout, FragmentLayout)
  • RecyclerView & ListView & GridView & ScrollView
  • ViewPager
  • Dialog
  • Fragment

Features:

  • One or more highlighted views can be displayed at one time
  • Customizing the paint for highlighting the view
  • Customize the shape of the highlighted view and the size of the shape
  • Customized tip view display animation
  • Custom relative position of the tip view
  • Chained display code, simple to use

Screenshots

Lighter


Lighter


Lighter


Lighter


Lighter


Usage

Gradle

Add it in your app build.gradle at the end of repositories:

dependencies {
    implementation 'me.samlss:lighter:1.0.3'
}

Maven

<dependency>
  <groupId>me.samlss</groupId>
  <artifactId>lighter</artifactId>
  <version>1.0.3</version>
  <type>pom</type>
</dependency>

Code

You can specify that the highlighted root view is attached to the activity or viewgroup,

you can use the below code to specify:

Lighter with(Activity activity) //will use activity.getWindow().getDecorView as the root view, so it will display in full screen 
    
Lighter with(ViewGroup rootView) //will use the 'rootView' as the root view

Complete call:

 Lighter.with(activity)
                .addHighlight(new LighterParameter.Builder()
                                .setHighlightedViewId(R.id.vp_btn_1)
                                .setTipLayoutId(R.layout.layout_tip_1)
                                .setLighterShape(new RectShape(5, 5, 30))
                                .setTipViewRelativeDirection(Direction.BOTTOM)
                                .setTipViewRelativeOffset(new MarginOffset(150, 0, 30, 0))
                                .build())
                .addHighlight(new LighterParameter.Builder()
                        .setHighlightedViewId(R.id.vp_btn_2)
                        .setTipLayoutId(R.layout.layout_tip_2)
                        .setLighterShape(new RectShape(5, 5, 30))
                        .setTipViewRelativeDirection(Direction.TOP)
                        .setTipViewRelativeOffset(new MarginOffset(-400, 0, 0, 30))
                        .build())
                .show();

When you need to display multiple highlight views at once, call addHighlight(LighterParameter...lighterParameters)

Lighter.with(activity)
                .addHighlight(
                        //Show two at a time
                        new LighterParameter.Builder()
                                .setHighlightedViewId(R.id.vp_btn_1)
                                .setTipLayoutId(R.layout.layout_tip_1)
                                .setLighterShape(new RectShape(5, 5, 30))
                                .setTipViewRelativeDirection(Direction.BOTTOM)
                                .setTipViewRelativeOffset(new MarginOffset(150, 0, 30, 0))
                                .build(),

                        new LighterParameter.Builder()
                                .setHighlightedViewId(R.id.vp_btn_2)
                                .setTipLayoutId(R.layout.layout_tip_2)
                                .setLighterShape(new RectShape(5, 5, 30))
                                .setTipViewRelativeDirection(Direction.TOP)
                                .setTipViewRelativeOffset(new MarginOffset(-400, 0, 0, 30))
                                .build())
                .show();

About LighterParameter.Builder

Method Description
setHighlightedViewId Set id the highlighted view
setHighlightedView Set the highlighted view
setTipLayoutId Set the layout id of the tip layout
setTipView Set the tip view
setLighterShape Set the shape of the wrapped highlight view
setShapeXOffset Set the x-axis offset of the shape rect
setShapeYOffset Set the y-axis offset of the shape rect
setTipViewRelativeDirection Set the direction of the tip view relative to the highlighted view
setTipViewRelativeOffset Set the offset of the tip view's margin relative to the highlighted view
setTipViewDisplayAnimation Set animation of the tip view when display
build To create a LighterParameter object
Note:
  • setHighlightedViewId & setHighlightedView
  • setTipLayoutId & setTipView

For the above two methods, you only need to use one. If you don't use it, an exception will be throwing.

About Shape

Shape Description
Rect A rectangular shape with rounded corners and blur radius
Circle A circle shape with blur radius
Oval A oval shape with blur radius
ShapeXOffset & ShapeYOffset

Refer to the below picture :

Lighter

About parameter of TipView

Direction

Refer to the below picture :

Lighter

Offset

When you specify a direction(the default is left), the offset distance will be based on the direction you specify.

E.g:

Left: The values of topMargin & rightMargin will take effect

Right: The values of topMargin & leftMargin will take effect

Top: If the highlighted view is on the left side of the screen, the values of leftMargin & bottomMargin will take effect. Otherwise, the values of rightMargin & bottomMargin will take effect.

Bottom: If the highlighted view is on the left side of the screen, the values of leftMargin & topMargin will take effect. Otherwise, the values of rightMargin & topMargin will take effect.

Animation

You can set any animation for the tip view.

License

Copyright 2018 samlss

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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].