Skip to content
This repository has been archived by the owner on Jul 11, 2020. It is now read-only.

dsa28s/TimeSkyBackground

Repository files navigation

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) - leeshoon1344@gmail.com

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.

About

Time Sky Background for Android

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages