Code Monkey home page Code Monkey logo

timeskybackground's Introduction

TimeSkyBackgroundView for Android

Interactive sky background widget, only declare on XML in your development app!

Usage

For a working implementation of this project see the timeskybackgroundsample/ folder.

  1. Include the following URL in your root build.gradle file.
buildscript {
    repositories {
        ...
        maven {
            url 'https://dl.bintray.com/leeshoon1344/TimeSkyBackgroundView'
        }
    }
    ...
}
  1. Include the following dependency in your build.gradle file.
compile 'me.sangs:TimeSkyBackgroundView:1.0.0'

Or add the library as a project.

  1. Include the SkyTimeBackgroundView widget in your layout. (Recommend - Your app background)
<me.sangs.time.sky.view.SkyTimeBackgroundView
        android:id="@+id/timeBackgroundView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:autoStart="true"
        app:planetVisible="true"
        app:planetPosition="70"
        app:planetAnimation="true"
        app:planetSpeed="100"
        app:starVisible="false"/>

Complete!

Customization - XML

  • app:autoStart (boolean) - Auto start background animation (default : true)
  • app:planetVisible (boolean) - Visibility planet (SUN / RED SUN / MOON)
  • app:planetPosition (integer) - Set planet position (Position range : 0 ≤ position ≤ 120)
  • app:planetAnimation (boolean) - Enable(Disable) planet move animation
  • app:planetSpeed (integer) - Animation repeat duration (millisec)
  • app:starVisible (boolean) - Visibility star particles
  • app:starLineisible (boolean) - Visibility star line particles
  • app:planetType (string) - Set planet (sun, redSun, moon)

Customization - Java

Change Background Gradient

mBackgroundView.setBackgroundGradient(R.drawable.red_gradient1, R.drawable.red_gradient2, R.drawable.red_gradient3); 

Change Time

mBackgroundView.changeTime(SkyTimeBackgroundView.Time.AFTERNOON); //morning
mBackgroundView.changeTime(SkyTimeBackgroundView.Time.EARLY_NIGHT); //early night
mBackgroundView.changeTime(SkyTimeBackgroundView.Time.NIGHT); //night

Change star visibility

mBackgroundView.setStarVisibility(true); //Visible Star

Change planet visibility

mBackgroundView.setPlanetVisibility(true); //Visible planet

Set planet position

mBackgroundView.setPlanetPosition(70); //Position range : 0 ≤ position ≤ 120

Set planet speed

mBackgroundView.setPlanetSpeed(2000);

Change planet animation enabled

mBackgroundView.usePlanetAnimation(true);

Set star line visibility

mBackgroundView.setStarLineVisibility(true);

Set planet

mBackgroundView.setPlanet(SkyTimeBackgroundView.Planet.SUN); //SUN
mBackgroundView.setPlanet(SkyTimeBackgroundView.Planet.RED_SUN); //RED SUN
mBackgroundView.setPlanet(SkyTimeBackgroundView.Planet.MOON); //MOON

Developed By

Contributions

  • Please, read the README file before opening an issue, thanks.
  • Please, all the Pull Request must be sent to the dev branch, thanks..

Credits

  • Thanks for ParticleDrawable - Docdoro

License

Copyright 2017 LEE SANG HUN(MR.LEE) - [email protected]

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.

timeskybackground's People

Contributors

dsa28s avatar

Watchers

 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.