Android Open Source - coloring-book-android Help Activity






From Project

Back to project page coloring-book-android.

License

The source code is released under:

GNU General Public License

If you think the Android project coloring-book-android 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

/*
 * Copyright (c) 2013 Byron Sanchez (hackbytes.com)
 * www.chompix.com/*from   ww  w  .j  a va 2 s  .  co  m*/
 *
 * This file is part of "Coloring Book for Android."
 *
 * "Coloring Book for Android" is free software: you can redistribute
 * it and/or modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation, version 2 of the
 * license.
 *
 * "Coloring Book for Android" is distributed in the hope that it will
 * be useful, but WITHOUT ANY WARRANTY; without even the implied
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with "Coloring Book for Android."  If not, see
 * <http://www.gnu.org/licenses/>.
 */

package net.globide.coloring_book_08;

import android.app.Activity;
import android.os.Bundle;
import android.text.Html;
import android.view.Window;
import android.view.WindowManager;
import android.widget.TextView;

/**
 * This activity presents the user with application usage instructions.
 */

public class HelpActivity extends Activity {

    // Define whether or not this activity continues music from the
    // MusicManager.
    private boolean mContinueMusic = true;

    private TextView mTvHelpBody;

    /**
     * Implements onCreate().
     */
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // We are using the Theme.Dialog theme in this activity's entry in the
        // manifest, thus, all we need to do is inflate the layout.
        super.onCreate(savedInstanceState);

        // Set the activity to full screen mode.
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);

        // Add default content.
        setContentView(R.layout.activity_help);

        // Attach views to their corresponding resource ids.
        mTvHelpBody = (TextView) findViewById(R.id.tvHelpBody);

        // Parse the help string html.
        mTvHelpBody.setText(Html.fromHtml(getResources().getString(R.string.tv_help), null, null));
    }

    /**
     * Implements onBackPressed().
     */
    @Override
    public void onBackPressed() {
        super.onBackPressed();
        // Ensure that the music will continue to play when the user returns to
        // another activity.
        mContinueMusic = true;
    }

    /**
     * Implements onPause().
     */
    @Override
    protected void onPause() {
        super.onPause();

        // If the music should not continue playing when leaving this activity,
        // pause it.
        if (!mContinueMusic) {
            MusicManager.pause();
        }
    }

    /**
     * Implements onResume().
     */
    @Override
    protected void onResume() {
        super.onResume();

        // If this activity continues playing the music, start the mediaplayer.
        mContinueMusic = false;
        MusicManager.start(this, MusicManager.MUSIC_A);
    }
}




Java Source Code List

net.globide.coloring_book_08.Category.java
net.globide.coloring_book_08.ColorActivity.java
net.globide.coloring_book_08.ColorGFX.java
net.globide.coloring_book_08.ColorGfxData.java
net.globide.coloring_book_08.ColorPalette.java
net.globide.coloring_book_08.CreditsActivity.java
net.globide.coloring_book_08.FixedSpeedScroller.java
net.globide.coloring_book_08.HelpActivity.java
net.globide.coloring_book_08.MainActivity.java
net.globide.coloring_book_08.MainPagerAdapter.java
net.globide.coloring_book_08.MainPanelFragment.java
net.globide.coloring_book_08.MusicManager.java
net.globide.coloring_book_08.NodeDatabase.java
net.globide.coloring_book_08.Node.java
net.globide.coloring_book_08.OnMainPanelTouchListener.java
net.globide.coloring_book_08.SettingsActivity.java
net.globide.coloring_book_08.ShopActivity.java
net.globide.coloring_book_08.SplashActivity.java
net.globide.coloring_book_08.util.Base64DecoderException.java
net.globide.coloring_book_08.util.Base64.java
net.globide.coloring_book_08.util.IabException.java
net.globide.coloring_book_08.util.IabHelper.java
net.globide.coloring_book_08.util.IabResult.java
net.globide.coloring_book_08.util.Inventory.java
net.globide.coloring_book_08.util.Purchase.java
net.globide.coloring_book_08.util.Security.java
net.globide.coloring_book_08.util.SkuDetails.java