Android Open Source - android-progress-panel Demo Activity






From Project

Back to project page android-progress-panel.

License

The source code is released under:

Apache License

If you think the Android project android-progress-panel 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.marvinlabs.widget.progresspanel.demo;
//  w  ww.  java  2 s.  co  m

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentTransaction;

import com.marvinlabs.widget.progresspanel.demo.R;

public class DemoActivity extends FragmentActivity {

    public static final String EXTRA_FRAGMENT_CLASS = "FragmentClass";
    public static final String EXTRA_FRAGMENT_ARGS = "FragmentArgs";
    private static final String TAG_DEMO_FRAGMENT = "DemoFragment";
    private Fragment demoFragment;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_demo);

        // If should be in two-pane mode, finish to return to main activity
        if (getResources().getBoolean(R.bool.has_two_panes)) {
            finish();
            return;
        }

        FragmentTransaction ft = getSupportFragmentManager().beginTransaction();

        demoFragment = getSupportFragmentManager().findFragmentByTag(TAG_DEMO_FRAGMENT);
        if (demoFragment != null) ft.remove(demoFragment);

        demoFragment = DemoListActivity.newFragmentInstance(getIntent().getStringExtra(EXTRA_FRAGMENT_CLASS),
                getIntent().getBundleExtra(EXTRA_FRAGMENT_ARGS));
        ft.replace(R.id.main_container, demoFragment, TAG_DEMO_FRAGMENT).commit();
    }
}




Java Source Code List

com.marvinlabs.widget.progresspanel.ProgressPanel.java
com.marvinlabs.widget.progresspanel.demo.DemoActivity.java
com.marvinlabs.widget.progresspanel.demo.DemoListActivity.java
com.marvinlabs.widget.progresspanel.demo.DemoListFragment.java
com.marvinlabs.widget.progresspanel.demo.ProgressFragment.java
com.marvinlabs.widget.progresspanel.demo.ProgressPanelDemoFragment.java