wie smooth-scroll-listview wie ios in android?

Ich bin Verwendung von Daten aus dem web über XML-parser und Einstellung von Daten mithilfe von benutzerdefinierten adapter verwenden asyncTask .
Mein problem ist, dass einige Geräte, wie das Samsang duos,gallaxy perfekt funktionieren, aber auf micromax-Geräten wird nicht richtig funktionieren.

Mein adapter ist

public class HallBookingAdapter extends ArrayAdapter<MyHall> {

private Context context;

private ArrayList<MCCIAHall> halls;

private int resource;

MyHall objHall;

public int count;

View view;

public static Boolean isScrollingHalls=true;

LayoutInflater inflater;

static class HallBookingHolder
{
    public TextView txtTitle,txtLocation,txtCapacity,txtCapacityTitle;
    public ImageView imgHall;
    public LinearLayout hallBookingLayout;
}

public HallBookingAdapter(Context context, int resource, ArrayList<MyHall> halls) {
    super(context, resource, halls);

    this.context=context;
    this.halls=halls;
    this.resource=resource;

    inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}

@Override
public int getCount() {
    count=halls.size();
    return halls.size();
}

@Override
public View getView(final int position, View convertView, ViewGroup parent) {

    view=convertView;

    objHall=halls.get(position);

    HallBookingHolder holder=new HallBookingHolder();

    if (convertView==null) {
        view = inflater.inflate(resource, null);

        holder.txtTitle=(TextView)view.findViewById(R.id.txtListHallTitle);
        holder.txtLocation=(TextView)view.findViewById(R.id.txtListHallLocation);
        holder.txtCapacity=(TextView)view.findViewById(R.id.txtListHallCapacity);
        holder.txtCapacityTitle=(TextView)view.findViewById(R.id.txtListHallCapacityHeadding);

        holder.imgHall=(ImageView)view.findViewById(R.id.imgListHall);

         view.setTag(holder);
    }
    else
    {
        holder = (HallBookingHolder)convertView.getTag();
    }

    //Creating the Font to the text
    Typeface tfLight = Typeface.createFromAsset(context.getAssets(),"OpenSans-Light.ttf");
    Typeface tfRegular = Typeface.createFromAsset(context.getAssets(),"OpenSans-Regular.ttf");
    Typeface tfsemiBold = Typeface.createFromAsset(context.getAssets(),"OpenSans-Semibold.ttf");

    //Setting the font
    holder.txtTitle.setTypeface(tfRegular);
    holder.txtLocation.setTypeface(tfLight);
    holder.txtCapacity.setTypeface(tfsemiBold);
    holder.txtCapacityTitle.setTypeface(tfLight);

//Setting data to textview and image
    holder.txtTitle.setText(objHall.hallName);
    holder.txtLocation.setText(objHall.location);
    holder.txtCapacity.setText(objHall.capacity);

    //Using Guild Library Image Load using image web url
    String imgurl=objHall.getImageUrl();
    Glide.load(imgurl).centerCrop().into(holder.imgHall);

    view.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent intent=new Intent(context, HallDetailsActivity.class);
            intent.putExtra("position", position);
            context.startActivity(intent);
        }
    });
    return view;
}

}

InformationsquelleAutor SAndroidD | 2014-03-21
Schreibe einen Kommentar