Source Code|Cloud Tags

Source Code|Cloud Tags

Source code introduction: cloud tag deletion, addition, beautiful style

Download address: http://download..com/data/2194855

Source code effect:

Source code snippet:

  1. package com.niceapp.lib.tagview;
  2.   
  3. import java.util.ArrayList;
  4. import java.util.List;
  5.   
  6. import android.app.Activity;
  7. import android.os.Bundle;
  8. import android.widget.TextView;
  9. import android.widget.Toast;
  10.   
  11. import com.niceapp.lib.tagview.widget.Tag;
  12. import com.niceapp.lib.tagview.widget.TagListView;
  13. import com.niceapp.lib.tagview.widget.TagListView.OnDelClickListener;
  14. import com.niceapp.lib.tagview.widget.TagListView.OnTagClickListener;
  15. import com.niceapp.lib.tagview.widget.TagView;
  16.   
  17. public   class MainActivity extends Activity {
  18.   
  19. private TagListView mTagListView;
  20. private   final List<tag> mTags = new ArrayList<tag>();
  21. private   final String[] titles = { "Safety Essentials" , "Music" , "Parenting" , "Essentials for Office Workers" , "360 Mobile Guard" ,
  22. "QQ" , "input method" , "WeChat" , "most beautiful application" , "AndevUI" , "Mogujie" , "add" };
  23.   
  24. @Override  
  25. protected   void onCreate(Bundle savedInstanceState) {
  26. super .onCreate(savedInstanceState);
  27. setContentView(R.layout.select_tag_activity);
  28.   
  29. mTagListView = (TagListView) findViewById(R.id.tagview);
  30. // mTagListView.setTagViewTextColorRes(Color.parseColor("#ff999999"));  
  31. // mTagListView.setDeleteMode(true);  
  32. setUpData();
  33. mTagListView.setTags(mTags);
  34. mTagListView.setOnTagClickListener( new OnTagClickListener() {
  35.   
  36. @Override  
  37. public   void onTagClick(TagView tagView, Tag tag) {
  38. // TODO Auto-generated method stub  
  39. Toast.makeText(getApplicationContext(), tag.getTitle(),
  40. Toast.LENGTH_LONG).show();
  41.   
  42. for (Tag mTag : mTags) {
  43. if (mTag.equals(tag)) {
  44. mTag.setChecked( true );
  45. } else {
  46. mTag.setChecked( false );
  47. }
  48. }
  49. mTagListView.setTags(mTags);
  50. }
  51. });
  52. mTagListView.setOnDelClickListener( new OnDelClickListener() {
  53.   
  54. @Override  
  55. public   void onDelClick(TextView textView, Tag tag) {
  56. // TODO Auto-generated method stub  
  57. Toast.makeText(MainActivity. this , "Delete" + tag.getTitle(),
  58. Toast.LENGTH_LONG).show();
  59. }
  60. });
  61. }
  62.   
  63. private   void setUpData() {
  64. for ( int i = 0 ; i < titles.length; i++) {
  65. Tag tag = new Tag();
  66. tag.setId(i);
  67. if (i % 2 == 0 ) {
  68. tag.setChecked( true );
  69. } else {
  70. tag.setChecked( false );
  71. }
  72. if (titles[i].equals( "Add" )) {
  73. tag.setShowDel( false );
  74. }
  75. tag.setTitle(titles[i]);
  76. mTags.add(tag);
  77. }
  78. }
  79. }
  80. </tag></tag>

<<:  Source code | Uber's welcome screen

>>:  Many apps ignore Apple's Human Interface Guidelines details

Recommend

Marketing hotspots and advertising suggestions in August!

Chinese Valentine's Day, the start of the sch...

Restoring Lei Jun's territory: ecological integration becomes more intense

The Xiaomi group - and to go further - the Lei Ju...

Why did Xunlei’s market value shrink by nearly 2.2 billion after its listing?

Although you are listed, your continued decline h...

Have you ever seen the golden lotus blooming from the soil?

The second chapter of "Journey to the West&q...

iOS 13 revealed: Dark mode, undo gesture, new volume UI

Apple will hold WWDC on June 3 this year and anno...

Regarding event creativity, you need to know these 4 key points

As an operator , perhaps you are occupied by vari...

What are SEM search engine marketing tools?

Baidu Promotion Client is a backend account manag...

Starting from 4 dimensions, let information flow ads accurately reach users

In 2011, Tiwtter launched a new advertising forma...

Why can Mimi Meng be a clickbait headline reader?

As an operator of a public account , I have a lov...

As autumn arrives, rhinitis is reported. How to prevent allergic rhinitis?

Review expert: Yuan Xiandao, deputy chief physici...