Advertisement
Guest User

Untitled

a guest
Sep 16th, 2014
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.14 KB | None | 0 0
  1.    
  2.     private void SynchronizeMoveForPresence() {
  3.        
  4.         App_class.listFromPresence.setOnTouchListener(new OnTouchListener() {
  5.              @Override
  6.              public boolean onTouch(View v, MotionEvent event) {
  7.                  if(touchSource == null)
  8.                      touchSource = v;
  9.  
  10.                  if(v == touchSource) {
  11.                      App_class.listFromListFragment.dispatchTouchEvent(event);
  12.                      if(event.getAction() == MotionEvent.ACTION_UP) {
  13.                          clickSource = v;
  14.                          touchSource = null;
  15.                      }
  16.                  }
  17.  
  18.                  return false;
  19.              }
  20.  
  21.        
  22.          });
  23.         App_class.listFromPresence.setOnScrollListener(new OnScrollListener() {
  24.             @Override
  25.             public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
  26.                 if(view == clickSource)
  27.                     App_class.listFromListFragment.setSelectionFromTop(firstVisibleItem, view.getChildAt(0).getTop() + offset);
  28.             }
  29.  
  30.             @Override
  31.             public void onScrollStateChanged(AbsListView view, int scrollState) {}
  32.  
  33.            
  34.         });
  35.         App_class.listFromListFragment.setOnTouchListener(new OnTouchListener() {
  36.              @Override
  37.              public boolean onTouch(View v, MotionEvent event) {
  38.                  if(touchSource == null)
  39.                      touchSource = v;
  40.  
  41.                  if(v == touchSource) {
  42.                      App_class.listFromPresence.dispatchTouchEvent(event);
  43.                      if(event.getAction() == MotionEvent.ACTION_UP) {
  44.                          clickSource = v;
  45.                          touchSource = null;
  46.                      }
  47.                  }
  48.  
  49.                  return false;
  50.              }
  51.  
  52.        
  53.          });
  54.         App_class.listFromListFragment.setOnScrollListener(new OnScrollListener() {
  55.             @Override
  56.             public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
  57.                 if(view == clickSource)
  58.                     App_class.listFromPresence.setSelectionFromTop(firstVisibleItem, view.getChildAt(0).getTop() + offset);
  59.             }
  60.  
  61.             @Override
  62.             public void onScrollStateChanged(AbsListView view, int scrollState) {}
  63.  
  64.            
  65.         });
  66.         Log.i("synchronized","fsf" );
  67.        
  68.        
  69.        
  70.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement