watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWluZ3l1ZV8xMTI4/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="">一、自己定义View

  1. public class TagCloudView extends RelativeLayout {
  2. RelativeLayout navigation_bar;
  3. TextView mTextView1;
  4. private final float TOUCH_SCALE_FACTOR = .8f;
  5. private float tspeed;
  6. private TagCloud mTagCloud;
  7. private float mAngleX =0;
  8. private float mAngleY =0;
  9. private float centerX, centerY;
  10. private float radius;
  11. private Context mContext;
  12. private List<TextView> mTextView;
  13. private List<RelativeLayout.LayoutParams> mParams;
  14. private int shiftLeft;
  15. float dowx = 0;
  16. float dowy = 0;
  17. float cutx=100;
  18. float cuty=100;
  19. public TagCloudView(Context mContext, int width, int height, List<Tag> tagList) {
  20. this(mContext, width, height, tagList, 6 , 34, 1);
  21. }
  22. public TagCloudView(Context mContext, int width, int height, List<Tag> tagList,
  23. int textSizeMin, int textSizeMax, int scrollSpeed) {
  24. super(mContext);
  25. this.mContext= mContext;
  26. tspeed = scrollSpeed;
  27. centerX = width / 2;
  28. centerY = height / 2;
  29. radius = Math.min(centerX * 0.95f , centerY * 0.95f );
  30. shiftLeft = (int)(Math.min(centerX * 0.15f , centerY * 0.15f ));
  31. mTagCloud = new TagCloud(tagList, (int) radius , textSizeMin, textSizeMax);
  32. float[] tempColor1 = {0.9412f,0.7686f,0.2f,1}; //rgb Alpha
  33. //{1f,0f,0f,1} red {0.3882f,0.21568f,0.0f,1} orange
  34. //{0.9412f,0.7686f,0.2f,1} light orange
  35. float[] tempColor2 = {1f,0f,0f,1}; //rgb Alpha
  36. //{0f,0f,1f,1} blue {0.1294f,0.1294f,0.1294f,1} grey
  37. //{0.9412f,0.7686f,0.2f,1} light orange
  38. mTagCloud.setTagColor1(tempColor1);//higher color
  39. mTagCloud.setTagColor2(tempColor2);//lower color
  40. mTagCloud.setRadius((int) radius);
  41. mTagCloud.create(true);
  42. mTagCloud.setAngleX(mAngleX);
  43. mTagCloud.setAngleY(mAngleY);
  44. mTagCloud.update();
  45. mTextView = new ArrayList<TextView>();
  46. mParams = new ArrayList<RelativeLayout.LayoutParams>();
  47. Iterator<?> it=mTagCloud.iterator();
  48. Tag tempTag;
  49. int i=0;
  50. //取出每一个数据放到TexView里
  51. while (it.hasNext()){
  52. tempTag= (Tag) it.next();
  53. tempTag.setParamNo(i);
  54. mTextView.add(new TextView(this.mContext));
  55. mTextView.get(i).setText(tempTag.getText());
  56. mParams.add(new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
  57. mParams.get(i).addRule(RelativeLayout.ALIGN_PARENT_LEFT);
  58. mParams.get(i).addRule(RelativeLayout.ALIGN_PARENT_TOP);
  59. mParams.get(i).setMargins((int) (centerX -shiftLeft + tempTag.getLoc2DX()),(int) (centerY + tempTag.getLoc2DY()),0,0);
  60. mTextView.get(i).setLayoutParams(mParams.get(i));
  61. mTextView.get(i).setSingleLine(true);
  62. int mergedColor = Color.argb((int)(tempTag.getAlpha() * 255), (int) (tempTag.getColorR() * 255), (int) (tempTag.getColorG() * 255),(int) (tempTag.getColorB() * 255));
  63. mTextView.get(i).setTextColor(mergedColor);
  64. mTextView.get(i).setTextSize((int)(tempTag.getTextSize() * tempTag.getScale()));
  65. addView(mTextView.get(i));
  66. mTextView.get(i).setOnClickListener(OnTagClickListener(tempTag.getUrl()));
  67. //设置每一个TexView有自己指定的标签为自己的位置,以便后期操作
  68. mTextView.get(i).setTag(i);
  69. i++;
  70. }
  71. /** 用来自己主动播放的*/
  72. new Timer().schedule(new TimerTask() {
  73.  
  74. @Override
  75. public void run() {
  76. handler.sendEmptyMessage(1);
  77. }
  78. }, 0,200);
  79. }
  80. @SuppressLint("HandlerLeak")
  81. Handler handler=new Handler(){
  82. @Override
  83. public void handleMessage(Message msg) {
  84. super.handleMessage(msg);
  85. mAngleX = (cuty/radius) *tspeed * TOUCH_SCALE_FACTOR;
  86. mAngleY = (-cutx/radius) *tspeed * TOUCH_SCALE_FACTOR;
  87. changPosition();
  88. }
  89. };
  90. @Override
  91. protected void onDraw(Canvas canvas){
  92. super.onDraw(canvas);
  93. }
  94.  
  95. /**
  96. * 触发事件
  97. */
  98. @Override
  99. public boolean onTouchEvent(MotionEvent e) {
  100. switch (e.getAction()) {
  101. case MotionEvent.ACTION_DOWN:
  102. dowx=e.getX();
  103. dowy=e.getY();
  104. break;
  105. case MotionEvent.ACTION_UP:
  106. float upx=e.getX();
  107. float upy=e.getY();
  108. cutx=upx-dowx;
  109. cuty=upy-dowy;
  110. break;
  111. case MotionEvent.ACTION_MOVE:
  112. mAngleX = (cuty/radius) *tspeed * TOUCH_SCALE_FACTOR;
  113. mAngleY = (-cutx/radius) *tspeed * TOUCH_SCALE_FACTOR;
  114. changPosition();
  115. break;
  116. }
  117.  
  118. return true;
  119. }
  120. /**
  121. * 改变位置
  122. */
  123. private void changPosition(){
  124. mTagCloud.setAngleX(mAngleX);
  125. mTagCloud.setAngleY(mAngleY);
  126. mTagCloud.update();
  127. Iterator<?
  128.  
  129. > it=mTagCloud.iterator();
  130. Tag tempTag;
  131. while (it.hasNext()){
  132. tempTag= (Tag) it.next();
  133. mParams.get(tempTag.getParamNo()).setMargins(
  134. (int) (centerX -shiftLeft + tempTag.getLoc2DX()),
  135. (int) (centerY + tempTag.getLoc2DY()),
  136. 0,
  137. 0);
  138. mTextView.get(tempTag.getParamNo()).setTextSize((int)(tempTag.getTextSize() * tempTag.getScale()));
  139. int mergedColor = Color.argb( (int) (tempTag.getAlpha() * 255),
  140. (int) (tempTag.getColorR() * 255),
  141. (int) (tempTag.getColorG() * 255),
  142. (int) (tempTag.getColorB() * 255));
  143. mTextView.get(tempTag.getParamNo()).setTextColor(mergedColor);
  144. mTextView.get(tempTag.getParamNo()).bringToFront();
  145. }
  146.  
  147. }
  148. /**
  149. * 点击事件
  150. * @param url
  151. * @return
  152. */
  153. View.OnClickListener OnTagClickListener(final String url){
  154. return new View.OnClickListener(){
  155. @Override
  156. public void onClick(View v) {
  157.  
  158. }
  159. };
  160. }
  161. }

二、自己定义迭代器

  1. /**
  2. * 自己定义的迭代器
  3. * @author Administrator
  4. *
  5. */
  6. public class TagCloud implements Iterable<Object>{
  7. private List<Tag> tagCloud;
  8. private int radius;
  9. private static final int DEFAULT_RADIUS = 3;
  10. private static final int TEXT_SIZE_MAX = 30 , TEXT_SIZE_MIN= 4;
  11. private static final float[] DEFAULT_COLOR1= { 0.886f, 0.725f, 0.188f, 1f};
  12. private static final float[] DEFAULT_COLOR2= { 0.3f, 0.3f, 0.3f, 1f};
  13. private float[] tagColor1;
  14. private float[] tagColor2;
  15. private int textSizeMax, textSizeMin;
  16. private float sin_mAngleX,cos_mAngleX,sin_mAngleY,cos_mAngleY,sin_mAngleZ,cos_mAngleZ;
  17. private float mAngleZ=0;
  18. private float mAngleX =0;
  19. private float mAngleY =0;
  20. private int size=0;
  21. private int smallest,largest;
  22. private boolean distrEven = true;
  23.  
  24. public TagCloud(){
  25. this(new ArrayList<Tag>());
  26. }
  27. public TagCloud(List<Tag> tags){
  28. this(tags,DEFAULT_RADIUS);
  29. }
  30. public TagCloud(List<Tag> tags, int radius){
  31. this( tags, radius, DEFAULT_COLOR1, DEFAULT_COLOR2, TEXT_SIZE_MIN, TEXT_SIZE_MAX);
  32. }
  33. public TagCloud(List<Tag> tags, int radius,int textSizeMin, int textSizeMax){
  34. this( tags, radius, DEFAULT_COLOR1, DEFAULT_COLOR2, textSizeMin, textSizeMax);
  35. }
  36. public TagCloud(List<Tag> tags, int radius,float[] tagColor1, float[] tagColor2){
  37. this( tags, radius, tagColor1, tagColor2, TEXT_SIZE_MIN, TEXT_SIZE_MAX);
  38. }
  39.  
  40. public TagCloud(List<Tag> tags, int radius, float[] tagColor1, float[] tagColor2,
  41. int textSizeMin, int textSizeMax){
  42. this.tagCloud=tags;
  43. this.radius = radius;
  44. this.tagColor1 = tagColor1;
  45. this.tagColor2 = tagColor2;
  46. this.textSizeMax = textSizeMax;
  47. this.textSizeMin = textSizeMin;
  48. }
  49. /**
  50. * 重写的方法
  51. */
  52. @Override
  53. public Iterator iterator() {
  54. return tagCloud.iterator();
  55. }
  56. /**
  57. * 创建
  58. * @param distrEven
  59. */
  60. public void create(boolean distrEven){
  61. this.distrEven =distrEven;
  62. positionAll(distrEven);
  63. sineCosine( mAngleX, mAngleY, mAngleZ);
  64. updateAll();
  65. smallest = 9999;
  66. largest = 0;
  67. for (int i=0; i< tagCloud.size(); i++){
  68. int j = tagCloud.get(i).getPopularity();
  69. largest = Math.max(largest, j);
  70. smallest = Math.min(smallest, j);
  71. }
  72. Tag tempTag;
  73. for (int i=0; i< tagCloud.size(); i++){
  74. tempTag = tagCloud.get(i);
  75. int j = tempTag.getPopularity();
  76. float percentage = ( smallest == largest ) ?
  77.  
  78. 1.0f : ((float)j-smallest) / ((float)largest-smallest);
  79. float[] tempColor = getColorFromGradient( percentage ); //(rgb Alpha)
  80. int tempTextSize = getTextSizeGradient( percentage );
  81. tempTag.setColorR(tempColor[0]);
  82. tempTag.setColorG(tempColor[1]);
  83. tempTag.setColorB(tempColor[2]);
  84. tempTag.setTextSize(tempTextSize);
  85. }
  86.  
  87. this.size= tagCloud.size();
  88. }
  89. /**
  90. * create创建完,就须要update
  91. */
  92. public void update(){
  93. if( Math.abs(mAngleX) > .1 || Math.abs(mAngleY) > .1 ){
  94. sineCosine( mAngleX, mAngleY, mAngleZ);
  95. updateAll();
  96. }
  97. }
  98. /**
  99. * 计算每一个Tag的
  100. * @param distrEven 是否依据字计算位置 true为是,否则字有覆盖的
  101. */
  102. private void positionAll(boolean distrEven){
  103. double phi = 0;
  104. double theta = 0;
  105. int max = tagCloud.size();
  106. for (int i=1; i<max+1; i++){
  107. if (distrEven){
  108. phi = Math.acos(-1.0 + (2.0*i -1.0)/max);
  109. theta = Math.sqrt(max*Math.PI) * phi;
  110. } else{
  111. phi = Math.random()*(Math.PI);
  112. theta = Math.random()*(2 * Math.PI);
  113. }
  114.  
  115. tagCloud.get(i-1).setLocX((int)( (radius * Math.cos(theta) * Math.sin(phi))));
  116. tagCloud.get(i-1).setLocY((int)(radius * Math.sin(theta) * Math.sin(phi)));
  117. tagCloud.get(i-1).setLocZ((int)(radius * Math.cos(phi)));
  118. }
  119. }
  120. /**
  121. * 更新全部的Tag位置
  122. */
  123. private void updateAll(){
  124. int max = tagCloud.size();
  125. for (int j=0; j<max; j++){
  126. float rx1 = (tagCloud.get(j).getLocX());
  127. float ry1 = (tagCloud.get(j).getLocY()) * cos_mAngleX +
  128. tagCloud.get(j).getLocZ() * -sin_mAngleX;
  129. float rz1 = (tagCloud.get(j).getLocY()) * sin_mAngleX +
  130. tagCloud.get(j).getLocZ() * cos_mAngleX;
  131. float rx2 = rx1 * cos_mAngleY + rz1 * sin_mAngleY;
  132. float ry2 = ry1;
  133. float rz2 = rx1 * -sin_mAngleY + rz1 * cos_mAngleY;
  134. float rx3 = rx2 * cos_mAngleZ + ry2 * -sin_mAngleZ;
  135. float ry3 = rx2 * sin_mAngleZ + ry2 * cos_mAngleZ;
  136. float rz3 = rz2;
  137. tagCloud.get(j).setLocX(rx3);
  138. tagCloud.get(j).setLocY(ry3);
  139. tagCloud.get(j).setLocZ(rz3);
  140. int diameter = 2 * radius;
  141. float per = diameter / (diameter+rz3);
  142. tagCloud.get(j).setLoc2DX((int)(rx3 * per));
  143. tagCloud.get(j).setLoc2DY((int)(ry3 * per));
  144. tagCloud.get(j).setScale(per);
  145. tagCloud.get(j).setAlpha(per / 2);
  146. }
  147. //给Tag排序
  148. Collections.sort(tagCloud);
  149. }
  150. /**
  151. * 计算字体颜色
  152. * @param perc
  153. * @return
  154. */
  155. private float[] getColorFromGradient(float perc){
  156. float[] tempRGB = new float[4];
  157. tempRGB[0] = ( perc * ( tagColor1[0] ) ) + ( (1-perc) * ( tagColor2[0] ) );
  158. tempRGB[1] = ( perc * ( tagColor1[1] ) ) + ( (1-perc) * ( tagColor2[1] ) );
  159. tempRGB[2] = ( perc * ( tagColor1[2] ) ) + ( (1-perc) * ( tagColor2[2] ) );
  160. tempRGB[3] = 1;
  161. return tempRGB;
  162. }
  163. /**
  164. * 计算字体的大小
  165. * @param perc
  166. * @return
  167. */
  168. private int getTextSizeGradient(float perc){
  169. int size;
  170. size = (int)( perc*textSizeMax + (1-perc)*textSizeMin );
  171. return size;
  172. }
  173. /**
  174. * 计算圆形的x y z坐标
  175. * @param mAngleX
  176. * @param mAngleY
  177. * @param mAngleZ
  178. */
  179. private void sineCosine(float mAngleX,float mAngleY,float mAngleZ) {
  180. double degToRad = (Math.PI / 180);
  181. sin_mAngleX= (float) Math.sin( mAngleX * degToRad);
  182. cos_mAngleX= (float) Math.cos( mAngleX * degToRad);
  183. sin_mAngleY= (float) Math.sin( mAngleY * degToRad);
  184. cos_mAngleY= (float) Math.cos( mAngleY * degToRad);
  185. sin_mAngleZ= (float) Math.sin( mAngleZ * degToRad);
  186. cos_mAngleZ= (float) Math.cos( mAngleZ * degToRad);
  187. }
  188. /**
  189. * 下面是get set方法
  190. * @return
  191. */
  192. public int getRadius() {
  193. return radius;
  194. }
  195. public void setRadius(int radius) {
  196. this.radius = radius;
  197. }
  198. public float[] getTagColor1() {
  199. return tagColor1;
  200. }
  201. public void setTagColor1(float[] tagColor) {
  202. this.tagColor1 = tagColor;
  203. }
  204. public float[] getTagColor2() {
  205. return tagColor2;
  206. }
  207. public void setTagColor2(float[] tagColor2) {
  208. this.tagColor2 = tagColor2;
  209. }
  210.  
  211. public float getRvalue(float[] color) {
  212. if (color.length>0)
  213. return color[0];
  214. else
  215. return 0;
  216. }
  217. public float getGvalue(float[] color) {
  218. if (color.length>0)
  219. return color[1];
  220. else
  221. return 0; }
  222. public float getBvalue(float[] color) {
  223. if (color.length>0)
  224. return color[2];
  225. else
  226. return 0; }
  227. public float getAlphaValue(float[] color) {
  228. if (color.length >= 4)
  229. return color[3];
  230. else
  231. return 0;
  232. }
  233. public float getAngleX() {
  234. return mAngleX;
  235. }
  236. public void setAngleX(float mAngleX) {
  237. this.mAngleX = mAngleX;
  238. }
  239. public float getAngleY() {
  240. return mAngleY;
  241. }
  242. public void setAngleY(float mAngleY) {
  243. this.mAngleY = mAngleY;
  244. }
  245. public int getSize() {
  246. return size;
  247. }
  248.  
  249. }

三、自己定义数据

  1. /**
  2. * Comparable接口 能够自己定义排序方式
  3. * @author Administrator
  4. *
  5. */
  6. public class Tag implements Comparable<Tag>{
  7.  
  8. private String text, url;
  9. private int popularity;
  10. private int textSize;
  11. private float locX, locY, locZ;
  12. private float loc2DX, loc2DY;
  13. private float scale;
  14. private float colorR, colorG, colorB, alpha;
  15. private static final int DEFAULT_POPULARITY = 1;
  16. private int paramNo;
  17.  
  18. public Tag(String text, int popularity) {
  19. this(text, 0f, 0f, 0f, 1.0f, popularity, "");
  20. }
  21. public Tag(String text, int popularity, String url) {
  22. this(text, 0f, 0f, 0f, 1.0f, popularity, url);
  23. }
  24. public Tag(String text,float locX, float locY, float locZ) {
  25. this(text, locX, locY, locZ, 1.0f, DEFAULT_POPULARITY, "");
  26. }
  27. public Tag(String text,float locX, float locY, float locZ, float scale) {
  28. this(text, locX, locY, locZ, scale, DEFAULT_POPULARITY, "");
  29. }
  30. public Tag(String text,float locX, float locY, float locZ, float scale, int popularity,
  31. String url) {
  32. this.text = text;
  33. this.locX = locX;
  34. this.locY = locY;
  35. this.locZ = locZ;
  36. this.loc2DX = 0;
  37. this.loc2DY=0;
  38. this.colorR= 0.5f;
  39. this.colorG= 0.5f;
  40. this.colorB= 0.5f;
  41. this.alpha = 1.0f;
  42. this.scale = scale;
  43. this.popularity= popularity;
  44. this.url = url;
  45. }
  46.  
  47. @Override
  48. public int compareTo(Tag another) {
  49. //排序方式
  50. return (int)(another.locZ - locZ);
  51. }
  52.  
  53. public float getLocX() {
  54. return locX;
  55. }
  56. public void setLocX(float locX) {
  57. this.locX = locX;
  58. }
  59. public float getLocY() {
  60. return locY;
  61. }
  62. public void setLocY(float locY) {
  63. this.locY = locY;
  64. }
  65. public float getLocZ() {
  66. return locZ;
  67. }
  68. public void setLocZ(float locZ) {
  69. this.locZ = locZ;
  70. }
  71. public float getScale() {
  72. return scale;
  73. }
  74. public void setScale(float scale) {
  75. this.scale = scale;
  76. }
  77. public String getText() {
  78. return text;
  79. }
  80. public void setText(String text) {
  81. this.text = text;
  82. }
  83. public float getColorR() {
  84. return colorR;
  85. }
  86. public void setColorR(float colorR) {
  87. this.colorR = colorR;
  88. }
  89. public float getColorG() {
  90. return colorG;
  91. }
  92. public void setColorG(float colorG) {
  93. this.colorG = colorG;
  94. }
  95. public float getColorB() {
  96. return colorB;
  97. }
  98. public void setColorB(float colorB) {
  99. this.colorB = colorB;
  100. }
  101. public float getAlpha() {
  102. return alpha;
  103. }
  104. public void setAlpha(float alpha) {
  105. this.alpha = alpha;
  106. }
  107. public int getPopularity() {
  108. return popularity;
  109. }
  110. public void setPopularity(int popularity) {
  111. this.popularity = popularity;
  112. }
  113.  
  114. public int getTextSize() {
  115. return textSize;
  116. }
  117. public void setTextSize(int textSize) {
  118. this.textSize = textSize;
  119. }
  120. public float getLoc2DX() {
  121. return loc2DX;
  122. }
  123. public void setLoc2DX(float loc2dx) {
  124. loc2DX = loc2dx;
  125. }
  126. public float getLoc2DY() {
  127. return loc2DY;
  128. }
  129. public void setLoc2DY(float loc2dy) {
  130. loc2DY = loc2dy;
  131. }
  132. public int getParamNo() {
  133. return paramNo;
  134. }
  135. public void setParamNo(int paramNo) {
  136. this.paramNo = paramNo;
  137. }
  138. public String getUrl() {
  139. return url;
  140. }
  141. public void setUrl(String url) {
  142. this.url = url;
  143. }
  144.  
  145. }

四、调用

  1. private TagCloudView mTagCloudView;
  2. public void onCreate(Bundle savedInstanceState) {
  3. super.onCreate(savedInstanceState);
  4.  
  5. this.requestWindowFeature(Window.FEATURE_NO_TITLE);
  6. getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
  7. WindowManager.LayoutParams.FLAG_FULLSCREEN);
  8.  
  9. Display display = getWindowManager().getDefaultDisplay();
  10. @SuppressWarnings("deprecation")
  11. int width = display.getWidth();
  12. @SuppressWarnings("deprecation")
  13. int height = display.getHeight();
  14. List<Tag> myTagList= createTags();
  15. mTagCloudView = new TagCloudView(this, width, height, myTagList );
  16. setContentView(mTagCloudView);
  17. mTagCloudView.requestFocus();
  18. mTagCloudView.setFocusableInTouchMode(true);
  19.  
  20. }
  21. private List<Tag> createTags(){
  22. List<Tag> tempList = new ArrayList<Tag>();
  23. tempList.add(new Tag("Google", 7, "http://www.google.com"));
  24. tempList.add(new Tag("Yahoo", 3, "www.yahoo.com"));
  25. tempList.add(new Tag("CNN", 4, "www.cnn.com"));
  26. tempList.add(new Tag("MSNBC", 5, "www.msnbc.com"));
  27. tempList.add(new Tag("CNBC", 5, "www.CNBC.com"));
  28. tempList.add(new Tag("Facebook", 7, "www.facebook.com"));
  29. tempList.add(new Tag("Youtube", 3, "www.youtube.com"));
  30. tempList.add(new Tag("BlogSpot", 5, "www.blogspot.com"));
  31. tempList.add(new Tag("Bing", 3, "www.bing.com"));
  32. tempList.add(new Tag("Wikipedia", 8, "www.wikipedia.com"));
  33. tempList.add(new Tag("Twitter", 5, "www.twitter.com"));
  34. tempList.add(new Tag("Msn", 1, "www.msn.com"));
  35. tempList.add(new Tag("Amazon", 3, "www.amazon.com"));
  36. tempList.add(new Tag("Ebay", 7, "www.ebay.com"));
  37. tempList.add(new Tag("LinkedIn", 5, "www.linkedin.com"));
  38. tempList.add(new Tag("Live", 7, "www.live.com"));
  39. tempList.add(new Tag("Microsoft", 3, "www.microsoft.com"));
  40. tempList.add(new Tag("Flicker", 1, "www.flicker.com"));
  41. tempList.add(new Tag("Apple", 5, "www.apple.com"));
  42. tempList.add(new Tag("Paypal", 5, "www.paypal.com"));
  43. tempList.add(new Tag("Craigslist", 7, "www.craigslist.com"));
  44. tempList.add(new Tag("Imdb", 2, "www.imdb.com"));
  45. tempList.add(new Tag("Ask", 4, "www.ask.com"));
  46. tempList.add(new Tag("Weibo", 1, "www.weibo.com"));
  47. tempList.add(new Tag("Tagin!", 8, "http://scyp.idrc.ocad.ca/projects/tagin"));
  48. tempList.add(new Tag("Shiftehfar", 8, "www.shiftehfar.org"));
  49. tempList.add(new Tag("Soso", 5, "www.google.com"));
  50. tempList.add(new Tag("XVideos", 3, "www.xvideos.com"));
  51. tempList.add(new Tag("BBC", 5, "www.bbc.co.uk"));
  52. return tempList;
  53. }

源代码下载地址点击打开链接

Android 3d云标签的更多相关文章

  1. 分享一个3D球面标签云

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  2. Drawable实战解析:Android XML shape 标签使用详解(apk瘦身,减少内存好帮手)

    Android XML shape 标签使用详解   一个android开发者肯定懂得使用 xml 定义一个 Drawable,比如定义一个 rect 或者 circle 作为一个 View 的背景. ...

  3. Android GradientDrawable(shape标签定义) 静态使用和动态使用(圆角,渐变实现)

    Android GradientDrawable使用优势: 1. 快速实现一些基本图形(线,矩形,圆,椭圆,圆环) 2. 快速实现一些圆角,渐变,阴影等效果 3. 代替图片设置为View的背景 4. ...

  4. Android 3D emulation 架构理解

    Android Emulator 给用户提供  GPU on 选项,意思是利用 Host ( 就是执行 Emulator 的PC机) 的 GPU. 当然PC机必须把 OpenGL 的驱动装好 在实现上 ...

  5. android中include标签使用详解

    android中include标签是为了便于控件的覆用的一个很好解决方案.   但是也有一些需要注意的地方,下面是本人在项目中碰到过的一个问题,做此记录,便于以后查看.   include标签用法. ...

  6. Android XML shape 标签使用详解(apk瘦身,减少内存好帮手)

    Android XML shape 标签使用详解   一个android开发者肯定懂得使用 xml 定义一个 Drawable,比如定义一个 rect 或者 circle 作为一个 View 的背景. ...

  7. Android 百度云推送

    http://developer.baidu.com/wiki/index.php?title=docs/cplat/push/sdk/clientsdk. public class DemoAppl ...

  8. TagCloudView云标签的灵活运用

    这两天做了一个项目,发现标签不能更改任意一个标签的字体的颜色,需求如同置前标签,然后就对tagcloudeview稍做修改做了这么一个demo.不为别的,只为以后自己用的时候方便拷贝. 先看效果图:  ...

  9. Android 3D游戏开发

    OpenGL ES(OpenGL Embedded System) Android 3D游戏开发技术宝典:OpenGL ES 2.0(android 3d游戏开发技术宝典 -opengl es 2.0 ...

随机推荐

  1. WinXP系统服务详细列表

    windows XP 系统服务“关闭”详细列表,释放N多内存,128也够用了! 在xp系统中,有近90个服务,默认开启了 30多个服务,而事实上我们只需要其中几个就够用了.禁止所有不必要的服务可以为您 ...

  2. A2DP和AVRCP蓝牙音频传输协议的应用解释

    A2DP全名是Advenced Audio Distribution Profile 蓝牙音频传输模型拹定.A2DP 规定了使用蓝牙非同步传输信道方式,传输高质量音乐文件数据的拹议堆栈软件和使用方法, ...

  3. C++11 thread::detach(2)

    原文地址:http://www.cplusplus.com/reference/thread/thread/detach/ public member function <thread> ...

  4. 由于物化视图定义为on commit导致update更新基表慢的解决方案

    由于物化视图定义为on commit导致update更新基表慢的解决方案 以下是模拟和解决测试过程: (模拟update慢的过程) 1.首先基于基表创建物化视图日志: create materiali ...

  5. WinForm 小程序 NotePad

    运行效果: 代码: using System; using System.Collections.Generic; using System.ComponentModel; using System. ...

  6. BZOJ 1901: Zju2112 Dynamic Rankings( BIT 套 BST )

    BIT 套 splay 其实也是不难...每个 BIT 的结点保存一颗 splay , 询问就二分答案然后判断rank... ------------------------------------- ...

  7. 什么是DNS劫持

    我们知道,某些网络运营商为了某些目的,对DNS进行了某些操作,导致使用ISP的正常上网设置无法通过域名取得正确的IP地址.常用的手段有:DNS劫持和DNS污染. 什么是DNS劫持 DNS劫持就是通过劫 ...

  8. Online SVG to PNG/JPEG/TIFF conversion

    Online SVG to PNG/JPEG/TIFF conversion SVG to raster image conversion

  9. Android中Drawable分类汇总(上)

    Android把可绘制的对象抽象为Drawable,不同的图形图像资源就代表着不同的drawable类型.Android FrameWork提供了一些具体的Drawable实现,通常在代码中都不会直接 ...

  10. 程序集的内部结构(托管模块、元素局、IL代码的分布情况)

    程序集的内部结构 在看程序集的结构之前,我们先来看托管模块的结构. 托管模块由四部分组成:PE32头.CLR头.元数据(Metadata).IL代码.其中PE32头是用来决定托管模块运行的系统环境(3 ...