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.tedx.activities.LazyActivity.java

protected void onCreate(Bundle savedInstanceState, int layoutResId, int rowLayoutResId) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setContentView(layoutResId);//from  w  ww. j  a  v  a2s . c om

    mList = (ListView) findViewById(android.R.id.list);
    mAdapter = new LazyAdapter(this, mAdapterData, rowLayoutResId, mFrom, mTo);
    mList.setAdapter(mAdapter);
    mList.setOnItemClickListener(this);
    mList.setFastScrollEnabled(true);
    mList.setTextFilterEnabled(true);

    // setEmptyView(R.layout.loading);

    restoreState();

    if (mLoadTask == null) {
        mLoadTask = newLoadTask();
    }
    setTaskActivity();

    if (mLoadTask != null && mLoadTask.getStatus() == AsyncTask.Status.PENDING) {
        mLoadTask.execute();
    }
}

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. jav  a2 s .c  o m
        public void onClick(View view) {
            handleButtonPrevious();
        }

    });
}

From source file:org.droidpres.activity.TransferActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setContentView(R.layout.transfer);/*from w w w  .  j ava 2 s.  c om*/

    cf = SetupRootActivity.getCurrencyFormat(this);

    mBtExport = (Button) findViewById(R.id.btExport);
    mBtImport = (Button) findViewById(R.id.btImport);
    mTvTrLog = (TextView) findViewById(R.id.tvTransferLog);
    mSpNetType = (Spinner) findViewById(R.id.spNetType);

    mBtImport.setOnClickListener(this);
    mBtExport.setOnClickListener(this);

    mDataBase = DB.get().getWritableDatabase();

    ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.itemNetType,
            android.R.layout.simple_spinner_item);
    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    mSpNetType.setAdapter(adapter);

    mAgentId = Integer.parseInt(SetupRootActivity.getAgentID(this));
}

From source file:nz.co.wholemeal.christchurchmetro.PlatformActivity.java

/** Called when the activity is first created. */
@Override//from   w  w w  . j a v a  2  s .c om
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    setContentView(R.layout.stop);

    stopHeader = findViewById(R.id.stop_header);

    arrival_adapter = new ArrivalAdapter(this, R.layout.arrival, arrivals);
    setListAdapter(arrival_adapter);

    current_stop = null;

    /* Load the requested stop information */
    Bundle extras = getIntent().getExtras();
    if (extras != null) {
        String platformTag = extras.getString("platformTag");
        if (platformTag != null) {
            loadStopByPlatformTag(platformTag);
        }
    } else {
        Log.e(TAG, "No extras in intent");
    }

    ListView listView = getListView();

    /* Enables the long click in the ListView to be handled in this Activity */
    registerForContextMenu(listView);

    listView.setOnItemClickListener(new OnItemClickListener() {
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

            Arrival arrival = (Arrival) arrivals.get(position);
            Log.d(TAG, "Got click on arrival " + arrival.destination);

            createAlarmDialog(arrival);
        }
    });
}

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

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

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

    setContentView(R.layout.activity_edit_auto_renew);
    getActionBar().setDisplayHomeAsUpEnabled(true);
    getActionBar().setTitle(R.string.button_edit_payment_details);

    if (savedInstanceState != null && !savedInstanceState.isEmpty()) {
        if (!DavAccount.build(savedInstanceState.getBundle(KEY_DAV_ACCOUNT_BUNDLE)).isPresent()) {
            finish();/*from www .  java 2s. c o  m*/
            return;
        }

        davAccount = DavAccount.build(savedInstanceState.getBundle(KEY_DAV_ACCOUNT_BUNDLE)).get();
        flockAccount = FlockAccount.build(savedInstanceState.getBundle(KEY_FLOCK_ACCOUNT_BUNDLE));
        cardInformation = FlockCardInformation.build(savedInstanceState.getBundle(KEY_CARD_INFORMATION_BUNDLE));
    } else if (getIntent().getExtras() != null) {
        if (!DavAccount.build(getIntent().getExtras().getBundle(KEY_DAV_ACCOUNT_BUNDLE)).isPresent()) {
            finish();
            return;
        }

        davAccount = DavAccount.build(getIntent().getExtras().getBundle(KEY_DAV_ACCOUNT_BUNDLE)).get();
        flockAccount = FlockAccount.build(getIntent().getExtras().getBundle(KEY_FLOCK_ACCOUNT_BUNDLE));
        cardInformation = FlockCardInformation
                .build(getIntent().getExtras().getBundle(KEY_CARD_INFORMATION_BUNDLE));
    }

    initCostPerYear();
}

From source file:org.gdgph.davao.boholearthquake.MainActivity.java

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

    // request window feature - progress indicator in actionbar
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    setContentView(R.layout.activity_main);

    initMap();//from w  w w.  j ava 2  s  .c om

    new DownloadDataTask().execute();
}

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

@Override
protected void onCreate(Bundle savedInstanceState) {

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

    setContentView(R.layout.activity_main);
    setButtonText();/*  w w  w  .  j a va 2s  . c  o m*/
    getSupportActionBar().setTitle(R.string.screen_title_main);
    showMsg(Utility.htmlColorGreen("Ready"));

    Settings.getInstance().restore(this);

    ble_device_list_adapter = new ListAdapter();

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

    registerReceiver(broadcastReceiver, new IntentFilter(BluetoothDevice.ACTION_BOND_STATE_CHANGED));

    ble_scanner = BleScannerFactory.getBleScanner(this.getApplicationContext());
    ble_scanner.setDevice_name_start(DEVICE_NAME_START);
    ble_scanner.setSelect_bonded_devices_only(true);

    listView.setOnItemClickListener(new OnItemClickListener() {

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

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

            BluetoothDevice device = ble_device_list_adapter.getDevice(position);
            if (device.getBondState() == BluetoothDevice.BOND_NONE
                    && Settings.getInstance().isFilter_unpaired_devices()) {
                device.createBond();
                showMsg(Utility.htmlColorRed("Selected micro:bit must be paired - pairing now"));
                return;
            }
            try {
                MainActivity.this.unregisterReceiver(broadcastReceiver);
            } catch (Exception e) {
                // ignore!
            }
            if (toast != null) {
                toast.cancel();
            }
            MicroBit microbit = MicroBit.getInstance();
            microbit.setBluetooth_device(device);
            Intent intent = new Intent(MainActivity.this, MenuActivity.class);
            intent.putExtra(MenuActivity.EXTRA_NAME, device.getName());
            intent.putExtra(MenuActivity.EXTRA_ID, device.getAddress());
            startActivity(intent);

        }
    });
}

From source file:tw.idv.palatis.danboorugallery.PostListActivity.java

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

    // enable progress icon
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setProgressBarIndeterminate(true);//w  ww. j a  v a  2  s .c o m

    setContentView(R.layout.activity_post_list);

    // enable ActionBar app icon to behave as action to toggle nav drawer
    getActionBar().setDisplayHomeAsUpEnabled(true);
    getActionBar().setHomeButtonEnabled(true);

    // setup drawer
    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    mDrawerLeft = (RelativeLayout) findViewById(R.id.left_drawer);
    mDrawerRight = (RelativeLayout) findViewById(R.id.right_drawer);
    ListView hostsList = (ListView) findViewById(R.id.host_list);
    mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.drawable.ic_drawer, R.string.drawer_open,
            R.string.drawer_close) {
        @Override
        public void onDrawerStateChanged(int newState) {
            super.onDrawerStateChanged(newState);

            if (newState == DrawerLayout.STATE_DRAGGING)
                mUiHider.show();
        }

        @Override
        public void onDrawerSlide(View drawerView, float slideOffset) {
            super.onDrawerSlide(drawerView, slideOffset);
        }

        public void onDrawerClosed(View view) {
            if (!mIsDoingSearch && !mDrawerLayout.isDrawerVisible(mDrawerLeft)
                    && !mDrawerLayout.isDrawerVisible(mDrawerRight)) {
                mUiHider.setAutoHideDelay(AUTO_HIDE_DELAY_MILLIS);
                mUiHider.hide();
            }
        }

        public void onDrawerOpened(View drawerView) {
            mUiHider.setAutoHideDelay(UiHider.AUTO_HIDE_DELAY_DISABLED);
            mUiHider.show();
        }
    };
    mDrawerLayout.setDrawerListener(mDrawerToggle);

    HostsTable.registerDataSetObserver(new DataSetObserver() {
        @Override
        public void onChanged() {
            super.onChanged();
            getLoaderManager().restartLoader(R.id.loader_host_ids, null, PostListActivity.this);
        }

        @Override
        public void onInvalidated() {
            super.onInvalidated();
            mHostsAdapter.swapCursor(null);
        }
    });
    mHostsAdapter = new CursorAdapter(this, null, false) {
        private CompoundButton.OnCheckedChangeListener mOnCheckedChangeListener = new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton button, boolean checked) {
                ViewHolder holder = (ViewHolder) button.getTag(R.id.view_tag_view_holder);
                Host host = SiteSession.getHostById(holder.host_id);
                host.enabled = checked;
                HostsTable.addOrUpdateHost(host);
            }
        };

        class ViewHolder {
            int host_id;
            TextView title;
            TextView summary;
            CheckBox toggle;

            public ViewHolder(View view, int host_id) {
                this.host_id = host_id;
                this.title = (TextView) view.findViewById(android.R.id.title);
                this.summary = (TextView) view.findViewById(android.R.id.summary);
                this.toggle = (CheckBox) view.findViewById(android.R.id.toggle);
                this.toggle.setTag(R.id.view_tag_view_holder, this);
            }
        }

        @Override
        public View newView(Context context, Cursor cursor, ViewGroup parent) {
            LayoutInflater inflater = (LayoutInflater) context.getSystemService(LAYOUT_INFLATER_SERVICE);
            View view = inflater.inflate(R.layout.listitem_drawer_host_item, parent, false);
            view.setTag(R.id.view_tag_view_holder,
                    new ViewHolder(view, cursor.getInt(HostsTable.INDEX_HOST_DATABASE_ID)));
            return view;
        }

        @Override
        public void bindView(View view, Context context, Cursor cursor) {
            Host host = SiteSession.getHostById(cursor.getInt(HostsTable.INDEX_HOST_DATABASE_ID));
            if (host == null)
                return;

            ViewHolder holder = (ViewHolder) view.getTag(R.id.view_tag_view_holder);

            holder.host_id = host.id;
            holder.toggle.setChecked(host.enabled);
            holder.title.setText(host.name);
            holder.summary.setText(host.url);
            holder.toggle.setOnCheckedChangeListener(mOnCheckedChangeListener);
        }
    };
    DrawerListAdapter adapter = new DrawerListAdapter(this, mHostsAdapter);
    hostsList.setAdapter(adapter);
    hostsList.setChoiceMode(AbsListView.CHOICE_MODE_NONE);
    hostsList.setOnItemClickListener(this);
    hostsList.setOnItemLongClickListener(this);

    getLoaderManager().initLoader(R.id.loader_host_ids, null, this);

    // Set up an instance of SystemUiHider to control the system UI for
    // this activity.
    mUiHider = new UiHider(AUTO_HIDE_DELAY_MILLIS, new UiHider.OnVisibilityChangeListener() {
        @Override
        public void onVisibilityChange(boolean visible) {
            if (visible)
                getActionBar().show();
            else
                getActionBar().hide();
        }
    });

    if (savedInstanceState == null) {
        mPostListFragment = new PostListFragment();
        getFragmentManager().beginTransaction().replace(R.id.post_list_container, mPostListFragment).commit();
    }
}

From source file:jupiter.broadcasting.live.tv.RssListActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {

    shows = new String[] { getString(R.string.allshows), "Coder Radio", "Faux Show", "Linux Action Show",
            "LINUX Unplugged", "Plan B", "SciByte", "Techsnap", "Unfilter" };

    audioFeedTable = new Hashtable<String, String>();
    audioFeedTable.put(getString(R.string.allshows), "http://feeds.feedburner.com/JupiterBroadcasting");
    audioFeedTable.put("Coder Radio", "http://feeds.feedburner.com/coderradiomp3");
    audioFeedTable.put("Faux Show", "http://www.jupiterbroadcasting.com/feeds/FauxShowMP3.xml");
    audioFeedTable.put("Linux Action Show", "http://feeds.feedburner.com/TheLinuxActionShow");
    audioFeedTable.put("LINUX Unplugged", "http://feeds.feedburner.com/linuxunplugged");
    audioFeedTable.put("SciByte", "http://feeds.feedburner.com/scibyteaudio");
    audioFeedTable.put("Techsnap", "http://feeds.feedburner.com/techsnapmp3");
    audioFeedTable.put("Unfilter", "http://www.jupiterbroadcasting.com/feeds/unfilterMP3.xml");
    audioFeedTable.put("Plan B", "http://feeds.feedburner.com/planbmp3");

    videoFeedTable = new Hashtable<String, String>();
    videoFeedTable.put(getString(R.string.allshows), "http://feeds2.feedburner.com/AllJupiterVideos");
    videoFeedTable.put("Coder Radio", "http://feeds.feedburner.com/coderradiovideo");
    videoFeedTable.put("Faux Show", "http://www.jupiterbroadcasting.com/feeds/FauxShowMobile.xml");
    videoFeedTable.put("Linux Action Show", "http://feeds.feedburner.com/linuxactionshowipodvid");
    videoFeedTable.put("LINUX Unplugged", "http://feeds.feedburner.com/linuxunvid");
    videoFeedTable.put("SciByte", "http://feeds.feedburner.com/scibytelarge");
    videoFeedTable.put("Techsnap", "http://feeds.feedburner.com/techsnapmobile");
    videoFeedTable.put("Unfilter", "http://www.jupiterbroadcasting.com/feeds/unfilterMob.xml");
    videoFeedTable.put("Plan B", "http://feeds.feedburner.com/PlanBVideo");

    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setContentView(R.layout.main);//from   w ww . j  a v a 2 s  .co m

    mTitle = mDrawerTitle = getTitle();

    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    mDrawerList = (ListView) findViewById(R.id.showlist);

    // set a custom shadow that overlays the main content when the drawer opens
    mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START);
    // set up the drawer's list view with shows
    mDrawerList.setAdapter(new ArrayAdapter<String>(this, R.layout.drawer_list_item, shows));

    mDrawerList.setOnItemClickListener(new DrawerItemClickListener());

    // enable ActionBar app icon to behave as action to toggle nav drawer
    aBar = getSupportActionBar();
    aBar.setDisplayHomeAsUpEnabled(true);
    aBar.setHomeButtonEnabled(true);

    mDrawerToggle = new ActionBarDrawerToggle(this, /* host Activity */
            mDrawerLayout, /* DrawerLayout object */
            R.drawable.ic_drawer, /* nav drawer image to replace 'Up' caret */
            R.string.drawer_open, /* "open drawer" description for accessibility */
            R.string.drawer_close /* "close drawer" description for accessibility */
    ) {
        public void onDrawerClosed(View view) {
            aBar.setTitle(mTitle);

        }

        public void onDrawerOpened(View drawerView) {
            aBar.setTitle(mDrawerTitle);

        }
    };
    //set the drawer icon to be clickable
    mDrawerLayout.setDrawerListener(mDrawerToggle);

    //first start opens the drawer
    if (savedInstanceState == null) {
        mDrawerLayout.openDrawer(mDrawerList);
    }
}

From source file:com.kiddobloom.bucketlist.DetailedEntryActivity.java

/**
* {@inheritDoc}/*from w w  w  . jav a  2s  .c  om*/
*/
@Override
public void onCreate(Bundle icicle) {

    Intent intent = getIntent();
    bucketListTab = intent.getIntExtra("com.kiddobloom.bucketlist.current_tab", 0);
    facebook_id = intent.getStringExtra("com.kiddobloom.bucketlist.facebook_id");

    //Log.d("tagaa", "DetailedEntry activity oncreate - bucketListTab: " + bucketListTab + " facebook: " + facebook_id);

    super.onCreate(icicle);

    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    getActionBar().setTitle("Bucket List");
    getActionBar().setSubtitle("by kiddoBLOOM");
    // getActionBar().setDisplayHomeAsUpEnabled(true);

    sp = getSharedPreferences(getString(R.string.pref_name), MODE_PRIVATE);
    myApp = (MyApplication) getApplication();
    list = new ArrayList<BucketListTable>();
}