Example usage for android.support.v4.view Window FEATURE_INDETERMINATE_PROGRESS

List of usage examples for android.support.v4.view Window FEATURE_INDETERMINATE_PROGRESS

Introduction

In this page you can find the example usage for android.support.v4.view Window FEATURE_INDETERMINATE_PROGRESS.

Prototype

long FEATURE_INDETERMINATE_PROGRESS

To view the source code for android.support.v4.view Window FEATURE_INDETERMINATE_PROGRESS.

Click Source Link

Document

Flag for indeterminate progress .

Usage

From source file:com.actionbarsherlock.sample.demos.app.ActionBarIndeterminateProgress.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    //This has to be called before setContentView and you must use the
    //class in android.support.v4.view and NOT android.view
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    setContentView(R.layout.actionbar_iprogress);
    setProgressBarIndeterminateVisibility(Boolean.FALSE);

    //Bind to the buttons which enable and disable the progress spinner.
    //Notice how we *MUST* pass TRUE/FALSE objects rather than the native
    //true/false values.
    findViewById(R.id.enable).setOnClickListener(new View.OnClickListener() {
        @Override/*from  ww w  .  j  av  a 2  s . c  o  m*/
        public void onClick(View arg0) {
            setProgressBarIndeterminateVisibility(Boolean.TRUE);
        }
    });
    findViewById(R.id.disable).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View arg0) {
            setProgressBarIndeterminateVisibility(Boolean.FALSE);
        }
    });
}

From source file:ca.mudar.mtlaucasou.MainActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    requestWindowFeature(Window.FEATURE_PROGRESS);

    /**/*from   w w w .  ja  v  a  2  s.co m*/
     * SharedPreferences are used to verify determine if syncService is
     * required for initial launch or on database upgrade.
     */
    hasLoadedData = prefs.getBoolean(Const.PrefsNames.HAS_LOADED_DATA, false);
    int dbVersionPrefs = prefs.getInt(Const.PrefsNames.VERSION_DATABASE, -1);

    if (!hasLoadedData || PlacemarkDatabase.getDatabaseVersion() > dbVersionPrefs) {
        hasLoadedData = false;
        createServiceFragment();
    }

    /**
     * Display the GPLv3 licence
     */
    if (!EulaHelper.hasAcceptedEula(this)) {
        EulaHelper.showEula(false, this);
    }

    /**
     * Get the ActivityHelper
     */
    mActivityHelper = ActivityHelper.createInstance(this);
    mAppHelper = (AppHelper) getApplicationContext();

    lang = mAppHelper.getLanguage();

    mAppHelper.updateUiLanguage();
    setContentView(R.layout.activity_home);

    setProgressBarIndeterminateVisibility(Boolean.FALSE);
    setProgressBarVisibility(false);

    /**
     * Android ICS has support for setHomeButtonEnabled() to disable tap on
     * actionbar logo on dashboard.
     */
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        getActionBar().setHomeButtonEnabled(false);
    }
}

From source file:com.flipzu.flipzu.Profile.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    initUser();//from   w  w  w.ja  v a 2  s. co  m

    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    //String data = this.getIntent().getDataString();
    String username = this.getIntent().getStringExtra("user");

    /* start async call in order to fetch user data */
    AsyncFlipInterface.getUser(username, user.getToken(), this);

    /* init Google Analytics tracker */
    initGATracker();

    /* set content view from player.xml */
    setContentView(R.layout.profile);

    /* actionbar */
    getSupportActionBar().setDisplayShowTitleEnabled(false);
    getSupportActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.ab_background));

    FragmentManager fragmentManager = this.getSupportFragmentManager();
    FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
    frag = new ListingsFragmentUser();
    fragmentTransaction.add(R.id.broadcasts, frag);
    fragmentTransaction.commit();
}

From source file:com.flipzu.flipzu.Listings.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    /* restore settings object */
    settings = getSharedPreferences(PREFS_NAME, 0);

    /* init Google Analytics tracker */
    initGATracker();/*  ww w. j  a va2s. c o m*/

    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    setContentView(R.layout.actionbar_tabs_pager);

    setProgressBarIndeterminateVisibility(Boolean.FALSE);

    getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    getSupportActionBar().setDisplayShowTitleEnabled(false);
    getSupportActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.ab_background));

    ActionBar.Tab tab1 = getSupportActionBar().newTab().setIcon(R.drawable.all);
    ActionBar.Tab tab2 = getSupportActionBar().newTab().setIcon(R.drawable.friends);
    ActionBar.Tab tab3 = getSupportActionBar().newTab().setIcon(R.drawable.me);
    ActionBar.Tab tab4 = getSupportActionBar().newTab().setIcon(R.drawable.hot);
    ActionBar.Tab tab5 = getSupportActionBar().newTab().setIcon(R.drawable.search);

    mViewPager = (ViewPager) findViewById(R.id.pager);
    mTabsAdapter = new TabsAdapter(this, getSupportActionBar(), mViewPager);
    mTabsAdapter.addTab(tab1, ListingsFragmentAll.class);
    mTabsAdapter.addTab(tab2, ListingsFragmentFriends.class);
    mTabsAdapter.addTab(tab3, ListingsFragmentProfile.class);
    mTabsAdapter.addTab(tab4, ListingsFragmentHottest.class);
    mTabsAdapter.addTab(tab5, SearchFragment.class);

    if (savedInstanceState != null) {
        getSupportActionBar().setSelectedNavigationItem(savedInstanceState.getInt("index"));
    }
    AppRater.app_launched(this);
}

From source file:org.projecthdata.ehr.viewer.activities.EhrActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    // This has to be called before setContentView and you must use the
    // class in android.support.v4.view and NOT android.view
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    super.onCreate(savedInstanceState);
    setContentView(R.layout.ehr);//from  w  w w .  j a  v a 2 s  .  com

    this.weightFragment = new WeightFragment();
    this.patientFragment = new PatientFragment();
    mAdapter = new MyAdapter(getSupportFragmentManager(), this);

    mPager = (ViewPager) findViewById(R.id.ehr_view_pager);
    mPager.setAdapter(mAdapter);

    // Bind the title indicator to the adapter
    PageIndicator indicator = (TitlePageIndicator) findViewById(R.id.ehr_view_titles);
    indicator.setViewPager(mPager);

    this.prefs = PreferenceManager.getDefaultSharedPreferences(this);
    prefs.registerOnSharedPreferenceChangeListener(this);

    this.ehrDatabaseHelper = new EhrDatabaseHelper(this);

    // initialize the utilities for communicating with the hData server
    this.connectionRepository = ((HHubApplication) getApplicationContext()).getConnectionRepository();

}

From source file:org.pixmob.droidlink.ui.EventsActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    requestWindowFeature(android.view.Window.FEATURE_PROGRESS);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    super.onCreate(savedInstanceState);
    setContentView(R.layout.events);//from  www .  j av  a  2  s.  co  m

    // A spinner is displayed when events are synchronizing.
    setProgressBarIndeterminateVisibility(Boolean.FALSE);
    setProgressBarVisibility(false);

    // Customize action bar.
    final ActionBar actionBar = getSupportActionBar();
    actionBar.setCustomView(R.layout.nav);
    actionBar.setDisplayShowCustomEnabled(true);
    actionBar.setDisplayShowHomeEnabled(false);
    actionBar.setDisplayShowTitleEnabled(false);
    actionBar.setBackgroundDrawable(getResources().getDrawable(R.drawable.nav_background));

    syncActionReceiver = new SyncActionReceiver();

    prefsEditor = getSharedPreferences(SHARED_PREFERENCES_FILE, MODE_PRIVATE).edit();
    notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);

    // The details fragment is hidden until an event is selected.
    final Fragment details = getSupportFragmentManager().findFragmentById(R.id.event_details);
    if (details != null) {
        final FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
        ft.hide(details);
        ft.commit();
    }
}

From source file:org.projecthdata.weight.WeightTrackerActivity.java

/**
 * Called when the activity is first created.
 * //ww  w  .  j  av a  2s. c om
 * @param savedInstanceState
 *            If the activity is being re-initialized after previously being
 *            shut down then this Bundle contains the data it most recently
 *            supplied in onSaveInstanceState(Bundle). <b>Note: Otherwise it
 *            is null.</b>
 */
@Override
public void onCreate(Bundle savedInstanceState) {
    // This has to be called before setContentView and you must use the
    // class in android.support.v4.view and NOT android.view
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    super.onCreate(savedInstanceState);

    setContentView(R.layout.main);
    addWeightFragment = new AddWeightFragment();
    weightListFragment = new WeightListFragment();
    chartFragment = new ChartFragment();

    getSupportFragmentManager().beginTransaction()
            .replace(R.id.fragment_container, weightListFragment, "weight list").commit();
    getSupportFragmentManager().beginTransaction().add(chartFragment, "chart").commit();
    this.prefs = PreferenceManager.getDefaultSharedPreferences(this);
    prefs.registerOnSharedPreferenceChangeListener(this);
    this.connectionRepository = getApplicationContext().getConnectionRepository();
    this.ormManager = new OrmManager(this);
    getSupportFragmentManager().addOnBackStackChangedListener(this);

    // if the data string is present, then it contains the EHR URL.
    // This is probably coming from a scanned QR code. Start the activity to
    // save the EHR URL and kickoff the OAuth handshake
    if (getIntent().getDataString() != null) {
        Intent ehrIntent = new Intent(this, EhrActivity.class);
        ehrIntent.putExtra(EhrActivity.EXTRA_EHR_URL, getIntent().getDataString());
        startActivityForResult(ehrIntent, REQUEST_CODE_EHR);
    }

}

From source file:com.flipzu.flipzu.Player.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // restore User object
    initUser();/*from  w  w w.j av a  2s  . com*/

    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    /* set content view from player.xml */
    setContentView(R.layout.player);

    /* set loading progress */
    setProgressBarIndeterminateVisibility(Boolean.TRUE);

    String data = this.getIntent().getDataString();

    Integer bcastId;
    if (data != null) {
        bcastId = parseUrl(data);
        debug.logV(TAG, "Player, onCreate() with data " + data);
    } else {
        bcastId = getBcastFromSettings();
        debug.logV(TAG, "Player, onCreate() with saved bcast " + bcastId);
    }

    /* start async call in order to fetch bcast data */
    AsyncFlipInterface.getBroadcast(bcastId, Player.this);

    /* init Google Analytics tracker */
    initGATracker();

    /* actionbar */
    getSupportActionBar().setDisplayShowTitleEnabled(false);
    getSupportActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.ab_background));

    /* play/pause button */
    final Button toggle_btn = (Button) findViewById(R.id.play_toggle_btn);
    toggle_btn.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            debug.logV(TAG, "onClick with state " + mState.toString());
            switch (mState) {
            case LOADING:
            case PLAYING:
                if (Player.this.bcast != null && Player.this.bcast.isLive()) {
                    mState = playerState.STOPPED;
                    updateButton();
                    setLiveVisible(false);
                    stopService(intent);
                } else {
                    sendPause();
                }
                break;
            case STOPPED:
                sendPlay();
                break;
            case ERROR:
                sendStop();
                sendPlay();
                break;
            case PAUSED:
                sendResume();
                break;
            }

        }
    });

    /* admob */
    if (user != null && !user.isPremium()) {
        debug.logV(TAG, "onCreate, normal user, showing ads");
        showAdmob();
    } else {
        debug.logV(TAG, "onCreate, premium user, no ads");
    }
}