Android Open Source - ManipalNow-Android Cafes






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;
/*from w w  w  .ja  v  a 2s .  com*/
import android.app.Fragment;
import android.content.Intent;
import android.graphics.Typeface;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView.FindListener;
import android.widget.AdapterView;
import android.widget.TextView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.GridView;

public class Cafes extends Fragment {
  static int count2;
  static int sc=1;
  public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
        ViewGroup root = (ViewGroup) inflater.inflate(R.layout.city1, null);
       // TextView tv1=(TextView)root.findViewById(R.id.tv1);
    Typeface robotoLight = Typeface.createFromAsset(getActivity().getAssets(), "Roboto-Thin.ttf");
        View header = inflater.inflate(R.layout.header1, null);

       // tv1.setTypeface(robotoLight);
    GridView gv1=(GridView)root.findViewById(R.id.gridview);
    Level data[]=new Level[]
        {
         new Level("Barista","",R.drawable.barista2),
         new Level("Basil Cafe","",R.drawable.basil),
         new Level("Cafe Coffee Day","",R.drawable.ccd),
         new Level("Cosmo Cafe",R.drawable.cosmo),
         new Level("Cafe MnM",R.drawable.mnm),
         new Level("7 Bees",R.drawable.cafe_empty),
         };
    ImageAdapter ia=new ImageAdapter(getActivity(), R.layout.grid_item_2, data);
       //  gv1.addView(header);

    gv1.setAdapter(ia);

    //gv1.setAdapter(new ImageAdapter(getActivity()));
    gv1.setOnItemClickListener(new OnItemClickListener() {

      @Override
      public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
          long arg3) {
        // TODO Auto-generated method stub
        if(arg2==0)
        {  count2=1;
          Intent i=new Intent(getActivity(),CafeFragment.class);
          getActivity().startActivity(i);
          getActivity().overridePendingTransition(R.anim.right_slide_1,R.anim.right_slide_2);

        }
        if(arg2==1)
        {
          count2=2;
          Intent i=new Intent(getActivity(),CafeFragment.class);
          getActivity().startActivity(i);
          getActivity().overridePendingTransition(R.anim.right_slide_1,R.anim.right_slide_2);

        }
        if(arg2==2)
        {
          count2=3;
          Intent i=new Intent(getActivity(),CafeFragment.class);
          getActivity().startActivity(i);
          getActivity().overridePendingTransition(R.anim.right_slide_1,R.anim.right_slide_2);
        }
        if(arg2==3)
        {
          count2=4;
          Intent i=new Intent(getActivity(),CafeFragment.class);
          getActivity().startActivity(i);
          getActivity().overridePendingTransition(R.anim.right_slide_1,R.anim.right_slide_2);
        }
        if(arg2==4)
        {
          count2=5;
          Intent i=new Intent(getActivity(),CafeFragment.class);
          getActivity().startActivity(i);
          getActivity().overridePendingTransition(R.anim.right_slide_1,R.anim.right_slide_2);
        }
        if(arg2==5)
        {
          count2=6;
          Intent i=new Intent(getActivity(),CafeFragment.class);
          getActivity().startActivity(i);
          getActivity().overridePendingTransition(R.anim.right_slide_1,R.anim.right_slide_2);
        }
        
      }
    });
        return root;
        
    

}
}




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