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:com.andrewshu.android.reddit.mail.InboxActivity.java

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

    mSettings.loadRedditPreferences(this, mClient);
    setRequestedOrientation(mSettings.getRotation());
    setTheme(mSettings.getTheme());// w ww.j a va 2  s  .  co  m

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

    for (String whichInbox : whichInboxes)
        addInboxTab(whichInbox);

    getTabHost().setCurrentTab(0);
}

From source file:org.jsharkey.oilcan.BrowserActivity.java

public void onCreate(Bundle icicle) {
    super.onCreate(icicle);

    requestWindowFeature(Window.FEATURE_PROGRESS);
    setContentView(R.layout.act_browse);

    scriptdb = new ScriptDatabase(this);
    scriptdb.onUpgrade(scriptdb.getWritableDatabase(), -10, 10);

    webview = (WebView) findViewById(R.id.browse_webview);

    WebSettings settings = webview.getSettings();
    settings.setSavePassword(false);/* www . j  a  v a2  s . co m*/
    settings.setSaveFormData(false);
    settings.setJavaScriptEnabled(true);
    settings.setSupportZoom(true);
    settings.setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);

    FrameLayout zoomholder = (FrameLayout) this.findViewById(R.id.browse_zoom);
    zoomholder.addView(webview.getZoomControls());
    webview.getZoomControls().setVisibility(View.GONE);

    webview.setWebViewClient(new OilCanClient());
    webview.setWebChromeClient(new OilCanChrome());

    webview.addJavascriptInterface(new IntentHelper(), "intentHelper");

    // load the last-viewed page into browser
    String url = "http://m.half.com/";
    if (icicle != null && icicle.containsKey(LAST_VIEWED))
        url = icicle.getString(LAST_VIEWED);

    // or watch for incoming requested urls
    if (getIntent().getExtras() != null && getIntent().getExtras().containsKey(SearchManager.QUERY))
        url = getIntent().getStringExtra(SearchManager.QUERY);

    webview.loadUrl(url);

}

From source file:net.kw.shrdlu.grtgtfs.Activities.RiderAlertsActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    mContext = this;

    // Will use the action bar progress bar
    requestWindowFeature(Window.FEATURE_PROGRESS);

    setContentView(R.layout.timeslayout);
    super.onCreate(savedInstanceState);

    mListDetails = new ArrayList<>();

    getActionBar().setTitle(R.string.twitter_querying_feed);
    getActionBar().setSubtitle(null);//from  w  w w .  j a  v  a2s  . co m

    new ProcessTweets().execute();
}

From source file:com.dictionary.activity.ArticleCollectionActivity.java

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    final Application app = (Application) getApplication();
    app.installTheme(this);
    requestWindowFeature(Window.FEATURE_PROGRESS);
    setContentView(R.layout.activity_article_collection_loading);
    app.push(this);
    final ActionBar actionBar = getActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setSubtitle("...");
    final Intent intent = getIntent();
    final int position = intent.getIntExtra("position", 0);

    AsyncTask<Void, Void, ArticleCollectionPagerAdapter> createAdapterTask = new AsyncTask<Void, Void, ArticleCollectionPagerAdapter>() {

        @Override/* www.  j  a va2s . c o m*/
        protected ArticleCollectionPagerAdapter doInBackground(Void... params) {
            ArticleCollectionPagerAdapter result;
            Uri articleUrl = intent.getData();
            if (articleUrl != null) {
                result = createFromUri(app, articleUrl);
            } else {
                String action = intent.getAction();
                if (action == null) {
                    result = createFromLastResult(app);
                } else if (action.equals("showRandom")) {
                    result = createFromRandom(app);
                } else if (action.equals("showBookmarks")) {
                    result = createFromBookmarks(app);
                } else if (action.equals("showHistory")) {
                    result = createFromHistory(app);
                } else {
                    result = createFromIntent(app, intent);
                }
            }
            return result;
        }

        @Override
        protected void onPostExecute(ArticleCollectionPagerAdapter adapter) {
            if (isFinishing() || onDestroyCalled) {
                return;
            }
            articleCollectionPagerAdapter = adapter;
            if (articleCollectionPagerAdapter == null || articleCollectionPagerAdapter.getCount() == 0) {
                int messageId;
                if (articleCollectionPagerAdapter == null) {
                    messageId = R.string.article_collection_invalid_link;
                } else {
                    messageId = R.string.article_collection_nothing_found;
                }
                Toast.makeText(ArticleCollectionActivity.this, messageId, Toast.LENGTH_SHORT).show();
                finish();
                return;
            }

            if (position > articleCollectionPagerAdapter.getCount() - 1) {
                Toast.makeText(ArticleCollectionActivity.this,
                        R.string.article_collection_selected_not_available, Toast.LENGTH_SHORT).show();
                finish();
                return;
            }

            setContentView(R.layout.activity_article_collection);

            findViewById(R.id.pager_title_strip).setVisibility(
                    articleCollectionPagerAdapter.getCount() == 1 ? ViewGroup.GONE : ViewGroup.VISIBLE);

            viewPager = (ViewPager) findViewById(R.id.pager);
            viewPager.setAdapter(articleCollectionPagerAdapter);
            viewPager.setOnPageChangeListener(new OnPageChangeListener() {

                @Override
                public void onPageScrollStateChanged(int arg0) {
                }

                @Override
                public void onPageScrolled(int arg0, float arg1, int arg2) {
                }

                @Override
                public void onPageSelected(final int position) {
                    updateTitle(position);
                    runOnUiThread(new Runnable() {
                        @Override
                        public void run() {
                            ArticleFragment fragment = (ArticleFragment) articleCollectionPagerAdapter
                                    .getItem(position);
                            fragment.applyTextZoomPref();
                        }
                    });

                }
            });
            viewPager.setCurrentItem(position);

            PagerTitleStrip titleStrip = (PagerTitleStrip) findViewById(R.id.pager_title_strip);
            titleStrip.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 10);
            updateTitle(position);
            articleCollectionPagerAdapter.registerDataSetObserver(new DataSetObserver() {
                @Override
                public void onChanged() {
                    if (articleCollectionPagerAdapter.getCount() == 0) {
                        finish();
                    }
                }
            });
        }
    };

    createAdapterTask.execute();

}

From source file:com.springsource.greenhouse.WebOAuthActivity.java

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

    getWindow().requestFeature(Window.FEATURE_PROGRESS);
    getWindow().setFeatureInt(Window.FEATURE_PROGRESS, Window.PROGRESS_VISIBILITY_ON);

    connectionRepository = application.getConnectionRepository();
    connectionFactory = application.getConnectionFactory();
}

From source file:org.openhab.habdroid.ui.OpenHABStartupActivity.java

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

    //      initPage();

}

From source file:org.projecthdata.hhub.ui.HDataWebOauthActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    getWindow().requestFeature(Window.FEATURE_PROGRESS);
    getWindow().setFeatureInt(Window.FEATURE_PROGRESS, Window.PROGRESS_VISIBILITY_ON);
    super.onCreate(savedInstanceState);

    webView = new WebView(this);
    setContentView(webView);// w w w  .j a  v  a 2s .  c om
    this.ehrUrl = getIntent().getStringExtra(EXTRA_EHR_URL);

    activity = this;

    this.connectionRepository = getApplicationContext().getConnectionRepository();
    this.hDataConnectionFactory = getApplicationContext().getHDataConnectionFactory(ehrUrl);

    webView.setWebChromeClient(new WebChromeClient() {

        public void onProgressChanged(WebView view, int progress) {
            activity.setTitle("Loading...");
            activity.setProgress(progress * 100);
            if (progress == 100) {
                activity.setTitle(R.string.app_name);
            }
        }
    });
    webView.setWebViewClient(new MyWebViewClient());

    // clear out any previously used credentials
    webView.clearCache(true);
    webView.clearFormData();
    webView.clearHistory();
    webView.getSettings().setSavePassword(false);
    webView.getSettings().setSaveFormData(false);
    CookieSyncManager.createInstance(this);
    CookieManager.getInstance().removeAllCookie();
}

From source file:net.gaast.giggity.ChooserActivity.java

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

    //this.setTheme(android.R.style.Theme_Holo);

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

    /*//test stuff//from  w w  w . j  a v  a2 s.  c o m
    Vibrator v = (Vibrator)getSystemService(Context.VIBRATOR_SERVICE);
    long[] pattern = {  };
    v.vibrate(pattern, -1);
    */

    Giggity app = (Giggity) getApplication();
    db = app.getDb();
    pref = PreferenceManager.getDefaultSharedPreferences(app);

    refreshSeed(false);

    list = new ListView(this);
    list.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> adapter, View view, int position, long id) {
            DbSchedule item = (DbSchedule) lista.getItem(position);
            if (item != null) {
                openSchedule(item, false);
            }
        }
    });
    list.setLongClickable(true);
    list.setOnCreateContextMenuListener(new OnCreateContextMenuListener() {
        @Override
        public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
            AdapterContextMenuInfo mi = (AdapterContextMenuInfo) menuInfo;
            DbSchedule sched = (DbSchedule) lista.getItem((int) mi.id);
            if (sched != null) {
                menu.setHeaderTitle(sched.getTitle());
                menu.add(ContextMenu.NONE, 0, 0, R.string.refresh);
                menu.add(ContextMenu.NONE, 3, 0, R.string.unhide);
                menu.add(ContextMenu.NONE, 1, 0, R.string.remove);
                menu.add(ContextMenu.NONE, 2, 0, R.string.show_url);
            }
        }
    });

    /* Filling in the list in onResume(). */
    refresher = new SwipeRefreshLayout(this);
    refresher.setOnRefreshListener(this);
    refresher.addView(list);

    LinearLayout cont = new LinearLayout(this);
    cont.setOrientation(LinearLayout.VERTICAL);
    cont.addView(refresher, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT, 1));

    setContentView(cont);
}

From source file:com.zbrown.droidsteal.activities.HijackActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().requestFeature(Window.FEATURE_PROGRESS);
    setContentView(R.layout.webview);// w w  w. ja  v  a2 s . co m
    CookieSyncManager.createInstance(this);

    ActionBar actionbar = getActionBar();
    actionbar.setDisplayHomeAsUpEnabled(true);
}

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

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

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

    setContentView(R.layout.setup_activity);
    getActionBar().setDisplayHomeAsUpEnabled(false);
    getActionBar().setTitle(R.string.app_name);

    setupStepIndicator = (StepPagerStrip) findViewById(R.id.setup_step_indicator);
    setupStepTitle = (TextView) findViewById(R.id.setup_activity_large_text);
    buttonPrevious = (Button) findViewById(R.id.button_previous);
    buttonNext = (Button) findViewById(R.id.button_next);

    buttonPrevious.setOnClickListener(new View.OnClickListener() {

        @Override//from  ww  w  . ja  va2 s .  co  m
        public void onClick(View view) {
            handleButtonPrevious();
        }

    });
}