Example usage for android.view Window FEATURE_PROGRESS

List of usage examples for android.view Window FEATURE_PROGRESS

Introduction

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

Prototype

int FEATURE_PROGRESS

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

Click Source Link

Document

Flag for the progress indicator feature.

Usage

From source file:org.anhonesteffort.flock.MyCalendarsActivity.java

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

    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    requestWindowFeature(Window.FEATURE_PROGRESS);

    setContentView(R.layout.simple_fragment_activity);
    getActionBar().setDisplayHomeAsUpEnabled(true);
    getActionBar().setTitle(R.string.title_my_calendars);

    FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
    Fragment calendarsFragment = new MyCalendarsFragment();

    calendarsFragment.setHasOptionsMenu(true);
    fragmentTransaction.replace(R.id.fragment_view, calendarsFragment);
    fragmentTransaction.commit();//from  ww  w  .  j a v a 2s. c  o  m
}

From source file:org.anhonesteffort.flock.MyAddressbooksActivity.java

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

    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    requestWindowFeature(Window.FEATURE_PROGRESS);

    setContentView(R.layout.simple_fragment_activity);
    getActionBar().setDisplayHomeAsUpEnabled(true);
    getActionBar().setTitle(R.string.title_my_addressbooks);

    FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
    Fragment addressbooksFragment = new MyAddressbooksFragment();

    addressbooksFragment.setHasOptionsMenu(false);
    fragmentTransaction.replace(R.id.fragment_view, addressbooksFragment);
    fragmentTransaction.commit();/*from  ww  w.j  a  va2s .c o m*/
}

From source file:org.anhonesteffort.flock.ImportContactsActivity.java

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

    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    requestWindowFeature(Window.FEATURE_PROGRESS);

    setContentView(R.layout.activity_with_action_button);
    getActionBar().setDisplayHomeAsUpEnabled(true);
    getActionBar().setTitle(R.string.title_import_contacts);

    FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
    Fragment importContactsFragment = new ImportContactsFragment();

    importContactsFragment.setHasOptionsMenu(false);
    fragmentTransaction.replace(R.id.fragment_view, importContactsFragment);
    fragmentTransaction.commit();/* w  ww. j  a v  a  2  s  .  c  om*/
}

From source file:org.anhonesteffort.flock.ImportCalendarsActivity.java

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

    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    requestWindowFeature(Window.FEATURE_PROGRESS);

    setContentView(R.layout.activity_with_action_button);
    getActionBar().setDisplayHomeAsUpEnabled(true);
    getActionBar().setTitle(R.string.title_import_calendars);

    FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
    Fragment importCalendarsFragment = new ImportCalendarsFragment();

    importCalendarsFragment.setHasOptionsMenu(false);
    fragmentTransaction.replace(R.id.fragment_view, importCalendarsFragment);
    fragmentTransaction.commit();//  ww  w.  j  av  a  2s .co  m
}

From source file:org.lee.android.activity.SearchActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().requestFeature(Window.FEATURE_PROGRESS);
    ActionBar actionBar = getActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setDisplayShowTitleEnabled(true);

    setContentView(R.layout.activity_search);

    SearchFragment search = new SearchFragment();
    Intent intent = getIntent();//from w  ww. j ava 2 s.  com
    search.setArguments(intent.getExtras());
    swichFragment(search, false);

}

From source file:com.google.android.demos.html.HtmlActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_PROGRESS);
    setContentView(R.layout.main);//from w  w w  .  j ava 2  s . c o  m
    mHtmlView = (HtmlView) findViewById(R.id.html);
    mHtmlView.setHtmlChromeClient(new ProgressChromeClient());
    mHtmlView.setMovementMethod(LinkMovementMethod.getInstance());

    // Load HTML asynchronously:
    //
    // TODO: Move this functionality into HtmlView
    new HtmlTask().execute("http://slashdot.org/palm");
}

From source file:com.iangclifton.auid.appendixc.sections.SectionActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    getWindow().requestFeature(Window.FEATURE_PROGRESS);
    setProgressBarIndeterminate(true);/*from  ww  w.java  2s . c  om*/

    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_section_detail);
    final Section section = (Section) getIntent().getSerializableExtra(ARG_SECTION);
    setTitle(section.getTitleResourceId());

    // Show the Up button in the action bar.
    getActionBar().setDisplayHomeAsUpEnabled(true);

    // savedInstanceState is non-null when there is fragment state
    // saved from previous configurations of this activity
    // (e.g. when rotating the screen from portrait to landscape).
    // In this case, the fragment will automatically be re-added
    // to its container so we don't need to manually add it.
    // For more information, see the Fragments API guide at:
    //
    // http://developer.android.com/guide/components/fragments.html
    //
    if (savedInstanceState == null) {
        final Fragment fragment = section.getFragment();
        getSupportFragmentManager().beginTransaction().add(R.id.section_detail_container, fragment).commit();
    }
}

From source file:org.geometerplus.android.fbreader.network.auth.WebAuthorisationScreen.java

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

    requestWindowFeature(Window.FEATURE_PROGRESS);
    SQLiteCookieDatabase.init(this);
    CookieSyncManager.createInstance(getApplicationContext());
    CookieManager.getInstance().removeAllCookie();
    final Intent intent = getIntent();
    final Uri data = intent.getData();
    if (data == null || data.getHost() == null) {
        finish();/* www.  ja v a  2  s.  c o  m*/
        return;
    }
    final String completeUrl = intent.getStringExtra(COMPLETE_URL_KEY);

    OrientationUtil.setOrientation(this, intent);
    final WebView view = new WebView(this);
    view.getSettings().setJavaScriptEnabled(true);

    view.setWebChromeClient(new WebChromeClient() {
        @Override
        public void onProgressChanged(WebView view, int progress) {
            setProgress(progress * 100);
        }
    });
    view.setWebViewClient(new WebViewClient() {
        @Override
        public void onPageStarted(WebView view, String url, Bitmap favicon) {
            setTitle(url);
            if (url != null && url.startsWith(completeUrl)) {
                final HashMap<String, String> cookies = new HashMap<String, String>();
                final String cookieString = CookieManager.getInstance().getCookie(url);
                if (cookieString != null) {
                    // cookieString is a string like NAME=VALUE [; NAME=VALUE]
                    for (String pair : cookieString.split(";")) {
                        final String[] parts = pair.split("=", 2);
                        if (parts.length != 2) {
                            continue;
                        }
                        cookies.put(parts[0].trim(), parts[1].trim());
                    }
                }
                storeCookies(data.getHost(), cookies);
                WebAuthorisationScreen.this.setResult(RESULT_OK);
                finish();
            }
        }

        public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
            if (android.os.Build.VERSION.SDK_INT == android.os.Build.VERSION_CODES.ECLAIR_MR1) {
                // hack for auth problem in android 2.1
                handler.proceed();
            } else {
                super.onReceivedSslError(view, handler, error);
            }
        }
    });
    setContentView(view);
    view.loadUrl(intent.getDataString());
}

From source file:net.nym.mutils.ui.test.TestWebViewActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    requestWindowFeature(Window.FEATURE_PROGRESS);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_test_web_view);
    //        url = "http://wsq.qq.com/reflow/255443386";
    url = "http://www.52kids.com.cn/school/share/feedback";
    mWebView = (WebView) findViewById(R.id.webView);
    initWebView();/*from  ww w  .j a va 2 s . c o  m*/
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}

From source file:dentex.youtube.downloader.menu.DonateActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    BugSenseHandler.leaveBreadcrumb("DonateActivity_onCreate");
    this.setTitle(R.string.title_activity_donate);

    getWindow().requestFeature(Window.FEATURE_PROGRESS);
    getWindow().requestFeature(Window.FEATURE_ACTION_BAR);

    // Theme init
    Utils.themeInit(this);

    // Language init
    Utils.langInit(this);

    // Load default preferences values
    PreferenceManager.setDefaultValues(this, R.xml.donate, false);

    // Display the fragment as the main content.
    getFragmentManager().beginTransaction().replace(android.R.id.content, new DonateFragment()).commit();
    setupActionBar();//from   w  ww .  j a  v a2  s.c o  m
}