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

Analysis of the account opening process of Douyin Feed

1. What is Feed Flow 1. What is a feed? Feed stre...

Comparison between server memory and normal memory

Server memory is also memory (RAM). There is no o...

CG Zhong Fenghua game scene class video tutorial

CG Zhong Fenghua Game Scene Class Video Tutorial ...

Kuaishou Operation: Kuaishou Merchant Account Certification Process

1. What is Kuaishou Merchant Account? Kuaishou de...

Douyin STOM full-link advertising solution

Today, I will also share with you my experience o...

Why can't you create a knowledge carnival in the Himalayas?

For the platform, creating a nominal "festiv...

My family's jealousy was caused by the dog...

Being jealous is an innate emotion of human being...

Jianfang 3L Strategy Practice Class 2021

Kong Qinlue practical class Momentum main line + ...