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.librelio.activity.MainMagazineActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setContentView(R.layout.issue_list_layout);
    overridePendingTransition(R.anim.flip_right_in, R.anim.flip_left_out);

    plistName = getIntent().getStringExtra(PLIST_NAME_EXTRA);
    if (!plistName.equals(getString(R.string.root_view))) {
        getActionBar().setDisplayHomeAsUpEnabled(true);
    }/*from  w w  w  .j  a va 2  s  . c o m*/

    hasTestMagazine = hasTestMagazine();

    grid = (GridView) findViewById(R.id.issue_list_grid_view);

    magazines = new ArrayList<DictItem>();

    adapter = new MagazineAdapter(magazines, this, hasTestMagazine);
    grid.setAdapter(adapter);

    IntentFilter subsFilter = new IntentFilter(REQUEST_SUBS);

    registerReceiver(subscriptionYear, subsFilter);
    registerReceiver(subscriptionMonthly, subsFilter);

    getLoaderManager().initLoader(PLIST_PARSER_LOADER, null, this);

}

From source file:th.in.ffc.person.visit.VisitDefaultActivity.java

protected void onCreate(Bundle savedInstanceState) {
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    setRetriveVisitData(false);//w  w w  . j  a  va2 s .c  om
    super.onCreate(savedInstanceState);
    setContentView(R.layout.visit_default_activity);

    setSupportProgressBarIndeterminateVisibility(false);
    doSetupMeasurement(null);
    doSetupDiagnose(null);

    mTimeStart = DateTime.getCurrentTime();

    String action = getIntent().getAction();
    Uri data = getIntent().getData();

    if (action.equals(Action.INSERT)) {
        mPid = data.getLastPathSegment();
        if (savedInstanceState != null) {
            mVisitNo = savedInstanceState.getString(Visit.NO);
        }

        if (TextUtils.isEmpty(mVisitNo)) {
            getSupportLoaderManager().initLoader(LOAD_MAXVISIT, null, this);
            getSupportLoaderManager().initLoader(LOAD_LAST_MEASURE, null, this);
        } else {
            getSupportActionBar().setSubtitle("Visit #" + mVisitNo);
        }

    } else if (action.equals(Action.EDIT)) {
        mVisitNo = data.getLastPathSegment();
        mPid = getIntent().getStringExtra(Person.PID);
        if (TextUtils.isEmpty(mPid))
            throw new IllegalArgumentException("need person.pid to edit visit");
        getSupportActionBar().setSubtitle("Visit #" + mVisitNo);
        getSupportLoaderManager().initLoader(LOAD_SAVED_VISIT, null, this);
    }
}

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

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setContentView(R.layout.activity_save);
    initViews();/* ww w.  ja  v  a2  s . com*/
}

From source file:th.in.ffc.person.visit.VisitDiagActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.visit_diag_activity);
    setSupportProgressBarIndeterminateVisibility(false);
    doSetupAppoint(savedInstanceState);/*from  w w  w  . j a v  a 2  s . c  o  m*/

    if (savedInstanceState == null) {
        getSupportLoaderManager().initLoader(0, null, this);
    }
}

From source file:org.strongswan.android.ui.activity.MainActivity.java

@SuppressWarnings("ConstantConditions")
@Override/*ww  w .ja v  a  2  s. c  om*/
public void onCreate(Bundle savedInstanceState) {
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    //?ActionBar
    ActionBar bar = getSupportActionBar();
    bar.setDisplayShowHomeEnabled(true);
    bar.setDisplayShowTitleEnabled(false);
    bar.setIcon(R.drawable.ic_launcher);

    //??
    this.bindService(new Intent(this, VpnStateService.class), mServiceConnection, Service.BIND_AUTO_CREATE);

    /* load CA certificates in a background task */
    //???
    new LoadCertificatesTask().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}

From source file:com.andrew67.ddrfinder.activity.MapViewer.java

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

    PreferenceManager.setDefaultValues(this, R.xml.preferences, false);

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

    progressBar = (CircleProgressBar) findViewById(R.id.progressBar);
    onCreateSavedInstanceState = savedInstanceState;

    ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMapAsync(this);
}

From source file:com.bluetooth.mwoolley.microbitbledemo.ui.HrmListActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {

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

    setContentView(R.layout.activity_hrm_list);
    setButtonText();/*from  w  w  w.jav a2 s.  c om*/
    getSupportActionBar().setTitle(R.string.screen_title_main);
    showMsg(Utility.htmlColorGreen("Ready"));

    Settings.getInstance().restore(this);

    // connect to the Bluetooth service
    Intent gattServiceIntent = new Intent(this, HrmAdapterService.class);
    bindService(gattServiceIntent, mServiceConnection, BIND_AUTO_CREATE);

    ble_device_list_adapter = new ListAdapter();

    ListView listView = (ListView) this.findViewById(R.id.deviceList);
    listView.setAdapter(ble_device_list_adapter);

    ble_scanner = BleScannerFactory.getBleScanner(this.getApplicationContext());

    ble_scanner.setDevice_name_start(null);
    ble_scanner.setSelect_bonded_devices_only(false);

    listView.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

            if (!service_connected) {
                showMsg("Not yet ready - try again soon");
                return;
            }

            if (ble_scanning) {
                setScanState(false);
                ble_scanner.stopScanning();
            }

            BluetoothDevice device = ble_device_list_adapter.getDevice(position);
            selected_device = device;
            connectToDevice(device);

        }
    });
}

From source file:joshuatee.wx.StormReportsActivity.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", "");
    if (theme_blue_current.contains("white")) {
        highlight_color = Color.BLUE;
        background_color = Color.BLACK;
        highlight_color_str = "blue";
        background_color_str = "black";

    }/*from  w w w . j  ava2s  .c o  m*/
    setTheme(Utility.Theme(theme_blue_current));
    setContentView(R.layout.activity_storm_reports);

    //padding = (int)res.getDimension(R.dimen.padding);
    //padding_vertical = (int)res.getDimension(R.dimen.padding_vertical);

    Resources res = getResources();
    padding = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
            (float) res.getDimension(R.dimen.padding), getResources().getDisplayMetrics());
    padding_vertical = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
            (float) res.getDimension(R.dimen.padding_vertical), getResources().getDisplayMetrics());
    text_size = res.getDimension(R.dimen.listitem_text);

    iv = new TouchImageView2(getBaseContext());
    no = getIntent().getStringExtra(NO);
    dm = new DisplayMetrics();
    this.getWindowManager().getDefaultDisplay().getMetrics(dm);

    final Calendar cal = Calendar.getInstance();
    pYear = cal.get(Calendar.YEAR);
    pMonth = cal.get(Calendar.MONTH);
    pDay = cal.get(Calendar.DAY_OF_MONTH);

    // FIXME, handle first of the month
    if (no.equals("yesterday"))
        pDay--;

    cYear = pYear;
    cMonth = pMonth;
    cDay = pDay;

    UpdateIowaMesoData();

    img_url = "http://www.spc.noaa.gov/climo/reports/" + no + ".gif";
    text_url = "http://www.spc.noaa.gov/climo/reports/" + no + ".csv";

    comma = Pattern.compile(",");
    br = Pattern.compile("<br>");

    output = new StringBuilder(200);

    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, state_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:com.flexvdi.androidlauncher.LoginActivity.java

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

    mContext = this;

    try {// w  w w .  j a  va 2  s  . c  o  m
        GStreamer.init(mContext);
    } catch (Exception e) {
        Log.e(TAG, "Can't initialize GStreamer" + e.getMessage());
        finish();
    }

    settings = getSharedPreferences("flexVDI", MODE_PRIVATE);
    settingsEditor = settings.edit();
    /* Uncomment this for clearing preferences (useful when debugging) */
    //settingsEditor.clear();
    //settingsEditor.apply();
    //settingsEditor.commit();

    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    setContentView(R.layout.activity_login);

    textUser = (EditText) findViewById(R.id.textUser);
    textServer = (EditText) findViewById(R.id.textServer);
    textPassword = (EditText) findViewById(R.id.textPassword);

    goButton = (Button) findViewById(R.id.buttonGO);
    goButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            ConnectivityManager cm = (ConnectivityManager) mContext
                    .getSystemService(Context.CONNECTIVITY_SERVICE);

            NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
            boolean isConnected = activeNetwork != null && activeNetwork.isConnectedOrConnecting();

            if (!isConnected) {
                Toast.makeText(view.getContext(), getResources().getString(R.string.no_network),
                        Toast.LENGTH_LONG).show();
                return;
            }

            if (checkBoxGenericSpice.isChecked()) {
                String userField = textUser.getText().toString();
                if (userField.length() == 0 || !userField.contains(":")) {
                    Toast.makeText(view.getContext(), getResources().getString(R.string.invalid_spice_server),
                            Toast.LENGTH_LONG).show();
                    return;
                }

                String spiceAddress = userField.substring(0, userField.indexOf(":"));
                String spicePort = userField.substring(userField.indexOf(":") + 1);

                if (spiceAddress.length() == 0 || spicePort.length() == 0) {
                    Toast.makeText(view.getContext(), getResources().getString(R.string.invalid_spice_server),
                            Toast.LENGTH_LONG).show();
                    return;
                }

                String spicePassword = textPassword.getText().toString();

                settingsEditor.putBoolean("enableSound", checkBoxEnableSound.isChecked());
                settingsEditor.putBoolean("staticResolution", checkBoxStaticResolution.isChecked());
                settingsEditor.putBoolean("genericSpice", checkBoxGenericSpice.isChecked());
                settingsEditor.putString("flexServerName", textServer.getText().toString());

                settingsEditor.putString("spice_address", spiceAddress);
                settingsEditor.putString("spice_port", spicePort);
                settingsEditor.putString("spice_password", spicePassword);
                settingsEditor.putBoolean("use_ws", false);

                settingsEditor.apply();
                settingsEditor.commit();

                startMainActivity();
            } else {
                if (textServer.getText().length() == 0) {
                    Toast.makeText(view.getContext(), getResources().getString(R.string.empty_flexvdi_server),
                            Toast.LENGTH_LONG).show();
                } else {
                    if (textUser.getText().length() != 0 && textPassword.getText().length() != 0) {
                        new RequestTask().execute("authmode", textServer.getText().toString(),
                                textUser.getText().toString(), textPassword.getText().toString(), "");
                    } else
                        Toast.makeText(view.getContext(), getResources().getString(R.string.empty_credentials),
                                Toast.LENGTH_LONG).show();
                }
            }
        }
    });

    // The advanced settings button.
    checkBoxAdvancedOptions = (CheckBox) findViewById(R.id.checkBoxAdvancedSettings);
    layoutAdvancedOptions = (LinearLayout) findViewById(R.id.layoutAdvancedOptions2);
    checkBoxAdvancedOptions.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(CompoundButton arg0, boolean checked) {
            if (checked)
                layoutAdvancedOptions.setVisibility(View.VISIBLE);
            else
                layoutAdvancedOptions.setVisibility(View.GONE);
        }
    });

    textServer.setOnFocusChangeListener(new View.OnFocusChangeListener() {
        @Override
        public void onFocusChange(View field, boolean hasFocus) {
            if (!hasFocus && checkBoxGenericSpice.isChecked()) {
                if (textUser.getText().toString().length() == 0) {
                    textUser.setText(textServer.getText());
                }
            }
        }
    });

    checkBoxEnableSound = (CheckBox) findViewById(R.id.checkBoxEnableSound);
    if (settings.getBoolean("enableSound", true)) {
        checkBoxEnableSound.setChecked(true);
    } else {
        checkBoxEnableSound.setChecked(false);
    }

    if (!settings.contains("staticResolution")) {
        Display display = getWindowManager().getDefaultDisplay();
        Point size = new Point();
        display.getSize(size);
        if ((size.x + size.y) > 2340) {
            /* 2340 = 1440+900 */
            settingsEditor.putBoolean("staticResolution", true);
        } else {
            settingsEditor.putBoolean("staticResolution", false);
        }
        settingsEditor.apply();
        settingsEditor.commit();
    }

    checkBoxStaticResolution = (CheckBox) findViewById(R.id.checkBoxStaticResolution);
    if (settings.getBoolean("staticResolution", true)) {
        checkBoxStaticResolution.setChecked(true);
    } else {
        checkBoxStaticResolution.setChecked(false);
    }

    checkBoxGenericSpice = (CheckBox) findViewById(R.id.checkBoxGenericSpice);
    if (settings.getBoolean("genericSpice", false)) {
        checkBoxGenericSpice.setChecked(true);
        checkBoxAdvancedOptions.setChecked(true);
        layoutAdvancedOptions.setVisibility(View.VISIBLE);

        if (settings.contains("flexServerName")) {
            textServer.setText(settings.getString("flexServerName", ""));
            textUser.setText(settings.getString("flexServerName", ""));
            textServer.setHint(getResources().getString(R.string.spice_server));
            textUser.setHint(getResources().getString(R.string.spice_server_port));
        }
    } else {
        checkBoxGenericSpice.setChecked(false);
        if (settings.contains("flexServerName")) {
            textServer.setText(settings.getString("flexServerName", ""));
            layoutAdvancedOptions.setVisibility(View.GONE);
        } else {
            textServer.setText("manager.flexvdi.com");
            checkBoxAdvancedOptions.setChecked(true);
        }
    }

    checkBoxGenericSpice.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(CompoundButton arg0, boolean checked) {
            if (checked) {
                textServer.setHint(getResources().getString(R.string.spice_server));
                textUser.setHint(getResources().getString(R.string.spice_server_port));
                String server = textServer.getText().toString();
                if (server.length() != 0) {
                    if (server.contains(":")) {
                        textUser.setText(server);
                    } else {
                        textUser.setText(server + ":5900");
                        textServer.setText(server + ":5900");
                    }
                }
            } else {
                textServer.setHint(getResources().getString(R.string.flexvdi_server));
                String server = textServer.getText().toString();
                if (server.length() != 0 && server.contains(":")) {
                    textServer.setText(server.substring(0, server.indexOf(":")));
                }
                textUser.setText("");
                textUser.setHint(getResources().getString(R.string.user));
            }
        }
    });

    deviceID = Settings.Secure.getString(mContext.getContentResolver(), Settings.Secure.ANDROID_ID);

    textViewDeviceID = (TextView) findViewById(R.id.textViewDeviceID);
    textViewDeviceID.setText("ID: " + deviceID + " (" + BuildConfig.VERSION_NAME + ")");

    try {
        HttpsURLConnection.setDefaultHostnameVerifier(new NullHostNameVerifier());
        SSLContext context = SSLContext.getInstance("TLS");
        context.init(null, new X509TrustManager[] { new NullX509TrustManager() }, new SecureRandom());
        HttpsURLConnection.setDefaultSSLSocketFactory(context.getSocketFactory());
    } catch (NoSuchAlgorithmException nsae) {
        Log.e(TAG, nsae.getMessage());
    } catch (KeyManagementException kme) {
        Log.e(TAG, kme.getMessage());
    }
}

From source file:com.akop.bach.activity.RibbonedSinglePane.java

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

    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setContentView(getLayout());/*  w ww. j a va  2s  .  c o m*/

    if (mAccount == null)
        mAccount = (BasicAccount) getIntent().getParcelableExtra("account");

    if (mAccount == null) {
        if (App.getConfig().logToConsole())
            App.logv("Account is null");

        finish();
        return;
    }

    if (android.os.Build.VERSION.SDK_INT >= 11) {
        new ActionBarHelper().init();
    }

    FragmentManager fm = getSupportFragmentManager();
    Fragment titleFrag;

    FragmentTransaction ft = fm.beginTransaction();
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);

    if ((titleFrag = fm.findFragmentByTag("details")) == null) {
        titleFrag = createFragment();
        ft.replace(R.id.fragment_titles, titleFrag, "details");
    }

    ft.commit();
}