Coder Social home page Coder Social logo

dreiklangdev / radarview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tristateandroidteam/radarview

0.0 0.0 0.0 400 KB

Radar view is custom library to help people create like radar based on their lat long and centre point

Java 100.00%

radarview's Introduction

radarview

Radar view is the custom library or custom class to help people create radar based on their lat-long and center point

Features

You can add a custom view to each and every radar marker or object, also you can add custom center view You can use all the common property of constraint layout in this layout like background or etc.,

Prerequisites

You can implement this directly download this module from GitHub or you can add a dependency from jetpack like bellow

First, add jitpack dependancy in your project level gradle file

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

After that add bellow dependancy in your app level gradle

    implementation 'com.github.TristateAndroidTeam:radarview:1.0' //Library Radarview

Example

First, add view where ever you want to create radar

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <ImageView
        android:id="@+id/mImgRadarBack"
        android:layout_width="250dp"
        android:layout_height="250dp"
        android:layout_centerInParent="true"
        android:background="@drawable/ic_radar" />

    <com.tristate.radarview.RadarViewC
        android:id="@+id/mRadarCustom"
        android:layout_width="250dp"
        android:layout_height="250dp"
        android:layout_centerInParent="true"/>

</RelativeLayout>

Now code part

mRadarCustom=(RadarViewC)findViewById(R.id.mRadarCustom);

ArrayList<ObjectModel> mDataSet = new ArrayList<>();

//Add custom data with a view, you can also add this view by looping
mDataSet.add(new ObjectModel(23.070390, 72.519176, 200, view1));
mDataSet.add(new ObjectModel(23.071559, 72.516494, 150, view2));
mDataSet.add(new ObjectModel(23.069906, 72.515504, 150, view3));


//Finally set data to view
mRadarCustom.setupData(250, mDataSet, latLongCs, mCenterView); //Here 250 is the radar radious you can set as per your choice or set 


//You can get callback of your view click 
mRadarCustom.setUpCallBack(new RadarViewC.IRadarCallBack() {
            @Override
            public void onViewClick(Object objectModel, View view) {

            }
        });

alt text

radarview's People

Contributors

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