Example #1
0
    public ViewHolder(View itemView) {
      super(itemView);
      view = itemView;

      llApplication = (LinearLayout) itemView.findViewById(R.id.llApplication);
      ivIcon = (ImageView) itemView.findViewById(R.id.ivIcon);
      ivExpander = (ImageView) itemView.findViewById(R.id.ivExpander);
      tvName = (TextView) itemView.findViewById(R.id.tvName);

      cbWifi = (CheckBox) itemView.findViewById(R.id.cbWifi);
      cbOther = (CheckBox) itemView.findViewById(R.id.cbOther);

      llAttributes = (LinearLayout) itemView.findViewById(R.id.llAttributes);
      ivUsing = (ImageView) itemView.findViewById(R.id.ivUsing);
      tvRoaming = (TextView) itemView.findViewById(R.id.tvRoaming);

      llConfiguration = (LinearLayout) itemView.findViewById(R.id.llConfiguration);
      tvPackage = (TextView) itemView.findViewById(R.id.tvPackage);
      tvDisabled = (TextView) itemView.findViewById(R.id.tvDisabled);
      tvInternet = (TextView) itemView.findViewById(R.id.tvInternet);
      cbUsing = (CheckBox) itemView.findViewById(R.id.cbUsing);
      cbRoaming = (CheckBox) itemView.findViewById(R.id.cbRoaming);
      btnSettings = (ImageButton) itemView.findViewById(R.id.btnSettings);
      btnLaunch = (Button) itemView.findViewById(R.id.btnLaunch);

      final View wifiParent = (View) cbWifi.getParent();
      wifiParent.post(
          new Runnable() {
            public void run() {
              Rect rect = new Rect();
              cbWifi.getHitRect(rect);
              rect.bottom += rect.top;
              rect.right += rect.left;
              rect.top = 0;
              rect.left = 0;
              wifiParent.setTouchDelegate(new TouchDelegate(rect, cbWifi));
            }
          });

      final View otherParent = (View) cbOther.getParent();
      otherParent.post(
          new Runnable() {
            public void run() {
              Rect rect = new Rect();
              cbOther.getHitRect(rect);
              rect.bottom += rect.top;
              rect.right += rect.left;
              rect.top = 0;
              rect.left = 0;
              otherParent.setTouchDelegate(new TouchDelegate(rect, cbOther));
            }
          });
    }
Example #2
0
    public ViewHolder(View itemView) {
      super(itemView);
      view = itemView;

      llApplication = (LinearLayout) itemView.findViewById(R.id.llApplication);
      ivIcon = (ImageView) itemView.findViewById(R.id.ivIcon);
      ivExpander = (ImageView) itemView.findViewById(R.id.ivExpander);
      tvName = (TextView) itemView.findViewById(R.id.tvName);

      tvHosts = (TextView) itemView.findViewById(R.id.tvHosts);

      cbWifi = (CheckBox) itemView.findViewById(R.id.cbWifi);
      ivScreenWifi = (ImageView) itemView.findViewById(R.id.ivScreenWifi);

      cbOther = (CheckBox) itemView.findViewById(R.id.cbOther);
      ivScreenOther = (ImageView) itemView.findViewById(R.id.ivScreenOther);
      tvRoaming = (TextView) itemView.findViewById(R.id.tvRoaming);

      llConfiguration = (LinearLayout) itemView.findViewById(R.id.llConfiguration);
      tvUid = (TextView) itemView.findViewById(R.id.tvUid);
      tvPackage = (TextView) itemView.findViewById(R.id.tvPackage);
      tvVersion = (TextView) itemView.findViewById(R.id.tvVersion);
      tvDisabled = (TextView) itemView.findViewById(R.id.tvDisabled);
      tvInternet = (TextView) itemView.findViewById(R.id.tvInternet);

      ivWifiLegend = (ImageView) itemView.findViewById(R.id.ivWifiLegend);
      cbScreenWifi = (CheckBox) itemView.findViewById(R.id.cbScreenWifi);

      ivOtherLegend = (ImageView) itemView.findViewById(R.id.ivOtherLegend);
      cbScreenOther = (CheckBox) itemView.findViewById(R.id.cbScreenOther);
      cbRoaming = (CheckBox) itemView.findViewById(R.id.cbRoaming);

      btnClear = (ImageButton) itemView.findViewById(R.id.btnClear);
      btnSettings = (ImageButton) itemView.findViewById(R.id.btnSettings);
      btnLaunch = (Button) itemView.findViewById(R.id.btnLaunch);

      lvAccess = (ListView) itemView.findViewById(R.id.lvAccess);
      tvNolog = (TextView) itemView.findViewById(R.id.tvNolog);
      cbNotify = (CheckBox) itemView.findViewById(R.id.cbNotify);
      btnClearAccess = (ImageButton) itemView.findViewById(R.id.btnClearAccess);
      tvStatistics = (TextView) itemView.findViewById(R.id.tvStatistics);

      final View wifiParent = (View) cbWifi.getParent();
      wifiParent.post(
          new Runnable() {
            public void run() {
              Rect rect = new Rect();
              cbWifi.getHitRect(rect);
              rect.bottom += rect.top;
              rect.right += rect.left;
              rect.top = 0;
              rect.left = 0;
              wifiParent.setTouchDelegate(new TouchDelegate(rect, cbWifi));
            }
          });

      final View otherParent = (View) cbOther.getParent();
      otherParent.post(
          new Runnable() {
            public void run() {
              Rect rect = new Rect();
              cbOther.getHitRect(rect);
              rect.bottom += rect.top;
              rect.right += rect.left;
              rect.top = 0;
              rect.left = 0;
              otherParent.setTouchDelegate(new TouchDelegate(rect, cbOther));
            }
          });
    }