Example usage for android.widget AdapterView getAdapter

List of usage examples for android.widget AdapterView getAdapter

Introduction

In this page you can find the example usage for android.widget AdapterView getAdapter.

Prototype

public abstract T getAdapter();

Source Link

Document

Returns the adapter currently associated with this widget.

Usage

From source file:jupiter.broadcasting.live.holo.EpisodeListFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    v = inflater.inflate(R.layout.episodelist_fragment, null);

    asyncResultView = (ListView) v.findViewById(R.id.episodelist);
    asyncResultView.setOnScrollListener(new EndlessScrollListener());
    asyncResultView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            aurls = arssLinkTable.get(parent.getAdapter().getItem(position));
            vurls = vrssLinkTable.get(parent.getAdapter().getItem(position));
            title = (String) parent.getAdapter().getItem(position);

            Intent p = new Intent(getActivity(), JBPlayer.class);
            p.putExtra("aLink", aurls[1]);
            p.putExtra("vLink", vurls[1]);
            if (!aurls[3].equalsIgnoreCase("X")) {
                p.putExtra("pic", aurls[3]);
            } else {
                p.putExtra("pic", vurls[3]);
            }//from   w w  w.j a  va  2s. co  m
            p.putExtra("title", title);
            p.putExtra("sum", aurls[5]);
            startActivity(p);
        }
    });
    Bundle b = getArguments();
    afeed = b.getString("SHOW_AUDIO");
    vfeed = b.getString("SHOW_VIDEO");
    name = b.getString("SHOW_NAME");

    first = true;
    history = getActivity().getSharedPreferences(name, 0);
    Progress(true);
    RSS_parse newparse = new RSS_parse(); //do networking in async task SDK>9
    newparse.execute(afeed, vfeed, "0");

    return v;
}

From source file:org.hedgewars.hedgeroid.Downloader.DownloadListFragment.java

public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {
    DownloadPackage task = (DownloadPackage) arg0.getAdapter().getItem(position);
    /*//from  w w w.j a va2 s . c o  m
    FragmentTransaction ft = getFragmentManager().beginTransaction();
    Fragment prev = getFragmentManager().findFragmentByTag("dialog");
            
    //remove any old dialogs
    if(prev != null) ft.remove(prev);
    ft.addToBackStack(null);
            
    //create a new dialog based on this task
            
    DialogFragment newFragment = DownloadDialogFragment.newInstance(task);
            
    //show it
    newFragment.show(ft, "dialog");
     */
    targetView = arg1;

    //determine state
    int min = arg0.getTop();
    int max = arg0.getBottom();
    int top = targetView.getTop();

    previousXCoord = top;
    for (OnItemMovementListener listener : listeners) {
        listener.onNewItemSelected(task, top, min, max, targetView.getHeight() * 2);
    }
}

From source file:dynamite.zafroshops.app.fragment.NearestZopsFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_typed_zops, container, false);

    ListView listView = (ListView) rootView.findViewById(R.id.listViewZops);

    resetVisibility(listView, (LinearLayout) rootView.findViewById(R.id.noZops),
            (RelativeLayout) rootView.findViewById(R.id.relativeLayoutLoader), loading);
    listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override/*from  w ww .  j  a va  2  s.  c om*/
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            MobileZop item = (MobileZop) parent.getAdapter().getItem(position);
            MainActivity activity = (MainActivity) getActivity();

            if (activity.AdsActive && activity.Interstitial.isLoaded()) {
                activity.Interstitial.show();
            }
            activity.setCurrentItem(item.id, item);
            activity.nextMenu(ZopItemFragment.newInstance(item.id), true, 100);
        }
    });

    listView.setAdapter(adapter);

    return rootView;
}

From source file:com.example.giggle.oschina2.emoji.EmojiPageFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);
    sGrid = new GridView(getActivity());
    sGrid.setNumColumns(KJEmojiConfig.COLUMNS);
    adapter = new EmojiGridAdapter(getActivity(), datas);
    sGrid.setAdapter(adapter);//  ww  w  . j  a va  2 s . c om
    sGrid.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            EditText editText = (EditText) getActivity().findViewById(R.id.emoji_titile_input);
            if (listener != null) {
                listener.onEmojiClick((Emojicon) parent.getAdapter().getItem(position));
            }
            InputHelper.input2OSC(editText, (Emojicon) parent.getAdapter().getItem(position));
        }
    });
    sGrid.setSelector(new ColorDrawable(android.R.color.transparent));
    return sGrid;
}

From source file:com.example.ibesteeth.git_keybordtest.emoji.EmojiPageFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);
    sGrid = new GridView(getActivity());
    sGrid.setNumColumns(KJEmojiConfig.COLUMNS);
    adapter = new EmojiGridAdapter(getActivity(), datas);
    sGrid.setAdapter(adapter);//from  ww w. j av a  2  s  .c  om
    sGrid.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            EditText editText = (EditText) getActivity().findViewById(R.id.emoji_titile_input);
            if (listener != null) {
                listener.onEmojiClick((Emojicon) parent.getAdapter().getItem(position));
            }
            InputHelper.input2OSC(editText, (Emojicon) parent.getAdapter().getItem(position));
        }
    });
    sGrid.setSelector(new ColorDrawable(getActivity().getResources().getColor(R.color.transparet)));
    return sGrid;
}

From source file:org.weishe.weichat.emoji.EmojiPageFragment.java

@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
        @Nullable Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);
    sGrid = new GridView(getActivity());
    sGrid.setNumColumns(KJEmojiConfig.COLUMNS);
    adapter = new EmojiGridAdapter(getActivity(), datas);
    sGrid.setAdapter(adapter);//from  w  ww . j  a  v  a 2 s. c o m
    sGrid.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            EditText editText = (EditText) getActivity().findViewById(R.id.emoji_titile_input);
            if (listener != null) {
                listener.onEmojiClick((Emojicon) parent.getAdapter().getItem(position));
            }
            InputHelper.input2OSC(editText, (Emojicon) parent.getAdapter().getItem(position));
        }
    });
    sGrid.setSelector(new ColorDrawable(android.R.color.transparent));
    return sGrid;
}

From source file:yet.another.hackernews.reader.HackernewsFragment.java

@Override
public void onItemClick(AdapterView<?> parent, View v, int pos, long id) {
    final News news = (News) parent.getAdapter().getItem(pos);

    if (news.getTitle().equals("More")) {
        return;//from   www  . ja v a2 s . c o  m
    }

    final int screenLayout = getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK;

    switch (screenLayout) {

    case Configuration.SCREENLAYOUT_SIZE_XLARGE:

        final FragmentManager fManager = getSherlockActivity().getSupportFragmentManager();
        final ViewFragment fragment = (ViewFragment) fManager.findFragmentById(R.id.fragment_view);

        if (fragment != null) {
            ViewFragment.setNews(news);
            fragment.update(null);
            v.setEnabled(true);
        }

        break;
    default:

        Bundle sendArgs = new Bundle();
        sendArgs.putString("NewsObject", news.toString());

        Intent browser = new Intent(getSherlockActivity(), ViewActivity.class);
        browser.putExtras(sendArgs);
        startActivity(browser);

        break;
    }
}

From source file:com.massivcode.androidmusicplayer.fragments.AddPlaylistFragment.java

@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
    MusicInfo selectedInfo = (MusicInfo) parent.getAdapter().getItem(position);
    Log.d(TAG, "? ???  : " + selectedInfo.toString());
    mMusicInfoList.remove(position);/*from   w ww .  java  2s . co m*/
    mAdapter.swapData(mMusicInfoList);

    if (mMusicInfoList.size() == 0) {
        dismiss();
    }
}

From source file:com.nttec.everychan.ui.FavoritesFragment.java

@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
    Object item = parent.getAdapter().getItem(position);
    if (item instanceof Database.FavoritesEntry) {
        UrlHandler.open(((Database.FavoritesEntry) item).url, activity);
    }//w  w w  .  j a  va  2s  . c o m
}

From source file:com.cachirulop.moneybox.fragment.MovementsFragment.java

/**
 * Called when a movement in the list is clicked.
 * /* ww  w .java 2 s  .c  o  m*/
 * Show a window to edit the movement (MovementDetailActivity).
 * 
 * @param a
 *            Adapter of the view that launch the event.
 * @param v
 *            View that launch the event.
 * @param position
 *            Position of the item clicked
 * @param id
 *            Identifier of the clicked item.
 */
protected void onMovementClick(AdapterView<?> a, View v, int position, long id) {
    Intent i;
    Movement m;

    m = ((Movement) a.getAdapter().getItem(position));
    i = new Intent(getActivity(), MovementDetailActivity.class);
    i.putExtra("movement", m);

    startActivityForResult(i, EDIT_MOVEMENT_REQUEST);
}