Android Open Source - ponyville-live-android Server Endpoint Adapter

From Project

Back to project page ponyville-live-android.


The source code is released under:

Apache License

If you think the Android project ponyville-live-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
//  w w w  . ja  v  a  2  s  .  co  m

class ServerEndpointAdapter extends BindableAdapter<Endpoints> {
    ServerEndpointAdapter(Context context) {

    @Override public int getCount() {
        return Endpoints.values().length;

    @Override public Endpoints getItem(int position) {
        return Endpoints.values()[position];

    @Override public long getItemId(int position) {
        return position;

    @Override public View newView(LayoutInflater inflater, int position, ViewGroup container) {
        return inflater.inflate(android.R.layout.simple_spinner_item, container, false);

    @Override public void bindView(Endpoints item, int position, View view) {
        TextView tv = (TextView) view.findViewById(;

    public View newDropDownView(LayoutInflater inflater, int position, ViewGroup container) {
        return inflater.inflate(android.R.layout.simple_spinner_dropdown_item, container, false);

Java Source Code List