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:com.android.mms.rcs.FavoriteDetailActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (MessageUtils.checkPermissionsIfNeeded(this)) {
        return;/*from  w w w.  j  av  a2 s. co  m*/
    }
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setProgressBarIndeterminateVisibility(true);
    setContentView(R.layout.message_detail_viewpaper);
    mContentResolver = getContentResolver();
    mBackgroundHandler = new BackgroundHandler(mContentResolver);
    mSlidePaperItemTextViews = new ArrayList<TextView>();
    startQuerySmsContent();
}

From source file:com.gizwits.gizdataaccesssdkdemo.activitys.MainActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setContentView(R.layout.main);/*from w  w w  .j  a va 2s . co m*/
    tvTerminal = (TextView) findViewById(R.id.tvTerminal);
    btnLoad = (Button) findViewById(R.id.btnLoad);
    btnSave = (Button) findViewById(R.id.btnSave);
    btnClean = (Button) findViewById(R.id.btnClean);
    tvVersion = (TextView) findViewById(R.id.tvVersion);
    buffer = new StringBuffer();
    tvTerminal.setText(buffer.toString());
    btnLoad.setOnClickListener(this);
    btnSave.setOnClickListener(this);
    btnClean.setOnClickListener(this);
    dialog = dateTimePicKDialog();
    tvVersion.setText("SDK?:" + GizDataAccess.getVersion());
}

From source file:mtmo.test.mediadrm.MainActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    mLogger.enter("onCreate");

    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    appMode = getSharedPreferences(Constants.APP_NAME, MODE_PRIVATE).getInt(Constants.PREFERENCE_APP_MODE,
            Constants.APP_MODE_OFFLINE);

    switch (appMode) {
    case Constants.APP_MODE_ABS:
        setContentView(R.layout.main_abs);
        break;//w w  w. j  a va 2s .  c  o m
    case Constants.APP_MODE_OFFLINE:
        setContentView(R.layout.activity_main);
        break;
    default:
        // setContentView(R.layout.main);
        break;
    }

    mContext = getApplicationContext();
    mHandler = new Handler();

    readPropFromFile();
    setupDropDownList();
    listFiles();
    setupDrmProcessButton(appMode);
    setupPlayerButton();

    checkMarlinPluginInfo();
}

From source file:de.androvdr.activities.AbstractFragmentActivity.java

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

    Preferences.init(false);//from  w  w  w.  ja v  a  2 s. co m
    if (Preferences.blackOnWhite)
        setTheme(R.style.Theme_Light);

    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setProgressBarIndeterminateVisibility(false);
    mDetector = new SimpleGestureFilter(this, this);
    mDetector.setMode(SimpleGestureFilter.MODE_TRANSPARENT);
    mConfigurationManager = ConfigurationManager.getInstance(this);
    ActionBarHelper.setHomeButtonEnabled(this, true);
}

From source file:joshuatee.wx.USWarningsWithRadarActivity.java

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

    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    preferences = PreferenceManager.getDefaultSharedPreferences(this);
    editor = preferences.edit();//  w w  w  .  j  av a2  s. c o  m
    theme_blue_current = preferences.getString("THEME_BLUE", "");
    if (theme_blue_current.contains("white")) {
        highlight_color = Color.BLUE;
        background_color = Color.BLACK;
        highlight_color_str = "blue";
        background_color_str = "black";

    }
    setTheme(Utility.Theme(theme_blue_current));
    setContentView(R.layout.activity_uswarnings_with_radar_v3);

    Resources res = getResources();
    padding = (int) res.getDimension(R.dimen.padding);
    padding_vertical = (int) res.getDimension(R.dimen.padding_vertical);
    text_size = res.getDimension(R.dimen.listitem_text);

    newline = System.getProperty("line.separator");
    space = Pattern.compile(" ");
    semicolon = Pattern.compile(";");

    turl = getIntent().getStringArrayExtra(URL);
    turl_local[0] = turl[0];
    turl_local[1] = turl[1];
    original_filter = turl[0];

    alert_cod_radar_current = preferences.getString("ALERT_COD_RADAR", "");
    debug_status_current = preferences.getString("DEBUG_STATUS", "");

    dynamicview = (LinearLayout) findViewById(R.id.ll);
    lprams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,
            LinearLayout.LayoutParams.WRAP_CONTENT);

    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, filter_array));
    mDrawerList.setOnItemClickListener(new DrawerItemClickListener());
    mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.drawable.drawer, R.string.drawer_open,
            R.string.drawer_close) {
        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);

    new GetContent().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);

}

From source file:ca.spencerelliott.mercury.Changesets.java

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

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

    setContentView(R.layout.changesets);

    //Cancel any notifications previously setup
    NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
    nm.cancel(1);//from   w ww.  j av  a  2  s. co m

    //Create a new array list for the changesets
    changesets_list = new ArrayList<Map<String, ?>>();
    changesets_data = new ArrayList<Beans.ChangesetBean>();

    //Get the list view to store the changesets
    changesets_listview = (ListView) findViewById(R.id.changesets_list);

    TextView empty_text = (TextView) findViewById(R.id.changesets_empty_text);

    //Set the empty view
    changesets_listview.setEmptyView(empty_text);

    //Use a simple adapter to display the changesets based on the array list made earlier
    changesets_listview.setAdapter(new SimpleAdapter(this, changesets_list, R.layout.changeset_item,
            new String[] { COMMIT, FORMATTED_INFO },
            new int[] { R.id.changesets_commit, R.id.changesets_info }));

    //Set the on click listener
    changesets_listview.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> adapterview, View view, int position, long id) {
            Intent intent = new Intent(Changesets.this, ChangesetViewer.class);

            //Pass the changeset information to the changeset viewer
            Bundle params = new Bundle();
            params.putString("changeset_commit_text", changesets_data.get(position).getTitle());
            params.putString("changeset_changes", changesets_data.get(position).getContent());
            params.putLong("changeset_updated", changesets_data.get(position).getUpdated());
            params.putString("changeset_authors", changesets_data.get(position).getAuthor());
            params.putString("changeset_link", changesets_data.get(position).getLink());
            //params.putBoolean("is_https", is_https);

            intent.putExtras(params);

            startActivity(intent);
        }

    });

    //Register the list view for opening the context menu
    registerForContextMenu(changesets_listview);

    //Get the intent passed by the program
    if (getIntent() != null) {
        //Check to see if this is a search window
        if (Intent.ACTION_SEARCH.equals(getIntent().getAction())) {
            //Change the title of the activity and the empty text of the list so it looks like a search window
            this.setTitle(R.string.search_results_label);
            empty_text.setText(R.string.search_results_empty);

            //Retrieve the query the user entered
            String query = getIntent().getStringExtra(SearchManager.QUERY);

            //Convert the query to lower case
            query = query.toLowerCase();

            //Retrieve the bundle data
            Bundle retrieved_data = getIntent().getBundleExtra(SearchManager.APP_DATA);

            //If the bundle was passed, grab the changeset data
            if (retrieved_data != null) {
                changesets_data = retrieved_data
                        .getParcelableArrayList("ca.spencerelliott.mercury.SEARCH_DATA");
            }

            //If we're missing changeset data, stop here
            if (changesets_data == null)
                return;

            //Create a new array list to store the changesets that were a match
            ArrayList<Beans.ChangesetBean> search_beans = new ArrayList<Beans.ChangesetBean>();

            //Loop through each changeset
            for (Beans.ChangesetBean b : changesets_data) {
                //Check to see if any changesets match
                if (b.getTitle().toLowerCase().contains(query)) {
                    //Get the title and date of the commit
                    String commit_text = b.getTitle();
                    Date commit_date = new Date(b.getUpdated());

                    //Add a new changeset to display in the list view
                    changesets_list.add(createChangeset(
                            (commit_text.length() > 30 ? commit_text.substring(0, 30) + "..." : commit_text),
                            b.getRevisionID() + " - " + commit_date.toLocaleString()));

                    //Add this bean to the list of found search beans
                    search_beans.add(b);
                }
            }

            //Switch the changeset data over to the changeset data that was a match
            changesets_data = search_beans;

            //Update the list in the activity
            list_handler.sendEmptyMessage(SUCCESSFUL);

            //Notify the activity that it is a search window
            is_search_window = true;

            //Stop loading here
            return;
        }

        //Get the data from the intent
        Uri data = getIntent().getData();

        if (data != null) {
            //Extract the path in the intent
            String path_string = data.getEncodedPath();

            //Split it by the forward slashes
            String[] split_path = path_string.split("/");

            //Make sure a valid path was passed
            if (split_path.length == 3) {
                //Get the repository id from the intent
                repo_id = Long.parseLong(split_path[2].toString());
            } else {
                //Notify the user if there was a problem
                Toast.makeText(this, R.string.invalid_intent, 1000).show();
            }
        }
    }

    //Retrieve the changesets
    refreshChangesets();
}

From source file:com.vishwa.pinit.MainActivity.java

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

    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    mFrameLayout = new FrameLayout(this);

    if (getResources().getBoolean(R.bool.portrait_only)) {
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
    }/*from   www . j a v  a2  s.c  om*/

    setContentView(mFrameLayout);

    LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    inflater.inflate(R.layout.activity_main, mFrameLayout);

    inflater.inflate(R.layout.splash_screen, mFrameLayout);
    mHandler = new Handler();
    final Runnable runnable = new Runnable() {

        @Override
        public void run() {
            Animation fadeOutAnimation = AnimationUtils.loadAnimation(getApplicationContext(),
                    android.R.anim.fade_out);
            fadeOutAnimation.setAnimationListener(new AnimationListener() {

                @Override
                public void onAnimationStart(Animation animation) {
                }

                @Override
                public void onAnimationRepeat(Animation animation) {
                }

                @Override
                public void onAnimationEnd(Animation animation) {
                    mFrameLayout.removeViewAt(1);
                    if (PinItUtils.isUsersFirstLogin(mCurrentUsername, getApplicationContext())) {
                        if (!DEBUG) {
                            handleUsersFirstTime();
                        }
                    }
                }
            });
            mFrameLayout.getChildAt(1).startAnimation(fadeOutAnimation);
        }

    };
    mHandler.postDelayed(runnable, 2300);

    mCurrentUsername = ParseUser.getCurrentUser().getUsername();

    final int maxMemory = (int) (Runtime.getRuntime().maxMemory() / 1024);

    final int cacheSize = maxMemory / 10;

    RetainFragment mRetainFragment = RetainFragment.findOrCreateRetainFragment(getSupportFragmentManager());
    mMemoryCache = mRetainFragment.mRetainedCache;
    if (mMemoryCache == null) {
        mMemoryCache = new LruCache<String, Bitmap>(cacheSize) {
            @Override
            protected int sizeOf(String key, Bitmap bitmap) {
                return bitmap.getByteCount() / 1024;
            }
        };
        mRetainFragment.mRetainedCache = mMemoryCache;
    }

    mAllNotesButton = (Button) findViewById(R.id.main_all_notes_button);
    mYourNotesButton = (Button) findViewById(R.id.main_your_notes_button);

    setProgressBarIndeterminateVisibility(false);

    mAllNotesButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            LatLngBounds mapBounds = mMap.getProjection().getVisibleRegion().latLngBounds;
            LatLng southwest = mapBounds.southwest;
            LatLng northeast = mapBounds.northeast;

            mMapViewMode = MapViewMode.ALL_NOTES;

            for (Marker marker : mMarkerList) {
                marker.remove();
            }

            mMarkerList.clear();
            mNoteStore.clear();
            mReverseNoteStore.clear();

            LatLngTuple tuple = new LatLngTuple(southwest, northeast);
            LoadNotesTask currentUserNotesTask = new LoadNotesTask(tuple, false);
            currentUserNotesTask.execute();
            setProgressBarIndeterminateVisibility(true);
        }
    });

    mYourNotesButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            LatLngBounds mapBounds = mMap.getProjection().getVisibleRegion().latLngBounds;
            LatLng southwest = mapBounds.southwest;
            LatLng northeast = mapBounds.northeast;

            for (Marker marker : mMarkerList) {
                marker.remove();
            }

            mMarkerList.clear();
            mNoteStore.clear();
            mReverseNoteStore.clear();

            mMapViewMode = MapViewMode.YOUR_NOTES;
            LatLngTuple tuple = new LatLngTuple(southwest, northeast);
            LoadNotesTask currentUserNotesTask = new LoadNotesTask(tuple, true);
            currentUserNotesTask.execute();
            setProgressBarIndeterminateVisibility(true);
        }
    });

    try {
        MapsInitializer.initialize(this);
        if (!PinItUtils.isOnline(getApplicationContext())) {
            PinItUtils.createAlert("Internet connection not found.",
                    "Connect to the Internet and press the refresh button at the top", this);
            mHasInternet = false;
        } else {
            mHasInternet = true;
            loadMapWhenOnline();
        }
    } catch (GooglePlayServicesNotAvailableException e) {
        PinItUtils.createAlert("We're sorry",
                "It seems that your phone doesn't have Google Play"
                        + "services installed, or is missing the maps application. Please download both of"
                        + "these and then try running this application",
                MainActivity.this);
    }

}

From source file:com.nuvolect.securesuite.main.ContactListActivity.java

@Override
protected void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (DEBUG) {/*from w  ww. j  a v  a  2s  .  c om*/
        String state = savedInstanceState == null ? "null" : "not null";
        LogUtil.log("ContactListActivity onCreate savedInstanceState: " + state);
    }

    m_act = this;
    m_ctx = getApplicationContext();
    m_savedInstanceState = savedInstanceState;

    mTwoPane = false;

    // Action bar progress setup.  Needs to be called before setting the content view
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    m_theme = AppTheme.activateTheme(m_act);
    setContentView(R.layout.contact_list_activity);

    /**
     * Kick off the license manager.  Among other tasks, the license manager captures
     * a license account.  The license account is used as part of the database encryption key.
     * Consequently, do not initialize the database prior to capturing the license account.
     */
    LicenseManager.getInstance(m_act).checkLicense(m_act, mLicenseManagerListener);
}

From source file:eu.trentorise.smartcampus.portfolio.HomeActivity.java

@Override
public void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setContentView(R.layout.activity_home);
    if (LauncherHelper.isLauncherInstalled(this, true)) {
        // Checking start action
        if (isViewer()) {
            mPortfolioEntityId = getIntent().getStringExtra(getString(R.string.view_intent_arg_object_id));
        }// w w w . j  a  v  a 2  s.  c  o m
        if (PMHelper.isFirstLaunch(this)) {
            AlertDialog.Builder builder = new AlertDialog.Builder(this);
            builder//.setTitle(R.string.welcome_title)
                    .setView(getLayoutInflater().inflate(R.layout.disclaimerdialog, null))
                    .setOnCancelListener(new DialogInterface.OnCancelListener() {

                        @Override
                        public void onCancel(DialogInterface arg0) {
                            arg0.dismiss();
                            initialize(savedInstanceState);
                        }
                    }).setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {

                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                            dialog.dismiss();
                            initialize(savedInstanceState);
                        }
                    });
            builder.create().show();
            PMHelper.disableFirstLanch(this);
        } else {

            initialize(savedInstanceState);
        }
    }
}

From source file:net.reichholf.dreamdroid.activities.MainActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    DreamDroid.setTheme(this);
    supportRequestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    super.onCreate(savedInstanceState);

    if (savedInstanceState != null) {
        mNavigationFragment = (NavigationFragment) getSupportFragmentManager().getFragment(savedInstanceState,
                "navigation");
    }/*ww  w . j a va  2s  .com*/

    DreamDroid.setCurrentProfileChangedListener(this);

    initViews();
    mNavigationFragment.setHighlightCurrent(true);

    showChangeLogIfNeeded(true);
}