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:at.diamonddogs.example.http.activity.UiAnnotationExampleActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // allow showing of indeterminate progress
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    // initializing the assister and progress receiver
    assister = new HttpServiceAssister(this);
    progressReceiver = new ProgressReceiver(this);

    setContentView(R.layout.uiannotationexampleactivity);

    testFragment = new TestFragment();
    getSupportFragmentManager().beginTransaction().add(R.id.uiannotationexampleactivity_container, testFragment)
            .commit();/*from www .ja  v  a 2  s . com*/

    testText = (TextView) findViewById(R.id.uiannotationexampleactivity_testText);
    testEdit = (EditText) findViewById(R.id.uiannotationexampleactivity_testEdit);
    testEdit1 = (EditText) findViewById(R.id.uiannotationexampleactivity_testEdit1);
    okButton = (Button) findViewById(R.id.uiannotationexampleactivity_okbutton);

    // clicking the button will fire a webrequest
    okButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            WebRequest wr = new WebRequest();
            wr.setUrl("http://google.com/");
            wr.setProcessorId(DummyProcessor.ID);
            assister.runWebRequest(new Callback() {

                @Override
                public boolean handleMessage(Message msg) {
                    return true;
                }
            }, wr, new DummyProcessor());
        }
    });
}

From source file:org.onebusaway.android.ui.ArrivalsListActivity.java

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

    FragmentManager fm = getSupportFragmentManager();

    // Create the list fragment and add it as our sole content.
    if (fm.findFragmentById(android.R.id.content) == null) {
        ArrivalsListFragment list = new ArrivalsListFragment();
        list.setArguments(FragmentUtils.getIntentArgs(getIntent()));
        fm.beginTransaction().add(android.R.id.content, list).commit();
    }//w w  w .  ja  v  a2s. co m
}

From source file:com.commonsware.android.EMusicDownloader.SingleBook.java

/** Called when the activity is first created. */
@Override// w  w  w .j  ava  2  s  . c om
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    setContentView(R.layout.singlebook);

    Intent myIntent = getIntent();
    albumId = myIntent.getStringExtra("keyalbumid");
    emusicURL = myIntent.getStringExtra("keyexturl");
    album = myIntent.getStringExtra("keyalbum");
    artist = myIntent.getStringExtra("keyartist");

    thisActivity = this;

    nameTextView = (TextView) findViewById(R.id.tname);
    authorTextView = (TextView) findViewById(R.id.tauthor);
    editionTextView = (TextView) findViewById(R.id.tedition);
    genreTextView = (TextView) findViewById(R.id.tgenre);
    bioBlurb = (WebView) findViewById(R.id.blurb);
    ratingBar = (RatingBar) findViewById(R.id.rbar);
    albumArt = (ImageView) findViewById(R.id.albumart);
    authorLayout = (LinearLayout) findViewById(R.id.llauthor);

    version = android.os.Build.VERSION.SDK_INT;

    Resources res = getResources();

    if (version < 11) {
        authorLayout.setBackgroundDrawable(res.getDrawable(android.R.drawable.list_selector_background));
    } else {
        authorLayout.setBackgroundResource(R.drawable.list_selector_holo_dark);
    }

    authorLayout.setFocusable(true);

    bioBlurb.setBackgroundColor(0);

    urlAddress = "http://api.emusic.com/book/info?" + Secrets.apikey + "&bookId=" + albumId
            + "&include=bookEditorial,bookRating&&imageSize=small";
    Log.d("EMD - ", urlAddress);

    getInfoFromXML();
}

From source file:com.android.gallery3d.app.Gallery.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_ACTION_BAR);
    requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    setContentView(R.layout.main);//from ww  w .  j av  a 2s  .c o m
    mActionBar = new GalleryActionBar(this);

    if (savedInstanceState != null) {
        getStateManager().restoreFromState(savedInstanceState);
    } else {
        initializeByIntent();
    }
}

From source file:prince.app.sphotos.Activity_Photos.java

@Override
public void onCreate(Bundle oldState) {
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    super.onCreate(oldState);
    setContentView(R.layout.fb_main_activity);

    initDrawer(); // initialize the Navigation Drawer

    fromHome = getIntent().getExtras().getBoolean(FROM_HOMEPAGE, false);

    initListeners();// www .  j ava2s .c  o  m

    // were we launched from the homepage?
    if (fromHome) { // yes
        mIntentExtras = getIntent().getExtras().getString(WHICH_ALBUM_NAME);

        if (FBINIT.isAlbumEmpty()) { // yes, album array is empty

            if (!Global.getInstance().isConnection())
                setStub(R.id.stub_internet, R.id.viewstub_internet);

            else
                setStub(R.id.stub_albums, R.id.viewstub_albums);

            mActionTitle = mIntentExtras.equalsIgnoreCase(NO_FAVORITE) ? "Favorite Album" : mIntentExtras;
            getActionBar().setTitle(mActionTitle); // Set the title bar to the album name

        }

        else { // no, we have album data

            // were we launched by favorite option and no favorite selected yet
            if (mIntentExtras.equalsIgnoreCase(NO_FAVORITE)) {
                if (oldState == null) {
                    getSupportFragmentManager().beginTransaction()
                            .replace(R.id.frame_fb_main_activity, Fragment_Favorite.newInstance(), FAV_FRAGMENT)
                            .commit();
                }

                mActionTitle = "Favorite Album";
                getActionBar().setTitle(mActionTitle); // Set the title bar to the album name
            }

            else {

                mAlbum = FBINIT.getIndexByName(mIntentExtras);

                // If we can't find by name, search by ID
                if (mAlbum == -1)
                    mAlbum = FBINIT.getIndexByID(mIntentExtras);

                mActionTitle = FBINIT.sAlbumsArray.get(mAlbum).mAlbumName;
                getActionBar().setTitle(mActionTitle); // Set the title bar to the album name

                // add the photos fragment
                if (oldState == null) {
                    getSupportFragmentManager().beginTransaction().replace(R.id.frame_fb_main_activity,
                            Fragment_Photos.newInstance(mAlbum), IMAGE_FRAGMENT).commit();
                }
            }
        }
    }

    // we were launched from the albums page
    else {
        mAlbum = getIntent().getExtras().getInt(WHICH_ALBUM_POS);
        mActionTitle = FBINIT.sAlbumsArray.get(mAlbum).mAlbumName; // Get the name of the album

        if (oldState == null) {
            getSupportFragmentManager().beginTransaction()
                    .add(R.id.frame_fb_main_activity, Fragment_Photos.newInstance(mAlbum), IMAGE_FRAGMENT)
                    .commit();
        }
    }

    // were we restored? 
    if (oldState != null) { // yes
        boolean visible = oldState.getBoolean(GRID_VISIBLE);

        Fragment_Photos frag = (Fragment_Photos) Global.findFrag(this, IMAGE_FRAGMENT);
        if (frag != null) {
            frag.setmGridVisible(visible);
        }

        mActionTitle = oldState.getString(BAR_TITLE);
        getActionBar().setTitle(mActionTitle);

        if (oldState.getBoolean(INTERNET_STUB))
            setStub(R.id.stub_internet, R.id.viewstub_internet);
        else if (oldState.getBoolean(ALBUM_STUB))
            setStub(R.id.stub_albums, R.id.viewstub_albums);
    }

}

From source file:th.in.ffc.person.PersonMainActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {

    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    super.onCreate(savedInstanceState);
    setSupportProgressBarIndeterminateVisibility(false);
    setContentView(R.layout.person_main_activity);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

    mData = getIntent().getData();/*  w  ww .ja  va  2s .com*/
    mPid = mData.getLastPathSegment();
    Bundle args = new Bundle();

    args.putString(PersonColumns._PID, mPid);
    args.putString(PersonColumns._PCUCODEPERSON, getIntent().getStringExtra(PersonColumns._PCUCODEPERSON));
    mArgs = args;

    mAdapter = new ActionBarTabPagersAdapter(this, getSupportFragmentManager(), getSupportActionBar(),
            getViewPager());
    mAdapter.addTab("Infomation", PersonDetailViewFragment.class, args);
    mAdapter.addTab("Behavior", PersonBehaviorViewFragment.class, args);
    mAdapter.addTab("Chronic", PersonChronicFamily.class, args);

    getSupportLoaderManager().initLoader(LOAD_PERSON, null, this);

    setTabPagerAdapter(mAdapter);
    mAdapter.setTabVisible(false);

    TextView code = (TextView) findViewById(R.id.code);
    if (code != null)
        code.setText(getString(R.string.shape).concat(mPid));
    doSetupImage();

}

From source file:com.google.android.demos.jamendo.widget.StatusViewManager.java

private void updateWindowIndeterminateProgress() {
    // Show an indeterminate progress spinner when something is loading,
    // unless the main loading view is already visible.
    mWindow.setFeatureInt(Window.FEATURE_INDETERMINATE_PROGRESS,
            mActive.size() != 0 && mLoading.getVisibility() != View.VISIBLE ? Window.PROGRESS_VISIBILITY_ON
                    : Window.PROGRESS_VISIBILITY_OFF);
}

From source file:com.commonsware.android.EMusicDownloader.SingleAlbum.java

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

    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    setContentView(R.layout.singlealbum);

    version = android.os.Build.VERSION.SDK_INT;

    Intent myIntent = getIntent();
    albumId = myIntent.getStringExtra("keyalbumid");
    emusicURL = myIntent.getStringExtra("keyexturl");
    album = myIntent.getStringExtra("keyalbum");
    artist = myIntent.getStringExtra("keyartist");

    thisActivity = this;

    genreLayout = (LinearLayout) findViewById(R.id.llgenre);
    artistLayout = (LinearLayout) findViewById(R.id.llartist);
    labelLayout = (LinearLayout) findViewById(R.id.lllabel);
    nameTextView = (TextView) findViewById(R.id.tname);
    artistTextView = (TextView) findViewById(R.id.tartist);
    genreTextView = (TextView) findViewById(R.id.tgenre);
    labelTextView = (TextView) findViewById(R.id.tlabel);

    Resources res = getResources();

    if (version < 11) {
        genreLayout.setBackgroundDrawable(res.getDrawable(android.R.drawable.list_selector_background));
        labelLayout.setBackgroundDrawable(res.getDrawable(android.R.drawable.list_selector_background));
        artistLayout.setBackgroundDrawable(res.getDrawable(android.R.drawable.list_selector_background));
    } else {
        genreLayout.setBackgroundResource(R.drawable.list_selector_holo_dark);
        labelLayout.setBackgroundResource(R.drawable.list_selector_holo_dark);
        artistLayout.setBackgroundResource(R.drawable.list_selector_holo_dark);
    }
    genreLayout.setFocusable(true);
    labelLayout.setFocusable(true);
    artistLayout.setFocusable(true);

    albumArt = (ImageView) findViewById(R.id.albumart);
    reviewsButton = (ImageView) findViewById(R.id.reviewsbutton);
    //sampleButton=(ImageView)findViewById(R.id.samplebutton);
    trackList = (ListView) findViewById(R.id.trklist);
    ratingBar = (RatingBar) findViewById(R.id.rbar);
    trackList.setOnItemClickListener(this);

    urlAddress = "http://api.emusic.com/album/info?" + Secrets.apikey + "&albumId=" + albumId
            + "&include=albumRating,label&imageSize=small";
    //Log.d("EMD - ",urlAddress);

    getInfoFromXML();
}

From source file:fi.mikuz.boarder.gui.internet.DownloadBoard.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    this.setVolumeControlStream(AudioManager.STREAM_MUSIC);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setContentView(R.layout.internet_download_board);
    setProgressBarIndeterminateVisibility(true);

    mWaitDialog = new TimeoutProgressDialog(DownloadBoard.this, "Waiting for response", TAG, true);

    Bundle extras = getIntent().getExtras();
    mAction = extras.getInt(DownloadBoard.SHOW_KEY);

    if (mAction == SHOW_INTERNET_BOARD) {
        mBoardId = extras.getInt(InternetMenu.BOARD_ID_KEY);
        mLoggedIn = extras.getBoolean(DownloadBoardList.LOGGED_IN_KEY);

        if (mLoggedIn) {
            mUserId = extras.getString(InternetMenu.USER_ID_KEY);
            mSessionToken = extras.getString(InternetMenu.SESSION_TOKEN_KEY);
        }/* ww w .  j  a  v a 2  s.  c om*/

        getBoard();
    } else if (mAction == SHOW_PREVIEW_BOARD) {
        mLoggedIn = false;

        XStream xstream = new XStream();
        JSONObject fakeMessage = (JSONObject) xstream.fromXML(extras.getString(DownloadBoard.JSON_KEY));
        String fakeMessageString = fakeMessage.toString();

        try {

            if (GlobalSettings.getSensitiveLogging())
                Log.v(TAG, "Got a preview: " + fakeMessageString);
            ConnectionSuccessfulResponse fakeResponse = new ConnectionSuccessfulResponse(
                    new JSONObject(fakeMessageString), InternetMenu.mGetBoardURL);
            onConnectionSuccessful(fakeResponse);
        } catch (JSONException e) {
            Log.e(TAG, "Error reading fake json message", e);
        }
    } else {
        throw new IllegalArgumentException("No proper action defined, action: " + mAction);
    }

}

From source file:org.spinsuite.bchat.view.V_BChat.java

/** Called when the activity is first created. */
@Override/*ww  w . j  a  v a2 s  .c om*/
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    //   New Intent
    onNewIntent(getIntent());
    //   Add Support to Progress Bar in Action Bar
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    //   
    super.setContentView(R.layout.v_business_chat);
    //   Set ProgressBar to false
    setProgressBarIndeterminateVisibility(false);

    actionBar = getActionBar();
    //   
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setHomeButtonEnabled(true);
    actionBar.setTitle(R.string.app_name);
    actionBar.setSubtitle(R.string.BChat);
    //   Load Drawer
    loadDrawer();
    //   Load Contact
    loadContact();
    //   
    loadFragment();
    //   
}