Android Open Source - ismartenit Areas Fragment






From Project

Back to project page ismartenit.

License

The source code is released under:

GNU General Public License

If you think the Android project ismartenit 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.smartenit.client;
// www .  j  a  v  a2 s  .  c o m
import com.smartenit.client.adapter.AreaItemAdapter;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.GridView;
 
public class AreasFragment extends Fragment {
 
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
 
      Context context = getActivity().getApplicationContext();
        View rootView = inflater.inflate(R.layout.fragment_areas, container, false);
        
        AreaItemAdapter adapter = new AreaItemAdapter(context);
        GridView gridview = (GridView) rootView.findViewById(R.id.gridview);
        gridview.setAdapter(adapter);
        
        gridview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
      @Override
      public void onItemClick(AdapterView<?> parent, View view,
          int position, long id) {
        Context context = getActivity().getApplicationContext();
        Intent intent = new Intent(context, DevicesActivity.class);
        AreaItemAdapter.ViewHolder holder = (AreaItemAdapter.ViewHolder)view.getTag();
        intent.putExtra("title", holder.txt.getText());
        startActivity(intent);
      }
    });
                 
        return rootView;
    }
}




Java Source Code List

com.smartenit.client.AreasFragment.java
com.smartenit.client.DeviceDetailActivity.java
com.smartenit.client.DevicesActivity.java
com.smartenit.client.MainActivity.java
com.smartenit.client.ScenesFragment.java
com.smartenit.client.SettingsActivity.java
com.smartenit.client.SquareImageView.java
com.smartenit.client.TypefaceSpan.java
com.smartenit.client.WizardsFragment.java
com.smartenit.client.adapter.AreaItemAdapter.java
com.smartenit.client.adapter.DeviceItemAdapter.java
com.smartenit.client.adapter.TabsPagerAdapter.java
com.smartenit.client.views.RobotoTextView.java