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:joshuatee.wx.NEXRADAttributesActivity.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  ww.ja va  2 s. c  o  m*/
    setTheme(Utility.Theme(theme_blue_current));
    setContentView(R.layout.activity_nexradattributes);

    Resources res = getResources();

    comma = Pattern.compile(",");

    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);

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

    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:net.reichholf.dreamdroid.abstivities.AbstractHttpActivity.java

@SuppressWarnings("unchecked")
@Override//from  ww w.jav  a  2 s.  com
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    // CustomExceptionHandler.register(this);
    mShc = null;

    if (savedInstanceState != null) {
        Object retained = getLastNonConfigurationInstance();
        if (retained instanceof HashMap) {
            mShc = (SimpleHttpClient) ((HashMap<String, Object>) retained).get("shc");
        }
    }

    if (mShc == null) {
        setClient();
    }
}

From source file:org.codecyprus.android_client.ui.ActivityCurrentQuestion.java

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

    actionBar = getActionBar();/*from w  ww  . j av  a 2s. c o m*/

    inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);

    locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);

    locationUpdater = new LocationUpdater();

    //        scoreTextView = (TextView) findViewById(R.id.activity_current_question_score);
    feedbackTextView = (TextView) findViewById(R.id.activity_current_question_feedback);
    feedbackTextView.setVisibility(View.GONE);
    questionTextView = (TextView) findViewById(R.id.activity_current_question_question);
    requiresLocationTextView = (TextView) findViewById(R.id.activity_current_question_requires_location);
    requiresLocationTextView.setVisibility(View.GONE);
    mcqButtonsContainer = findViewById(R.id.activity_current_question_mcq_buttons);
    textButtonsContainer = findViewById(R.id.activity_current_question_text_buttons);
    textAnswerEditText = (EditText) findViewById(R.id.activity_current_question_edit_text);

    buttonA = (Button) findViewById(R.id.activity_current_question_button_A);
    buttonA.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            submitAnswer("A");
        }
    });
    buttonB = (Button) findViewById(R.id.activity_current_question_button_B);
    buttonB.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            submitAnswer("B");
        }
    });
    buttonC = (Button) findViewById(R.id.activity_current_question_button_C);
    buttonC.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            submitAnswer("C");
        }
    });
    buttonD = (Button) findViewById(R.id.activity_current_question_button_D);
    buttonD.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            submitAnswer("D");
        }
    });
    buttonSubmit = (Button) findViewById(R.id.activity_current_question_button_submit);
    buttonSubmit.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            final CharSequence charSequence = textAnswerEditText.getText();
            final String answer = charSequence == null ? "" : charSequence.toString();
            if (answer.isEmpty()) {
                Toast.makeText(ActivityCurrentQuestion.this, R.string.Invalid_empty_answer, Toast.LENGTH_SHORT)
                        .show();
            } else {
                inputMethodManager.hideSoftInputFromWindow(textAnswerEditText.getWindowToken(), 0);
                submitAnswer(answer);
            }
        }
    });

    progressReceiver = new ProgressReceiver();
}

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

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

    setContentView(R.layout.visit_pragnancy_activity);
    setSupportProgressBarIndeterminateVisibility(false);

    mAction = getIntent().getAction();// w ww. ja  va 2s  . c  o  m
    if (TextUtils.isEmpty(mAction))
        throw new IllegalStateException("VisitAncPregnancyActivity not support null Action Intent");

    doInitializeView(savedInstanceState);
    if (savedInstanceState == null) {
        //do by request action
        if (mAction.equals(Action.INSERT))
            getSupportLoaderManager().initLoader(LOAD_LAST_PREG, null, this);
        else if (mAction.equals(Action.EDIT)) {
            mPregNo = getIntent().getStringExtra(PregnancyColumns._PREGNO);

            if (TextUtils.isEmpty(mPregNo))
                throw new InvalidParameterException("Edit Action must have \'pregno\'");
            if (!TextUtils.isDigitsOnly(mPregNo))
                throw new InvalidParameterException("pregno must be digits only");

            PregNo.setEnabled(false);
            PregNo.setText(mPregNo);
            getSupportLoaderManager().initLoader(LOAD_PREG, null, this);
            getSupportLoaderManager().initLoader(LOAD_RISK, null, this);
        }
    } else {
        mAction = savedInstanceState.getString("action");
        mMinPregNo = savedInstanceState.getInt("min");
        Hint.setText(savedInstanceState.getCharSequence("hint"));
        mPregNo = savedInstanceState.getString("pregno");

        PregNo.setEnabled(savedInstanceState.getBoolean("enable"));
        RiskLayout.setVisibility(savedInstanceState.getBoolean("showRisk") ? View.VISIBLE : View.GONE);

    }

}

From source file:com.scigames.slidegame.Registration1UserNameActivity.java

/** Called with the activity is first created. */
@Override/*  w ww  .  j a  v  a2  s.  co  m*/
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Log.d(TAG, "super.OnCreate");

    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
    Intent i = getIntent();
    Log.d(TAG, "...getIntent");
    //       firstNameIn = i.getStringExtra("fName");
    //       lastNameIn = i.getStringExtra("lName");
    //       studentIdIn = i.getStringExtra("studentId");
    //       visitIdIn = i.getStringExtra("visitId");
    Log.d(TAG, "...getStringExtra");
    // Inflate our UI from its XML layout description.
    setContentView(R.layout.registration1_username);
    Log.d(TAG, "...setContentView");
    // Find the text editor view inside the layout, because we
    // want to do various programmatic things with it.
    firstName = (EditText) findViewById(R.id.first_name);
    /* to hide the keyboard on launch, then open when tap in firstname field */
    firstName.setInputType(InputType.TYPE_NULL);
    firstName.setOnTouchListener(new View.OnTouchListener() {
        //@Override
        public boolean onTouch(View v, MotionEvent event) {
            firstName.setInputType(InputType.TYPE_TEXT_VARIATION_PERSON_NAME);
            firstName
                    .setInputType(InputType.TYPE_TEXT_FLAG_CAP_WORDS | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
            firstName.onTouchEvent(event); // call native handler
            return true; // consume touch even
        }
    });
    lastName = (EditText) findViewById(R.id.last_name);
    password = (EditText) findViewById(R.id.password);
    Log.d(TAG, "...instantiateEditTexts");

    // Hook up button presses to the appropriate event handler.
    ((Button) findViewById(R.id.back)).setOnClickListener(mBackListener);
    //((Button) findViewById(R.id.clear)).setOnClickListener(mClearListener);
    ((Button) findViewById(R.id.continue_button)).setOnClickListener(mContinueButtonListener);
    Log.d(TAG, "...instantiateButtons");

    //set info to what we know already
    //firstName.setText(firstNameIn);
    //lastName.setText(lastNameIn);
    //password.setText(passwordIn);
    //Log.d(TAG,"...setTexts with incoming name/pw");

    //set listener
    task.setOnResultsListener(this);

    alertDialog = new AlertDialog.Builder(Registration1UserNameActivity.this).create();
    // Setting Dialog Title
    alertDialog.setTitle("Login Failed");
    // Setting Dialog Message
    alertDialog.setMessage("Welcome to AndroidHive.info");
    // Setting Icon to Dialog
    //alertDialog.setIcon(R.drawable.tick);

    alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int which) {
            // Write your code here to execute after dialog closed
            Toast.makeText(getApplicationContext(), "You clicked on OK", Toast.LENGTH_SHORT).show();
        }
    });
}

From source file:com.mooshim.mooshimeter.main.ScanActivity.java

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

    // Use this check to determine whether BLE is supported on the device. Then
    // you can selectively disable BLE-related features.
    if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)) {
        Toast.makeText(this, R.string.ble_not_supported, Toast.LENGTH_LONG).show();
    }// www  .ja  v  a 2s . com

    // Checks if Bluetooth is supported on the device.
    if (BluetoothAdapter.getDefaultAdapter() == null) {
        Toast.makeText(this, R.string.bt_not_supported, Toast.LENGTH_LONG).show();
        setError("BLE not supported on this device");
    }

    if (!BluetoothAdapter.getDefaultAdapter().isEnabled()) {
        // Request BT adapter to be turned on
        Intent enableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
        startActivityForResult(enableIntent, REQ_ENABLE_BT);
    }

    setContentView(R.layout.fragment_scan);
    // Initialize widgets
    mStatus = (TextView) findViewById(R.id.status);
    mBtnScan = (Button) findViewById(R.id.btn_scan);
    mDeviceScrollView = (LinearLayout) findViewById(R.id.device_list);
    mEmptyMsg = (TextView) findViewById(R.id.no_device);

    mDeviceScrollView.setClickable(true);

    mInflater = LayoutInflater.from(this);
}

From source file:org.sufficientlysecure.keychain.ui.ViewKeyActivity.java

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

    mExportHelper = new ExportHelper(this);
    mProviderHelper = new ProviderHelper(this);

    // let the actionbar look like Android's contact app
    ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setIcon(android.R.color.transparent);
    actionBar.setHomeButtonEnabled(true);

    setContentView(R.layout.view_key_activity);

    mStatusDivider = findViewById(R.id.status_divider);
    mStatusRevoked = findViewById(R.id.view_key_revoked);
    mStatusExpired = findViewById(R.id.view_key_expired);

    mViewPager = (ViewPager) findViewById(R.id.view_key_pager);
    mSlidingTabLayout = (SlidingTabLayout) findViewById(R.id.view_key_sliding_tab_layout);

    mTabsAdapter = new PagerTabStripAdapter(this);
    mViewPager.setAdapter(mTabsAdapter);

    int switchToTab = TAB_MAIN;
    Intent intent = getIntent();//  w ww .j  a  v a2 s  .  c o m
    if (intent.getExtras() != null && intent.getExtras().containsKey(EXTRA_SELECTED_TAB)) {
        switchToTab = intent.getExtras().getInt(EXTRA_SELECTED_TAB);
    }

    Uri dataUri = getIntent().getData();
    if (dataUri == null) {
        Log.e(Constants.TAG, "Data missing. Should be Uri of key!");
        finish();
        return;
    }

    loadData(dataUri);

    initNfc(dataUri);

    Bundle mainBundle = new Bundle();
    mainBundle.putParcelable(ViewKeyMainFragment.ARG_DATA_URI, dataUri);
    mTabsAdapter.addTab(ViewKeyMainFragment.class, mainBundle, getString(R.string.key_view_tab_main));

    Bundle shareBundle = new Bundle();
    shareBundle.putParcelable(ViewKeyMainFragment.ARG_DATA_URI, dataUri);
    mTabsAdapter.addTab(ViewKeyShareFragment.class, mainBundle, getString(R.string.key_view_tab_share));

    Bundle keyDetailsBundle = new Bundle();
    keyDetailsBundle.putParcelable(ViewKeyKeysFragment.ARG_DATA_URI, dataUri);
    mTabsAdapter.addTab(ViewKeyKeysFragment.class, keyDetailsBundle, getString(R.string.key_view_tab_keys));

    Bundle certBundle = new Bundle();
    certBundle.putParcelable(ViewKeyCertsFragment.ARG_DATA_URI, dataUri);
    mTabsAdapter.addTab(ViewKeyCertsFragment.class, certBundle, getString(R.string.key_view_tab_certs));

    // NOTE: must be after adding the tabs!
    mSlidingTabLayout.setViewPager(mViewPager);

    // switch to tab selected by extra
    mViewPager.setCurrentItem(switchToTab);
}

From source file:com.renard.ocr.documents.viewing.single.DocumentActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setVolumeControlStream(AudioManager.STREAM_ALARM);
    supportRequestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setContentView(R.layout.activity_document);
    if (!init(savedInstanceState)) {
        finish();//ww  w  .j a v  a2  s.c  o m
        return;
    }

    if (savedInstanceState == null && isStartedAfterAScan(getIntent())) {
        showResultDialog();
    } else {
        mAnalytics.sendScreenView("Document");
    }
    setDocumentFragmentType();
    initToolbar();
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    mActionCallback = new TtsActionCallback(this);
}

From source file:com.scigames.registration.Registration1UserNameActivity.java

/** Called with the activity is first created. */
@Override/*w  w  w. j  a v a  2s .  c om*/
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Log.d(TAG, "super.OnCreate");

    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
    Intent i = getIntent();
    Log.d(TAG, "...getIntent");
    firstNameIn = i.getStringExtra("fName");
    lastNameIn = i.getStringExtra("lName");
    passwordIn = i.getStringExtra("pword");

    Log.d(TAG, "...getStringExtra");
    // Inflate our UI from its XML layout description.
    setContentView(R.layout.registration1_username);
    Log.d(TAG, "...setContentView");

    lastName = (EditText) findViewById(R.id.last_name);
    password = (EditText) findViewById(R.id.password);
    password_confirm = (EditText) findViewById(R.id.confirm_password);
    firstName = (EditText) findViewById(R.id.first_name);
    /* to hide the keyboard on launch, then open when tap in firstname field */
    firstName.setCursorVisible(false);
    firstName.setInputType(InputType.TYPE_NULL);
    firstName.setOnTouchListener(new View.OnTouchListener() {
        //@Override
        public boolean onTouch(View v, MotionEvent event) {
            firstName.setInputType(InputType.TYPE_TEXT_VARIATION_PERSON_NAME);
            firstName
                    .setInputType(InputType.TYPE_TEXT_FLAG_CAP_WORDS | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
            firstName.setCursorVisible(true);
            firstName.onTouchEvent(event); // call native handler
            return true; // consume touch even
        }
    });

    Log.d(TAG, "...instantiateEditTexts");

    // Hook up button presses to the appropriate event handler.
    ((Button) findViewById(R.id.continue_button)).setOnClickListener(mContinueButtonListener);
    Log.d(TAG, "...instantiateButtons");

    Typeface ExistenceLightOtf = Typeface.createFromAsset(getAssets(), "fonts/Existence-Light.ttf");
    Typeface Museo300Regular = Typeface.createFromAsset(getAssets(), "fonts/Museo300-Regular.otf");
    Typeface Museo500Regular = Typeface.createFromAsset(getAssets(), "fonts/Museo500-Regular.otf");
    Typeface Museo700Regular = Typeface.createFromAsset(getAssets(), "fonts/Museo700-Regular.otf");

    setEditTextFont(Museo500Regular, firstName, lastName, password, password_confirm);

    //set info to what we know already
    firstName.setText(firstNameIn);
    lastName.setText(lastNameIn);
    //password.setText(passwordIn);
    Log.d(TAG, "...setTexts with incoming name/pw");

    //set listener
    task.setOnResultsListener(this);

    alertDialog = new AlertDialog.Builder(Registration1UserNameActivity.this).create();
    // Setting Dialog Title
    alertDialog.setTitle("Login Failed");
    // Setting Dialog Message
    alertDialog.setMessage("Welcome to AndroidHive.info");
    // Setting Icon to Dialog
    //alertDialog.setIcon(R.drawable.tick);

    alertDialog.setButton(RESULT_OK, "OK", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int which) {
            // Write your code here to execute after dialog closed
            Toast.makeText(getApplicationContext(), "", Toast.LENGTH_SHORT).show();
        }
    });
}

From source file:com.enstage.wibmo.sdk.inapp.InAppInitActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Log.v(TAG, "OnCreate");
    activity = this;

    Bundle extras = getIntent().getExtras();
    if (extras != null) {

        w2faInitRequest = (W2faInitRequest) extras.getSerializable("W2faInitRequest");
        wPayInitRequest = (WPayInitRequest) extras.getSerializable("WPayInitRequest");

        //reset//  w  ww  .  jav a 2s.c  om
        w2faInitResponse = null;
        wPayInitResponse = null;

        if (w2faInitRequest != null || wPayInitRequest != null) {
            qrMsg = "InApp payment";
        } else {
            Log.e(TAG, "W2faInitRequest and wPayInitRequest was null!");
            sendAbort(WibmoSDK.RES_CODE_FAILURE_SYSTEM_ABORT,
                    "sdk init - W2faInitRequest and wPayInitRequest was null!");
            return;
        }
    }

    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setProgressBarIndeterminateVisibility(false);

    LayoutInflater inflator = getLayoutInflater();
    view = inflator.inflate(R.layout.activity_inapp_init, null, false);
    view.startAnimation(AnimationUtils.loadAnimation(this, android.R.anim.slide_in_left));
    setContentView(view);

    TextView text = (TextView) findViewById(R.id.text);
    text.setText(qrMsg);

    mainView = (View) findViewById(R.id.main_view);

    final Activity activity = this;

    Button abortButton = (Button) findViewById(R.id.abort_button);
    abortButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            cancelIAP();
            sendAbort();
        }
    });

    if (WibmoSDK.IS_PHONE_STATE_PERMISSION_REQ) {
        if (WibmoSDKPermissionUtil.checkSelfPermission(activity,
                Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) {
            Log.w(TAG, "Permission not granted! READ_PHONE_STATE");

            WibmoSDKPermissionUtil.showRequestPermissionRationalel(activity,
                    getString(R.string.wibmosdk_phone_state_permission_rationale), new Runnable() {
                        @Override
                        public void run() {
                            ActivityCompat.requestPermissions(activity,
                                    new String[] { Manifest.permission.READ_PHONE_STATE },
                                    WibmoSDKPermissionUtil.REQUEST_CODE_ASK_PERMISSION_PHONE_STATE);
                        }
                    }, new Runnable() {
                        @Override
                        public void run() {
                            WibmoSDKPermissionUtil.showPermissionMissingUI(activity,
                                    getString(R.string.wibmosdk_phone_state_permission_missing_msg));
                            sendAbort(WibmoSDK.RES_CODE_FAILURE_SYSTEM_ABORT,
                                    "sdk init - no permission ph state");
                        }
                    });

            return;//we need this so can;t go on
        }
    }

    doIAPStuff();
}