Android Open Source - Planets-Gradle Planets List






From Project

Back to project page Planets-Gradle.

License

The source code is released under:

Apache License

If you think the Android project Planets-Gradle listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.andrewq.planets.tv;
//from   ww w  . j a va 2s  .co  m
import java.util.ArrayList;
import java.util.List;

public final class PlanetsList {
    public static final String MOVIE_CATEGORY[] = {
            "Stars"
    };

    public static List<Planet> planetList;
    public static List<Planet> sunList;
    public static List<Planet> moonList;

    public static List<Planet> setupSun() {
        sunList = new ArrayList<Planet>();

        String title[] = {
                "Sun"
        };

        String sunDescription = "The sun is the center of our solar system, " +
                "and the Earth revolves around " +
                "it at a distance of about 93 million miles, " +
                "although this distance varies throughout the year because of " +
                "the Earths elliptical orbit around the sun. " +
                "The distance between the Earth and the Sun " +
                "is called an Astronomical Unit or AU.";

        String bgImageUrl[] = {
                "http://amqtech.com/planets_pics/sun.jpg"
        };
        String cardImageUrl[] = {
                "http://amqtech.com/planets_pics/sun.jpg"
        };

        sunList.add(buildMovieInfo("category", title[0],
                sunDescription, "Star", cardImageUrl[0], bgImageUrl[0]));
        return sunList;
    }

    public static List<Planet> setupPlanets() {
        planetList = new ArrayList<Planet>();

        String title[] = {
                "Mercury",
                "Venus",
                "Earth",
                "Mars",
                "Jupiter",
                "Saturn",
                "Uranus",
                "Neptune"
        };

        String mercuryDescription = "Mercury is the closest planet to the sun. Because of its highly elliptical orbit, its distance from the sun can range from 46 to 70 million kilometers. It is nearly tidally locked, so it rotates three times around its axis in two of its years?? or orbits. A year on Mercury is 88 days long, but one day is the same as 176 Earth days.";
        String venusDescription = "Venus is the second planet from the sun, and it is often thought of as Earths sister planet because the two are so similar in size, density, composition, and gravity. Both have a central core, a molten mantle, and a crust. Venus, however, is not hospitable to life. Venus is the hottest planet in the solar system even though it is not the closest to the sun";
        String earthDescription = "Due to the apparent movements of the Sun and the other planets in relationship to the Earth, ancient scientists thought that the Earth was the center of the universe and that it stayed still as other celestial bodies travelled in circular orbits around it. Finally, the scientist Copernicus postulated that the Sun was at the center of the universe, and he was eventually proven correct.";
        String marsDescription = "Mars, the fourth planet from the Sun, is named after the Roman god of war, and it is often called the Red Planet?? because of its bloody?? color. The bright rust color of Mars is due to iron-rich minerals in its regolith  the loose dust and rock covering its surface. Mars is a terrestrial planet with a thin atmosphere composed primarily of carbon dioxide.";
        String jupiterDescription = "Jupiter is the fifth planet from the Sun. It is two and a half times more massive than all the other planets in the solar system combined, and it is made primarily of gases. It is, therefore, known as a gas giant.?? Its diameter is 142,984 kilometers, and its mass is 317.83 times that of Earth.";
        String saturnDescription = "Saturn, the second largest planet in the solar system, is the sixth planet from the Sun and is named after the Roman god of wealth. It is large enough to hold more than 760 Earths and is more massive than any other planet except Jupiter, roughly 95 times Earth\'s mass. However, Saturn has the lowest density of all the planets and is the only one less dense than water.";
        String uranusDescription = "Uranus is the seventh planet from the Sun and was the first planet to be discovered with the use of a telescope. William Herschel discovered the planet on the 13th of March 1781. He initially believed it was a comet. Herschel tried to have his discovery named Georgian Sidus after King George III.";
        String neptuneDescription = "Neptune is the eighth planet from the Sun and the smallest of the gas giants. Neptune was the first planet found by mathematical prediction after unexpected changes in the orbit of Uranus were observed. It is named after the Roman god of the sea. Neptune\'s elliptical, oval-shaped orbit keeps the planet an average distance from the sun of almost 4.5 billion kilometers, about 30 times as far away as Earth.";

        String bgImageUrl[] = {
                "http://amqtech.com/planets_pics/mercury.jpg",
                "http://amqtech.com/planets_pics/venus.jpg",
                "http://amqtech.com/planets_pics/earth.jpg",
                "http://amqtech.com/planets_pics/mars.jpg",
                "http://amqtech.com/planets_pics/jupiter.jpg",
                "http://amqtech.com/planets_pics/saturn.jpg",
                "http://amqtech.com/planets_pics/uranus.jpg",
                "http://amqtech.com/planets_pics/neptune.jpg"
        };
        String cardImageUrl[] = {
                "http://amqtech.com/planets_pics/mercury.jpg",
                "http://amqtech.com/planets_pics/venus.jpg",
                "http://amqtech.com/planets_pics/earth.jpg",
                "http://amqtech.com/planets_pics/mars.jpg",
                "http://amqtech.com/planets_pics/jupiter.jpg",
                "http://amqtech.com/planets_pics/saturn.jpg",
                "http://amqtech.com/planets_pics/uranus.jpg",
                "http://amqtech.com/planets_pics/neptune.jpg"
        };

        planetList.add(buildMovieInfo("category", title[0],
                mercuryDescription, "Planet", cardImageUrl[0], bgImageUrl[0]));
        planetList.add(buildMovieInfo("category", title[1],
                venusDescription, "Planet", cardImageUrl[1], bgImageUrl[1]));
        planetList.add(buildMovieInfo("category", title[2],
                earthDescription, "Planet", cardImageUrl[2], bgImageUrl[2]));
        planetList.add(buildMovieInfo("category", title[3],
                marsDescription, "Planet", cardImageUrl[3], bgImageUrl[3]));
        planetList.add(buildMovieInfo("category", title[4],
                jupiterDescription, "Planet", cardImageUrl[4], bgImageUrl[4]));
        planetList.add(buildMovieInfo("category", title[5],
                saturnDescription, "Planet", cardImageUrl[5], bgImageUrl[5]));
        planetList.add(buildMovieInfo("category", title[6],
                uranusDescription, "Planet", cardImageUrl[6], bgImageUrl[6]));
        planetList.add(buildMovieInfo("category", title[7],
                neptuneDescription, "Planet", cardImageUrl[7], bgImageUrl[7]));

        return planetList;
    }

    public static List<Planet> setupMoons() {
        moonList = new ArrayList<Planet>();

        String title[] = {
                "Our Moon",
                "Mars: Phobos",
                "Mars: Deimos",
                "Jupiter: Europa",
        };

        String moonDescription = "This is a test!";
        String phobosDescription = "This is a test!";
        String deimosDescription = "This is a test!";
        String europaDescription = "This is a test";

        String bgImageUrl[] = {
                "http://amqtech.com/planets_pics/moon.jpg",
                "http://amqtech.com/planets_pics/deimos.jpg",
                "http://amqtech.com/planets_pics/phobos.jpg",
                "http://amqtech.com/planets_pics/europa.jpg",
        };
        String cardImageUrl[] = {
                "http://amqtech.com/planets_pics/moon.jpg",
                "http://amqtech.com/planets_pics/deimos.jpg",
                "http://amqtech.com/planets_pics/phobos.jpg",
                "http://amqtech.com/planets_pics/europa.jpg",
        };

        moonList.add(buildMovieInfo("category", title[0],
                moonDescription, "Moon", cardImageUrl[0], bgImageUrl[0]));
        moonList.add(buildMovieInfo("category", title[1],
                phobosDescription, "Moon", cardImageUrl[1], bgImageUrl[1]));
        moonList.add(buildMovieInfo("category", title[2],
                deimosDescription, "Moon", cardImageUrl[2], bgImageUrl[2]));
        moonList.add(buildMovieInfo("category", title[3],
                europaDescription, "Moon", cardImageUrl[3], bgImageUrl[3]));

        return moonList;
    }

    private static Planet buildMovieInfo(String category, String title,
                                         String description, String studio, String cardImageUrl,
                                         String bgImageUrl) {
        Planet planet = new Planet();
        planet.setId(Planet.getCount());
        Planet.incCount();
        planet.setTitle(title);
        planet.setDescription(description);
        planet.setStudio(studio);
        planet.setCategory(category);
        planet.setCardImageUrl(cardImageUrl);
        planet.setBackgroundImageUrl(bgImageUrl);
        return planet;
    }
}




Java Source Code List

com.andrewq.planets.MainActivity.java
com.andrewq.planets.iab.Base64DecoderException.java
com.andrewq.planets.iab.Base64.java
com.andrewq.planets.iab.IabException.java
com.andrewq.planets.iab.IabHelper.java
com.andrewq.planets.iab.IabResult.java
com.andrewq.planets.iab.Inventory.java
com.andrewq.planets.iab.Purchase.java
com.andrewq.planets.iab.Security.java
com.andrewq.planets.iab.SkuDetails.java
com.andrewq.planets.image_views.DeimosImageView.java
com.andrewq.planets.image_views.EarthImageView.java
com.andrewq.planets.image_views.EuropaImageView.java
com.andrewq.planets.image_views.JupiterImageView.java
com.andrewq.planets.image_views.MarsImageView.java
com.andrewq.planets.image_views.MercuryImageView.java
com.andrewq.planets.image_views.MoonImageView.java
com.andrewq.planets.image_views.NeptuneImageView.java
com.andrewq.planets.image_views.PhobosImageView.java
com.andrewq.planets.image_views.PlutoImageView.java
com.andrewq.planets.image_views.SaturnImageView.java
com.andrewq.planets.image_views.SunImageView.java
com.andrewq.planets.image_views.UranusImageView.java
com.andrewq.planets.image_views.VenusImageView.java
com.andrewq.planets.misc.Settings.java
com.andrewq.planets.moons.DeimosActivity.java
com.andrewq.planets.moons.EuropaActivity.java
com.andrewq.planets.moons.MoonActivity.java
com.andrewq.planets.moons.PhobosActivity.java
com.andrewq.planets.other_bodies.PlutoActivity.java
com.andrewq.planets.other_bodies.SunActivity.java
com.andrewq.planets.planets.EarthActivity.java
com.andrewq.planets.planets.JupiterActivity.java
com.andrewq.planets.planets.MarsActivity.java
com.andrewq.planets.planets.MercuryActivity.java
com.andrewq.planets.planets.NeptuneActivity.java
com.andrewq.planets.planets.SaturnActivity.java
com.andrewq.planets.planets.UranusActivity.java
com.andrewq.planets.planets.VenusActivity.java
com.andrewq.planets.tv.ApplicationTest.java
com.andrewq.planets.tv.CardPresenter.java
com.andrewq.planets.tv.DetailsActivity.java
com.andrewq.planets.tv.DetailsDescriptionPresenter.java
com.andrewq.planets.tv.PicassoBackgroundManagerTarget.java
com.andrewq.planets.tv.Planet.java
com.andrewq.planets.tv.PlanetsFragment.java
com.andrewq.planets.tv.PlanetsList.java
com.andrewq.planets.tv.PlayerActivity.java
com.andrewq.planets.tv.SettingsActivity.java
com.andrewq.planets.tv.TvActivity.java
com.andrewq.planets.tv.Utils.java
com.andrewq.planets.tv.VideoDetailsFragment.java
com.andrewq.planets.util.NotifyingScrollView.java
com.andrewq.planets.util.RowItem.java
com.andrewq.planets.util.SquareImageView.java
com.andrewq.planets.util.ZoomOutPageTransformer.java