android UI 往右滑动,滑动到最后一页就自动加载数据并显示
如图:



Java代码
  1. packagecn.anycall.ju;
  2. importjava.util.ArrayList;
  3. importjava.util.HashMap;
  4. importjava.util.List;
  5. importjava.util.Map;
  6. importandroid.app.Activity;
  7. importandroid.content.ActivityNotFoundException;
  8. importandroid.content.Context;
  9. importandroid.content.Intent;
  10. importandroid.content.pm.ResolveInfo;
  11. importandroid.os.Bundle;
  12. importandroid.os.Handler;
  13. importandroid.os.Looper;
  14. importandroid.os.Message;
  15. importandroid.view.KeyEvent;
  16. importandroid.view.View;
  17. importandroid.view.Window;
  18. importandroid.widget.AdapterView;
  19. importandroid.widget.AdapterView.OnItemClickListener;
  20. importandroid.widget.GridView;
  21. importandroid.widget.Toast;
  22. importcn.anycall.ju.ScrollLayout.OnScreenChangeListenerDataLoad;
  23. /**
  24. *GridView分页显示安装的应用程序
  25. */
  26. publicclassAllAppListextendsActivity{
  27. privateScrollLayoutmScrollLayout;
  28. privatestaticfinalfloatAPP_PAGE_SIZE=4.0f;
  29. privateContextmContext;
  30. privatePageControlViewpageControl;
  31. publicMyHandlermyHandler;
  32. publicintn=0;
  33. privateDataLoadingdataLoad;
  34. @Override
  35. protectedvoidonCreate(BundlesavedInstanceState){
  36. //TODOAuto-generatedmethodstub
  37. super.onCreate(savedInstanceState);
  38. this.requestWindowFeature(Window.FEATURE_NO_TITLE);
  39. mContext=this;
  40. setContentView(R.layout.main);
  41. dataLoad=newDataLoading();
  42. mScrollLayout=(ScrollLayout)findViewById(R.id.ScrollLayoutTest);
  43. myHandler=newMyHandler(this,1);
  44. //起一个线程更新数据
  45. MyThreadm=newMyThread();
  46. newThread(m).start();
  47. }
  48. /**
  49. *gridView的onItemLick响应事件
  50. */
  51. publicOnItemClickListenerlistener=newOnItemClickListener(){
  52. publicvoidonItemClick(AdapterView<?>parent,Viewview,intposition,
  53. longid){
  54. //TODOAuto-generatedmethodstub
  55. System.out.println("position="+position);
  56. }
  57. };
  58. @Override
  59. protectedvoidonDestroy(){
  60. //TODOAuto-generatedmethodstub
  61. android.os.Process.killProcess(android.os.Process.myPid());
  62. super.onDestroy();
  63. }
  64. @Override
  65. publicbooleanonKeyDown(intkeyCode,KeyEventevent){
  66. //TODOAuto-generatedmethodstub
  67. if(keyCode==KeyEvent.KEYCODE_BACK){
  68. finish();
  69. returntrue;
  70. }
  71. returnsuper.onKeyDown(keyCode,event);
  72. }
  73. //更新后台数据
  74. classMyThreadimplementsRunnable{
  75. publicvoidrun(){
  76. try{
  77. Thread.sleep(1000*3);
  78. }catch(InterruptedExceptione){
  79. //TODOAuto-generatedcatchblock
  80. e.printStackTrace();
  81. }
  82. Stringmsglist="1";
  83. Messagemsg=newMessage();
  84. Bundleb=newBundle();//存放数据
  85. b.putString("rmsg",msglist);
  86. msg.setData(b);
  87. AllAppList.this.myHandler.sendMessage(msg);//向Handler发送消息,更新UI
  88. }
  89. }
  90. classMyHandlerextendsHandler{
  91. privateAllAppListmContext;
  92. publicMyHandler(Contextconn,inta){
  93. mContext=(AllAppList)conn;
  94. }
  95. publicMyHandler(LooperL){
  96. super(L);
  97. }
  98. //子类必须重写此方法,接受数据
  99. @Override
  100. publicvoidhandleMessage(Messagemsg){
  101. //TODOAuto-generatedmethodstub
  102. super.handleMessage(msg);
  103. Bundleb=msg.getData();
  104. Stringrmsg=b.getString("rmsg");
  105. if("1".equals(rmsg)){
  106. //donothing
  107. List<Map>list=newArrayList<Map>();
  108. for(inti=0;i<16;i++){
  109. n++;
  110. Mapmap=newHashMap();
  111. map.put("name",n);
  112. list.add(map);
  113. }
  114. intpageNo=(int)Math.ceil(list.size()/APP_PAGE_SIZE);
  115. for(inti=0;i<pageNo;i++){
  116. GridViewappPage=newGridView(mContext);
  117. //getthe"i"pagedata
  118. appPage.setAdapter(newAppAdapter(mContext,list,i));
  119. appPage.setNumColumns(2);
  120. appPage.setOnItemClickListener(listener);
  121. mScrollLayout.addView(appPage);
  122. }
  123. //加载分页
  124. pageControl=(PageControlView)findViewById(R.id.pageControl);
  125. pageControl.bindScrollViewGroup(mScrollLayout);
  126. //加载分页数据
  127. dataLoad.bindScrollViewGroup(mScrollLayout);
  128. }
  129. }
  130. }
  131. //分页数据
  132. classDataLoading{
  133. privateintcount;
  134. publicvoidbindScrollViewGroup(ScrollLayoutscrollViewGroup){
  135. this.count=scrollViewGroup.getChildCount();
  136. scrollViewGroup.setOnScreenChangeListenerDataLoad(newOnScreenChangeListenerDataLoad(){
  137. publicvoidonScreenChange(intcurrentIndex){
  138. //TODOAuto-generatedmethodstub
  139. generatePageControl(currentIndex);
  140. }
  141. });
  142. }
  143. privatevoidgeneratePageControl(intcurrentIndex){
  144. //如果到最后一页,就加载16条记录
  145. if(count==currentIndex+1){
  146. MyThreadm=newMyThread();
  147. newThread(m).start();
  148. }
  149. }
  150. }
  151. }
[java] view plain copy
  1. packagecn.anycall.ju;
  2. importjava.util.ArrayList;
  3. importjava.util.HashMap;
  4. importjava.util.List;
  5. importjava.util.Map;
  6. importandroid.app.Activity;
  7. importandroid.content.ActivityNotFoundException;
  8. importandroid.content.Context;
  9. importandroid.content.Intent;
  10. importandroid.content.pm.ResolveInfo;
  11. importandroid.os.Bundle;
  12. importandroid.os.Handler;
  13. importandroid.os.Looper;
  14. importandroid.os.Message;
  15. importandroid.view.KeyEvent;
  16. importandroid.view.View;
  17. importandroid.view.Window;
  18. importandroid.widget.AdapterView;
  19. importandroid.widget.AdapterView.OnItemClickListener;
  20. importandroid.widget.GridView;
  21. importandroid.widget.Toast;
  22. importcn.anycall.ju.ScrollLayout.OnScreenChangeListenerDataLoad;
  23. /**
  24. *GridView分页显示安装的应用程序
  25. */
  26. publicclassAllAppListextendsActivity{
  27. privateScrollLayoutmScrollLayout;
  28. privatestaticfinalfloatAPP_PAGE_SIZE=4.0f;
  29. privateContextmContext;
  30. privatePageControlViewpageControl;
  31. publicMyHandlermyHandler;
  32. publicintn=0;
  33. privateDataLoadingdataLoad;
  34. @Override
  35. protectedvoidonCreate(BundlesavedInstanceState){
  36. //TODOAuto-generatedmethodstub
  37. super.onCreate(savedInstanceState);
  38. this.requestWindowFeature(Window.FEATURE_NO_TITLE);
  39. mContext=this;
  40. setContentView(R.layout.main);
  41. dataLoad=newDataLoading();
  42. mScrollLayout=(ScrollLayout)findViewById(R.id.ScrollLayoutTest);
  43. myHandler=newMyHandler(this,1);
  44. //起一个线程更新数据
  45. MyThreadm=newMyThread();
  46. newThread(m).start();
  47. }
  48. /**
  49. *gridView的onItemLick响应事件
  50. */
  51. publicOnItemClickListenerlistener=newOnItemClickListener(){
  52. publicvoidonItemClick(AdapterView<?>parent,Viewview,intposition,
  53. longid){
  54. //TODOAuto-generatedmethodstub
  55. System.out.println("position="+position);
  56. }
  57. };
  58. @Override
  59. protectedvoidonDestroy(){
  60. //TODOAuto-generatedmethodstub
  61. android.os.Process.killProcess(android.os.Process.myPid());
  62. super.onDestroy();
  63. }
  64. @Override
  65. publicbooleanonKeyDown(intkeyCode,KeyEventevent){
  66. //TODOAuto-generatedmethodstub
  67. if(keyCode==KeyEvent.KEYCODE_BACK){
  68. finish();
  69. returntrue;
  70. }
  71. returnsuper.onKeyDown(keyCode,event);
  72. }
  73. //更新后台数据
  74. classMyThreadimplementsRunnable{
  75. publicvoidrun(){
  76. try{
  77. Thread.sleep(1000*3);
  78. }catch(InterruptedExceptione){
  79. //TODOAuto-generatedcatchblock
  80. e.printStackTrace();
  81. }
  82. Stringmsglist="1";
  83. Messagemsg=newMessage();
  84. Bundleb=newBundle();//存放数据
  85. b.putString("rmsg",msglist);
  86. msg.setData(b);
  87. AllAppList.this.myHandler.sendMessage(msg);//向Handler发送消息,更新UI
  88. }
  89. }
  90. classMyHandlerextendsHandler{
  91. privateAllAppListmContext;
  92. publicMyHandler(Contextconn,inta){
  93. mContext=(AllAppList)conn;
  94. }
  95. publicMyHandler(LooperL){
  96. super(L);
  97. }
  98. //子类必须重写此方法,接受数据
  99. @Override
  100. publicvoidhandleMessage(Messagemsg){
  101. //TODOAuto-generatedmethodstub
  102. super.handleMessage(msg);
  103. Bundleb=msg.getData();
  104. Stringrmsg=b.getString("rmsg");
  105. if("1".equals(rmsg)){
  106. //donothing
  107. List<Map>list=newArrayList<Map>();
  108. for(inti=0;i<16;i++){
  109. n++;
  110. Mapmap=newHashMap();
  111. map.put("name",n);
  112. list.add(map);
  113. }
  114. intpageNo=(int)Math.ceil(list.size()/APP_PAGE_SIZE);
  115. for(inti=0;i<pageNo;i++){
  116. GridViewappPage=newGridView(mContext);
  117. //getthe"i"pagedata
  118. appPage.setAdapter(newAppAdapter(mContext,list,i));
  119. appPage.setNumColumns(2);
  120. appPage.setOnItemClickListener(listener);
  121. mScrollLayout.addView(appPage);
  122. }
  123. //加载分页
  124. pageControl=(PageControlView)findViewById(R.id.pageControl);
  125. pageControl.bindScrollViewGroup(mScrollLayout);
  126. //加载分页数据
  127. dataLoad.bindScrollViewGroup(mScrollLayout);
  128. }
  129. }
  130. }
  131. //分页数据
  132. classDataLoading{
  133. privateintcount;
  134. publicvoidbindScrollViewGroup(ScrollLayoutscrollViewGroup){
  135. this.count=scrollViewGroup.getChildCount();
  136. scrollViewGroup.setOnScreenChangeListenerDataLoad(newOnScreenChangeListenerDataLoad(){
  137. publicvoidonScreenChange(intcurrentIndex){
  138. //TODOAuto-generatedmethodstub
  139. generatePageControl(currentIndex);
  140. }
  141. });
  142. }
  143. privatevoidgeneratePageControl(intcurrentIndex){
  144. //如果到最后一页,就加载16条记录
  145. if(count==currentIndex+1){
  146. MyThreadm=newMyThread();
  147. newThread(m).start();
  148. }
  149. }
  150. }
  151. }


Java代码
  1. packagecn.anycall.ju;
  2. importjava.util.ArrayList;
  3. importjava.util.List;
  4. importjava.util.Map;
  5. importandroid.content.Context;
  6. importandroid.content.pm.PackageManager;
  7. importandroid.content.pm.ResolveInfo;
  8. importandroid.view.LayoutInflater;
  9. importandroid.view.View;
  10. importandroid.view.ViewGroup;
  11. importandroid.widget.BaseAdapter;
  12. importandroid.widget.ImageView;
  13. importandroid.widget.TextView;
  14. importcn.anycall.ju.R;
  15. publicclassAppAdapterextendsBaseAdapter{
  16. privateList<Map>mList;
  17. privateContextmContext;
  18. publicstaticfinalintAPP_PAGE_SIZE=4;
  19. privatePackageManagerpm;
  20. publicAppAdapter(Contextcontext,List<Map>list,intpage){
  21. mContext=context;
  22. pm=context.getPackageManager();
  23. mList=newArrayList<Map>();
  24. inti=page*APP_PAGE_SIZE;
  25. intiEnd=i+APP_PAGE_SIZE;
  26. while((i<list.size())&&(i<iEnd)){
  27. mList.add(list.get(i));
  28. i++;
  29. }
  30. }
  31. publicintgetCount(){
  32. //TODOAuto-generatedmethodstub
  33. returnmList.size();
  34. }
  35. publicObjectgetItem(intposition){
  36. //TODOAuto-generatedmethodstub
  37. returnmList.get(position);
  38. }
  39. publiclonggetItemId(intposition){
  40. //TODOAuto-generatedmethodstub
  41. returnposition;
  42. }
  43. publicViewgetView(intposition,ViewconvertView,ViewGroupparent){
  44. //TODOAuto-generatedmethodstub
  45. MapappInfo=mList.get(position);
  46. AppItemappItem;
  47. if(convertView==null){
  48. Viewv=LayoutInflater.from(mContext).inflate(R.layout.app_item,null);
  49. appItem=newAppItem();
  50. appItem.mAppIcon=(ImageView)v.findViewById(R.id.imgdetail);
  51. appItem.mAppName=(TextView)v.findViewById(R.id.tuaninfo);
  52. v.setTag(appItem);
  53. convertView=v;
  54. }else{
  55. appItem=(AppItem)convertView.getTag();
  56. }
  57. //settheicon
  58. appItem.mAppIcon.setImageResource(R.drawable.icon);
  59. //settheappname
  60. appItem.mAppName.setText(appInfo.get("name").toString());
  61. returnconvertView;
  62. }
  63. /**
  64. *每个应用显示的内容,包括图标和名称
  65. *@authorYao.GUET
  66. *
  67. */
  68. classAppItem{
  69. ImageViewmAppIcon;
  70. TextViewmAppName;
  71. }
  72. }
[java] view plain copy
  1. packagecn.anycall.ju;
  2. importjava.util.ArrayList;
  3. importjava.util.List;
  4. importjava.util.Map;
  5. importandroid.content.Context;
  6. importandroid.content.pm.PackageManager;
  7. importandroid.content.pm.ResolveInfo;
  8. importandroid.view.LayoutInflater;
  9. importandroid.view.View;
  10. importandroid.view.ViewGroup;
  11. importandroid.widget.BaseAdapter;
  12. importandroid.widget.ImageView;
  13. importandroid.widget.TextView;
  14. importcn.anycall.ju.R;
  15. publicclassAppAdapterextendsBaseAdapter{
  16. privateList<Map>mList;
  17. privateContextmContext;
  18. publicstaticfinalintAPP_PAGE_SIZE=4;
  19. privatePackageManagerpm;
  20. publicAppAdapter(Contextcontext,List<Map>list,intpage){
  21. mContext=context;
  22. pm=context.getPackageManager();
  23. mList=newArrayList<Map>();
  24. inti=page*APP_PAGE_SIZE;
  25. intiEnd=i+APP_PAGE_SIZE;
  26. while((i<list.size())&&(i<iEnd)){
  27. mList.add(list.get(i));
  28. i++;
  29. }
  30. }
  31. publicintgetCount(){
  32. //TODOAuto-generatedmethodstub
  33. returnmList.size();
  34. }
  35. publicObjectgetItem(intposition){
  36. //TODOAuto-generatedmethodstub
  37. returnmList.get(position);
  38. }
  39. publiclonggetItemId(intposition){
  40. //TODOAuto-generatedmethodstub
  41. returnposition;
  42. }
  43. publicViewgetView(intposition,ViewconvertView,ViewGroupparent){
  44. //TODOAuto-generatedmethodstub
  45. MapappInfo=mList.get(position);
  46. AppItemappItem;
  47. if(convertView==null){
  48. Viewv=LayoutInflater.from(mContext).inflate(R.layout.app_item,null);
  49. appItem=newAppItem();
  50. appItem.mAppIcon=(ImageView)v.findViewById(R.id.imgdetail);
  51. appItem.mAppName=(TextView)v.findViewById(R.id.tuaninfo);
  52. v.setTag(appItem);
  53. convertView=v;
  54. }else{
  55. appItem=(AppItem)convertView.getTag();
  56. }
  57. //settheicon
  58. appItem.mAppIcon.setImageResource(R.drawable.icon);
  59. //settheappname
  60. appItem.mAppName.setText(appInfo.get("name").toString());
  61. returnconvertView;
  62. }
  63. /**
  64. *每个应用显示的内容,包括图标和名称
  65. *@authorYao.GUET
  66. *
  67. */
  68. classAppItem{
  69. ImageViewmAppIcon;
  70. TextViewmAppName;
  71. }
  72. }

Java代码
  1. packagecn.anycall.ju;
  2. importandroid.content.Context;
  3. importandroid.util.AttributeSet;
  4. importandroid.widget.ImageView;
  5. importandroid.widget.LinearLayout;
  6. importcn.anycall.ju.R;
  7. importcn.anycall.ju.ScrollLayout.OnScreenChangeListener;
  8. publicclassPageControlViewextendsLinearLayout{
  9. privateContextcontext;
  10. privateintcount;
  11. publicvoidbindScrollViewGroup(ScrollLayoutscrollViewGroup){
  12. this.count=scrollViewGroup.getChildCount();
  13. System.out.println("count="+count);
  14. generatePageControl(scrollViewGroup.getCurrentScreenIndex());
  15. scrollViewGroup.setOnScreenChangeListener(newOnScreenChangeListener(){
  16. publicvoidonScreenChange(intcurrentIndex){
  17. //TODOAuto-generatedmethodstub
  18. generatePageControl(currentIndex);
  19. }
  20. });
  21. }
  22. publicPageControlView(Contextcontext){
  23. super(context);
  24. this.init(context);
  25. }
  26. publicPageControlView(Contextcontext,AttributeSetattrs){
  27. super(context,attrs);
  28. this.init(context);
  29. }
  30. privatevoidinit(Contextcontext){
  31. this.context=context;
  32. }
  33. privatevoidgeneratePageControl(intcurrentIndex){
  34. this.removeAllViews();
  35. intpageNum=6;//显示多少个
  36. intpageNo=currentIndex+1;//第几页
  37. intpageSum=this.count;//总共多少页
  38. if(pageSum>1){
  39. intcurrentNum=(pageNo%pageNum==0?(pageNo/pageNum)-1
  40. :(int)(pageNo/pageNum))
  41. *pageNum;
  42. if(currentNum<0)
  43. currentNum=0;
  44. if(pageNo>pageNum){
  45. ImageViewimageView=newImageView(context);
  46. imageView.setImageResource(R.drawable.zuo);
  47. this.addView(imageView);
  48. }
  49. for(inti=0;i<pageNum;i++){
  50. if((currentNum+i+1)>pageSum||pageSum<2)
  51. break;
  52. ImageViewimageView=newImageView(context);
  53. if(currentNum+i+1==pageNo){
  54. imageView.setImageResource(R.drawable.page_indicator_focused);
  55. }else{
  56. imageView.setImageResource(R.drawable.page_indicator);
  57. }
  58. this.addView(imageView);
  59. }
  60. if(pageSum>(currentNum+pageNum)){
  61. ImageViewimageView=newImageView(context);
  62. imageView.setImageResource(R.drawable.you);
  63. this.addView(imageView);
  64. }
  65. }
  66. }
  67. }
[java] view plain copy
  1. packagecn.anycall.ju;
  2. importandroid.content.Context;
  3. importandroid.util.AttributeSet;
  4. importandroid.widget.ImageView;
  5. importandroid.widget.LinearLayout;
  6. importcn.anycall.ju.R;
  7. importcn.anycall.ju.ScrollLayout.OnScreenChangeListener;
  8. publicclassPageControlViewextendsLinearLayout{
  9. privateContextcontext;
  10. privateintcount;
  11. publicvoidbindScrollViewGroup(ScrollLayoutscrollViewGroup){
  12. this.count=scrollViewGroup.getChildCount();
  13. System.out.println("count="+count);
  14. generatePageControl(scrollViewGroup.getCurrentScreenIndex());
  15. scrollViewGroup.setOnScreenChangeListener(newOnScreenChangeListener(){
  16. publicvoidonScreenChange(intcurrentIndex){
  17. //TODOAuto-generatedmethodstub
  18. generatePageControl(currentIndex);
  19. }
  20. });
  21. }
  22. publicPageControlView(Contextcontext){
  23. super(context);
  24. this.init(context);
  25. }
  26. publicPageControlView(Contextcontext,AttributeSetattrs){
  27. super(context,attrs);
  28. this.init(context);
  29. }
  30. privatevoidinit(Contextcontext){
  31. this.context=context;
  32. }
  33. privatevoidgeneratePageControl(intcurrentIndex){
  34. this.removeAllViews();
  35. intpageNum=6;//显示多少个
  36. intpageNo=currentIndex+1;//第几页
  37. intpageSum=this.count;//总共多少页
  38. if(pageSum>1){
  39. intcurrentNum=(pageNo%pageNum==0?(pageNo/pageNum)-1
  40. :(int)(pageNo/pageNum))
  41. *pageNum;
  42. if(currentNum<0)
  43. currentNum=0;
  44. if(pageNo>pageNum){
  45. ImageViewimageView=newImageView(context);
  46. imageView.setImageResource(R.drawable.zuo);
  47. this.addView(imageView);
  48. }
  49. for(inti=0;i<pageNum;i++){
  50. if((currentNum+i+1)>pageSum||pageSum<2)
  51. break;
  52. ImageViewimageView=newImageView(context);
  53. if(currentNum+i+1==pageNo){
  54. imageView.setImageResource(R.drawable.page_indicator_focused);
  55. }else{
  56. imageView.setImageResource(R.drawable.page_indicator);
  57. }
  58. this.addView(imageView);
  59. }
  60. if(pageSum>(currentNum+pageNum)){
  61. ImageViewimageView=newImageView(context);
  62. imageView.setImageResource(R.drawable.you);
  63. this.addView(imageView);
  64. }
  65. }
  66. }
  67. }

Java代码
  1. packagecn.anycall.ju;
  2. importandroid.content.Context;
  3. importandroid.graphics.Canvas;
  4. importandroid.util.AttributeSet;
  5. importandroid.util.Log;
  6. importandroid.view.MotionEvent;
  7. importandroid.view.VelocityTracker;
  8. importandroid.view.View;
  9. importandroid.view.ViewConfiguration;
  10. importandroid.view.ViewGroup;
  11. importandroid.widget.Scroller;
  12. /**
  13. *仿Launcher中的WorkSapce,可以左右滑动切换屏幕的类
  14. *
  15. */
  16. publicclassScrollLayoutextendsViewGroup{
  17. privatestaticfinalStringTAG="ScrollLayout";
  18. privateScrollermScroller;
  19. privateVelocityTrackermVelocityTracker;
  20. privateintmCurScreen;
  21. privateintmDefaultScreen=0;
  22. privatestaticfinalintTOUCH_STATE_REST=0;
  23. privatestaticfinalintTOUCH_STATE_SCROLLING=1;
  24. privatestaticfinalintSNAP_VELOCITY=600;
  25. privateintmTouchState=TOUCH_STATE_REST;
  26. privateintmTouchSlop;
  27. privatefloatmLastMotionX;
  28. privatefloatmLastMotionY;
  29. privateintcurrentScreenIndex=0;
  30. publicintgetCurrentScreenIndex(){
  31. returncurrentScreenIndex;
  32. }
  33. publicvoidsetCurrentScreenIndex(intcurrentScreenIndex){
  34. this.currentScreenIndex=currentScreenIndex;
  35. }
  36. publicScrollLayout(Contextcontext,AttributeSetattrs){
  37. this(context,attrs,0);
  38. //TODOAuto-generatedconstructorstub
  39. }
  40. publicScrollLayout(Contextcontext,AttributeSetattrs,intdefStyle){
  41. super(context,attrs,defStyle);
  42. //TODOAuto-generatedconstructorstub
  43. mScroller=newScroller(context);
  44. mCurScreen=mDefaultScreen;
  45. mTouchSlop=ViewConfiguration.get(getContext()).getScaledTouchSlop();
  46. }
  47. @Override
  48. protectedvoidonLayout(booleanchanged,intl,intt,intr,intb){
  49. //TODOAuto-generatedmethodstub
  50. intchildLeft=0;
  51. finalintchildCount=getChildCount();
  52. System.out.println("childCount="+childCount);
  53. for(inti=0;i<childCount;i++){
  54. finalViewchildView=getChildAt(i);
  55. if(childView.getVisibility()!=View.GONE){
  56. finalintchildWidth=childView.getMeasuredWidth();
  57. childView.layout(childLeft,0,childLeft+childWidth,
  58. childView.getMeasuredHeight());
  59. childLeft+=childWidth;
  60. }
  61. }
  62. }
  63. @Override
  64. protectedvoidonMeasure(intwidthMeasureSpec,intheightMeasureSpec){
  65. Log.e(TAG,"onMeasure");
  66. super.onMeasure(widthMeasureSpec,heightMeasureSpec);
  67. finalintwidth=MeasureSpec.getSize(widthMeasureSpec);
  68. finalintwidthMode=MeasureSpec.getMode(widthMeasureSpec);
  69. if(widthMode!=MeasureSpec.EXACTLY){
  70. thrownewIllegalStateException(
  71. "ScrollLayoutonlycanmCurScreenrunatEXACTLYmode!");
  72. }
  73. finalintheightMode=MeasureSpec.getMode(heightMeasureSpec);
  74. if(heightMode!=MeasureSpec.EXACTLY){
  75. thrownewIllegalStateException(
  76. "ScrollLayoutonlycanrunatEXACTLYmode!");
  77. }
  78. //ThechildrenaregiventhesamewidthandheightasthescrollLayout
  79. finalintcount=getChildCount();
  80. for(inti=0;i<count;i++){
  81. getChildAt(i).measure(widthMeasureSpec,heightMeasureSpec);
  82. }
  83. System.out.println("movingtoscreen"+mCurScreen);
  84. scrollTo(mCurScreen*width,0);
  85. }
  86. /**
  87. *Accordingtothepositionofcurrentlayoutscrolltothedestination
  88. *page.
  89. */
  90. publicvoidsnapToDestination(){
  91. finalintscreenWidth=getWidth();
  92. finalintdestScreen=(getScrollX()+screenWidth/2)/screenWidth;
  93. snapToScreen(destScreen);
  94. }
  95. publicvoidsnapToScreen(intwhichScreen){
  96. //getthevalidlayoutpage
  97. whichScreen=Math.max(0,Math.min(whichScreen,getChildCount()-1));
  98. if(getScrollX()!=(whichScreen*getWidth())){
  99. finalintdelta=whichScreen*getWidth()-getScrollX();
  100. mScroller.startScroll(getScrollX(),0,delta,0,
  101. Math.abs(delta)*2);
  102. mCurScreen=whichScreen;
  103. invalidate();//Redrawthelayout
  104. }
  105. }
  106. publicvoidsetToScreen(intwhichScreen){
  107. whichScreen=Math.max(0,Math.min(whichScreen,getChildCount()-1));
  108. mCurScreen=whichScreen;
  109. scrollTo(whichScreen*getWidth(),0);
  110. }
  111. publicintgetCurScreen(){
  112. returnmCurScreen;
  113. }
  114. @Override
  115. publicvoidcomputeScroll(){
  116. //TODOAuto-generatedmethodstub
  117. if(mScroller.computeScrollOffset()){
  118. scrollTo(mScroller.getCurrX(),mScroller.getCurrY());
  119. postInvalidate();
  120. }
  121. }
  122. @Override
  123. publicbooleanonTouchEvent(MotionEventevent){
  124. //TODOAuto-generatedmethodstub
  125. if(mVelocityTracker==null){
  126. mVelocityTracker=VelocityTracker.obtain();
  127. }
  128. mVelocityTracker.addMovement(event);
  129. finalintaction=event.getAction();
  130. finalfloatx=event.getX();
  131. finalfloaty=event.getY();
  132. switch(action){
  133. caseMotionEvent.ACTION_DOWN:
  134. Log.e(TAG,"eventdown!");
  135. if(!mScroller.isFinished()){
  136. mScroller.abortAnimation();
  137. }
  138. mLastMotionX=x;
  139. break;
  140. caseMotionEvent.ACTION_MOVE:
  141. intdeltaX=(int)(mLastMotionX-x);
  142. mLastMotionX=x;
  143. scrollBy(deltaX,0);
  144. break;
  145. caseMotionEvent.ACTION_UP:
  146. Log.e(TAG,"event:up");
  147. //if(mTouchState==TOUCH_STATE_SCROLLING){
  148. finalVelocityTrackervelocityTracker=mVelocityTracker;
  149. velocityTracker.computeCurrentVelocity(1000);
  150. intvelocityX=(int)velocityTracker.getXVelocity();
  151. Log.e(TAG,"velocityX:"+velocityX);
  152. if(velocityX>SNAP_VELOCITY&&mCurScreen>0){
  153. //Flingenoughtomoveleft
  154. Log.e(TAG,"snapleft");
  155. onScreenChangeListener.onScreenChange(mCurScreen-1);
  156. System.out.println("mCurScreen="+(mCurScreen-1));
  157. snapToScreen(mCurScreen-1);
  158. }elseif(velocityX<-SNAP_VELOCITY
  159. &&mCurScreen<getChildCount()-1){
  160. //Flingenoughtomoveright
  161. Log.e(TAG,"snapright");
  162. onScreenChangeListener.onScreenChange(mCurScreen+1);
  163. //只往右移动才加载数据
  164. onScreenChangeListenerDataLoad.onScreenChange(mCurScreen+1);
  165. snapToScreen(mCurScreen+1);
  166. }else{
  167. snapToDestination();
  168. }
  169. if(mVelocityTracker!=null){
  170. mVelocityTracker.recycle();
  171. mVelocityTracker=null;
  172. }
  173. //}
  174. mTouchState=TOUCH_STATE_REST;
  175. break;
  176. caseMotionEvent.ACTION_CANCEL:
  177. mTouchState=TOUCH_STATE_REST;
  178. break;
  179. }
  180. returntrue;
  181. }
  182. @Override
  183. publicbooleanonInterceptTouchEvent(MotionEventev){
  184. //TODOAuto-generatedmethodstub
  185. Log.e(TAG,"onInterceptTouchEvent-slop:"+mTouchSlop);
  186. finalintaction=ev.getAction();
  187. if((action==MotionEvent.ACTION_MOVE)
  188. &&(mTouchState!=TOUCH_STATE_REST)){
  189. returntrue;
  190. }
  191. finalfloatx=ev.getX();
  192. finalfloaty=ev.getY();
  193. switch(action){
  194. caseMotionEvent.ACTION_MOVE:
  195. finalintxDiff=(int)Math.abs(mLastMotionX-x);
  196. if(xDiff>mTouchSlop){
  197. mTouchState=TOUCH_STATE_SCROLLING;
  198. }
  199. break;
  200. caseMotionEvent.ACTION_DOWN:
  201. mLastMotionX=x;
  202. mLastMotionY=y;
  203. mTouchState=mScroller.isFinished()?TOUCH_STATE_REST
  204. :TOUCH_STATE_SCROLLING;
  205. break;
  206. caseMotionEvent.ACTION_CANCEL:
  207. caseMotionEvent.ACTION_UP:
  208. mTouchState=TOUCH_STATE_REST;
  209. break;
  210. }
  211. returnmTouchState!=TOUCH_STATE_REST;
  212. }
  213. //分页监听
  214. publicinterfaceOnScreenChangeListener{
  215. voidonScreenChange(intcurrentIndex);
  216. }
  217. privateOnScreenChangeListeneronScreenChangeListener;
  218. publicvoidsetOnScreenChangeListener(
  219. OnScreenChangeListeneronScreenChangeListener){
  220. this.onScreenChangeListener=onScreenChangeListener;
  221. }
  222. //动态数据监听
  223. publicinterfaceOnScreenChangeListenerDataLoad{
  224. voidonScreenChange(intcurrentIndex);
  225. }
  226. privateOnScreenChangeListenerDataLoadonScreenChangeListenerDataLoad;
  227. publicvoidsetOnScreenChangeListenerDataLoad(OnScreenChangeListenerDataLoadonScreenChangeListenerDataLoad){
  228. this.onScreenChangeListenerDataLoad=onScreenChangeListenerDataLoad;
  229. }
  230. }
[java] view plain copy
  1. packagecn.anycall.ju;
  2. importandroid.content.Context;
  3. importandroid.graphics.Canvas;
  4. importandroid.util.AttributeSet;
  5. importandroid.util.Log;
  6. importandroid.view.MotionEvent;
  7. importandroid.view.VelocityTracker;
  8. importandroid.view.View;
  9. importandroid.view.ViewConfiguration;
  10. importandroid.view.ViewGroup;
  11. importandroid.widget.Scroller;
  12. /**
  13. *仿Launcher中的WorkSapce,可以左右滑动切换屏幕的类
  14. *
  15. */
  16. publicclassScrollLayoutextendsViewGroup{
  17. privatestaticfinalStringTAG="ScrollLayout";
  18. privateScrollermScroller;
  19. privateVelocityTrackermVelocityTracker;
  20. privateintmCurScreen;
  21. privateintmDefaultScreen=0;
  22. privatestaticfinalintTOUCH_STATE_REST=0;
  23. privatestaticfinalintTOUCH_STATE_SCROLLING=1;
  24. privatestaticfinalintSNAP_VELOCITY=600;
  25. privateintmTouchState=TOUCH_STATE_REST;
  26. privateintmTouchSlop;
  27. privatefloatmLastMotionX;
  28. privatefloatmLastMotionY;
  29. privateintcurrentScreenIndex=0;
  30. publicintgetCurrentScreenIndex(){
  31. returncurrentScreenIndex;
  32. }
  33. publicvoidsetCurrentScreenIndex(intcurrentScreenIndex){
  34. this.currentScreenIndex=currentScreenIndex;
  35. }
  36. publicScrollLayout(Contextcontext,AttributeSetattrs){
  37. this(context,attrs,0);
  38. //TODOAuto-generatedconstructorstub
  39. }
  40. publicScrollLayout(Contextcontext,AttributeSetattrs,intdefStyle){
  41. super(context,attrs,defStyle);
  42. //TODOAuto-generatedconstructorstub
  43. mScroller=newScroller(context);
  44. mCurScreen=mDefaultScreen;
  45. mTouchSlop=ViewConfiguration.get(getContext()).getScaledTouchSlop();
  46. }
  47. @Override
  48. protectedvoidonLayout(booleanchanged,intl,intt,intr,intb){
  49. //TODOAuto-generatedmethodstub
  50. intchildLeft=0;
  51. finalintchildCount=getChildCount();
  52. System.out.println("childCount="+childCount);
  53. for(inti=0;i<childCount;i++){
  54. finalViewchildView=getChildAt(i);
  55. if(childView.getVisibility()!=View.GONE){
  56. finalintchildWidth=childView.getMeasuredWidth();
  57. childView.layout(childLeft,0,childLeft+childWidth,
  58. childView.getMeasuredHeight());
  59. childLeft+=childWidth;
  60. }
  61. }
  62. }
  63. @Override
  64. protectedvoidonMeasure(intwidthMeasureSpec,intheightMeasureSpec){
  65. Log.e(TAG,"onMeasure");
  66. super.onMeasure(widthMeasureSpec,heightMeasureSpec);
  67. finalintwidth=MeasureSpec.getSize(widthMeasureSpec);
  68. finalintwidthMode=MeasureSpec.getMode(widthMeasureSpec);
  69. if(widthMode!=MeasureSpec.EXACTLY){
  70. thrownewIllegalStateException(
  71. "ScrollLayoutonlycanmCurScreenrunatEXACTLYmode!");
  72. }
  73. finalintheightMode=MeasureSpec.getMode(heightMeasureSpec);
  74. if(heightMode!=MeasureSpec.EXACTLY){
  75. thrownewIllegalStateException(
  76. "ScrollLayoutonlycanrunatEXACTLYmode!");
  77. }
  78. //ThechildrenaregiventhesamewidthandheightasthescrollLayout
  79. finalintcount=getChildCount();
  80. for(inti=0;i<count;i++){
  81. getChildAt(i).measure(widthMeasureSpec,heightMeasureSpec);
  82. }
  83. System.out.println("movingtoscreen"+mCurScreen);
  84. scrollTo(mCurScreen*width,0);
  85. }
  86. /**
  87. *Accordingtothepositionofcurrentlayoutscrolltothedestination
  88. *page.
  89. */
  90. publicvoidsnapToDestination(){
  91. finalintscreenWidth=getWidth();
  92. finalintdestScreen=(getScrollX()+screenWidth/2)/screenWidth;
  93. snapToScreen(destScreen);
  94. }
  95. publicvoidsnapToScreen(intwhichScreen){
  96. //getthevalidlayoutpage
  97. whichScreen=Math.max(0,Math.min(whichScreen,getChildCount()-1));
  98. if(getScrollX()!=(whichScreen*getWidth())){
  99. finalintdelta=whichScreen*getWidth()-getScrollX();
  100. mScroller.startScroll(getScrollX(),0,delta,0,
  101. Math.abs(delta)*2);
  102. mCurScreen=whichScreen;
  103. invalidate();//Redrawthelayout
  104. }
  105. }
  106. publicvoidsetToScreen(intwhichScreen){
  107. whichScreen=Math.max(0,Math.min(whichScreen,getChildCount()-1));
  108. mCurScreen=whichScreen;
  109. scrollTo(whichScreen*getWidth(),0);
  110. }
  111. publicintgetCurScreen(){
  112. returnmCurScreen;
  113. }
  114. @Override
  115. publicvoidcomputeScroll(){
  116. //TODOAuto-generatedmethodstub
  117. if(mScroller.computeScrollOffset()){
  118. scrollTo(mScroller.getCurrX(),mScroller.getCurrY());
  119. postInvalidate();
  120. }
  121. }
  122. @Override
  123. publicbooleanonTouchEvent(MotionEventevent){
  124. //TODOAuto-generatedmethodstub
  125. if(mVelocityTracker==null){
  126. mVelocityTracker=VelocityTracker.obtain();
  127. }
  128. mVelocityTracker.addMovement(event);
  129. finalintaction=event.getAction();
  130. finalfloatx=event.getX();
  131. finalfloaty=event.getY();
  132. switch(action){
  133. caseMotionEvent.ACTION_DOWN:
  134. Log.e(TAG,"eventdown!");
  135. if(!mScroller.isFinished()){
  136. mScroller.abortAnimation();
  137. }
  138. mLastMotionX=x;
  139. break;
  140. caseMotionEvent.ACTION_MOVE:
  141. intdeltaX=(int)(mLastMotionX-x);
  142. mLastMotionX=x;
  143. scrollBy(deltaX,0);
  144. break;
  145. caseMotionEvent.ACTION_UP:
  146. Log.e(TAG,"event:up");
  147. //if(mTouchState==TOUCH_STATE_SCROLLING){
  148. finalVelocityTrackervelocityTracker=mVelocityTracker;
  149. velocityTracker.computeCurrentVelocity(1000);
  150. intvelocityX=(int)velocityTracker.getXVelocity();
  151. Log.e(TAG,"velocityX:"+velocityX);
  152. if(velocityX>SNAP_VELOCITY&&mCurScreen>0){
  153. //Flingenoughtomoveleft
  154. Log.e(TAG,"snapleft");
  155. onScreenChangeListener.onScreenChange(mCurScreen-1);
  156. System.out.println("mCurScreen="+(mCurScreen-1));
  157. snapToScreen(mCurScreen-1);
  158. }elseif(velocityX<-SNAP_VELOCITY
  159. &&mCurScreen<getChildCount()-1){
  160. //Flingenoughtomoveright
  161. Log.e(TAG,"snapright");
  162. onScreenChangeListener.onScreenChange(mCurScreen+1);
  163. //只往右移动才加载数据
  164. onScreenChangeListenerDataLoad.onScreenChange(mCurScreen+1);
  165. snapToScreen(mCurScreen+1);
  166. }else{
  167. snapToDestination();
  168. }
  169. if(mVelocityTracker!=null){
  170. mVelocityTracker.recycle();
  171. mVelocityTracker=null;
  172. }
  173. //}
  174. mTouchState=TOUCH_STATE_REST;
  175. break;
  176. caseMotionEvent.ACTION_CANCEL:
  177. mTouchState=TOUCH_STATE_REST;
  178. break;
  179. }
  180. returntrue;
  181. }
  182. @Override
  183. publicbooleanonInterceptTouchEvent(MotionEventev){
  184. //TODOAuto-generatedmethodstub
  185. Log.e(TAG,"onInterceptTouchEvent-slop:"+mTouchSlop);
  186. finalintaction=ev.getAction();
  187. if((action==MotionEvent.ACTION_MOVE)
  188. &&(mTouchState!=TOUCH_STATE_REST)){
  189. returntrue;
  190. }
  191. finalfloatx=ev.getX();
  192. finalfloaty=ev.getY();
  193. switch(action){
  194. caseMotionEvent.ACTION_MOVE:
  195. finalintxDiff=(int)Math.abs(mLastMotionX-x);
  196. if(xDiff>mTouchSlop){
  197. mTouchState=TOUCH_STATE_SCROLLING;
  198. }
  199. break;
  200. caseMotionEvent.ACTION_DOWN:
  201. mLastMotionX=x;
  202. mLastMotionY=y;
  203. mTouchState=mScroller.isFinished()?TOUCH_STATE_REST
  204. :TOUCH_STATE_SCROLLING;
  205. break;
  206. caseMotionEvent.ACTION_CANCEL:
  207. caseMotionEvent.ACTION_UP:
  208. mTouchState=TOUCH_STATE_REST;
  209. break;
  210. }
  211. returnmTouchState!=TOUCH_STATE_REST;
  212. }
  213. //分页监听
  214. publicinterfaceOnScreenChangeListener{
  215. voidonScreenChange(intcurrentIndex);
  216. }
  217. privateOnScreenChangeListeneronScreenChangeListener;
  218. publicvoidsetOnScreenChangeListener(
  219. OnScreenChangeListeneronScreenChangeListener){
  220. this.onScreenChangeListener=onScreenChangeListener;
  221. }
  222. //动态数据监听
  223. publicinterfaceOnScreenChangeListenerDataLoad{
  224. voidonScreenChange(intcurrentIndex);
  225. }
  226. privateOnScreenChangeListenerDataLoadonScreenChangeListenerDataLoad;
  227. publicvoidsetOnScreenChangeListenerDataLoad(OnScreenChangeListenerDataLoadonScreenChangeListenerDataLoad){
  228. this.onScreenChangeListenerDataLoad=onScreenChangeListenerDataLoad;
  229. }
  230. }



main.xml
Xml代码
  1. <?xmlversion="1.0"encoding="utf-8"?>
  2. <LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"
  3. android:orientation="vertical"
  4. android:layout_width="fill_parent"
  5. android:layout_height="fill_parent"
  6. >
  7. <TextViewandroid:layout_width="fill_parent"
  8. android:layout_height="wrap_content"android:text="仿淘宝聚划算"/>
  9. <RelativeLayout
  10. android:id="@+id/myView"
  11. android:layout_width="fill_parent"
  12. android:layout_height="fill_parent"
  13. >
  14. <cn.anycall.ju.ScrollLayout
  15. xmlns:android="http://schemas.android.com/apk/res/android"
  16. android:id="@+id/ScrollLayoutTest"
  17. android:layout_width="fill_parent"
  18. android:layout_height="fill_parent"android:background="#000000">
  19. </cn.anycall.ju.ScrollLayout>
  20. <cn.anycall.ju.PageControlView
  21. android:id="@+id/pageControl"
  22. android:layout_width="fill_parent"
  23. android:layout_height="40px"
  24. android:background="#8f00000f"
  25. android:layout_alignParentBottom="true"
  26. android:gravity="center"/>
  27. </RelativeLayout>
  28. </LinearLayout>
[xml] view plain copy
  1. <?xmlversion="1.0"encoding="utf-8"?>
  2. <LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"
  3. android:orientation="vertical"
  4. android:layout_width="fill_parent"
  5. android:layout_height="fill_parent"
  6. >
  7. <TextViewandroid:layout_width="fill_parent"
  8. android:layout_height="wrap_content"android:text="仿淘宝聚划算"/>
  9. <RelativeLayout
  10. android:id="@+id/myView"
  11. android:layout_width="fill_parent"
  12. android:layout_height="fill_parent"
  13. >
  14. <cn.anycall.ju.ScrollLayout
  15. xmlns:android="http://schemas.android.com/apk/res/android"
  16. android:id="@+id/ScrollLayoutTest"
  17. android:layout_width="fill_parent"
  18. android:layout_height="fill_parent"android:background="#000000">
  19. </cn.anycall.ju.ScrollLayout>
  20. <cn.anycall.ju.PageControlView
  21. android:id="@+id/pageControl"
  22. android:layout_width="fill_parent"
  23. android:layout_height="40px"
  24. android:background="#8f00000f"
  25. android:layout_alignParentBottom="true"
  26. android:gravity="center"/>
  27. </RelativeLayout>
  28. </LinearLayout>

app_item.xml
Xml代码
  1. <?xmlversion="1.0"encoding="utf-8"?>
  2. <RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"
  3. android:layout_width="fill_parent"
  4. android:layout_height="wrap_content"
  5. >
  6. <RelativeLayoutandroid:id="@+id/alllayout"android:layout_width="wrap_content"android:layout_height="wrap_content">
  7. <RelativeLayoutandroid:id="@+id/imglayout"android:layout_width="160dp"android:layout_height="160dp"android:background="@drawable/mer_border">
  8. <ImageViewandroid:id="@+id/imgdetail"android:layout_width="145dp"android:layout_height="145dp"android:layout_margin="8dp"/>
  9. <TextViewandroid:id="@+id/price"android:layout_width="180dp"android:layout_height="wrap_content"android:text="12345"android:layout_alignParentBottom="true"android:background="#C02000"android:textColor="#FFFFFF"/>
  10. <TextViewandroid:id="@+id/look"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="去看看"android:layout_alignParentBottom="true"android:layout_alignParentRight="true"android:background="#C02000"android:textColor="#FFFFFF"/>
  11. </RelativeLayout>
  12. <TextViewandroid:id="@+id/tuaninfo"android:layout_width="fill_parent"
  13. android:layout_height="wrap_content"android:textSize="16dp"
  14. android:maxLines="2"android:layout_below="@id/imglayout"
  15. android:ellipsize="end"android:text="dddddddddd"/>"
  16. </RelativeLayout>
  17. </RelativeLayout>
[xml] view plain copy 源码下载: http://download.csdn.net/detail/javadxz/6910017
  1. <?xmlversion="1.0"encoding="utf-8"?>
  2. <RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"
  3. android:layout_width="fill_parent"
  4. android:layout_height="wrap_content"
  5. >
  6. <RelativeLayoutandroid:id="@+id/alllayout"android:layout_width="wrap_content"android:layout_height="wrap_content">
  7. <RelativeLayoutandroid:id="@+id/imglayout"android:layout_width="160dp"android:layout_height="160dp"android:background="@drawable/mer_border">
  8. <ImageViewandroid:id="@+id/imgdetail"android:layout_width="145dp"android:layout_height="145dp"android:layout_margin="8dp"/>
  9. <TextViewandroid:id="@+id/price"android:layout_width="180dp"android:layout_height="wrap_content"android:text="12345"android:layout_alignParentBottom="true"android:background="#C02000"android:textColor="#FFFFFF"/>
  10. <TextViewandroid:id="@+id/look"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="去看看"android:layout_alignParentBottom="true"android:layout_alignParentRight="true"android:background="#C02000"android:textColor="#FFFFFF"/>
  11. </RelativeLayout>
  12. <TextViewandroid:id="@+id/tuaninfo"android:layout_width="fill_parent"
  13. android:layout_height="wrap_content"android:textSize="16dp"
  14. android:maxLines="2"android:layout_below="@id/imglayout"
  15. android:ellipsize="end"android:text="dddddddddd"/>"
  16. </RelativeLayout>
  17. </RelativeLayout>

更多相关文章

  1. mybatisplus的坑 insert标签insert into select无参数问题的解决
  2. python起点网月票榜字体反爬案例
  3. Android实现图片帮助跳转以及选择重拍Sqlite本地保存
  4. android Sqlite多线程访问异常解决方案
  5. ImageView的属性android:scaleType,即ImageView.setScaleType(Ima
  6. Android启动画面实现
  7. SeekBar 粗略小节
  8. 【Android(安卓)Training - 04】保存数据 [ Lesson 0 - 章节概览
  9. Android(安卓)系统状态栏一体化

随机推荐

  1. android实现点击按钮切换不同的fragment
  2. 给android imageView(图片) 添加超链接
  3. Android文本闪烁
  4. Android中文翻译 - AbstractAccountAuthe
  5. Android中获取指定包名下的所有类
  6. windows 下安卓开发环境配置
  7. Android(安卓)RecyclerView 二级列表实现
  8. 编译Android下纯C的静态程序,undefined r
  9. 解决MainActivity.onCreate(Unknown Sour
  10. Android(安卓)8.0 启动Service适配(Not a