Android Open Source - ManipalNow-Android Image Adapter






From Project

Back to project page ManipalNow-Android.

License

The source code is released under:

Apache License

If you think the Android project ManipalNow-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

package com.example.nav;
//www. j a  v  a2s  .c o  m
import android.app.Activity;
import android.content.Context;
import android.graphics.Typeface;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView.FindListener;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class ImageAdapter extends ArrayAdapter<Level> {
  
   static Context context;
      static int layoutResourceId;   
       Level data[] = null;
     
   public ImageAdapter(Context context, int layoutResourceId, Level[] data) {
          super(context, layoutResourceId, data);
          this.layoutResourceId = layoutResourceId;
          this.context = context;
          this.data = data;
      }
      
     /* public LevelAdapter(ShowFrag1 showFrag1, int listItem,
        Level[] weather_data) {
        super(context, layoutResourceId, data);
          this.layoutResourceId = layoutResourceId;
          this.context = context;
          this.data = data;

      // TODO Auto-generated constructor stub
    }*/

    public long getItemId(int position) {
            return position;
      }

      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
          View row = convertView;
          WeatherHolder holder = null;
         
          if(row == null)
          {
              LayoutInflater inflater = ((Activity)context).getLayoutInflater();
              row = inflater.inflate(layoutResourceId, parent, false);
             //row.setMinimumHeight(200);
              
              holder = new WeatherHolder();
             holder.imgIcon = (ImageView)row.findViewById(R.id.imgIcon);
              holder.txtTitle = (TextView)row.findViewById(R.id.txtTitle);
              holder.txtTitle2 = (TextView)row.findViewById(R.id.txtTitle2);
           //   holder.txtTitle3 = (TextView)row.findViewById(R.id.txtTitle3);
          Typeface robotoSlab = Typeface.createFromAsset(getContext().getAssets(), "RobotoSlab-Light.ttf");
            //   holder.imgIcon2=(ImageView)row.findViewById(R.id.imgIcon2);
          Typeface robotoLight = Typeface.createFromAsset(getContext().getAssets(), "Roboto-Light.ttf");
          Typeface robotoLightItalic = Typeface.createFromAsset(getContext().getAssets(), "Roboto-LightItalic.ttf");
          Typeface robotoRegular = Typeface.createFromAsset(getContext().getAssets(), "Roboto-Regular.ttf");
          holder.txtTitle.setTypeface(robotoLight);
              holder.txtTitle2.setTypeface(robotoLightItalic);
              row.setTag(holder);
          }
          else
          {
              holder = (WeatherHolder)row.getTag();
          }
         
          Level weather = data[position];
          holder.txtTitle.setText(weather.title);
          holder.imgIcon.setImageResource(weather.icon);
          holder.txtTitle2.setText(weather.title2);
          //holder.txtTitle3.setText(weather.title3);
         
          return row;
      }
     
      static class WeatherHolder
      {
         ImageView imgIcon;
          TextView txtTitle;
          TextView txtTitle2;
          TextView txtTitle3;
      //    ImageView imgIcon2;
      }

}




Java Source Code List

com.example.nav.BarFragment.java
com.example.nav.BarInfo.java
com.example.nav.Bars.java
com.example.nav.CafeFragment.java
com.example.nav.CafeInfo.java
com.example.nav.Cafes.java
com.example.nav.Coffee.java
com.example.nav.Food.java
com.example.nav.HelpAct.java
com.example.nav.HelpFragment1.java
com.example.nav.HelpFragment2.java
com.example.nav.HelpFragment3.java
com.example.nav.HelpFragment4.java
com.example.nav.HelpFragment5.java
com.example.nav.HelpFragment6.java
com.example.nav.HelpFragment7.java
com.example.nav.HelpFragment8.java
com.example.nav.HospitalFragment.java
com.example.nav.HospitalInfo.java
com.example.nav.Hospitals.java
com.example.nav.ImageAdapter.java
com.example.nav.LevelAdapter.java
com.example.nav.Level.java
com.example.nav.MainActivity.java
com.example.nav.RestaurantFragment.java
com.example.nav.RestaurantInfo.java
com.example.nav.Restaurants.java
com.example.nav.Settings3.java
com.example.nav.ShowCity3.java
com.example.nav.ShowCity5.java
com.example.nav.ShowCity6.java
com.example.nav.ShowCity7.java
com.example.nav.util.SystemUiHiderBase.java
com.example.nav.util.SystemUiHiderHoneycomb.java
com.example.nav.util.SystemUiHider.java