Android Open Source - Planets-App Fragment Home






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 ww.  j  av  a 2 s .co m
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.app.Fragment;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

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

public class FragmentHome extends Fragment {

    TextView mQuoteView;
    Handler handler = new Handler();
    Runnable updateTextRunnable = new Runnable() {

        @Override
        public void run() {
            final String quotes = mRandomQuotes.getQuotes();
            mQuoteView.setText(quotes);
        }
    };
    private RandomQuotes mRandomQuotes = new RandomQuotes();

    public FragmentHome() {
        // Required empty public constructor
    }

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View v = inflater.inflate(R.layout.fragment_home, container, false);
        mQuoteView = (TextView) v.findViewById(R.id.tvRandomQuote);
        mQuoteView.setGravity(Gravity.CENTER);
        handler.post(updateTextRunnable);

        return v;
    }

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

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

}




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