Java Code Examples for android.widget.ListView.setItemsCanFocus()

The following are Jave code examples for showing how to use setItemsCanFocus() of the android.widget.ListView class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: CSipSimple   File: ConversationsListFragment.java   View Source Code Vote up 6 votes
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);

    // View management
    mDualPane = getResources().getBoolean(R.bool.use_dual_panes);

    // Modify list view
    ListView lv = getListView();
    lv.setVerticalFadingEdgeEnabled(true);
    // lv.setCacheColorHint(android.R.color.transparent);
    if (mDualPane) {
        lv.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
        lv.setItemsCanFocus(false);
    } else {
        lv.setChoiceMode(ListView.CHOICE_MODE_NONE);
        lv.setItemsCanFocus(true);
    }
}
 
Example 2
Project: CSipSimple   File: FavListFragment.java   View Source Code Vote up 6 votes
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);

    // View management
    mDualPane = getResources().getBoolean(R.bool.use_dual_panes);

    // Modify list view
    ListView lv = getListView();
    lv.setVerticalFadingEdgeEnabled(true);
    // lv.setCacheColorHint(android.R.color.transparent);
    if (mDualPane) {
        lv.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
        lv.setItemsCanFocus(false);
    } else {
        lv.setChoiceMode(ListView.CHOICE_MODE_NONE);
        lv.setItemsCanFocus(true);
    }
}
 
Example 3
Project: open-rmbt   File: RMBTMapFilterFragment.java   View Source Code Vote up 6 votes
protected void populateList(List<ServerOption> optionList, boolean isRoot)
{
	this.isRoot = isRoot;
	this.currentOptionList = optionList;
    final RMBTMainActivity activity = getRMBTMainActivity();
    final SectionListAdapter sectionListAdapter = new SectionListAdapter(activity, R.layout.preferences_category, !isRoot);
 
    // add filter options
    if (optionList != null && optionList.size() > 0) {
     for (final ServerOption option : optionList) {
     	if (option.isEnabled()) {
     		if (option.getOptionList() != null && option.getOptionList().size() > 0 && !options.isAnyChildSelected(option)) {
     			options.select(option.getOptionList().get(0));
     		}
     		sectionListAdapter.addSection(option.getTitle(), new MapListSectionAdapter(activity, option, isRoot));
     	}
     }
    }

    final ListView listView = (ListView) view.findViewById(R.id.valueList);
    listView.setAdapter(sectionListAdapter);        	

    listView.setItemsCanFocus(true);
    listView.setOnItemClickListener(this);
}
 
Example 4
Project: microMathematics   File: FileListView.java   View Source Code Vote up 6 votes
FileListView(Commander c)
{
    commander = c;
    listView = (ListView) commander.findViewById(R.id.fman_list_view);
    listView.setItemsCanFocus(false);
    listView.setFocusableInTouchMode(true);
    listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
    listView.setOnItemClickListener(this);
    if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH)
    {
        TypedValue outValue = new TypedValue();
        commander.getContext().getTheme().resolveAttribute(R.attr.selectableItemBackground, outValue, true);
        listView.setSelector(outValue.resourceId);
    }
    commander.registerForContextMenu(listView);
    statusPanel = (LinearLayout) commander.findViewById(R.id.fman_status_panel);
    statusPanelDivider = commander.findViewById(R.id.fman_status_panel_divider);
    statusBar = (TextView) commander.findViewById(R.id.fman_status_bar);
}
 
Example 5
Project: q-mail   File: AccountList.java   View Source Code Vote up 5 votes
@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);

    setResult(RESULT_CANCELED);

    setContentView(R.layout.account_list);

    ListView listView = getListView();
    listView.setOnItemClickListener(this);
    listView.setItemsCanFocus(false);
}
 
Example 6
Project: CSipSimple   File: CallLogListFragment.java   View Source Code Vote up 5 votes
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);

    // View management
    mDualPane = getResources().getBoolean(R.bool.use_dual_panes);


    // Modify list view
    ListView lv = getListView();
    lv.setVerticalFadingEdgeEnabled(true);
    // lv.setCacheColorHint(android.R.color.transparent);
    if (mDualPane) {
        lv.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
        lv.setItemsCanFocus(false);
    } else {
        lv.setChoiceMode(ListView.CHOICE_MODE_NONE);
        lv.setItemsCanFocus(true);
    }
    
    // Map long press
    lv.setLongClickable(true);
    lv.setOnItemLongClickListener(new OnItemLongClickListener() {

        @Override
        public boolean onItemLongClick(AdapterView<?> ad, View v, int pos, long id) {
            turnOnActionMode();
            getListView().setItemChecked(pos, true);
            mMode.invalidate();
            return true;
        }
    });
}
 
Example 7
Project: q-mail   File: Accounts.java   View Source Code Vote up 4 votes
@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);

    if (!QMail.isHideSpecialAccounts()) {
        createSpecialAccounts();
    }

    List<Account> accounts = Preferences.getPreferences(this).getAccounts();
    Intent intent = getIntent();
    //onNewIntent(intent);

    // see if we should show the welcome message
    if (ACTION_IMPORT_SETTINGS.equals(intent.getAction())) {
        onImport();
    } else if (accounts.size() < 1) {
        WelcomeMessage.showWelcomeMessage(this);
        finish();
        return;
    }

    if (UpgradeDatabases.actionUpgradeDatabases(this, intent)) {
        finish();
        return;
    }

    boolean startup = intent.getBooleanExtra(EXTRA_STARTUP, true);
    if (startup && QMail.startIntegratedInbox() && !QMail.isHideSpecialAccounts()) {
        onOpenAccount(mUnifiedInboxAccount);
        finish();
        return;
    } else if (startup && accounts.size() == 1 && onOpenAccount(accounts.get(0))) {
        finish();
        return;
    }

    requestWindowFeature(Window.FEATURE_PROGRESS);
    mActionBar = getActionBar();
    initializeActionBar();
    setContentView(R.layout.accounts);
    ListView listView = getListView();
    listView.setOnItemClickListener(this);
    listView.setItemsCanFocus(false);
    listView.setScrollingCacheEnabled(false);
    registerForContextMenu(listView);


    if (icicle != null && icicle.containsKey(SELECTED_CONTEXT_ACCOUNT)) {
        String accountUuid = icicle.getString("selectedContextAccount");
        mSelectedContextAccount = Preferences.getPreferences(this).getAccount(accountUuid);
    }

    restoreAccountStats(icicle);
    mHandler.setViewTitle();

    // Handle activity restarts because of a configuration change (e.g. rotating the screen)
    mNonConfigurationInstance = (NonConfigurationInstance) getLastNonConfigurationInstance();
    if (mNonConfigurationInstance != null) {
        mNonConfigurationInstance.restore(this);
    }

    ChangeLog cl = new ChangeLog(this);
    if (cl.isFirstRun()) {
        cl.getLogDialog().show();
    }
}
 
Example 8
Project: aos-Video   File: VideoPicker.java   View Source Code Vote up 4 votes
/******************************************************************
** Activity life cycle
******************************************************************/

@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    Log.d(TAG, "onCreate : intent=" + getIntent());
    
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    if (icicle != null) {
        // Restore former activity state
        mListState = icicle.getParcelable(LIST_STATE_KEY);
        mListHasFocus = icicle.getBoolean(FOCUS_KEY);
    }
    
    if (Intent.ACTION_GET_CONTENT.equals(getIntent().getAction())) {
        mBaseUri = VideoStore.Video.Media.EXTERNAL_CONTENT_URI;
    } else {
        mBaseUri = getIntent().getData();
        if (mBaseUri == null) {
            Log.e(TAG, "No data URI given to GET_CONTENT action");
            setResult(RESULT_CANCELED);
            finish();
            return;
        }
    }

    setContentView(R.layout.video_picker);

    final ListView listView = getListView();
    listView.setItemsCanFocus(false);
    listView.setTextFilterEnabled(true);
    listView.setOnItemClickListener(this);

    mAdapter = new VideoListAdapter(this, listView,
            R.layout.video_picker_item, new String[] {},
            new int[] {});

    setListAdapter(mAdapter);
    
    // We manually save/restore the listview state
    listView.setSaveEnabled(false);

    mQueryHandler = new QueryHandler(this);

    mProgressContainer = findViewById(R.id.progressContainer);
    mListContainer = findViewById(R.id.listContainer);
    mCancelButton = findViewById(R.id.cancelButton);
    mCancelButton.setOnClickListener(this);
   
    // If there is a currently selected Uri, then try to determine who it is.
    if (mSelectedUri != null) {
        Uri.Builder builder = mSelectedUri.buildUpon();
        String path = mSelectedUri.getEncodedPath();
        int idx = path.lastIndexOf('/');
        if (idx >= 0) {
            path = path.substring(0, idx);
        }
        builder.encodedPath(path);
        Uri baseSelectedUri = builder.build();
        if (DBG) Log.v(TAG, "Selected Uri: " + mSelectedUri);
        if (DBG) Log.v(TAG, "Selected base Uri: " + baseSelectedUri);
        if (DBG) Log.v(TAG, "Base Uri: " + mBaseUri);
        if (baseSelectedUri.equals(mBaseUri)) {
            // If the base Uri of the selected Uri is the same as our
            // content's base Uri, then use the selection!
            mSelectedId = ContentUris.parseId(mSelectedUri);
        }
    }

    doQuery(false, null);
}