Android SpinnerAdapter - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android SpinnerAdapter class.

This code example shows how to use the following methods: getCount, getView
        int preferredHeight = 0;
        int preferredWidth = 0;
        boolean needsMeasuring = true;
 
        int selectedPosition = getSelectedItemPosition();
        if (selectedPosition >= 0 && mAdapter != null && selectedPosition < mAdapter.getCount()) {
            // Try looking in the recycler. (Maybe we were measured once already) 
            View view = mRecycler.get(selectedPosition);
            if (view == null) {
                // Make a new one 
                view = mAdapter.getView(selectedPosition, null, this);
            } 
 
            if (view != null) {
                // Put in recycler for re-measuring and/or layout 
                mRecycler.put(selectedPosition, view);
            } 
 
            if (view != null) {
                if (view.getLayoutParams() == null) {
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getCount
    public void testPreconditions() {	 
        assertNotNull(mStatusView);
        assertNotNull(mAccountsSpinner);
 
        assertTrue(mAccountAdapter != null);
        assertEquals(mAccountAdapter.getCount(),1);
    } 
     
    public void testStatusRegisteredText() { 
    	status = mActivity.getString(sg.macbuntu.android.pushcontacts.R.string.status_registered);
        assertEquals(status,(String)mStatusView.getText());
    } 
     
    public void testStatusNotRegisteredText() { 
    	status = mActivity.getString(sg.macbuntu.android.pushcontacts.R.string.status_not_registered);
        assertEquals(status,(String)mStatusView.getText());
    } 
} 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getCount
 
        /* 
         *  Also ensure that the backing mLocalAdapter has the correct number of entries. 
         */ 
 
        assertEquals(mPlanetData.getCount(), ADAPTER_COUNT);
    } 
 
    /* 
     * Tests the UI of the main activity. Sends key events (keystrokes) to the UI, then checks 
     * if the resulting spinner state is consistent with the attempted selection. 
     */ 
    public void testSpinnerUI() { 
 
        /* 
         * Request focus for the spinner widget in the application under test, 
         * and set its initial position. This code interacts with the app's View 
         *  so it has to run on the app's thread not the test's thread. 
         * 
         * To do this, pass the necessary code to the application with 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getView
								false); 
				v.setText(getPrompt());
				return v;
			} 
 
			return obj.getView(position, convertView, parent);
		} 
 
	} 
} 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getItem
 
	public boolean onNavigationItemSelected(int position, long itemId) {
		try { 
			ListNavigationSelectedItem selectedItem = 
					(ListNavigationSelectedItem)Binder.getAttributeForView(getView(), "ListNavigationSelectedItem"); 
			selectedItem.set(mAdapter.getItem(position));
			 
			ListNavigationOnItemSelected onItemSelected = 
					(ListNavigationOnItemSelected)Binder.getAttributeForView(getView(), "ListNavigationOnItemSelected"); 
			onItemSelected.invokeCommand(getView(), position, itemId);
		} catch (Exception e) {
			e.printStackTrace();
		} 
		return false; 
	} 
} 
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Android SpinnerAdapter Questions & Answers:

See Code Examples for Android SpinnerAdapter Methods: