Code Monkey home page Code Monkey logo

android-wind-direction-view's Introduction

header

build.gradle

dependencies {
    ...
    implementation 'com.radiance.winddirections:winddirections:1.0.0'
}

To display a WindDirections in an activity, add a petal to the activity's layout XML file:

  <com.radiance.winddirections.WindDirections
      android:id="@+id/wd_id"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      app:layout_constraintTop_toTopOf="parent"
      app:layout_constraintLeft_toLeftOf="parent"
      app:directionsCount="eight"
      
      app:grid_text_size="18dp"
      app:grid_text_color="#000000"
      app:grid_line_size="1dp"
      app:grid_line_color="#000000"
      
      app:petal_color="@color/colorAccent"
      app:petal_border_color="#000000"  
      app:petal_border_size="2dp"   
      app:petal_margin="2dp"        
      app:petal_top_style="sector"     
      app:petal_bottom_style="sector"     
      app:petal_bottom_radius="4dp" />

To set wind power:

// 1. Create WindPower object. WindPower contains wind power depending on the direction.
val windPower = WindDirections.WindPower().apply {N = 400
                                                  S = 300
                                                  E = 200
                                                  W = 500}
// 2. Find windDirection view
val windDirections = findViewById<WindDirections>(R.id.wd_id)
// 3. Set windPower property
windDirections.windPower = windPower
Value Sample XML property Kotlin property
margin eight app:petal_margin="2dp" wdView.petalMargin = 4.0
Value Sample XML property Kotlin property
radius eight app:petal_bottom_radius="4dp" wdView.bottomRadius = 4.0
Value Sample XML property Kotlin property
color eight app:petal_color="@color/colorAccent" wdView.petalColor = color
border size eight app:petal_border_size="2dp" wdView.petalBorder = 3.0
border color eight app:petal_border_color="#000000" wdView.petalBorderColor = color
Value Sample XML property Kotlin property
sector eight app:petal_top_style="sector" wdView.topStyle = Petal.TopStyle.Sector
flat eight app:petal_top_style="flat" wdView.topStyle = Petal.TopStyle.Flat
Value Sample XML property Kotlin property
sector eight app:petal_bottom_style="sector" wdView.bottomStyle = Petal.BottomStyle.Sector
flat eight app:petal_bottom_style="flat" wdView.bottomStyle = Petal.BottomStyle.Flat

Directions

Value Sample XML property Kotlin property
eight eight app:directionsCount="eight" wdView.angle = WindDirections.Angle.Eight
sixteen sixteen app:directionsCount="sixteen" wdView.angle = WindDirections.AngleSixteen
Value Sample XML property Kotlin property
size eight app:grid_text_size="18dp" wdView.gridTextSize = 10.0
color eight app:grid_text_color="#000000" wdView.gridTextColor = color
Value Sample XML property Kotlin property
size eight app:grid_line_size="1dp" wdView.gridLineSize = 3.0
color eight app:grid_line_color="#000000" wdView.gridLineColor = color

android-wind-direction-view's People

Contributors

vladislaudaroshka avatar

Watchers

James Cloos avatar Hvilinka 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.