Esempio n. 1
0
 /**
  * 发送时间设置命令
  *
  * @param time
  */
 private void sendShowTime(int time) {
   if (mSendDataListen != null) {
     DataConbine mConbine = new DataConbine(DataConfig.SHOW_TIME_SETTING);
     mConbine.addByte(DataUtils.getByte(curShowItem.getItemId()));
     mConbine.addByte(DataUtils.getByte(time));
     mSendDataListen.sendData(mConbine.getTotalData(), curShowItem);
   }
 }
Esempio n. 2
0
 /**
  * 添加场景的item进指定容器
  *
  * @param item
  * @param adapter
  * @param pannerNum
  */
 @SuppressWarnings("unchecked")
 private void addSenceItemToPanner(
     SenceItem item, List<SenceItem> data, ShowPannerAdapter adapter, int pannerNum) {
   if (data.size() > 0) {
     mSenceView.notifyItemToNoSelect(data.get(0));
     data.clear();
   }
   data.add(item);
   adapter.notifyDataSetChanged();
   setPannerToFoces(pannerNum);
   mSenceView.showTargetToFocus(getPanAllSenceItem(), true);
   curShowItem.changeChildData(getPanAllSenceItem());
   if (mSendDataListen != null) {
     if (mSendDataListen != null) {
       DataConbine mConbine = new DataConbine(DataConfig.SHOW_PANE_ADD_SENCE);
       mConbine.addByte(DataUtils.getByte(curShowItem.getItemId()));
       for (SenceItem mItem : (List<SenceItem>) curShowItem.getChildData()) {
         mConbine.addByte(DataUtils.getByte(mItem.getItemId()));
       }
       mSendDataListen.sendData(mConbine.getTotalData(), curShowItem);
     }
   }
 }
Esempio n. 3
0
  @SuppressWarnings("unchecked")
  private void deleteItem(int pannerPos, int itemPos) {
    switch (pannerPos) {
      case 0:
        mChildPaneData1.remove(itemPos);
        mChildPaneAdaper1.notifyDataSetChanged();
        curShowItem.getItemChildData().set(0, null);
        break;
      case 1:
        mChildPaneData2.remove(itemPos);
        mChildPaneAdaper2.notifyDataSetChanged();
        curShowItem.getItemChildData().set(1, null);
        break;
      case 2:
        mChildPaneData3.remove(itemPos);
        mChildPaneAdaper3.notifyDataSetChanged();
        curShowItem.getItemChildData().set(2, null);
        break;
      default:
        break;
    }

    if (mSendDataListen != null) {
      if (mSendDataListen != null) {
        DataConbine mConbine = new DataConbine(DataConfig.SHOW_PANE_ADD_SENCE);
        mConbine.addByte(DataUtils.getByte(curShowItem.getItemId()));
        for (int i = 0; i < pannerPos; i++) {
          if (i < curShowItem.getChildData().size()) {
            mConbine.addByte(
                DataUtils.getByte(((SenceItem) curShowItem.getChildData().get(i)).getItemId()));
          }
        }
        mSendDataListen.sendData(mConbine.getTotalData(), curShowItem);
      }
    }
  }