Example usage for android.support.v4.app ListFragment getListView

List of usage examples for android.support.v4.app ListFragment getListView

Introduction

In this page you can find the example usage for android.support.v4.app ListFragment getListView.

Prototype

public ListView getListView() 

Source Link

Document

Get the activity's list view widget.

Usage

From source file:org.solovyev.android.list.ListItemAdapter.java

public static <LI extends ListItem> void attach(@Nonnull ListFragment listFragment,
        @Nonnull ListItemAdapter<? extends LI> adapter) {
    listFragment.setListAdapter(adapter);

    fillListView(listFragment.getListView(), adapter, listFragment.getActivity());
}

From source file:org.solovyev.android.list.ListItemAdapter.java

public static <LI extends ListItem> void attach(@Nonnull android.app.ListFragment listFragment,
        @Nonnull ListItemAdapter<? extends LI> adapter) {
    listFragment.setListAdapter(adapter);

    fillListView(listFragment.getListView(), adapter, listFragment.getActivity());
}

From source file:ca.rmen.android.networkmonitor.app.prefs.FilterColumnActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    Log.v(TAG, "onCreate");
    super.onCreate(savedInstanceState);
    setContentView(R.layout.filter_columns);
    ListFragment lvf = (ListFragment) getSupportFragmentManager().findFragmentById(R.id.listFragment);
    mListView = lvf.getListView();

    // Show a hint to the user, explaining what filtering this column does.
    TextView tvHint = (TextView) findViewById(R.id.filter_columns_hint);
    String columnName = getIntent().getStringExtra(EXTRA_COLUMN_NAME);
    String columnLabel = NetMonColumns.getColumnLabel(this, columnName);
    String hintText = getString(R.string.filter_columns_hint, columnLabel);
    tvHint.setText(hintText);//from   ww  w . j a  va 2 s  .co  m
}

From source file:ca.rmen.android.networkmonitor.app.prefs.SelectFieldsActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    Log.v(TAG, "onCreate");
    super.onCreate(savedInstanceState);
    setContentView(R.layout.select_fields);
    ListFragment lvf = (ListFragment) getSupportFragmentManager().findFragmentById(R.id.listFragment);
    mListView = lvf.getListView();
}

From source file:com.wuman.androidimageloader.samples.ui.StatusViewManager.java

/**
 * Decorates {@link LoaderManager.LoaderCallbacks} in order to show loading
 * and error indicator views.//from  ww  w . j  a  v a 2 s .c  o  m
 * 
 * @param callbacks
 *            the callbacks to decorate.
 * @param id
 *            the loader ID of the primary data.
 * @param activity
 *            an activity containing the loading and error views. If the
 *            {@link Window} has
 *            {@link Window#FEATURE_INDETERMINATE_PROGRESS}, a spinner will
 *            when the primary loader is reloading data or when a secondary
 *            loader is running.
 */
public StatusViewManager(LoaderManager.LoaderCallbacks<Cursor> callbacks, int id, ListFragment fragment) {
    mCallbacks = callbacks;
    mLoaderId = id;
    mListFragment = fragment;
    mAdapterView = (AdapterView<?>) fragment.getListView();

    // Loader may still be running from last Activity instance
    mListFragment.setListShown(false);
}

From source file:com.google.android.apps.mytracks.util.Api8Adapter.java

@Override
public void configureListViewContextualMenu(ListFragment activity,
        ContextualActionModeCallback contextualActionModeCallback) {
    activity.registerForContextMenu(activity.getListView());
}

From source file:universe.constellation.orion.viewer.OrionFileManagerActivity.java

private void createRecentView(ListFragment list) {
    ListView recent = list.getListView();
    if (showRecentsAndSavePath()) {
        recent.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                GlobalOptions.RecentEntry entry = (GlobalOptions.RecentEntry) parent
                        .getItemAtPosition(position);
                File file = new File(entry.getPath());
                if (file.exists()) {
                    openFile(file);/*from  w  ww  .  j a v  a2 s.c o m*/
                }
            }
        });

        list.setListAdapter(new FileChooser(this, globalOptions.getRecentFiles()));
    } else {
        recent.setVisibility(View.GONE);
    }
}

From source file:universe.constellation.orion.viewer.OrionFileManagerActivity.java

private void createFileView(ListFragment list) {
    ListView view = list.getListView();
    view.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            File file = (File) parent.getItemAtPosition(position);
            if (file.isDirectory()) {
                File newFolder = ((FileChooser) parent.getAdapter()).changeFolder(file);
                updatePathTextView(newFolder.getAbsolutePath());
            } else {
                if (showRecentsAndSavePath()) {
                    SharedPreferences.Editor editor = prefs.edit();
                    editor.putString(Common.LAST_OPENED_DIRECTORY, file.getParentFile().getAbsolutePath());
                    editor.commit();//from   w  w w . j  av a  2 s  .co m
                }
                openFile(file);
            }
        }
    });

    list.setListAdapter(new FileChooser(this, getStartFolder(), getFileNameFilter()));
}

From source file:com.google.android.apps.mytracks.util.Api11Adapter.java

@Override
public void configureListViewContextualMenu(final ListFragment activity,
        final ContextualActionModeCallback contextualActionModeCallback) {
    activity.getListView().setOnItemLongClickListener(new OnItemLongClickListener() {
        ActionMode actionMode;/* w  w w.  j  av  a2 s. c o m*/

        @Override
        public boolean onItemLongClick(AdapterView<?> parent, View view, final int position, final long id) {
            if (actionMode != null) {
                //  return false;
            }
            actionMode = activity.getActivity().startActionMode(new ActionMode.Callback() {
                @Override
                public boolean onCreateActionMode(ActionMode mode, Menu menu) {
                    //mode.getMenuInflater().inflate(R.menu.list_context_menu, menu);
                    contextualActionModeCallback.onCreate(menu);
                    return true;
                }

                @Override
                public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
                    contextualActionModeCallback.onPrepare(menu, position, id);
                    // Return true to indicate change
                    return true;
                }

                @Override
                public void onDestroyActionMode(ActionMode mode) {
                    actionMode = null;
                }

                @Override
                public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
                    mode.finish();
                    return contextualActionModeCallback.onClick(item.getItemId(), position, id);
                }
            });
            CharSequence text = contextualActionModeCallback.getCaption(view);
            if (text != null) {
                actionMode.setTitle(text);
            }
            view.setSelected(true);
            return true;
        }
    });
}

From source file:org.getlantern.firetweet.util.Utils.java

public static void makeListFragmentFitsSystemWindows(ListFragment fragment, Rect insets) {
    final ListView listView = fragment.getListView();
    listView.setPadding(insets.left, insets.top, insets.right, insets.bottom);
    listView.setClipToPadding(false);//from  w  w w . ja va 2  s  . c  om
    //        if (listView instanceof RefreshNowListView) {
    //            final View indicatorView = ((RefreshNowListView) listView).getRefreshIndicatorView();
    //            final LayoutParams lp = indicatorView.getLayoutParams();
    //            if (lp instanceof MarginLayoutParams) {
    //                ((MarginLayoutParams) lp).topMargin = insets.top;
    //                indicatorView.setLayoutParams(lp);
    //            }
    //        }
}