Selaa lähdekoodia

增加颜色测试和触点测试

vothin 1 vuosi sitten
vanhempi
commit
7aab9d09a0

+ 4 - 0
i18n/zh_CN.tr

@@ -132,8 +132,12 @@
     <string name="RecordStart">录音开始,录制时间5秒</string>
     <string name="RecordPlay">录音结束,开始播放</string>
     <string name="RecordStop">录音播放结束</string>
+    <string name="ColorTest">颜色测试</string>
     <!-- 错误界面 -->
     <string name="NoBedList">当前房间没有床位</string>
     <string name="NoCustomer">当前房间用户入住</string>
     <string name="NoBedDevice">当前房间没有床位设备</string>
+    <!-- 颜色测试界面 -->
+    <string name="ColorMsg">点击变换颜色</string>
+    <string name="ContactButton">触点界面</string>
 </resources>

+ 416 - 0
jni/activity/colorActivity.cpp

@@ -0,0 +1,416 @@
+/***********************************************
+/gen auto by zuitools
+***********************************************/
+#include "colorActivity.h"
+
+/*TAG:GlobalVariable全局变量*/
+static ZKButton* mBackButtonPtr;
+static ZKPainter* mColorPainterPtr;
+static ZKWindow* mContactWindowPtr;
+static ZKButton* msys_backPtr;
+static ZKButton* mContactButtonPtr;
+static ZKButton* mColorButtonPtr;
+static colorActivity* mActivityPtr;
+
+/*register activity*/
+REGISTER_ACTIVITY(colorActivity);
+
+typedef struct {
+	int id; // 定时器ID , 不能重复
+	int time; // 定时器  时间间隔  单位 毫秒
+}S_ACTIVITY_TIMEER;
+
+#include "logic/colorLogic.cc"
+
+/***********/
+typedef struct {
+    int id;
+    const char *pApp;
+} SAppInfo;
+
+/**
+ *点击跳转window
+ */
+static SAppInfo sAppInfoTab[] = {
+//  { ID_MAIN_TEXT, "TextViewActivity" },
+};
+
+/***************/
+typedef bool (*ButtonCallback)(ZKButton *pButton);
+/**
+ * button onclick表
+ */
+typedef struct {
+    int id;
+    ButtonCallback callback;
+}S_ButtonCallback;
+
+/*TAG:ButtonCallbackTab按键映射表*/
+static S_ButtonCallback sButtonCallbackTab[] = {
+    ID_COLOR_BackButton, onButtonClick_BackButton,
+    ID_COLOR_sys_back, onButtonClick_sys_back,
+    ID_COLOR_ContactButton, onButtonClick_ContactButton,
+    ID_COLOR_ColorButton, onButtonClick_ColorButton,
+};
+/***************/
+
+
+typedef void (*SeekBarCallback)(ZKSeekBar *pSeekBar, int progress);
+typedef struct {
+    int id;
+    SeekBarCallback callback;
+}S_ZKSeekBarCallback;
+/*TAG:SeekBarCallbackTab*/
+static S_ZKSeekBarCallback SZKSeekBarCallbackTab[] = {
+};
+
+
+typedef int (*ListViewGetItemCountCallback)(const ZKListView *pListView);
+typedef void (*ListViewobtainListItemDataCallback)(ZKListView *pListView,ZKListView::ZKListItem *pListItem, int index);
+typedef void (*ListViewonItemClickCallback)(ZKListView *pListView, int index, int id);
+typedef struct {
+    int id;
+    ListViewGetItemCountCallback getListItemCountCallback;
+    ListViewobtainListItemDataCallback obtainListItemDataCallback;
+    ListViewonItemClickCallback onItemClickCallback;
+}S_ListViewFunctionsCallback;
+/*TAG:ListViewFunctionsCallback*/
+static S_ListViewFunctionsCallback SListViewFunctionsCallbackTab[] = {
+};
+
+
+typedef void (*SlideWindowItemClickCallback)(ZKSlideWindow *pSlideWindow, int index);
+typedef struct {
+    int id;
+    SlideWindowItemClickCallback onSlideItemClickCallback;
+}S_SlideWindowItemClickCallback;
+/*TAG:SlideWindowFunctionsCallbackTab*/
+static S_SlideWindowItemClickCallback SSlideWindowItemClickCallbackTab[] = {
+};
+
+
+typedef void (*EditTextInputCallback)(const std::string &text);
+typedef struct {
+    int id;
+    EditTextInputCallback onEditTextChangedCallback;
+}S_EditTextInputCallback;
+/*TAG:EditTextInputCallback*/
+static S_EditTextInputCallback SEditTextInputCallbackTab[] = {
+};
+
+typedef void (*VideoViewCallback)(ZKVideoView *pVideoView, int msg);
+typedef struct {
+    int id; //VideoView ID
+    bool loop; // 是否是轮播类型
+    int defaultvolume;//轮播类型时,默认视频音量
+    VideoViewCallback onVideoViewCallback;
+}S_VideoViewCallback;
+/*TAG:VideoViewCallback*/
+static S_VideoViewCallback SVideoViewCallbackTab[] = {
+};
+
+
+colorActivity::colorActivity() {
+	//todo add init code here
+	mVideoLoopIndex = -1;
+	mVideoLoopErrorCount = 0;
+}
+
+colorActivity::~colorActivity() {
+  //todo add init file here
+  // 退出应用时需要反注册
+    EASYUICONTEXT->unregisterGlobalTouchListener(this);
+    unregisterProtocolDataUpdateListener(onProtocolDataUpdate);
+    onUI_quit();
+    mActivityPtr = NULL;
+    mBackButtonPtr = NULL;
+    mColorPainterPtr = NULL;
+    mContactWindowPtr = NULL;
+    msys_backPtr = NULL;
+    mContactButtonPtr = NULL;
+    mColorButtonPtr = NULL;
+}
+
+const char* colorActivity::getAppName() const{
+	return "color.ftu";
+}
+
+//TAG:onCreate
+void colorActivity::onCreate() {
+	Activity::onCreate();
+    mBackButtonPtr = (ZKButton*)findControlByID(ID_COLOR_BackButton);
+    mColorPainterPtr = (ZKPainter*)findControlByID(ID_COLOR_ColorPainter);
+    mContactWindowPtr = (ZKWindow*)findControlByID(ID_COLOR_ContactWindow);
+    msys_backPtr = (ZKButton*)findControlByID(ID_COLOR_sys_back);
+    mContactButtonPtr = (ZKButton*)findControlByID(ID_COLOR_ContactButton);
+    mColorButtonPtr = (ZKButton*)findControlByID(ID_COLOR_ColorButton);
+	mActivityPtr = this;
+	onUI_init();
+  registerProtocolDataUpdateListener(onProtocolDataUpdate);
+  rigesterActivityTimer();
+}
+
+void colorActivity::onClick(ZKBase *pBase) {
+	//TODO: add widget onClik code 
+    int buttonTablen = sizeof(sButtonCallbackTab) / sizeof(S_ButtonCallback);
+    for (int i = 0; i < buttonTablen; ++i) {
+        if (sButtonCallbackTab[i].id == pBase->getID()) {
+            if (sButtonCallbackTab[i].callback((ZKButton*)pBase)) {
+            	return;
+            }
+            break;
+        }
+    }
+
+
+    int len = sizeof(sAppInfoTab) / sizeof(sAppInfoTab[0]);
+    for (int i = 0; i < len; ++i) {
+        if (sAppInfoTab[i].id == pBase->getID()) {
+            EASYUICONTEXT->openActivity(sAppInfoTab[i].pApp);
+            return;
+        }
+    }
+
+	Activity::onClick(pBase);
+}
+
+void colorActivity::onResume() {
+	Activity::onResume();
+	EASYUICONTEXT->registerGlobalTouchListener(this);
+	startVideoLoopPlayback();
+	onUI_show();
+}
+
+void colorActivity::onPause() {
+	Activity::onPause();
+	EASYUICONTEXT->unregisterGlobalTouchListener(this);
+	stopVideoLoopPlayback();
+	onUI_hide();
+}
+
+void colorActivity::onIntent(const Intent *intentPtr) {
+	Activity::onIntent(intentPtr);
+	onUI_intent(intentPtr);
+}
+
+bool colorActivity::onTimer(int id) {
+	return onUI_Timer(id);
+}
+
+void colorActivity::onProgressChanged(ZKSeekBar *pSeekBar, int progress){
+
+    int seekBarTablen = sizeof(SZKSeekBarCallbackTab) / sizeof(S_ZKSeekBarCallback);
+    for (int i = 0; i < seekBarTablen; ++i) {
+        if (SZKSeekBarCallbackTab[i].id == pSeekBar->getID()) {
+            SZKSeekBarCallbackTab[i].callback(pSeekBar, progress);
+            break;
+        }
+    }
+}
+
+int colorActivity::getListItemCount(const ZKListView *pListView) const{
+    int tablen = sizeof(SListViewFunctionsCallbackTab) / sizeof(S_ListViewFunctionsCallback);
+    for (int i = 0; i < tablen; ++i) {
+        if (SListViewFunctionsCallbackTab[i].id == pListView->getID()) {
+            return SListViewFunctionsCallbackTab[i].getListItemCountCallback(pListView);
+            break;
+        }
+    }
+    return 0;
+}
+
+void colorActivity::obtainListItemData(ZKListView *pListView,ZKListView::ZKListItem *pListItem, int index){
+    int tablen = sizeof(SListViewFunctionsCallbackTab) / sizeof(S_ListViewFunctionsCallback);
+    for (int i = 0; i < tablen; ++i) {
+        if (SListViewFunctionsCallbackTab[i].id == pListView->getID()) {
+            SListViewFunctionsCallbackTab[i].obtainListItemDataCallback(pListView, pListItem, index);
+            break;
+        }
+    }
+}
+
+void colorActivity::onItemClick(ZKListView *pListView, int index, int id){
+    int tablen = sizeof(SListViewFunctionsCallbackTab) / sizeof(S_ListViewFunctionsCallback);
+    for (int i = 0; i < tablen; ++i) {
+        if (SListViewFunctionsCallbackTab[i].id == pListView->getID()) {
+            SListViewFunctionsCallbackTab[i].onItemClickCallback(pListView, index, id);
+            break;
+        }
+    }
+}
+
+void colorActivity::onSlideItemClick(ZKSlideWindow *pSlideWindow, int index) {
+    int tablen = sizeof(SSlideWindowItemClickCallbackTab) / sizeof(S_SlideWindowItemClickCallback);
+    for (int i = 0; i < tablen; ++i) {
+        if (SSlideWindowItemClickCallbackTab[i].id == pSlideWindow->getID()) {
+            SSlideWindowItemClickCallbackTab[i].onSlideItemClickCallback(pSlideWindow, index);
+            break;
+        }
+    }
+}
+
+bool colorActivity::onTouchEvent(const MotionEvent &ev) {
+    return oncolorActivityTouchEvent(ev);
+}
+
+void colorActivity::onTextChanged(ZKTextView *pTextView, const std::string &text) {
+    int tablen = sizeof(SEditTextInputCallbackTab) / sizeof(S_EditTextInputCallback);
+    for (int i = 0; i < tablen; ++i) {
+        if (SEditTextInputCallbackTab[i].id == pTextView->getID()) {
+            SEditTextInputCallbackTab[i].onEditTextChangedCallback(text);
+            break;
+        }
+    }
+}
+
+void colorActivity::rigesterActivityTimer() {
+    int tablen = sizeof(REGISTER_ACTIVITY_TIMER_TAB) / sizeof(S_ACTIVITY_TIMEER);
+    for (int i = 0; i < tablen; ++i) {
+        S_ACTIVITY_TIMEER temp = REGISTER_ACTIVITY_TIMER_TAB[i];
+        registerTimer(temp.id, temp.time);
+    }
+}
+
+
+void colorActivity::onVideoPlayerMessage(ZKVideoView *pVideoView, int msg) {
+    int tablen = sizeof(SVideoViewCallbackTab) / sizeof(S_VideoViewCallback);
+    for (int i = 0; i < tablen; ++i) {
+        if (SVideoViewCallbackTab[i].id == pVideoView->getID()) {
+        	if (SVideoViewCallbackTab[i].loop) {
+                //循环播放
+        		videoLoopPlayback(pVideoView, msg, i);
+        	} else if (SVideoViewCallbackTab[i].onVideoViewCallback != NULL){
+        	    SVideoViewCallbackTab[i].onVideoViewCallback(pVideoView, msg);
+        	}
+            break;
+        }
+    }
+}
+
+void colorActivity::videoLoopPlayback(ZKVideoView *pVideoView, int msg, size_t callbackTabIndex) {
+
+	switch (msg) {
+	case ZKVideoView::E_MSGTYPE_VIDEO_PLAY_STARTED:
+		LOGD("ZKVideoView::E_MSGTYPE_VIDEO_PLAY_STARTED\n");
+    if (callbackTabIndex >= (sizeof(SVideoViewCallbackTab)/sizeof(S_VideoViewCallback))) {
+      break;
+    }
+		pVideoView->setVolume(SVideoViewCallbackTab[callbackTabIndex].defaultvolume / 10.0);
+		mVideoLoopErrorCount = 0;
+		break;
+	case ZKVideoView::E_MSGTYPE_VIDEO_PLAY_ERROR:
+		/**错误处理 */
+		++mVideoLoopErrorCount;
+		if (mVideoLoopErrorCount > 100) {
+			LOGD("video loop error counts > 100, quit loop playback !");
+            break;
+		} //不用break, 继续尝试播放下一个
+	case ZKVideoView::E_MSGTYPE_VIDEO_PLAY_COMPLETED:
+		LOGD("ZKVideoView::E_MSGTYPE_VIDEO_PLAY_COMPLETED\n");
+        std::vector<std::string> videolist;
+        std::string fileName(getAppName());
+        if (fileName.size() < 4) {
+             LOGD("getAppName size < 4, ignore!");
+             break;
+        }
+        fileName = fileName.substr(0, fileName.length() - 4) + "_video_list.txt";
+        fileName = "/mnt/extsd/" + fileName;
+        if (!parseVideoFileList(fileName.c_str(), videolist)) {
+            LOGD("parseVideoFileList failed !");
+		    break;
+        }
+		if (pVideoView && !videolist.empty()) {
+			mVideoLoopIndex = (mVideoLoopIndex + 1) % videolist.size();
+			pVideoView->play(videolist[mVideoLoopIndex].c_str());
+		}
+		break;
+	}
+}
+
+void colorActivity::startVideoLoopPlayback() {
+    int tablen = sizeof(SVideoViewCallbackTab) / sizeof(S_VideoViewCallback);
+    for (int i = 0; i < tablen; ++i) {
+    	if (SVideoViewCallbackTab[i].loop) {
+    		ZKVideoView* videoView = (ZKVideoView*)findControlByID(SVideoViewCallbackTab[i].id);
+    		if (!videoView) {
+    			return;
+    		}
+    		//循环播放
+    		videoLoopPlayback(videoView, ZKVideoView::E_MSGTYPE_VIDEO_PLAY_COMPLETED, i);
+    		return;
+    	}
+    }
+}
+
+void colorActivity::stopVideoLoopPlayback() {
+    int tablen = sizeof(SVideoViewCallbackTab) / sizeof(S_VideoViewCallback);
+    for (int i = 0; i < tablen; ++i) {
+    	if (SVideoViewCallbackTab[i].loop) {
+    		ZKVideoView* videoView = (ZKVideoView*)findControlByID(SVideoViewCallbackTab[i].id);
+    		if (!videoView) {
+    			return;
+    		}
+    		if (videoView->isPlaying()) {
+    		    videoView->stop();
+    		}
+    		return;
+    	}
+    }
+}
+
+bool colorActivity::parseVideoFileList(const char *pFileListPath, std::vector<string>& mediaFileList) {
+	mediaFileList.clear();
+	if (NULL == pFileListPath || 0 == strlen(pFileListPath)) {
+        LOGD("video file list is null!");
+		return false;
+	}
+
+	ifstream is(pFileListPath, ios_base::in);
+	if (!is.is_open()) {
+		LOGD("cann't open file %s \n", pFileListPath);
+		return false;
+	}
+	char tmp[1024] = {0};
+	while (is.getline(tmp, sizeof(tmp))) {
+		string str = tmp;
+		removeCharFromString(str, '\"');
+		removeCharFromString(str, '\r');
+		removeCharFromString(str, '\n');
+		if (str.size() > 1) {
+     		mediaFileList.push_back(str.c_str());
+		}
+	}
+  LOGD("(f:%s, l:%d) parse fileList[%s], get [%d]files", __FUNCTION__,
+      __LINE__, pFileListPath, int(mediaFileList.size()));
+  for (std::vector<string>::size_type i = 0; i < mediaFileList.size(); i++) {
+    LOGD("file[%u]:[%s]", ::size_t(i), mediaFileList[i].c_str());
+  }
+	is.close();
+
+	return true;
+}
+
+int colorActivity::removeCharFromString(string& nString, char c) {
+    string::size_type   pos;
+    while(1) {
+        pos = nString.find(c);
+        if(pos != string::npos) {
+            nString.erase(pos, 1);
+        } else {
+            break;
+        }
+    }
+    return (int)nString.size();
+}
+
+void colorActivity::registerUserTimer(int id, int time) {
+	registerTimer(id, time);
+}
+
+void colorActivity::unregisterUserTimer(int id) {
+	unregisterTimer(id);
+}
+
+void colorActivity::resetUserTimer(int id, int time) {
+	resetTimer(id, time);
+}

+ 103 - 0
jni/activity/colorActivity.h

@@ -0,0 +1,103 @@
+/***********************************************
+/gen auto by zuitools
+***********************************************/
+#ifndef __COLORACTIVITY_H__
+#define __COLORACTIVITY_H__
+
+
+#include "app/Activity.h"
+#include "entry/EasyUIContext.h"
+
+#include "uart/ProtocolData.h"
+#include "uart/ProtocolParser.h"
+
+#include "utils/Log.h"
+#include "control/ZKDigitalClock.h"
+#include "control/ZKPainter.h"
+#include "control/ZKButton.h"
+#include "control/ZKCircleBar.h"
+#include "control/ZKDiagram.h"
+#include "control/ZKListView.h"
+#include "control/ZKPointer.h"
+#include "control/ZKQRCode.h"
+#include "control/ZKTextView.h"
+#include "control/ZKSeekBar.h"
+#include "control/ZKEditText.h"
+#include "control/ZKVideoView.h"
+#include "window/ZKSlideWindow.h"
+
+/*TAG:Macro宏ID*/
+#define ID_COLOR_BackButton    20004
+#define ID_COLOR_ColorPainter    52001
+#define ID_COLOR_ContactWindow    110001
+#define ID_COLOR_sys_back   100
+#define ID_COLOR_ContactButton    20002
+#define ID_COLOR_ColorButton    20001
+/*TAG:Macro宏ID END*/
+
+class colorActivity : public Activity, 
+                     public ZKSeekBar::ISeekBarChangeListener, 
+                     public ZKListView::IItemClickListener,
+                     public ZKListView::AbsListAdapter,
+                     public ZKSlideWindow::ISlideItemClickListener,
+                     public EasyUIContext::ITouchListener,
+                     public ZKEditText::ITextChangeListener,
+                     public ZKVideoView::IVideoPlayerMessageListener
+{
+public:
+    colorActivity();
+    virtual ~colorActivity();
+
+    /**
+     * 注册定时器
+     */
+	void registerUserTimer(int id, int time);
+	/**
+	 * 取消定时器
+	 */
+	void unregisterUserTimer(int id);
+	/**
+	 * 重置定时器
+	 */
+	void resetUserTimer(int id, int time);
+
+protected:
+    /*TAG:PROTECTED_FUNCTION*/
+    virtual const char* getAppName() const;
+    virtual void onCreate();
+    virtual void onClick(ZKBase *pBase);
+    virtual void onResume();
+    virtual void onPause();
+    virtual void onIntent(const Intent *intentPtr);
+    virtual bool onTimer(int id);
+
+    virtual void onProgressChanged(ZKSeekBar *pSeekBar, int progress);
+
+    virtual int getListItemCount(const ZKListView *pListView) const;
+    virtual void obtainListItemData(ZKListView *pListView, ZKListView::ZKListItem *pListItem, int index);
+    virtual void onItemClick(ZKListView *pListView, int index, int subItemIndex);
+
+    virtual void onSlideItemClick(ZKSlideWindow *pSlideWindow, int index);
+
+    virtual bool onTouchEvent(const MotionEvent &ev);
+
+    virtual void onTextChanged(ZKTextView *pTextView, const string &text);
+
+    void rigesterActivityTimer();
+
+    virtual void onVideoPlayerMessage(ZKVideoView *pVideoView, int msg);
+    void videoLoopPlayback(ZKVideoView *pVideoView, int msg, size_t callbackTabIndex);
+    void startVideoLoopPlayback();
+    void stopVideoLoopPlayback();
+    bool parseVideoFileList(const char *pFileListPath, std::vector<string>& mediaFileList);
+    int removeCharFromString(string& nString, char c);
+
+
+private:
+    /*TAG:PRIVATE_VARIABLE*/
+    int mVideoLoopIndex;
+    int mVideoLoopErrorCount;
+
+};
+
+#endif

+ 4 - 0
jni/activity/sipTestActivity.cpp

@@ -4,6 +4,7 @@
 #include "sipTestActivity.h"
 
 /*TAG:GlobalVariable全局变量*/
+static ZKButton* mColorTestButtonPtr;
 static ZKTextView* mRecordTestTextViewPtr;
 static ZKButton* mRecordTestButtonPtr;
 static ZKCheckBox* mPanelCallKeysCheckboxPtr;
@@ -49,6 +50,7 @@ typedef struct {
 
 /*TAG:ButtonCallbackTab按键映射表*/
 static S_ButtonCallback sButtonCallbackTab[] = {
+    ID_SIPTEST_ColorTestButton, onButtonClick_ColorTestButton,
     ID_SIPTEST_RecordTestButton, onButtonClick_RecordTestButton,
     ID_SIPTEST_sys_back, onButtonClick_sys_back,
     ID_SIPTEST_CallButton, onButtonClick_CallButton,
@@ -134,6 +136,7 @@ sipTestActivity::~sipTestActivity() {
     EASYUICONTEXT->unregisterGlobalTouchListener(this);
     onUI_quit();
     unregisterProtocolDataUpdateListener(onProtocolDataUpdate);
+    mColorTestButtonPtr = NULL;
     mRecordTestTextViewPtr = NULL;
     mRecordTestButtonPtr = NULL;
     mPanelCallKeysCheckboxPtr = NULL;
@@ -152,6 +155,7 @@ const char* sipTestActivity::getAppName() const{
 //TAG:onCreate
 void sipTestActivity::onCreate() {
 	Activity::onCreate();
+    mColorTestButtonPtr = (ZKButton*)findControlByID(ID_SIPTEST_ColorTestButton);
     mRecordTestTextViewPtr = (ZKTextView*)findControlByID(ID_SIPTEST_RecordTestTextView);
     mRecordTestButtonPtr = (ZKButton*)findControlByID(ID_SIPTEST_RecordTestButton);
     mPanelCallKeysCheckboxPtr = (ZKCheckBox*)findControlByID(ID_SIPTEST_PanelCallKeysCheckbox);if(mPanelCallKeysCheckboxPtr!= NULL){mPanelCallKeysCheckboxPtr->setCheckedChangeListener(this);}

+ 1 - 0
jni/activity/sipTestActivity.h

@@ -27,6 +27,7 @@
 #include "window/ZKSlideWindow.h"
 
 /*TAG:Macro宏ID*/
+#define ID_SIPTEST_ColorTestButton    20004
 #define ID_SIPTEST_RecordTestTextView    50005
 #define ID_SIPTEST_RecordTestButton    20002
 #define ID_SIPTEST_PanelCallKeysCheckbox    21002

+ 202 - 0
jni/logic/colorLogic.cc

@@ -0,0 +1,202 @@
+#pragma once
+#include "uart/ProtocolSender.h"
+/*
+*此文件由GUI工具生成
+*文件功能:用于处理用户的逻辑相应代码
+*功能说明:
+*========================onButtonClick_XXXX
+当页面中的按键按下后系统会调用对应的函数,XXX代表GUI工具里面的[ID值]名称,
+如Button1,当返回值为false的时候系统将不再处理这个按键,返回true的时候系统将会继续处理此按键。比如SYS_BACK.
+*========================onSlideWindowItemClick_XXXX(int index) 
+当页面中存在滑动窗口并且用户点击了滑动窗口的图标后系统会调用此函数,XXX代表GUI工具里面的[ID值]名称,
+如slideWindow1;index 代表按下图标的偏移值
+*========================onSeekBarChange_XXXX(int progress) 
+当页面中存在滑动条并且用户改变了进度后系统会调用此函数,XXX代表GUI工具里面的[ID值]名称,
+如SeekBar1;progress 代表当前的进度值
+*========================ogetListItemCount_XXXX() 
+当页面中存在滑动列表的时候,更新的时候系统会调用此接口获取列表的总数目,XXX代表GUI工具里面的[ID值]名称,
+如List1;返回值为当前列表的总条数
+*========================oobtainListItemData_XXXX(ZKListView::ZKListItem *pListItem, int index)
+ 当页面中存在滑动列表的时候,更新的时候系统会调用此接口获取列表当前条目下的内容信息,XXX代表GUI工具里面的[ID值]名称,
+如List1;pListItem 是贴图中的单条目对象,index是列表总目的偏移量。具体见函数说明
+*========================常用接口===============
+*LOGD(...)  打印调试信息的接口
+*mTextXXXPtr->setText("****") 在控件TextXXX上显示文字****
+*mButton1Ptr->setSelected(true); 将控件mButton1设置为选中模式,图片会切换成选中图片,按钮文字会切换为选中后的颜色
+*mSeekBarPtr->setProgress(12) 在控件mSeekBar上将进度调整到12
+*mListView1Ptr->refreshListView() 让mListView1 重新刷新,当列表数据变化后调用
+*mDashbroadView1Ptr->setTargetAngle(120) 在控件mDashbroadView1上指针显示角度调整到120度
+*
+* 在Eclipse编辑器中  使用 “alt + /”  快捷键可以打开智能提示
+*/
+
+int color = 0;
+bool contactShow = false;
+
+/**
+ * 注册定时器
+ * 填充数组用于注册定时器
+ * 注意:id不能重复
+ */
+static S_ACTIVITY_TIMEER REGISTER_ACTIVITY_TIMER_TAB[] = {
+	//{0,  6000}, //定时器id=0, 时间间隔6秒
+	//{1,  1000},
+};
+
+/**
+ * 当界面构造时触发
+ */
+static void onUI_init(){
+    //Tips :添加 UI初始化的显示代码到这里,如:mText1Ptr->setText("123");
+	mColorPainterPtr->setLineWidth(1);
+	mColorPainterPtr->setSourceColor(0xFF000000);
+
+}
+
+/**
+ * 当切换到该界面时触发
+ */
+static void onUI_intent(const Intent *intentPtr) {
+    if (intentPtr != NULL) {
+        //TODO
+    }
+}
+
+/*
+ * 当界面显示时触发
+ */
+static void onUI_show() {
+	EASYUICONTEXT->hideNaviBar();
+	EASYUICONTEXT->hideStatusBar();
+
+	color = 0;
+	contactShow = false;
+}
+
+/*
+ * 当界面隐藏时触发
+ */
+static void onUI_hide() {
+
+}
+
+/*
+ * 当界面完全退出时触发
+ */
+static void onUI_quit() {
+	EASYUICONTEXT->showStatusBar();
+
+}
+
+/**
+ * 串口数据回调接口
+ */
+static void onProtocolDataUpdate(const SProtocolData &data) {
+
+}
+
+/**
+ * 定时器触发函数
+ * 不建议在此函数中写耗时操作,否则将影响UI刷新
+ * 参数: id
+ *         当前所触发定时器的id,与注册时的id相同
+ * 返回值: true
+ *             继续运行当前定时器
+ *         false
+ *             停止运行当前定时器
+ */
+static bool onUI_Timer(int id){
+	switch (id) {
+
+		default:
+			break;
+	}
+    return true;
+}
+
+/**
+ * 有新的触摸事件时触发
+ * 参数:ev
+ *         新的触摸事件
+ * 返回值:true
+ *            表示该触摸事件在此被拦截,系统不再将此触摸事件传递到控件上
+ *         false
+ *            触摸事件将继续传递到控件上
+ */
+static bool oncolorActivityTouchEvent(const MotionEvent &ev) {
+    switch (ev.mActionStatus) {
+		case MotionEvent::E_ACTION_DOWN://触摸按下
+			//LOGD("时刻 = %ld 坐标  x = %d, y = %d", ev.mEventTime, ev.mX, ev.mY);
+			if (contactShow) {
+				mColorPainterPtr->fillRect(ev.mX - 4, ev.mY - 4, 8, 8);
+			}
+			break;
+		case MotionEvent::E_ACTION_MOVE://触摸滑动
+			if (contactShow) {
+				mColorPainterPtr->fillRect(ev.mX - 4, ev.mY - 4, 8, 8);
+			}
+			break;
+		case MotionEvent::E_ACTION_UP:  //触摸抬起
+			break;
+		default:
+			break;
+	}
+	return false;
+}
+
+static bool onButtonClick_ColorButton(ZKButton *pButton) {
+    LOGD(" ButtonClick ColorButton !!!\n");
+    if (color == 1) {
+    	color += 1;
+    	mColorButtonPtr->setBgStatusColor(ZK_CONTROL_STATUS_NORMAL, 0xFFFFFF00);
+    }
+    else if (color == 2) {
+    	color += 1;
+    	mColorButtonPtr->setBgStatusColor(ZK_CONTROL_STATUS_NORMAL, 0xFFFF0000);
+    }
+    else if (color == 3) {
+    	color += 1;
+    	mColorButtonPtr->setBgStatusColor(ZK_CONTROL_STATUS_NORMAL, 0xFF0000FF);
+    }
+    else if (color == 4) {
+    	color += 1;
+    	mColorButtonPtr->setBgStatusColor(ZK_CONTROL_STATUS_NORMAL, 0xFF00FFFF);
+    }
+    else if (color == 5) {
+    	color += 1;
+    	mColorButtonPtr->setBgStatusColor(ZK_CONTROL_STATUS_NORMAL, 0xFF008000);
+    }
+    else if (color == 6) {
+    	color += 1;
+    	mColorButtonPtr->setBgStatusColor(ZK_CONTROL_STATUS_NORMAL, 0xFF800080);
+    }
+    else if (color == 7) {
+    	color = 0;
+    	mColorButtonPtr->setBgStatusColor(ZK_CONTROL_STATUS_NORMAL, 0xFF000000);
+    }
+    else {
+    	color += 1;
+    	mColorButtonPtr->setBgStatusColor(ZK_CONTROL_STATUS_NORMAL, 0xFFFFFFFF);
+    }
+    return false;
+}
+
+static bool onButtonClick_ContactButton(ZKButton *pButton) {
+    LOGD(" ButtonClick ContactButton !!!\n");
+    mContactWindowPtr->showWnd();
+    contactShow = true;
+    return false;
+}
+
+static bool onButtonClick_sys_back(ZKButton *pButton) {
+    LOGD(" ButtonClick sys_back !!!\n");
+    return false;
+}
+
+static bool onButtonClick_BackButton(ZKButton *pButton) {
+    LOGD(" ButtonClick BackButton !!!\n");
+    mContactWindowPtr->hideWnd();
+    mColorPainterPtr->erase(0, 0, 1024,600);
+    contactShow = false;
+    return false;
+}

+ 5 - 0
jni/logic/sipTestLogic.cc

@@ -302,3 +302,8 @@ static bool onButtonClick_RecordTestButton(ZKButton *pButton) {
 static void onCheckedChanged_PanelCallKeysCheckbox(ZKCheckBox* pCheckBox, bool isChecked) {
     LOGD(" Checkbox PanelCallKeysCheckbox checked %d", isChecked);
 }
+static bool onButtonClick_ColorTestButton(ZKButton *pButton) {
+    LOGD(" ButtonClick ColorTestButton !!!\n");
+    EASYUICONTEXT->openActivity("colorActivity");
+    return false;
+}

+ 2 - 2
jni/service/BusinessConfig.h

@@ -51,8 +51,8 @@
 #define STORE_SCREEN_LIGHT "screen_light"
 #define SIGNAL_TYPE "TCP" //TCP,SIP
 
-static std::string version = "v1.0.28";
-static int versionNo = 28;
+static std::string version = "v1.0.29";
+static int versionNo = 29;
 static std::string serverIP = "172.28.100.100";
 static std::string tcpIP = "172.28.100.100";
 static int serverHttpPort = 8006;

BIN
libs/armeabi/libzkgui.so


BIN
obj/activity/DeviceUpdateActivity.o


BIN
obj/activity/callActivity.o


BIN
obj/activity/colorActivity.o


BIN
obj/activity/mainActivity.o


BIN
obj/activity/sipTestActivity.o


BIN
obj/activity/startActivity.o


BIN
obj/activity/statusbar.o


BIN
obj/activity/ui3Activity.o


BIN
obj/activity/warnActivity.o


BIN
obj/core/update_assistant.o


BIN
obj/net/tcp_client.o


BIN
obj/server/http_server.o


BIN
obj/service/BusinessConfig.o


BIN
obj/service/time.o


BIN
ui/color.ftu


BIN
ui/sipTest.ftu