Git Product home page Git Product logo

radarscanview's Introduction

RadarScanView

Android RadarScanView , An easy-to-use view, can be used for any scanning operation view. 雷达扫描视图

Preview

How to

To get a Git project into your build:

Step 1. Add the JitPack repository to your build file

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

	allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

Step 2. Add the dependency

	dependencies {
	        implementation 'com.github.Pillarzx:RadarScanView:1.2.0'
	}

Usage

XML:

<com.radar.widget.RadarScanView
        android:id="@+id/radar_scan"
        android:layout_width="120dp"
        android:layout_height="120dp"
        app:circleColor="#8aa8ff"  
        app:circleWidth="1"
        app:tailColor="#8aa8ff"
        app:radarColor="#99a2a2a2"
        app:innerRingAlpha="94"
        app:outerRingAlpha="64"
        app:innerRingWidth="6"
        app:outerRingWidth="4"/>
Name Value
circleColor color for radar circle
circleWidth width for radar circle
tailColor tail color for scan line
radarColor center color for radar
innerRingAlpha Alpha for the first ring out of radar
outerRingAlpha Alpha for the second ring out of radar
innerRingWidth width for the first ring out of radar
outerRingWidth width for the second ring out of radar
commonSpeed speed for scan line
ringSpeed speed for ring

Java:

RadarScanView radarScanView = findViewById(R.id.radar_scan);

radarScanView.setCanClickToStart(true); //Is it possible to start the animation by clicking the view
radarScanView.getScanState(); //Get the scan state of the animation
radarScanView.startScan(); //Start to scan
radarScanView.stopScan(); //Stop to scan
radarScanView.setOnScanClickListener(view -> { /*TODO*/ })  
radarScanView.setRingSpeed(5); //set ring speed(recommend range 1-30)
radarScanView.setCommonSpeed(3); //set scan line speed(recommend range 1-30)
radarScanView
    .setCircleColor("#FFCDDC39")
	.setCircleWidth(2)
    .setTailColor("#FFF3DB0F")
    .setRadarColor("#FFCDDC39")
    .setInnerRingStrokeWidth(6)
    .setInnerRingStrokeAlpha(94)
    .setOuterRingStrokeWidth(5)
    .setOuterRingStrokeAlpha(94)
    .build(); 

Change log

  • V1.0.0 2020.11.20

    Release the first edition

  • V1.1.0 2020.11.24

    1. Add some new XML attrbutes.
    2. Add new methods for the class.
  • V1.2.0 2020.11.27

    1. Add speed attributes
    2. Adjust animation logic

radarscanview's People

Contributors

pillarzx 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.