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:org.onebusaway.android.ui.ReportTripProblemActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    super.onCreate(savedInstanceState);
    UIUtils.setupActionBar(this);

    FragmentManager fm = getSupportFragmentManager();

    // Create the fragment and add it as our sole content.
    if (fm.findFragmentById(android.R.id.content) == null) {
        ReportTripProblemFragment list = new ReportTripProblemFragment();
        list.setArguments(FragmentUtils.getIntentArgs(getIntent()));
        fm.beginTransaction().add(android.R.id.content, list).commit();
    }/* w w  w  .  j av  a 2  s . c o m*/
}

From source file:ch.ethz.twimight.activities.TwimightBaseActivity.java

/**
 * Called when the activity is first created.
 *///from ww  w  .  j a  va2s.c  om
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    // action bar
    actionBar = getActionBar();
    actionBar.setHomeButtonEnabled(true);
    actionBar.setDisplayShowTitleEnabled(true);
    actionBar.setTitle("@" + LoginActivity.getTwitterScreenname(this));

}

From source file:com.spondbob.bluetooth.BluetoothActivity.java

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

    // Setup the window
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setContentView(R.layout.device_list);

    // Set result CANCELED in case the user backs out
    setResult(Activity.RESULT_CANCELED);

    // Initialize array adapters. One for already paired devices and
    // one for newly discovered devices
    mNewDevicesArrayAdapter = new ArrayAdapter<String>(this, R.layout.device_name);

    // Find and set up the ListView for newly discovered devices
    newDevicesListView = (ListView) findViewById(R.id.new_devices);
    newDevicesListView.setAdapter(mNewDevicesArrayAdapter);

    // Register for broadcasts when a device is discovered
    IntentFilter filter = new IntentFilter(BluetoothDevice.ACTION_FOUND);
    this.registerReceiver(mReceiver, filter);

    // Register for broadcasts when discovery has finished
    filter = new IntentFilter(BluetoothAdapter.ACTION_DISCOVERY_FINISHED);
    this.registerReceiver(mReceiver, filter);

    // Get the local Bluetooth adapter
    mBtAdapter = BluetoothAdapter.getDefaultAdapter();
}

From source file:com.google.android.demos.rss.app.ChannelActivity.java

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

    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setContentView(R.layout.list_activity);
    ListView listView = (ListView) findViewById(android.R.id.list);
    mEmpty = findViewById(R.id.empty);//from   w ww .  j a v a  2s.com
    mLoading = findViewById(R.id.loading);
    mError = findViewById(R.id.error);
    mError.findViewById(R.id.retry).setOnClickListener(this);

    // Loader from last Activity instance may still be loading
    mLoading.setVisibility(View.VISIBLE);
    mEmpty.setVisibility(View.GONE);
    mError.setVisibility(View.GONE);

    Context context = this;
    int layout = android.R.layout.simple_list_item_1;
    String[] from = { Items.TITLE };
    int[] to = { android.R.id.text1 };
    SimpleCursorAdapter innerAdapter = new SimpleCursorAdapter(context, layout, null, from, to);
    innerAdapter.setViewBinder(this);

    mAdapter = new ChannelAdapter(this);
    mAdapter.registerDataSetObserver(new TitleObserver());
    listView.setAdapter(mAdapter);
    listView.setOnItemClickListener(this);
    getSupportLoaderManager().initLoader(LOADER_CHANNEL, Bundle.EMPTY, this);
}

From source file:com.scigames.slidegame.Registration4PhotoActivity.java

/** Called with the activity is first created. */
@Override/*from   w  w  w .  ja va 2s . co m*/
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Log.d(TAG, "super.OnCreate");
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
    Intent i = getIntent();
    Log.d(TAG, "getIntent");
    firstNameIn = i.getStringExtra("fName");
    lastNameIn = i.getStringExtra("lName");
    studentIdIn = i.getStringExtra("studentId");
    visitIdIn = i.getStringExtra("visitId");
    Log.d(TAG, "...getStringExtra");

    // Inflate our UI from its XML layout description.
    setContentView(R.layout.registration4_photo);
    Log.d(TAG, "...setContentView");

    this.imageView = (ImageView) this.findViewById(R.id.imageView1);
    Log.d(TAG, "...findViewById. imageView1");

    // Hook up button presses to the appropriate event handler.
    ((Button) findViewById(R.id.back)).setOnClickListener(mBackListener);
    //((Button) findViewById(R.id.continue_button)).setOnClickListener(mContinueButtonListener);
    ((Button) findViewById(R.id.continue_button)).setOnClickListener(mContinueButtonListener);//(mDoneListener);
    ((Button) findViewById(R.id.take_pic)).setOnClickListener(mTakePhotoListener);
    Log.d(TAG, "...instantiateButtons");

    //set listener
    task.setOnResultsListener(this);
}

From source file:org.birthdayadapter.ui.BaseActivity.java

/**
 * Called when the activity is first created.
 *///from w  w w  .j  a v  a 2  s . co  m
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mActivity = this;

    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        // Load Activity for Android < 4.0
        Intent oldActivity = new Intent(mActivity, BaseActivityV8.class);
        oldActivity.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
        startActivity(oldActivity);
        finish();
    } else {
        // Load new design with tabs
        mViewPager = new ViewPager(this);
        mViewPager.setId(R.id.pager);

        setContentView(mViewPager);

        ActionBar actionBar = getActionBar();
        actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
        actionBar.setDisplayShowTitleEnabled(true);
        actionBar.setDisplayHomeAsUpEnabled(false);

        mTabsAdapter = new TabsAdapter(this, mViewPager);

        mTabsAdapter.addTab(actionBar.newTab().setText(getString(R.string.tab_main)), BaseFragment.class, null);

        mTabsAdapter.addTab(actionBar.newTab().setText(getString(R.string.tab_preferences)),
                PreferencesFragment.class, null);

        mTabsAdapter.addTab(actionBar.newTab().setText(getString(R.string.tab_accounts)),
                AccountListFragment.class, null);

        mTabsAdapter.addTab(actionBar.newTab().setText(getString(R.string.tab_help)), HelpFragment.class, null);

        mTabsAdapter.addTab(actionBar.newTab().setText(getString(R.string.tab_about)), AboutFragment.class,
                null);

        // default is disabled:
        mActivity.setProgressBarIndeterminateVisibility(Boolean.FALSE);

        mySharedPreferenceChangeListener = new MySharedPreferenceChangeListener(mActivity,
                mBackgroundStatusHandler);

        /*
         * Show workaround dialog for Android bug http://code.google.com/p/android/issues/detail?id=34880
         * Bug exists on Android 4.1 (SDK 16) and on some phones like Galaxy S4
         */
        if (BuildConfig.GOOGLE_PLAY_VERSION && PreferencesHelper.getShowWorkaroundDialog(mActivity)
                && !isPackageInstalled("org.birthdayadapter.jb.workaround")) {
            if ((Build.VERSION.SDK_INT == 16) || Build.DEVICE.toUpperCase().startsWith("GT-I9000")
                    || Build.DEVICE.toUpperCase().startsWith("GT-I9500")) {
                InstallWorkaroundDialogFragment dialog = InstallWorkaroundDialogFragment.newInstance();
                dialog.show(getFragmentManager(), "workaroundDialog");
            }
        }
    }
}

From source file:com.google.android.demos.jamendo.app.JamendoActivity.java

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

    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setContentView(R.layout.jamendo_list);

    mImageLoader = ImageLoader.get(this);
    mHeaderAdapter = createHeaderAdapter();
    mSeparatorAdapter = createSeparatorAdapter();
    mListAdapter = createListAdapter();/*from  w w w.  j a  v  a 2s.  co m*/

    LoaderManager.LoaderCallbacks<Cursor> callbacks = new StatusViewManager(this, LOADER_LIST, this, this);
    mHeader = new Loadable(getSupportLoaderManager(), LOADER_HEADER, callbacks);
    mList = new Loadable(getSupportLoaderManager(), LOADER_LIST, callbacks);

    ListView list = (ListView) findViewById(android.R.id.list);
    list.setAdapter(new CompositeListAdapter(mHeaderAdapter, mSeparatorAdapter, mListAdapter));
    list.setOnItemClickListener(this);

    // Load up to 100 list items initially instead of loading incrementally
    mHeader.init();
    mList.init(100);
}

From source file:joshuatee.wx.SPCCompmapActivity.java

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

    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    preferences = PreferenceManager.getDefaultSharedPreferences(this);
    theme_blue_current = preferences.getString("THEME_BLUE", "");
    setTheme(Utility.Theme(theme_blue_current));
    setContentView(R.layout.activity_spccompmap);

    dm = new DisplayMetrics();
    this.getWindowManager().getDefaultDisplay().getMetrics(dm);

    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    mDrawerList = (ListView) findViewById(R.id.left_drawer);
    mDrawerList.setAdapter(new ArrayAdapter<String>(this, R.layout.drawer_list_item, model_params_labels));
    mDrawerList.setOnItemClickListener(new DrawerItemClickListener());

    mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.drawable.drawer, R.string.drawer_open,
            R.string.drawer_close) {/* w  w w. j  av  a 2s .c o m*/
        public void onDrawerClosed(View view) {
            super.onDrawerClosed(view);
        }

        public void onDrawerOpened(View drawerView) {
            super.onDrawerOpened(drawerView);

        }
    };

    mDrawerLayout.setDrawerListener(mDrawerToggle);
    getActionBar().setDisplayHomeAsUpEnabled(true);
    getActionBar().setHomeButtonEnabled(true);

    img_url = "http://www.spc.noaa.gov/exper/compmap/basemap.gif";
    new GetContent().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}

From source file:semanticweb.hws14.movapp.activities.MovieDetail.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setContentView(R.layout.activity_movie_detail);
    getActionBar().setDisplayHomeAsUpEnabled(false);
    initDetailView();//ww w  . ja  v  a2s  .  c o m

    Intent intent = getIntent();
    Movie movie = intent.getParcelableExtra("movie");
    MovieDet movieD = new MovieDet(movie);
    if (movie.equals(staticMovie)) {
        movie.geteListener().onFinished(movieDet);
    } else {
        staticMovie = movie;
        q = new queryForMovieData();
        q.execute(movieD);
    }

    movieD.setOnFinishedEventListener(new EventListener() {
        @Override
        public void onFinished(final MovieDet movie) {
            movieDet = movie;
            //for the async HttpRequester
            staticRequestCanceled = false;
            setData(movie);
        }
    });
}

From source file:com.google.android.demos.jamendo.app.ArtistGalleryActivity.java

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

    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setContentView(R.layout.jamendo_gallery);
    mGallery = (Gallery) findViewById(android.R.id.list);
    mTextArtistName = (TextView) findViewById(R.id.text1);
    mTextArtistGenre = (TextView) findViewById(R.id.text2);

    Resources resources = getResources();
    mImageSize = resources.getDimensionPixelSize(R.dimen.gallery_size);

    ArtistDetailsObserver artistDetailsObserver = new ArtistDetailsObserver();
    mAdapter = new ArtistGalleryAdapter(this);
    mAdapter.registerDataSetObserver(artistDetailsObserver);

    mArtists = new Loadable(getSupportLoaderManager(), LOADER_ARTISTS,
            new StatusViewManager(this, LOADER_ARTISTS, this, this));

    mGallery.setAdapter(new GalleryDecorator(mAdapter, this));
    mGallery.setOnItemClickListener(this);
    mGallery.setOnItemSelectedListener(new CompositeOnItemSelectedListener(artistDetailsObserver, mAdapter,
            new GalleryScrollListener(mArtists)));

    mArtists.init();/* ww w.  ja v a  2  s  .co m*/
}