Android Open Source - Planets-App Deimos






From Project

Back to project page Planets-App.

License

The source code is released under:

Apache License

If you think the Android project Planets-App 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;
//from w w  w.j  a v a  2 s . c  o  m
import android.app.ActionBar;
import android.app.Activity;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v4.app.NavUtils;
import android.view.MenuItem;

import com.google.analytics.tracking.android.EasyTracker;

/**
 * Created by Andrew Quebe on 4/5/14.
 */
public class Deimos extends Activity {

    private ActionBar mActionBar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        setContentView(R.layout.deimos);
        getActionBar().setDisplayHomeAsUpEnabled(true);
        super.onCreate(savedInstanceState);

        overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_left);

        SharedPreferences getPrefs = PreferenceManager
                .getDefaultSharedPreferences(getBaseContext());
        int theme_chooser = Integer.parseInt(getPrefs.getString("prefSetTheme", "1"));
        mActionBar = getActionBar();

        if (theme_chooser == 1) {
            //Red
            mActionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#cc0202")));
        } else if (theme_chooser == 2) {
            //Orange
            mActionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#ff8801")));
        } else if (theme_chooser == 3) {
            //Blue
            mActionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#0497c9")));
        } else if (theme_chooser == 4) {
            //Green
            mActionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#679a03")));
        } else if (theme_chooser == 5) {
            //Purple
            mActionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#9832cb")));
        } else {
            //Black
            mActionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#292929")));
        }

    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case android.R.id.home:
                NavUtils.navigateUpFromSameTask(this);
                overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_right);
                return true;
        }

        return true;
    }

    @Override
    public void onBackPressed() {
        super.onBackPressed();
        overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_right);
    }

    @Override
    public void onStart() {
        super.onStart();
        EasyTracker.getInstance(this).activityStart(this);  // Add this method.
    }

    @Override
    public void onStop() {
        super.onStop();
        EasyTracker.getInstance(this).activityStop(this);  // Add this method.
    }

    @Override
    public void finish() {
        super.finish();
        overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_right);
    }


}




Java Source Code List

com.andrewq.planets.CustomAdapter.java
com.andrewq.planets.Deimos.java
com.andrewq.planets.EclairMotionEvent.java
com.andrewq.planets.FragmentA.java
com.andrewq.planets.FragmentB.java
com.andrewq.planets.FragmentC.java
com.andrewq.planets.FragmentD.java
com.andrewq.planets.FragmentE.java
com.andrewq.planets.FragmentF.java
com.andrewq.planets.FragmentG.java
com.andrewq.planets.FragmentH.java
com.andrewq.planets.FragmentHome.java
com.andrewq.planets.FragmentI.java
com.andrewq.planets.FragmentPlanets.java
com.andrewq.planets.ImageGallery.java
com.andrewq.planets.Phobos.java
com.andrewq.planets.RandomQuotes.java
com.andrewq.planets.RowItem.java
com.andrewq.planets.SatelliteEarth.java
com.andrewq.planets.Settings.java
com.andrewq.planets.SunGLActivity.java
com.andrewq.planets.SunRenderer.java
com.andrewq.planets.TouchImageView.java
com.andrewq.planets.VenusRenderer.java
com.andrewq.planets.WrapMotionEvent.java
com.obsidian.planets.Main.java