Android Open Source - JayJayLab-Android-Demo Activity Base






From Project

Back to project page JayJayLab-Android-Demo.

License

The source code is released under:

Apache License

If you think the Android project JayJayLab-Android-Demo 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.jayjaylab.androiddemo.main.activity;
//  w w w .  j  a  v  a 2s.c  o  m
import android.os.Bundle;
import android.support.v4.app.DialogFragment;

import com.jayjaylab.androiddemo.dialog.ProgressDialog;
import com.jayjaylab.androiddemo.event.ProgressBarEvent;

import roboguice.activity.RoboActionBarActivity;
import roboguice.event.Observes;
import roboguice.util.Ln;

/**
 * Created by jongjoo on 12/30/14.
 */
public class ActivityBase extends RoboActionBarActivity {

    @SuppressWarnings("unused")
    protected void handleProgressBarEvent(@Observes ProgressBarEvent event) {
        Ln.d("handleProgressBarEvent() : event : %s", event);

        if(event.getVisibility()) {
            if(event.getStringResourceId() == 0) {
                Ln.d("handleProgressBarEvent() with no text");
                showProgressDialog();
            } else {
                Ln.d("handleProgressBarEvent() with text");
                showProgressDialog(event.getStringResourceId());
            }
        } else {
            dismissProgressDialog();
        }
    }

    protected void showProgressDialog() {
        ProgressDialog dialog = new ProgressDialog();
        dialog.show(getSupportFragmentManager(), ProgressDialog.TAG);
    }

    protected void showProgressDialog(int stringResId) {
        ProgressDialog dialog = new ProgressDialog();
        Bundle args = new Bundle();
        args.putInt("stringResId", stringResId);
        dialog.setArguments(args);
        dialog.show(getSupportFragmentManager(), ProgressDialog.TAG);
    }

    protected void dismissProgressDialog() {
        final DialogFragment dialog = (DialogFragment)
                getSupportFragmentManager().findFragmentByTag(ProgressDialog.TAG);

        Ln.d("dismissProgressDialog() : dialog : %s", dialog);
        if(dialog != null) {
            try {
                dialog.dismiss();
            } catch(Exception e) {
                Ln.e(e);
            }
        }
    }
}




Java Source Code List

com.jayjaylab.androiddemo.ActivityIntroTest.java
com.jayjaylab.androiddemo.Application.java
com.jayjaylab.androiddemo.DaoMaster.java
com.jayjaylab.androiddemo.DaoSession.java
com.jayjaylab.androiddemo.PathDao.java
com.jayjaylab.androiddemo.Path.java
com.jayjaylab.androiddemo.app.greyhound.activity.ActivityMain.java
com.jayjaylab.androiddemo.app.greyhound.activity.ActivityMap.java
com.jayjaylab.androiddemo.app.greyhound.adapter.AdapterPathHistory.java
com.jayjaylab.androiddemo.app.greyhound.event.OnGPXParsingCompleteEvent.java
com.jayjaylab.androiddemo.app.greyhound.event.OnReceiveResultEvent.java
com.jayjaylab.androiddemo.app.greyhound.fragment.FragmentPathHistory.java
com.jayjaylab.androiddemo.app.greyhound.model.Path.java
com.jayjaylab.androiddemo.app.greyhound.service.ServiceRecordingPath.java
com.jayjaylab.androiddemo.app.greyhound.util.Constants.java
com.jayjaylab.androiddemo.app.greyhound.util.GPXParser.java
com.jayjaylab.androiddemo.app.greyhound.util.GPXWriter.java
com.jayjaylab.androiddemo.app.greyhound.util.MyResultReceiver.java
com.jayjaylab.androiddemo.app.greyhound.util.PreferenceHelper.java
com.jayjaylab.androiddemo.dialog.ProgressDialog.java
com.jayjaylab.androiddemo.event.OnClickEvent.java
com.jayjaylab.androiddemo.event.OnLongClickEvent.java
com.jayjaylab.androiddemo.event.ProgressBarEvent.java
com.jayjaylab.androiddemo.main.activity.ActivityBase.java
com.jayjaylab.androiddemo.main.activity.ActivityIntro.java
com.jayjaylab.androiddemo.main.activity.ActivityMain.java
com.jayjaylab.androiddemo.main.adapter.AdapterMain.java
com.jayjaylab.androiddemo.main.model.App.java
com.jayjaylab.androiddemo.util.AndroidHelper.java
com.jayjaylab.androiddemo.util.NIOHelper.java
com.jayjaylab.androiddemo.view.BubbleViewMaker.java
com.jayjaylab.androiddemo.view.CardView.java
com.jayjaylab.androiddemo.view.ImageViewThreadPool.java
com.jayjaylab.androiddemo.view.ViewThreadPool.java
de.greenrobot.daogenerator.gentest.ExampleDaoGenerator.java