登录
首页 » Android » Android 支持单选、多选的云标签效果

Android 支持单选、多选的云标签效果

于 2023-01-08 发布 文件大小:1.07 MB
0 174
下载积分: 2 下载次数: 1

代码说明:

本源码演示如何实现一个 支持单癣多选的Android云标签效果,单击对应的操作类型,然后选择标签,多选后标签呈红色。   Label的选择类型NONE、SINGLE、MULTI分别对应不可癣单癣多选等选项,标签文字颜色,标签文字大小,标签背景,标签间隔,标签类型、标签最大选择数量等参数都可以自定义,标签的文字内容存储在label中,Lable通过tag保存自己的位置(position)。具体的效果大家可参见下边的测试截图所示。

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • android短信功能
    android短信功能 核心代码:package cn.edu.siso;import java.util.ArrayList;import java.util.HashMap;import java.util.Iterator;import java.util.List;import javax.xml.parsers.SAXParserFactory;import org.xml.sax.InputSource;import org.xml.sax.XMLReader;import android.app.ListActivity;import android.content.Intent;import android.os.Bundle;import android.view.KeyEvent;import android.view.View;import android.view.Window;import android.widget.Button;import android.widget.ListView;import android.widget.SimpleAdapter;import cn.edu.ContentProvide.Diary.DiaryColumns;import cn.edu.Info.MyInfo;import cn.edu.MyContentHandler.MyContentHandler;import cn.edu.siso.WareHouselistview.SMSBsharpturn;import cn.edu.siso.WareHouselistview.SMSFriendTab;import cn.edu.siso.WareHouselistview.SMSHavefanTab;import cn.edu.siso.WareHouselistview.SMSLoverTab;import cn.edu.siso.WareHouselistview.SMSSchooljoke;import cn.edu.siso.WareHouselistview.SMSapologize;import cn.edu.siso.WareHouselistview.SMShumorjokes;import cn.edu.siso.WareHouselistview.SMSlovewords;import cn.edu.siso.WareHouselistview.SMSmylove;import cn.edu.siso.WareHouselistview.SMSplayful;public class WareHouseActivity extends ListActivity { /** Called when the activity is first created. */ private List mp3Infos=null; private ListView listview; private Button back,updata; public static final String[] PROJECTION = new String[] { DiaryColumns._ID,DiaryColumns.TITLE, DiaryColumns.CREATED }; private Touch touch=new Touch(); @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.warehouse); listview=(ListView) findViewById(android.R.id.list); listview.setScrollingCacheEnabled(false); ShowListView(); back=(Button) findViewById(R.id.back); updata=(Button) findViewById(R.id.updata); back.setOnClickListener(new backlistener()); updata.setOnClickListener(new updatalistener()); back.setOnTouchListener(touch); updata.setOnTouchListener(touch); } private SimpleAdapter budildSimpleAdapter(List mp3Infos){ List list=new ArrayList(); for (Iterator iterator = mp3Infos.iterator(); iterator.hasNext();) { MyInfo mp3Info = (MyInfo) iterator.next(); HashMap map=new HashMap(); map.put("name", mp3Info.getName()); map.put("listimageview", R.drawable.image); list.add(map); } SimpleAdapter listadapter=new SimpleAdapter(this, list, R.layout.textview, new String[]{"name","listimageview"}, new int[]{R.id.houseText,R.id.listimageview}); return listadapter ; } private void ShowListView(){ mp3Infos=pares(R.raw.information); SimpleAdapter listadapter= budildSimpleAdapter(mp3Infos); setListAdapter(listadapter); } public List pares(Object xmlname){ List info=new ArrayList(); try { SAXParserFactory factory=SAXParserFactory.newInstance(); XMLReader reader=factory.newSAXParser().getXMLReader(); MyContentHandler mycontenthandler=new MyContentHandler(info); reader.setContentHandler(mycontenthandler); reader.parse(new InputSource(getResources().openRawResource((Integer) xmlname))); } catch (Exception e) { e.printStackTrace(); } return info; } @Override protected void onListItemClick(ListView l, View v, int position, long id) { // TODO Auto-generated method stub //MyInfo myinfo=mp3Infos.get(position); //System.out.println("myinfo-------" myinfo); Intent intent =new Intent(); switch(position){ case 0: intent.setClass(WareHouseActivity.this, SMSapologize.class); startActivity(intent); break; case 1: intent.setClass(WareHouseActivity.this, SMSmylove.class); startActivity(intent); break; case 2: intent.setClass(WareHouseActivity.this, SMSlovewords.class); startActivity(intent); break; case 3: intent.setClass(WareHouseActivity.this, SMSHavefanTab.class); startActivity(intent); break; case 4: intent.setClass(WareHouseActivity.this, SMSLoverTab.class); startActivity(intent); break; case 5: intent.setClass(WareHouseActivity.this, SMSplayful.class); startActivity(intent); break; case 6: intent.setClass(WareHouseActivity.this, SMSBsharpturn.class); startActivity(intent); break; case 7: intent.setClass(WareHouseActivity.this, SMShumorjokes.class); startActivity(intent); break; case 8: intent.setClass(WareHouseActivity.this, SMSFriendTab.class); startActivity(intent); break; case 9: intent.setClass(WareHouseActivity.this, SMSSchooljoke.class); startActivity(intent); break; case 10: intent.setClass(WareHouseActivity.this, SMSSchooljoke.class); startActivity(intent); break; case 11: intent.setClass(WareHouseActivity.this, SMSSchooljoke.class); startActivity(intent); break; case 12: intent.setClass(WareHouseActivity.this, SMSSchooljoke.class); startActivity(intent); break; case 13: intent.setClass(WareHouseActivity.this, SMSSchooljoke.class); startActivity(intent); break; case 14: intent.setClass(WareHouseActivity.this, SMSSchooljoke.class); startActivity(intent); break; case 15: intent.setClass(WareHouseActivity.this, SMSSchooljoke.class); startActivity(intent); break; case 16: intent.setClass(WareHouseActivity.this, SMSSchooljoke.class); startActivity(intent); break; } super.onListItemClick(l, v, position, id); } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { // TODO Auto-generated method stub if(keyCode==KeyEvent.KEYCODE_BACK&&event.getRepeatCount()==0){ //需要处理 Intent intent =new Intent(); intent.setClass(WareHouseActivity.this, InformationActivityActivity.class); startActivity(intent); finish(); } return false; } class backlistener implements Button.OnClickListener{ @Override public void onClick(View arg0) { // TODO Auto-generated method stub Intent intent = new Intent(); intent.setClass(WareHouseActivity.this,InformationActivityActivity.class); startActivity(intent); finish(); }} class updatalistener implements Button.OnClickListener{ @Override public void onClick(View v) { ShowListView(); }}}
    2014-11-09下载
    积分:1
  • 安卓的日历小软件
    基于安卓系统的一个日历的小软件,功能比较简单,实现了查看时间......简单的功能,希望对于入门安卓的朋友有所帮助
    2022-08-02 21:51:34下载
    积分:1
  • android webrtc
    WebRTC Android端的大体实现过程如下:(在不考虑播放本地视频的情况下) 连接服务器,并通过服务器打通两个客户端的网络通道。 从摄像头和麦克风获取媒体流 。 将本地媒体流通过网络通道传送给对方的客户端 。 渲染播放接收到的媒体流 。
    2022-02-05 21:16:00下载
    积分:1
  • and_client1
    client app for android ticket booking
    2012-05-21 00:35:46下载
    积分:1
  • android 拍照上传 实例源码下载
    android 拍照上传 实例源码下载
    2014-06-19下载
    积分:1
  • Map
    学习Android的map开发,有利于初学者对Android的程序代码有一个比较清晰的理解(Android s development learning map, help beginners on Android s code to have a clearer understanding of)
    2010-05-12 12:16:14下载
    积分:1
  • baofengyingyin
    说明:  A UI project source code that imitates storm video and audio. The imitated interface includes menu pages, home pages, classification pages, etc. The local analog data used for all data in the project. The imitated degree will be problematic in layout and display on high-resolution devices. The resolution of 480 x 800 should be just right.
    2020-06-15 22:40:02下载
    积分:1
  • 图片层叠效果
    【核心代码】 protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); fp=(AdapterViewFlipper) findViewById(R.id.fp); List listgroup=new ArrayList();
    2014-05-16下载
    积分:1
  • MapDemo.tar
    android开发的地图,有一定的意义可以看一下(android mapgetWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN) )
    2012-11-13 17:40:46下载
    积分:1
  • Android静默安装/卸载App
    在Android手机Root了的情况下,通过执行pm install -r 或 pm uninstall来静默安装/卸载App。
    2022-11-23 18:20:03下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载