码迷,mamicode.com
首页 > 移动开发 > 详细

SkylineGlobe 移动端开发测试

时间:2015-12-04 18:03:25      阅读:184      评论:0      收藏:0      [点我收藏+]

标签:

基于SkylineGlobe提供的安卓版本SDK,在已有菜单中增加自定义内容,测试代码如下:

新增加文件ZhaoHeContainer.java

package com.skyline.terraexplorer.tools;

import java.util.concurrent.Callable;

import android.widget.Toast;

import com.skyline.teapi.IFeatureLayer;
import com.skyline.teapi.ISGWorld;
import com.skyline.terraexplorer.R;
import com.skyline.terraexplorer.TEApp;
import com.skyline.terraexplorer.models.MenuEntry;
import com.skyline.terraexplorer.models.UI;

public class ZhaoHeContainer extends BaseToolWithContainer  {
	@Override
	public MenuEntry getMenuEntry() {
		return MenuEntry.createFor(this, R.string.zhaohe_tool, R.drawable.navigate_plus, 80);
	}
	@Override
	public boolean onBeforeOpenToolContainer() {
	    toolContainer.setText(String.format("New Tool"));
		toolContainer.addButton(1, R.drawable.label);
		toolContainer.addButton(2, R.drawable.add_polyline);
		toolContainer.addButton(3, R.drawable.add_polygon);
		toolContainer.addButton(4, R.drawable.list);
		return true;
	}
	@Override
	public void onButtonClick(int tag) {
		IFeatureLayer layer = null;
	    switch (tag) {
        case 1:
        	Toast.makeText(TEApp.getAppContext(), "A button 1", Toast.LENGTH_SHORT).show();
            break;
        case 2:
        	Toast.makeText(TEApp.getAppContext(), "A button 2", Toast.LENGTH_SHORT).show();
            break;
        case 3:
        	Toast.makeText(TEApp.getAppContext(), "A button 3", Toast.LENGTH_SHORT).show();
            break;
        case 4: 
        	Toast.makeText(TEApp.getAppContext(), "A button 4", Toast.LENGTH_SHORT).show();
            break;
	    }	    
	}
}

 在ToolManager.java中添加:

registerTool(new ZhaoHeContainer());

 

SkylineGlobe 移动端开发测试

标签:

原文地址:http://www.cnblogs.com/yitianhe/p/5020019.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!