GithubHelp home page GithubHelp logo

pranavlathigara / androidwidgets Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ntoskrnl/androidwidgets

0.0 2.0 0.0 456 KB

Custom Android widgets used in cardiomood.com projects

Java 100.00%

androidwidgets's Introduction

Build Status Maven Central AndroidWidgets

Custom Android widgets used in cardiomood.com projects.

Import to your project

The labrary is available in maven repository.

You can include your library in your build.gradle:

compile 'com.cardiomood.android:android-widgets:0.1.1'

If you are using Maven, add the following dependency to pom.xml:

<dependency>
  <groupId>com.cardiomood.android</groupId>
  <artifactId>android-widgets</artifactId>
  <version>0.1.1</version>
  <type>aar</type>
</dependency>

Widgets

At the moment, the library includes the following components:

  • SpeedometerGauge - a simple needle gauge that looks like speedometer
  • BatteryIndicatorGauge - an iPhone like pseudo-3d battery indicator
  • CircularProgressBar - a siple circular progress bar with a text inside
  • CircledTextView - a TextView that has a circle around it

SpeedometerGauge

This was moved from the previous repository: https://github.com/ntoskrnl/SpeedometerView

Simple speedometer-like gauge with needle for Android.

speedometerview-v1

Usage

Import the library to your project.

In your layout xml-file add SpeedometerGauge as shown:

<com.cardiomood.android.controls.gauge.SpeedometerGauge
    android:layout_height="wrap_content"
    android:layout_width="match_parent"
    android:padding="8dp"
    android:id="@+id/speedometer" />

Configure SpeedometerGuge:

  private SpeedometerGauge speedometer;

  // Customize SpeedometerGauge
  speedometer = (SpeedometerGauge) v.findViewById(R.id.speedometer);
  
  // Add label converter
  speedometer.setLabelConverter(new SpeedometerView.LabelConverter() {
      @Override
      public String getLabelFor(double progress, double maxProgress) {
          return String.valueOf((int) Math.round(progress));
      }
  });
  
  // configure value range and ticks
  speedometer.setMaxSpeed(300);
  speedometer.setMajorTickStep(30);
  speedometer.setMinorTicks(2);
  
  // Configure value range colors
  speedometer.addColoredRange(30, 140, Color.GREEN);
  speedometer.addColoredRange(140, 180, Color.YELLOW);
  speedometer.addColoredRange(180, 400, Color.RED);

androidwidgets's People

Contributors

ntoskrnl avatar

Watchers

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