自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

仿QQ側(cè)滑刪除

移動開發(fā)
模仿QQ側(cè)滑刪除,需要的可以學(xué)習(xí)下

源碼簡介

 

模仿QQ側(cè)滑刪除,需要的可以學(xué)習(xí)下
源碼截圖

源碼片段:

  1. Width = getWidth(); 
  2.         list = getList(); 
  3.         swipe = (SwipeListView) findViewById(R.id.example_lv_list); 
  4.         swipelist = new SwipeList(MainActivity.this, swipe, list); 
  5.         swipe.setAdapter(swipelist); 
  6.         swipe.setSwipeListViewListener(new BaseSwipeListViewListener(){ 
  7.   
  8.             @Override 
  9.             public void onClickFrontView(int position) { 
  10.                 // TODO Auto-generated method stub 
  11.                 super.onClickFrontView(position); 
  12.             } 
  13.   
  14.             @Override 
  15.             public void onDismiss(int[] reverseSortedPositions) { 
  16.                 // TODO Auto-generated method stub 
  17.                 super.onDismiss(reverseSortedPositions); 
  18.                 for(int position:reverseSortedPositions){ 
  19.                     list.remove(position); 
  20.                 } 
  21.                 swipelist.notifyDataSetChanged(); 
  22.             } 
  23.   
  24.           
  25.             @Override   public void onListChanged() { 
  26.                 // TODO Auto-generated method stub 
  27.                 super.onListChanged(); 
  28.             } 
  29.         }); 
  30.           
  31.         show(); 
  32.     } 
  33.       
  34.       
  35.       
  36.     private void show(){ 
  37.         swipe.setSwipeMode(SwipeListView.SWIPE_MODE_LEFT); 
  38.         swipe.setSwipeActionLeft(SwipeListView.SWIPE_ACTION_REVEAL); 
  39.         swipe.setOffsetLeft(Width*1/5); 
  40.         swipe.setAnimationTime(0); 
  41.         swipe.setSwipeOpenOnLongPress(false); 
  42.     } 
  43.       
  44.     private List<img> getList(){ 
  45.         List<img> mlist = new ArrayList<img>(); 
  46.         for(int i=0;i<numbers.length;i++){ image="" image();="" image.setimage(numbers[i]);="" image.settext(i+"");="" image.setname((i+1)+"");="" mlist.add(image);="" }="" return="" mlist;="" private="" int="" getwidth(){="" getresources().getdisplaymetrics().widthpixels;="" }<="" pre=""
  47.                 </numbers.length;i++){> 

源碼鏈接:http://down.51cto.com/data/2013976

 

責(zé)任編輯:chenqingxiang 來源: 網(wǎng)絡(luò)整理
相關(guān)推薦

2015-07-20 15:14:19

側(cè)滑菜單功能多樣

2015-09-07 10:57:38

qq未讀消息

2021-03-01 14:01:41

鴻蒙HarmonyOS應(yīng)用開發(fā)

2015-09-09 11:08:48

qq空間可拉伸頭部

2015-08-07 15:32:19

歡迎界面仿微信仿qq空間

2012-04-02 22:20:49

蘋果

2014-12-15 09:53:55

Android側(cè)滑菜單SlidingMenu

2015-01-19 12:19:04

iOS源碼ActionSheet仿QQ音樂

2012-04-02 19:32:11

iPhone 4

2021-11-24 10:02:53

鴻蒙HarmonyOS應(yīng)用

2017-05-03 16:30:38

AndroidScrollView滾動視圖

2020-07-13 08:45:14

亞馬遜TikTok移動設(shè)備

2021-04-15 17:47:38

鴻蒙HarmonyOS應(yīng)用

2012-12-25 13:16:56

AndroidQQ2012UI

2013-09-02 15:04:25

QQ高仿版GG嘰嘰

2017-09-05 15:57:47

2015-07-31 11:29:25

錘子時鐘

2015-10-20 16:01:47

華為商城源碼android

2015-12-09 11:07:16

商城源碼android
點贊
收藏

51CTO技術(shù)棧公眾號