/*
 * Copyright (c) 2015. Ncomz. All Rights Reserved
 */

package com.ntels.kneet.v3.view.things;

import android.content.Context;
import android.content.Intent;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.util.SparseArray;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;

import com.ntels.kneet.v3.common.AppConfig;
import com.ntels.kneet.v3.common.Constants;
import com.ntels.kneet.v3.common.c_interface.List_Interface;
import com.ntels.kneet.v3.common.util.Util;
import com.ntels.kneet.v3.common.widget.CustomViewPager;
import com.ntels.kneet.v3.R;

import java.util.ArrayList;
import java.util.HashMap;

public class Things_Detail_Vp_Adapter extends PagerAdapter {

    private List_Interface mAdapterCallback;
    private LayoutInflater mInflter;
    private Context        mContext;
    private Util util = new Util();
    private Intent    intent;
    private AppConfig appConfig;
    private String sHTTP_value      = "";
    private int    mCurrentPosition = -1;

    SparseArray<View> views = new SparseArray<View>();
    private ArrayList<HashMap<String, Object>> alTotalList;

    public Things_Detail_Vp_Adapter(final Context context, ArrayList<HashMap<String, Object>> alval, List_Interface mAdapterCallback) {

        mInflter = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        mContext = context;
        alTotalList = alval;
        appConfig = (AppConfig) mContext.getApplicationContext();
        try {
            this.mAdapterCallback = ((List_Interface) mAdapterCallback);
        } catch (ClassCastException e) {
            e.printStackTrace();
            //            throw new ClassCastException("Activity must implement AdapterCallback.");
        }
    }

    @Override public void destroyItem(ViewGroup container, int position, Object object) {

        View view = (View) object;
        ViewPager viewPager = (ViewPager) container;
        viewPager.removeView(view);
        views.remove(position);
        view = null;
    }

    @Override public int getItemPosition(Object object) {
        //	    for (int i = 0 ; i < views.size() ; ++i) {
        //	        if (object.equals(views.get(i))) {
        //	            return POSITION_UNCHANGED;
        //	        }
        //	    }
        return POSITION_NONE;
    }

    //	@Override
    //	public void notifyDataSetChanged() {
    //		int key = 0;
    //		for (int i = 0; i < views.size(); i++) {
    //			key = views.keyAt(i);
    //			View view = views.get(key);
    //
    //			// refresh할 작업들
    //		}
    //		super.notifyDataSetChanged();
    //	}

    @Override public int getCount() {

        return alTotalList.size();
    }

    @Override public boolean isViewFromObject(View view, Object object) {

        return view.equals(object);
    }

    @Override public Object instantiateItem(ViewGroup container, int position) {

        HashMap<String, Object> hmItem = new HashMap<String, Object>();
        hmItem = alTotalList.get(position);

        String sHTTP_online_state = util.null2string(hmItem.get(Constants.HTTP_online_state));
        String sHTTP_device_id = util.null2string(hmItem.get(Constants.HTTP_device_id));
        String sHTTP_device_mf_id = util.null2string(hmItem.get(Constants.HTTP_device_mf_id));
        String sHTTP_node_id = util.null2string(hmItem.get(Constants.HTTP_node_id));
        String sHTTP_node_name = util.null2string(hmItem.get(Constants.HTTP_node_name));
        String sHTTP_control_min_value = util.null2string(hmItem.get(Constants.HTTP_control_min_value));
        String sHTTP_control_max_value = util.null2string(hmItem.get(Constants.HTTP_control_max_value));
        String sHTTP_control_step = util.null2string(hmItem.get(Constants.HTTP_control_step));
        String sHTTP_unit = util.null2string(hmItem.get(Constants.HTTP_unit));
        String sHTTP_data_type_code = util.null2string(hmItem.get(Constants.HTTP_data_type_code));
        String sHTTP_cmdcls_type_id = util.null2string(hmItem.get(Constants.HTTP_cmdcls_type_id));
        int iCmdcls_Type = util.null2int(hmItem.get(Constants.HTTP_cmdcls_type_id));
        String sHTTP_cmdcls_code = util.null2string(hmItem.get(Constants.HTTP_cmdcls_code));
        String sHTTP_cmdcls_type_name = util.null2string(hmItem.get(Constants.HTTP_cmdcls_type_name));
        String sHTTP_cmdcls_type_system_name = util.null2string(hmItem.get(Constants.HTTP_cmdcls_type_system_name));
        String sHTTP_content_value = util.null2string(hmItem.get(Constants.HTTP_content_value));
        String sHTTP_request_time = util.null2string(hmItem.get(Constants.HTTP_request_time));

        String sTempValue = "";
        String sSelect = util.getStringValues(mContext, "CMDCLS_TYPE_ID_" + sHTTP_cmdcls_type_id + "_BG_DEFAULT");
        if ( sHTTP_content_value.equals("none") ) {
            sTempValue = util.getStringValues(mContext, "CMDCLS_TYPE_ID_" + sHTTP_cmdcls_type_id + "_" + sSelect);
            sHTTP_content_value = sSelect;
        } else {
            sTempValue = util.getStringValues(mContext, "CMDCLS_TYPE_ID_" + sHTTP_cmdcls_type_id + "_" + sHTTP_content_value);
        }

        LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        LinearLayout childView = (LinearLayout) inflater.inflate(R.layout.row_things_detail_list, null);

        util.getView(childView, R.id.llRowBody1).setVisibility(View.VISIBLE);
        util.getView(childView, R.id.llRowBody2).setVisibility(View.GONE);
        util.getView(childView, R.id.tvRowBody1_Desc).setVisibility(View.GONE);
        util.getView(childView, R.id.btnRowBody1_Contents_On).setVisibility(View.GONE);
        util.getView(childView, R.id.btnRowBody1_Contents_Off).setVisibility(View.GONE);
        util.getView(childView, R.id.btnRowBody1_Contents_Lock).setVisibility(View.GONE);
        util.getView(childView, R.id.tvRowBody1_NodeName).setVisibility(View.GONE);
        util.getView(childView, R.id.llRowBody1_Page_Icon).setVisibility(View.GONE);

        if ( getCount() > 1 ) {
            util.getView(childView, R.id.tvRowBody1_NodeName).setVisibility(View.VISIBLE);
            util.getTextView(childView, R.id.tvRowBody1_NodeName).setText(sHTTP_node_name);
            util.getView(childView, R.id.llRowBody1_Page_Icon).setVisibility(View.VISIBLE);
        }

        final View vLoding = util.getView(childView, R.id.llLoading1);
        if ( !sHTTP_request_time.equals("") ) {
            vLoding.setVisibility(View.VISIBLE);
        } else {
            vLoding.setVisibility(View.GONE);
        }

        int iTempType = 0;
        switch (iCmdcls_Type) {
            //SENSOR_BINARY
            case Constants.CMDCLS_TYPE_ID_11001:
            case Constants.CMDCLS_TYPE_ID_11002:
            case Constants.CMDCLS_TYPE_ID_11004:
            case Constants.CMDCLS_TYPE_ID_11005:
            case Constants.CMDCLS_TYPE_ID_11006:
            case Constants.CMDCLS_TYPE_ID_11008:
            case Constants.CMDCLS_TYPE_ID_11009:
            case Constants.CMDCLS_TYPE_ID_11010:
            case Constants.CMDCLS_TYPE_ID_11012:
            case Constants.CMDCLS_TYPE_ID_11014:
            case Constants.CMDCLS_TYPE_ID_11015:
            case Constants.CMDCLS_TYPE_ID_11016:
            case Constants.CMDCLS_TYPE_ID_11018:
                util.getTextView(childView, R.id.tvRowBody1_Title).setText(sTempValue);
                //열감지
                if ( sHTTP_online_state.equals("OFF") || appConfig.getSelect_Homegrp_Homehub_Online_State().equals("OFF") ) {
                    util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText(util.getString(mContext, R.string.layout_offline));
                } else {
                    if ( sHTTP_content_value.equals(sSelect) ) {
                        util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                    } else {
                        util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_02));
                    }
                }
                break;
            case Constants.CMDCLS_TYPE_ID_11003:
                //연기감지 센서
                util.getTextView(childView, R.id.tvRowBody1_Title).setText(sTempValue);
                if ( sHTTP_online_state.equals("OFF") || appConfig.getSelect_Homegrp_Homehub_Online_State().equals("OFF") ) {
                    util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_09_00_smoke_state_offline);
                    util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText(util.getString(mContext, R.string.layout_offline));
                } else {
                    if ( sHTTP_content_value.equals(sSelect) ) {
                        util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_09_01_smoke_state_none);
                        util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                    } else {
                        util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_09_02_smoke_state_detect);
                        util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_02));
                    }
                }
                break;
            case Constants.CMDCLS_TYPE_ID_11007:
                //누수감지 센서
                util.getTextView(childView, R.id.tvRowBody1_Title).setText(sTempValue);
                if ( sHTTP_online_state.equals("OFF") || appConfig.getSelect_Homegrp_Homehub_Online_State().equals("OFF") ) {
                    util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_10_00_waterleak_state_offline);
                    util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText(util.getString(mContext, R.string.layout_offline));
                } else {
                    if ( sHTTP_content_value.equals(sSelect) ) {
                        util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_10_01_waterleak_state_none);
                        util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                    } else {
                        util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_10_02_waterleak_state_detect);
                        util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_02));
                    }
                }
                break;
            case Constants.CMDCLS_TYPE_ID_11011:
                //문열림 센서
                util.getTextView(childView, R.id.tvRowBody1_Title).setText(sTempValue);
                if ( sHTTP_online_state.equals("OFF") || appConfig.getSelect_Homegrp_Homehub_Online_State().equals("OFF") ) {
                    util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_01_00_sensor_door_offline);
                    util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText(util.getString(mContext, R.string.layout_offline));
                } else {
                    if ( sHTTP_content_value.equals(sSelect) ) {
                        util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_01_01_sensor_door_close);
                        util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                    } else {
                        util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_01_02_sensor_door_open);
                        util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_02));
                    }
                }
                break;
            case Constants.CMDCLS_TYPE_ID_11013:
                //모션 센서
                util.getTextView(childView, R.id.tvRowBody1_Title).setText(sTempValue);
                if ( sHTTP_online_state.equals("OFF") || appConfig.getSelect_Homegrp_Homehub_Online_State().equals("OFF") ) {
                    util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_08_00_motion_state_offline);
                    util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText(util.getString(mContext, R.string.layout_offline));
                } else {
                    if ( sHTTP_content_value.equals(sSelect) ) {
                        util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_08_01_motion_state_none);
                        util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                    } else {
                        util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_08_02_motion_state_detect);
                        util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_02));
                    }
                }
                break;
            case Constants.CMDCLS_TYPE_ID_11017:
                //충격 센서
                util.getTextView(childView, R.id.tvRowBody1_Title).setText(sTempValue);
                if ( sHTTP_online_state.equals("OFF") || appConfig.getSelect_Homegrp_Homehub_Online_State().equals("OFF") ) {
                    util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_02_00_sensor_shock_offline);
                    util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText(util.getString(mContext, R.string.layout_offline));
                } else {
                    if ( sHTTP_content_value.equals(sSelect) ) {
                        util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_02_01_sensor_shock_normal);
                        util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                    } else {
                        util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_02_02_sensor_shock_sensing);
                        util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_02));
                    }
                }
                break;
            //SWITCH_BINARY
            case Constants.CMDCLS_TYPE_ID_17001:
            case Constants.CMDCLS_TYPE_ID_17002:
            case Constants.CMDCLS_TYPE_ID_17005:
                util.getView(childView, R.id.btnRowBody1_Contents_On).setVisibility(View.VISIBLE);
                util.getTextView(childView, R.id.btnRowBody1_Contents_On).setText(util.getStringValues(mContext, "CMDCLS_TYPE_ID_" + sHTTP_cmdcls_type_id + "_ON"));

                util.getView(childView, R.id.btnRowBody1_Contents_Off).setVisibility(View.VISIBLE);
                util.getTextView(childView, R.id.btnRowBody1_Contents_Off).setText(util.getStringValues(mContext, "CMDCLS_TYPE_ID_" + sHTTP_cmdcls_type_id + "_OFF"));

                util.getTextView(childView, R.id.tvRowBody1_Title).setText(sTempValue);
                if ( sHTTP_online_state.equals("OFF") || appConfig.getSelect_Homegrp_Homehub_Online_State().equals("OFF") ) {
                    util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_06_00_plug_state_offline);
                    util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText(util.getString(mContext, R.string.layout_offline));
                    util.getView(childView, R.id.btnRowBody1_Contents_On).setEnabled(false);
                    util.getView(childView, R.id.btnRowBody1_Contents_Off).setEnabled(false);
                } else {
                    if ( sHTTP_content_value.equals(sSelect) ) {
                        util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_06_01_plug_state_off);
                        util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                    } else {
                        util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_06_02_plug_state_on);
                        util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_02));
                    }
                }
                util.getView(childView, R.id.btnRowBody1_Contents_On).setTag(position);
                util.getView(childView, R.id.btnRowBody1_Contents_On).setOnClickListener(new View.OnClickListener() {
                    int iTag = 0;
                    private Intent intent;

                    @Override public void onClick(View v) {

                        iTag = (int) v.getTag();
                        setHTTP_Value("ON");
                        vLoding.setVisibility(View.VISIBLE);
                        mAdapterCallback.onCallAction(3, iTag);
                    }
                });
                util.getView(childView, R.id.btnRowBody1_Contents_Off).setTag(position);
                util.getView(childView, R.id.btnRowBody1_Contents_Off).setOnClickListener(new View.OnClickListener() {
                    int iTag = 0;
                    private Intent intent;

                    @Override public void onClick(View v) {

                        iTag = (int) v.getTag();
                        setHTTP_Value("OFF");
                        vLoding.setVisibility(View.VISIBLE);
                        mAdapterCallback.onCallAction(3, iTag);
                    }
                });
                break;
            case Constants.CMDCLS_TYPE_ID_17003:
            case Constants.CMDCLS_TYPE_ID_17004:
                //bulb, led
                util.getView(childView, R.id.btnRowBody1_Contents_On).setVisibility(View.VISIBLE);
                util.getTextView(childView, R.id.btnRowBody1_Contents_On).setText(util.getStringValues(mContext, "CMDCLS_TYPE_ID_" + sHTTP_cmdcls_type_id + "_ON"));

                util.getView(childView, R.id.btnRowBody1_Contents_Off).setVisibility(View.VISIBLE);
                util.getTextView(childView, R.id.btnRowBody1_Contents_Off).setText(util.getStringValues(mContext, "CMDCLS_TYPE_ID_" + sHTTP_cmdcls_type_id + "_OFF"));

                util.getTextView(childView, R.id.tvRowBody1_Title).setText(sTempValue);
                if ( sHTTP_online_state.equals("OFF") || appConfig.getSelect_Homegrp_Homehub_Online_State().equals("OFF") ) {
                    util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_12_00_ledbulb_state_offline);
                    util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText(util.getString(mContext, R.string.layout_offline));
                    util.getView(childView, R.id.btnRowBody1_Contents_On).setEnabled(false);
                    util.getView(childView, R.id.btnRowBody1_Contents_Off).setEnabled(false);
                } else {
                    if ( sHTTP_content_value.equals(sSelect) ) {
                        util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_12_01_ledbulb_state_off);
                        util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                    } else {
                        util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_12_02_ledbulb_state_on);
                        util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_02));
                    }
                }
                util.getView(childView, R.id.btnRowBody1_Contents_On).setTag(position);
                util.getView(childView, R.id.btnRowBody1_Contents_On).setOnClickListener(new View.OnClickListener() {
                    int iTag = 0;
                    private Intent intent;

                    @Override public void onClick(View v) {

                        iTag = (int) v.getTag();
                        setHTTP_Value("ON");
                        vLoding.setVisibility(View.VISIBLE);
                        mAdapterCallback.onCallAction(3, iTag);
                    }
                });
                util.getView(childView, R.id.btnRowBody1_Contents_Off).setTag(position);
                util.getView(childView, R.id.btnRowBody1_Contents_Off).setOnClickListener(new View.OnClickListener() {
                    int iTag = 0;
                    private Intent intent;

                    @Override public void onClick(View v) {

                        iTag = (int) v.getTag();
                        setHTTP_Value("OFF");
                        vLoding.setVisibility(View.VISIBLE);
                        mAdapterCallback.onCallAction(3, iTag);
                    }
                });
                break;
            case Constants.CMDCLS_TYPE_ID_17006:
                //사이렌
                util.getView(childView, R.id.btnRowBody1_Contents_On).setVisibility(View.VISIBLE);
                util.getTextView(childView, R.id.btnRowBody1_Contents_On).setText(util.getStringValues(mContext, "CMDCLS_TYPE_ID_" + sHTTP_cmdcls_type_id + "_ON"));

                util.getView(childView, R.id.btnRowBody1_Contents_Off).setVisibility(View.VISIBLE);
                util.getTextView(childView, R.id.btnRowBody1_Contents_Off).setText(util.getStringValues(mContext, "CMDCLS_TYPE_ID_" + sHTTP_cmdcls_type_id + "_OFF"));

                util.getTextView(childView, R.id.tvRowBody1_Title).setText(sTempValue);
                if ( sHTTP_online_state.equals("OFF") || appConfig.getSelect_Homegrp_Homehub_Online_State().equals("OFF") ) {
                    util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_11_00_siren_state_offline);
                    util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText(util.getString(mContext, R.string.layout_offline));
                    util.getView(childView, R.id.btnRowBody1_Contents_On).setEnabled(false);
                    util.getView(childView, R.id.btnRowBody1_Contents_Off).setEnabled(false);
                } else {
                    if ( sHTTP_content_value.equals(sSelect) ) {
                        util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_11_01_siren_state_off);
                        util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                    } else {
                        util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_11_02_siren_state_on);
                        util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_02));
                    }
                }
                util.getView(childView, R.id.btnRowBody1_Contents_On).setTag(position);
                util.getView(childView, R.id.btnRowBody1_Contents_On).setOnClickListener(new View.OnClickListener() {
                    int iTag = 0;
                    private Intent intent;

                    @Override public void onClick(View v) {

                        iTag = (int) v.getTag();
                        setHTTP_Value("ON");
                        vLoding.setVisibility(View.VISIBLE);
                        mAdapterCallback.onCallAction(3, iTag);
                    }
                });
                util.getView(childView, R.id.btnRowBody1_Contents_Off).setTag(position);
                util.getView(childView, R.id.btnRowBody1_Contents_Off).setOnClickListener(new View.OnClickListener() {
                    int iTag = 0;
                    private Intent intent;

                    @Override public void onClick(View v) {

                        iTag = (int) v.getTag();
                        setHTTP_Value("OFF");
                        vLoding.setVisibility(View.VISIBLE);
                        mAdapterCallback.onCallAction(3, iTag);
                    }
                });
                break;
            case Constants.CMDCLS_TYPE_ID_36002:
                //가스락
                util.getView(childView, R.id.btnRowBody1_Contents_Lock).setVisibility(View.VISIBLE);
                util.getTextView(childView, R.id.btnRowBody1_Contents_Lock).setText(util.getStringValues(mContext, "CMDCLS_TYPE_ID_" + sHTTP_cmdcls_type_id + "_CLOSE"));
                util.getTextView(childView, R.id.tvRowBody1_Title).setText(sTempValue);
                if ( sHTTP_online_state.equals("OFF") || appConfig.getSelect_Homegrp_Homehub_Online_State().equals("OFF") ) {
                    util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_05_00_valve_state_offline);
                    util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText(util.getString(mContext, R.string.layout_offline));
                    util.getView(childView, R.id.btnRowBody1_Contents_Lock).setEnabled(false);
                } else {
                    if ( sHTTP_content_value.equals(sSelect) ) {
                        util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_05_01_valve_state_locked);
                        util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                    } else {
                        util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_05_02_valve_state_unlocked);
                        util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_02));
                    }
                }
                util.getView(childView, R.id.btnRowBody1_Contents_Lock).setTag(position);
                util.getView(childView, R.id.btnRowBody1_Contents_Lock).setOnClickListener(new View.OnClickListener() {
                    int iTag = 0;
                    private Intent intent;

                    @Override public void onClick(View v) {

                        iTag = (int) v.getTag();
                        setHTTP_Value("CLOSE");
                        vLoding.setVisibility(View.VISIBLE);
                        mAdapterCallback.onCallAction(3, iTag);
                    }
                });
                break;

            // SENSOR_MULTILEVEL
            case Constants.CMDCLS_TYPE_ID_12001:
            case Constants.CMDCLS_TYPE_ID_12003:
            case Constants.CMDCLS_TYPE_ID_12005:
            case Constants.CMDCLS_TYPE_ID_12007:
            case Constants.CMDCLS_TYPE_ID_12008:
            case Constants.CMDCLS_TYPE_ID_12009:
            case Constants.CMDCLS_TYPE_ID_12010:
            case Constants.CMDCLS_TYPE_ID_12011:
            case Constants.CMDCLS_TYPE_ID_12012:
            case Constants.CMDCLS_TYPE_ID_12013:
            case Constants.CMDCLS_TYPE_ID_12014:
            case Constants.CMDCLS_TYPE_ID_12015:
            case Constants.CMDCLS_TYPE_ID_12016:
            case Constants.CMDCLS_TYPE_ID_12017:
            case Constants.CMDCLS_TYPE_ID_12018:
            case Constants.CMDCLS_TYPE_ID_12019:
            case Constants.CMDCLS_TYPE_ID_12020:
            case Constants.CMDCLS_TYPE_ID_12021:
            case Constants.CMDCLS_TYPE_ID_12022:
            case Constants.CMDCLS_TYPE_ID_12023:
            case Constants.CMDCLS_TYPE_ID_12024:
            case Constants.CMDCLS_TYPE_ID_12025:
            case Constants.CMDCLS_TYPE_ID_12026:
            case Constants.CMDCLS_TYPE_ID_12027:
            case Constants.CMDCLS_TYPE_ID_12028:
            case Constants.CMDCLS_TYPE_ID_12029:
            case Constants.CMDCLS_TYPE_ID_12030:
            case Constants.CMDCLS_TYPE_ID_12031:
            case Constants.CMDCLS_TYPE_ID_12032:
                if ( sHTTP_content_value.equals("none") ) {
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText("-" + sHTTP_unit);
                } else {
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText(sHTTP_content_value + sHTTP_unit);
                }
                if ( sHTTP_online_state.equals("OFF") || appConfig.getSelect_Homegrp_Homehub_Online_State().equals("OFF") ) {
                    util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText(util.getString(mContext, R.string.layout_offline));
                }
                break;
            case Constants.CMDCLS_TYPE_ID_12002:
                //온도센서
                if ( sHTTP_content_value.equals("none") ) {
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText("-");
                } else {
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText(sHTTP_content_value + sHTTP_unit);
                }
                if ( sHTTP_online_state.equals("OFF") || appConfig.getSelect_Homegrp_Homehub_Online_State().equals("OFF") ) {
                    util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_03_00_sensor_temperature_offline);
                    util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText(util.getString(mContext, R.string.layout_offline));
                } else {
                    switch (util.str2int(util.getRealDateMonth())) {
                        case 12:
                        case 1:
                        case 2:
                            //겨울
                            if ( util.str2float(sHTTP_content_value) < 18 ) {
                                iTempType = 1;
                            } else if ( util.str2float(sHTTP_content_value) > 20 ) {
                                iTempType = 3;
                            } else {
                                iTempType = 2;
                            }
                            break;
                        case 3:
                        case 4:
                        case 5:
                        case 10:
                        case 11:
                            //봄,가을
                            if ( util.str2float(sHTTP_content_value) < 20 ) {
                                iTempType = 1;
                            } else if ( util.str2float(sHTTP_content_value) > 22 ) {
                                iTempType = 3;
                            } else {
                                iTempType = 2;
                            }
                            break;
                        case 6:
                        case 7:
                        case 8:
                        case 9:
                            //여름
                            if ( util.str2float(sHTTP_content_value) < 26 ) {
                                iTempType = 1;
                            } else if ( util.str2float(sHTTP_content_value) > 28 ) {
                                iTempType = 3;
                            } else {
                                iTempType = 2;
                            }
                            break;
                    }
                    util.getView(childView, R.id.tvRowBody1_Desc).setVisibility(View.VISIBLE);
                    if ( iTempType == 1 ) {
                        util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_03_01_sensor_temperature_cool);
                        util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                        util.getTextView(childView, R.id.tvRowBody1_Desc).setText(util.getString(mContext, R.string.layout_things_cool));
                    } else if ( iTempType == 2 ) {

                        util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_03_02_sensor_temperature_nice);
                        util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                        util.getTextView(childView, R.id.tvRowBody1_Desc).setText(util.getString(mContext, R.string.layout_things_nice));
                    } else if ( iTempType == 3 ) {
                        util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_03_03_sensor_temperature_hot);
                        util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                        util.getTextView(childView, R.id.tvRowBody1_Desc).setText(util.getString(mContext, R.string.layout_things_hot));
                    }
                }
                break;
            case Constants.CMDCLS_TYPE_ID_12004:
                //밝기
                if ( sHTTP_content_value.equals("none") ) {
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText("-");
                } else {
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText(sHTTP_content_value + sHTTP_unit);
                }
                if ( sHTTP_online_state.equals("OFF") || appConfig.getSelect_Homegrp_Homehub_Online_State().equals("OFF") ) {
                    util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_07_00_bright_state_offline);
                    util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText(util.getString(mContext, R.string.layout_offline));
                } else {
                    if ( (sHTTP_unit.equals("%") && util.str2float(sHTTP_content_value) < 10) || (sHTTP_unit.equals("lx") && util.str2float(sHTTP_content_value) < 30) ) {
                        iTempType = 1;
                    } else if ( (sHTTP_unit.equals("%") && util.str2float(sHTTP_content_value) < 50) || (sHTTP_unit.equals("lx") && util.str2float(sHTTP_content_value) < 300) ) {
                        iTempType = 2;
                    } else if ( (sHTTP_unit.equals("%") && util.str2float(sHTTP_content_value) < 80) || (sHTTP_unit.equals("lx") && util.str2float(sHTTP_content_value) < 600) ) {
                        iTempType = 3;
                    } else {
                        iTempType = 4;
                    }
                    util.getView(childView, R.id.tvRowBody1_Desc).setVisibility(View.VISIBLE);
                    if ( iTempType == 1 ) {
                        util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_07_01_bright_state_dark);
                        util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                        util.getTextView(childView, R.id.tvRowBody1_Desc).setText(util.getString(mContext, R.string.layout_things_dark));
                    } else if ( iTempType == 2 ) {

                        util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_07_02_bright_state_soft);
                        util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                        util.getTextView(childView, R.id.tvRowBody1_Desc).setText(util.getString(mContext, R.string.layout_things_soft));
                    } else if ( iTempType == 3 ) {
                        util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_07_03_bright_state_nice);
                        util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                        util.getTextView(childView, R.id.tvRowBody1_Desc).setText(util.getString(mContext, R.string.layout_things_nice));
                    } else if ( iTempType == 4 ) {
                        util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_07_04_bright_state_bright);
                        util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                        util.getTextView(childView, R.id.tvRowBody1_Desc).setText(util.getString(mContext, R.string.layout_things_bright));
                    }
                }
                break;
            case Constants.CMDCLS_TYPE_ID_12006:
                //습도센서
                if ( sHTTP_content_value.equals("none") ) {
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText("-");
                } else {
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText(sHTTP_content_value + sHTTP_unit);
                }
                if ( sHTTP_online_state.equals("OFF") || appConfig.getSelect_Homegrp_Homehub_Online_State().equals("OFF") ) {
                    util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_04_00_sensor_humidity_offline);
                    util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText(util.getString(mContext, R.string.layout_offline));
                } else {
                    switch (util.str2int(util.getRealDateMonth())) {
                        case 12:
                        case 1:
                        case 2:
                            //겨울
                            if ( util.str2float(sHTTP_content_value) < 60 ) {
                                iTempType = 1;
                            } else if ( util.str2float(sHTTP_content_value) > 70 ) {
                                iTempType = 3;
                            } else {
                                iTempType = 2;
                            }
                            break;
                        case 3:
                        case 4:
                        case 5:
                        case 10:
                        case 11:
                            //봄,가을
                            if ( util.str2float(sHTTP_content_value) < 50 ) {
                                iTempType = 1;
                            } else if ( util.str2float(sHTTP_content_value) > 60 ) {
                                iTempType = 3;
                            } else {
                                iTempType = 2;
                            }
                            break;
                        case 6:
                        case 7:
                        case 8:
                        case 9:
                            //여름
                            if ( util.str2float(sHTTP_content_value) < 30 ) {
                                iTempType = 1;
                            } else if ( util.str2float(sHTTP_content_value) > 40 ) {
                                iTempType = 3;
                            } else {
                                iTempType = 2;
                            }
                            break;
                    }
                    util.getView(childView, R.id.tvRowBody1_Desc).setVisibility(View.VISIBLE);
                    if ( iTempType == 1 ) {
                        util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_04_01_sensor_humidity_dry);
                        util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                        util.getTextView(childView, R.id.tvRowBody1_Desc).setText(util.getString(mContext, R.string.layout_things_dry));
                    } else if ( iTempType == 2 ) {

                        util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_04_02_sensor_humidity_nice);
                        util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                        util.getTextView(childView, R.id.tvRowBody1_Desc).setText(util.getString(mContext, R.string.layout_things_nice));
                    } else if ( iTempType == 3 ) {
                        util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_04_03_sensor_humidity_moist);
                        util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                        util.getTextView(childView, R.id.tvRowBody1_Desc).setText(util.getString(mContext, R.string.layout_things_moist));
                    }
                }
                break;

            //METER_CURRENT
            case Constants.CMDCLS_TYPE_ID_15001:
            case Constants.CMDCLS_TYPE_ID_15002:
                if ( sHTTP_content_value.equals("none") ) {
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText("-" + sHTTP_unit);
                } else {
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText(sHTTP_content_value + sHTTP_unit);
                }
                if ( sHTTP_online_state.equals("OFF") || appConfig.getSelect_Homegrp_Homehub_Online_State().equals("OFF") ) {
                    util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_02_00_sensor_shock_offline);
                    util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText(util.getString(mContext, R.string.layout_offline));
                }
                break;
            //METER_TOTAL
            case Constants.CMDCLS_TYPE_ID_16001:
            case Constants.CMDCLS_TYPE_ID_16002:
            case Constants.CMDCLS_TYPE_ID_16003:
            case Constants.CMDCLS_TYPE_ID_16004:
                if ( sHTTP_content_value.equals("none") ) {
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText("-" + sHTTP_unit);
                } else {
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText(sHTTP_content_value + sHTTP_unit);
                }
                if ( sHTTP_online_state.equals("OFF") || appConfig.getSelect_Homegrp_Homehub_Online_State().equals("OFF") ) {
                    util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_02_00_sensor_shock_offline);
                    util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText(util.getString(mContext, R.string.layout_offline));
                }
                break;
            //SWITCH_MULTILEVEL
            case Constants.CMDCLS_TYPE_ID_18001:
            case Constants.CMDCLS_TYPE_ID_18002:
            case Constants.CMDCLS_TYPE_ID_18003:
            case Constants.CMDCLS_TYPE_ID_18004:
            case Constants.CMDCLS_TYPE_ID_18005:
                if ( sHTTP_content_value.equals("none") ) {
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText("-" + sHTTP_unit);
                } else {
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText(sHTTP_content_value + sHTTP_unit);
                }
                if ( sHTTP_online_state.equals("OFF") || appConfig.getSelect_Homegrp_Homehub_Online_State().equals("OFF") ) {
                    util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_02_00_sensor_shock_offline);
                    util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText(util.getString(mContext, R.string.layout_offline));
                }
                break;
            //THERMOSTAT_SETPOINT
            case Constants.CMDCLS_TYPE_ID_19001:
                if ( sHTTP_content_value.equals("none") ) {
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText("-" + sHTTP_unit);
                } else {
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText(sHTTP_content_value + sHTTP_unit);
                }
                if ( sHTTP_online_state.equals("OFF") || appConfig.getSelect_Homegrp_Homehub_Online_State().equals("OFF") ) {
                    util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_02_00_sensor_shock_offline);
                    util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText(util.getString(mContext, R.string.layout_offline));
                }
                break;
            // METER
            case Constants.CMDCLS_TYPE_ID_29001:
            case Constants.CMDCLS_TYPE_ID_29002:
            case Constants.CMDCLS_TYPE_ID_29003:
            case Constants.CMDCLS_TYPE_ID_29004:
            case Constants.CMDCLS_TYPE_ID_29005:
            case Constants.CMDCLS_TYPE_ID_29006:
            case Constants.CMDCLS_TYPE_ID_29007:
            case Constants.CMDCLS_TYPE_ID_29008:
            case Constants.CMDCLS_TYPE_ID_29009:
            case Constants.CMDCLS_TYPE_ID_29010:
            case Constants.CMDCLS_TYPE_ID_29011:
            case Constants.CMDCLS_TYPE_ID_29012:
            case Constants.CMDCLS_TYPE_ID_29013:
            case Constants.CMDCLS_TYPE_ID_29014:
                if ( sHTTP_content_value.equals("none") ) {
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText("-" + sHTTP_unit);
                } else {
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText(sHTTP_content_value + sHTTP_unit);
                }
                if ( sHTTP_online_state.equals("OFF") || appConfig.getSelect_Homegrp_Homehub_Online_State().equals("OFF") ) {
                    util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText(util.getString(mContext, R.string.layout_offline));
                }
                break;
            //BATTERY
            case Constants.CMDCLS_TYPE_ID_30001:
                if ( sHTTP_content_value.equals("none") ) {
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText("-" + sHTTP_unit);
                } else {
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText(sHTTP_content_value + sHTTP_unit);
                }
                if ( sHTTP_online_state.equals("OFF") || appConfig.getSelect_Homegrp_Homehub_Online_State().equals("OFF") ) {
                    util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_02_00_sensor_shock_offline);
                    util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText(util.getString(mContext, R.string.layout_offline));
                }
                break;
            //SYSTEM
            case Constants.CMDCLS_TYPE_ID_34006:
            case Constants.CMDCLS_TYPE_ID_34007:
            case Constants.CMDCLS_TYPE_ID_34008:
            case Constants.CMDCLS_TYPE_ID_34009:
            case Constants.CMDCLS_TYPE_ID_34010:
            case Constants.CMDCLS_TYPE_ID_34011:
            case Constants.CMDCLS_TYPE_ID_34012:
            case Constants.CMDCLS_TYPE_ID_34013:
            case Constants.CMDCLS_TYPE_ID_34014:
                if ( sHTTP_content_value.equals("none") ) {
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText("-" + sHTTP_unit);
                } else {
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText(sHTTP_content_value + sHTTP_unit);
                }
                if ( sHTTP_online_state.equals("OFF") || appConfig.getSelect_Homegrp_Homehub_Online_State().equals("OFF") ) {
                    util.getView(childView, R.id.ivRowBody1_Icon).setBackgroundResource(R.drawable.img_things_detail_02_00_sensor_shock_offline);
                    util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText(util.getString(mContext, R.string.layout_offline));
                }
                break;
            default:
                if ( sHTTP_content_value.equals("none") ) {
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText("-" + sHTTP_unit);
                } else {
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText(sHTTP_content_value + sHTTP_unit);
                }
                if ( sHTTP_online_state.equals("OFF") || appConfig.getSelect_Homegrp_Homehub_Online_State().equals("OFF") ) {
                    util.getTextView(childView, R.id.tvRowBody1_Title).setTextColor(util.getColor(mContext, R.color.color_text_01));
                    util.getTextView(childView, R.id.tvRowBody1_Title).setText(util.getString(mContext, R.string.layout_offline));
                }
                break;
        }

        container.addView(childView);
        views.put(position, childView);

        if ( position != mCurrentPosition ) {
            CustomViewPager pager = (CustomViewPager) container;
            if ( childView != null ) {
                mCurrentPosition = position;
                pager.measureCurrentView(childView);
            }
        }
        return childView;
    }

    public String getHTTP_Value() {

        return sHTTP_value;
    }

    public void setHTTP_Value(String sVal) {

        sHTTP_value = sVal;
    }
}
