Example usage for android.view Window FEATURE_INDETERMINATE_PROGRESS

List of usage examples for android.view Window FEATURE_INDETERMINATE_PROGRESS

Introduction

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

Prototype

int FEATURE_INDETERMINATE_PROGRESS

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

Click Source Link

Document

Flag for indeterminate progress.

Usage

From source file:ca.liquidlabs.android.speedtestvisualizer.activities.MapperActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // get feature to show progress in actionbar when processing data
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setContentView(R.layout.activity_mapper);
    // It seems like 4.0.x enables progress by default - STOP it!
    hideProgressIndicator();/*www  .jav  a  2s .  c om*/

    Spinner spinner = (Spinner) findViewById(R.id.spinner_conntype_filter);
    ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.filters_array,
            android.R.layout.simple_spinner_item);
    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    spinner.setAdapter(adapter);
    spinner.setOnItemSelectedListener(new ConnectionTypeFilterHandler());

    // Show the Up button in the action bar.
    setupActionBar();

    setUpMapIfNeeded();
}

From source file:com.kii.demo.ui.FragmentTabsPager.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setProgressBarIndeterminateVisibility(false);
    setContentView(R.layout.fragment_tabs_pager);
    mTabHost = (TabHost) findViewById(android.R.id.tabhost);
    mTabHost.setup();//from www  . j a  v a2  s  . com
    mViewPager = (ViewPager) findViewById(R.id.pager);
    mTabsAdapter = new TabsAdapter(this, mTabHost, mViewPager);
    mTabsAdapter.addTab(mTabHost.newTabSpec(TAG_DEVICE).setIndicator(getString(R.string.tab_device),
            getResources().getDrawable(R.drawable.device)), FileListFragment.class, null);
    mTabsAdapter.addTab(mTabHost.newTabSpec(TAG_CLOUD).setIndicator(getString(R.string.tab_cloud),
            getResources().getDrawable(R.drawable.cloud)), KiiFileFragment.class, null);
    if (savedInstanceState != null) {
        mTabHost.setCurrentTabByTag(savedInstanceState.getString("tab"));
    }
    KiiCloudClient.getInstance(this).setActivity(this);
    KiiCloudClient.getInstance(this).refresh();
}

From source file:com.androidquery.simplefeed.base.BaseActivity.java

private void initView() {
    boolean full = fullScreen();

    if (!full) {//  w  w w.  ja  va 2  s  .  c om
        //requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
    }

    //boolean progress = needProgress();
    if (!isActionBar()) {
        requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
        setProgressBarIndeterminate(true);
    }
    setContentView(getContainerView());

    if (!isActionBar()) {
        setProgressBarIndeterminateVisibility(false);
    }

    if (!full) {
        //getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.actionbar);
    }
}

From source file:de.stadtrallye.rallyesoft.MainActivity.java

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

    //      android.support.v4.app.FragmentManager.enableDebugLogging(true);

    // Layout, Title, ProgressCircle etc.
    supportRequestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    setTitle(R.string.app_name);/*from  w  ww  .ja va 2s .c  o  m*/
    setContentView(R.layout.main);

    DrawerLayout drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);

    actionBar = getSupportActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setDisplayShowTitleEnabled(true);
    logo = (TransitionDrawable) getResources().getDrawable(R.drawable.transition_logo);
    actionBar.setIcon(logo);

    // Check if Google Play Services is working
    int errorCode;
    if ((errorCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this)) != ConnectionResult.SUCCESS) {
        GooglePlayServicesUtil.getErrorDialog(errorCode, this, 0).show();
        finish();
    }

    // Google Cloud Messaging Init
    //PushInit.ensureRegistration(this);
    GcmHelper.ensureRegistration(getApplicationContext());

    Storage.aquireStorage(getApplicationContext(), this);
    pref = Storage.getAppPreferences();
    pref.registerOnSharedPreferenceChangeListener(this);
    pref_autoUpload = pref.getBoolean("auto_upload", true);
    pictureManager = Storage.getPictureManager();

    // Initialize Model
    Server.addListener(this);
    server = Server.getCurrentServer();

    // Manages all fragments that will be displayed as Tabs in this activity
    tabManager = new RallyeTabManager(this, server, drawerLayout);

    tabManager.setArguments(RallyeTabManager.TAB_MAP, getDefaultMapOptions(null));// this map is currently not used anyway, so for the time being we always do lateInitialization
    // Recover Last State
    tabManager.restoreState(savedInstanceState);

    //      forceOverflowMenu(); // Force devices with hardware menu key to display the modern overflow menu

    // Initialize NFC ability
    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        initNFC();
    }
}

From source file:com.google.android.apps.watchme.MainActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    getWindow().requestFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    takePicture();//from   w  w  w. ja v  a  2s .co m
    ensureLoader();
    if (!hasPermissions(this, PERMISSIONS)) {
        ActivityCompat.requestPermissions(this, PERMISSIONS, PERMISSION_ALL);
    }

    credential = GoogleAccountCredential.usingOAuth2(getApplicationContext(), Arrays.asList(Utils.SCOPES));
    // set exponential backoff policy
    credential.setBackOff(new ExponentialBackOff());

    if (savedInstanceState != null) {
        mChosenAccountName = savedInstanceState.getString(ACCOUNT_KEY);
    } else {
        loadAccount();
    }

    credential.setSelectedAccountName(mChosenAccountName);

    mEventsListFragment = (EventsListFragment) getFragmentManager().findFragmentById(R.id.list_fragment);
}

From source file:com.dwdesign.tweetings.activity.LinkHandlerActivity.java

@Override
public void onCreate(final Bundle savedInstanceState) {
    requestSupportWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    super.onCreate(savedInstanceState);
    setSupportProgressBarIndeterminateVisibility(false);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    final Intent intent = getIntent();
    final Uri data = intent.getData();
    if (data != null) {
        if (setFragment(data)) {
            if (mFragment != null) {
                if (isDualPaneMode()) {
                    showFragment(mFragment, true);
                } else {
                    final FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
                    ft.replace(R.id.content, mFragment);
                    ft.commit();//w w  w .  j  av  a 2 s. c  o m
                }
                return;
            } else {
                finish();
            }
        }
    } else {
        finish();
    }
}

From source file:org.strongswan.android.ui.MainActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);//from www.j  a v  a 2  s  .c  o m

    ActionBar bar = getSupportActionBar();
    bar.setDisplayShowHomeEnabled(true);
    bar.setDisplayShowTitleEnabled(false);
    bar.setIcon(R.drawable.ic_launcher);

    this.bindService(new Intent(this, VpnStateService.class), mServiceConnection, Service.BIND_AUTO_CREATE);

    /* load CA certificates in a background task */
    new LoadCertificatesTask().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}

From source file:com.shawbeat.MainActivity.java

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

    // set up progress bar on actionbar
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    setContentView(R.layout.activity_main);

    // enable ActionBar app icon to behave as action to toggle nav drawer
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setHomeButtonEnabled(true);

    mTitle = getTitle();/*from   w w  w  . j av  a2 s .  c  o  m*/
    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);

    // set a custom shadow that overlays the main content when the drawer opens
    mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START);
    //*** disable swipe to avoid touch event conflict between nav drawer and pull-to-refresh ***
    mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);

    // ActionBarDrawerToggle ties together the the proper interactions
    // between the sliding drawer and the action bar app icon
    mDrawerToggle = new ActionBarDrawerToggle(this, /* host Activity */
            mDrawerLayout, /* DrawerLayout object */
            R.drawable.ic_drawer, /* nav drawer image to replace 'Up' caret */
            R.string.drawer_open, /* "open drawer" description for accessibility */
            R.string.drawer_close /* "close drawer" description for accessibility */
    ) {
        public void onDrawerClosed(View view) {
            getSupportActionBar().setTitle(mTitle);
        }

        public void onDrawerOpened(View drawerView) {
            //getSupportActionBar().setTitle(mDrawerTitle);
        }
    };
    mDrawerLayout.setDrawerListener(mDrawerToggle);

    mRefreshDrawerList = (PullToRefreshListView) findViewById(R.id.left_drawer);
    mRefreshDrawerList.getRefreshableView().setOnItemClickListener(new DrawerItemClickListener());
    mRefreshDrawerList.setOnRefreshListener(new OnRefreshListener<ListView>() {
        @Override
        public void onRefresh(PullToRefreshBase<ListView> refreshView) {
            new DownloadEdition(MainActivity.this, MainActivity.this).execute();
        }
    });

    // db get all edition
    List<Edition> cache = editionDBHelper.getAllEdition();
    if (cache != null) {
        for (Edition e : cache) {
            mDrawerTitles.add(e.getEdition_name());
        }

    }

    // set list adapter
    mAdapter = new ArrayAdapter<String>(this, R.layout.drawer_list_item, mDrawerTitles);
    mRefreshDrawerList.setAdapter(mAdapter);

    // show refreshing view onCreate()
    new DownloadEdition(this, this).execute();
}

From source file:com.radicaldynamic.groupinform.activities.AccountFolderList.java

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

    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    setContentView(R.layout.generic_list);

    if (savedInstanceState == null) {
        Intent intent = getIntent();/*ww w .  j a v a  2 s  .  c o m*/

        if (intent == null) {
            // Load defaults
        } else {
            mCopyToFolder = intent.getBooleanExtra(KEY_COPY_TO_FOLDER, false);
        }
    } else {
        if (savedInstanceState.containsKey(KEY_COPY_TO_FOLDER))
            mCopyToFolder = savedInstanceState.getBoolean(KEY_COPY_TO_FOLDER);

        if (savedInstanceState.containsKey(KEY_FOLDER_ID))
            mSelectedFolderId = savedInstanceState.getString(KEY_FOLDER_ID);

        if (savedInstanceState.containsKey(KEY_FOLDER_NAME))
            mSelectedFolderName = savedInstanceState.getString(KEY_FOLDER_NAME);

        Object data = getLastNonConfigurationInstance();

        if (data instanceof RefreshViewTask)
            mRefreshViewTask = (RefreshViewTask) data;
        else if (data instanceof SynchronizeFoldersTask)
            mSynchronizeFoldersTask = (SynchronizeFoldersTask) data;
    }

    if (mCopyToFolder)
        setTitle(getString(R.string.app_name) + " > " + getString(R.string.tf_copy_to_folder));
    else
        setTitle(getString(R.string.app_name) + " > " + getString(R.string.tf_form_folders));
}

From source file:com.android.music.AlbumBrowserActivity.java

/** Called when the activity is first created. */
@Override/*  ww w .  j  av a 2 s  . co  m*/
public void onCreate(Bundle icicle) {
    if (icicle != null) {
        mCurrentAlbumId = icicle.getString("selectedalbum");
        mArtistId = icicle.getString("artist");
    } else {
        mArtistId = getIntent().getStringExtra("artist");
    }
    super.onCreate(icicle);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setVolumeControlStream(AudioManager.STREAM_MUSIC);
    mToken = MusicUtils.bindToService(this, this);

    IntentFilter f = new IntentFilter();
    f.addAction(Intent.ACTION_MEDIA_SCANNER_STARTED);
    f.addAction(Intent.ACTION_MEDIA_SCANNER_FINISHED);
    f.addAction(Intent.ACTION_MEDIA_UNMOUNTED);
    f.addDataScheme("file");
    registerReceiver(mScanListener, f);

    setContentView(R.layout.media_picker_activity);
    MusicUtils.updateButtonBar(this, R.id.albumtab);
    ListView lv = getListView();
    lv.setOnCreateContextMenuListener(this);
    lv.setTextFilterEnabled(true);

    mAdapter = (AlbumListAdapter) getLastNonConfigurationInstance();
    if (mAdapter == null) {
        //Log.i("@@@", "starting query");
        mAdapter = new AlbumListAdapter(getApplication(), this, R.layout.track_list_item, mAlbumCursor,
                new String[] {}, new int[] {});
        setListAdapter(mAdapter);
        setTitle(R.string.working_albums);
        getAlbumCursor(mAdapter.getQueryHandler(), null);
    } else {
        mAdapter.setActivity(this);
        setListAdapter(mAdapter);
        mAlbumCursor = mAdapter.getCursor();
        if (mAlbumCursor != null) {
            init(mAlbumCursor);
        } else {
            getAlbumCursor(mAdapter.getQueryHandler(), null);
        }
    }

    badSymptoms = new BadSymptoms(this);
}