Java Code Examples for android.widget.AbsListView

The following code examples are extracted from open source projects. You can click to vote up the examples that are useful to you.

Example 1

From project androidquery, under directory /src/com/androidquery/.

Source file: AbstractAQuery.java

  32 
vote

private Common setScrollListener(){
  AbsListView lv=(AbsListView)view;
  Common common=(Common)lv.getTag(AQuery.TAG_SCROLL_LISTENER);
  if (common == null) {
    common=new Common();
    lv.setOnScrollListener(common);
    lv.setTag(AQuery.TAG_SCROLL_LISTENER,common);
    AQUtility.debug("set scroll listenr");
  }
  return common;
}
 

Example 2

From project smsdroid, under directory /src/de/ub0r/android/smsdroid/.

Source file: ConversationListActivity.java

  32 
vote

/** 
 * Set  {@link ListAdapter} to {@link ListView}.
 * @param la ListAdapter
 */
private void setListAdapter(final ListAdapter la){
  AbsListView v=this.getListView();
  if (v instanceof GridView) {
    ((GridView)v).setAdapter(la);
  }
 else   if (v instanceof ListView) {
    ((ListView)v).setAdapter(la);
  }
}
 

Example 3

From project android-xbmcremote, under directory /src/org/xbmc/android/remote/presentation/controller/.

Source file: ListControllerOnKeyListener.java

  31 
vote

@SuppressWarnings("unchecked") public boolean onKey(View v,int keyCode,KeyEvent event){
  if (keyCode == KeyEvent.KEYCODE_MENU) {
switch (event.getAction()) {
case KeyEvent.ACTION_DOWN:
      if (!sHandleMenuLongPress)       return false;
    return handleMenuKeyDown(v,event);
case KeyEvent.ACTION_UP:
  return handleMenuKeyUp(v,event);
default :
return false;
}
}
if (event.getAction() == KeyEvent.ACTION_DOWN) {
if (keyCode >= KeyEvent.KEYCODE_A && keyCode <= KeyEvent.KEYCODE_Z) {
final AbsListView view=(AbsListView)v;
int startIndex=(view).getSelectedItem() == null ? 0 : (view).getSelectedItemPosition() + 1;
int count=(view).getCount();
for (int i=startIndex; i < count; i++) {
if (((T)(view).getItemAtPosition(i)).getShortName().toLowerCase().charAt(0) == Character.toLowerCase(event.getDisplayLabel())) {
  (view).setSelection(i);
  return true;
}
}
if (startIndex > 0) {
for (int i=0; i < startIndex - 1; i++) {
  if (((T)(view).getItemAtPosition(i)).getShortName().toLowerCase().charAt(0) == Character.toLowerCase(event.getDisplayLabel())) {
    (view).setSelection(i);
    return true;
  }
}
}
return true;
}
}
return false;
}
 

Example 4

From project 2Degrees-Toolbox, under directory /ActionBarSherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  29 
vote

public void onScrollStateChanged(AbsListView view,int scrollState){
  if (scrollState == SCROLL_STATE_TOUCH_SCROLL && !isInputMethodNotNeeded() && mPopup.getContentView() != null) {
    mHandler.removeCallbacks(mResizePopupRunnable);
    mResizePopupRunnable.run();
  }
}
 

Example 5

From project 4308Cirrus, under directory /Extras/actionbarsherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  29 
vote

public void onScrollStateChanged(AbsListView view,int scrollState){
  if (scrollState == SCROLL_STATE_TOUCH_SCROLL && !isInputMethodNotNeeded() && mPopup.getContentView() != null) {
    mHandler.removeCallbacks(mResizePopupRunnable);
    mResizePopupRunnable.run();
  }
}
 

Example 6

From project ActionBarSherlock, under directory /library/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  29 
vote

public void onScrollStateChanged(AbsListView view,int scrollState){
  if (scrollState == SCROLL_STATE_TOUCH_SCROLL && !isInputMethodNotNeeded() && mPopup.getContentView() != null) {
    mHandler.removeCallbacks(mResizePopupRunnable);
    mResizePopupRunnable.run();
  }
}
 

Example 7

From project Amantech, under directory /Android/action_bar_sherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  29 
vote

public void onScrollStateChanged(AbsListView view,int scrollState){
  if (scrollState == SCROLL_STATE_TOUCH_SCROLL && !isInputMethodNotNeeded() && mPopup.getContentView() != null) {
    mHandler.removeCallbacks(mResizePopupRunnable);
    mResizePopupRunnable.run();
  }
}
 

Example 8

From project AmDroid, under directory /AmDroid/src/main/java/com/jaeckel/amenoid/widget/.

Source file: PullToRefreshListView.java

  29 
vote

@Override public void onScroll(AbsListView view,int firstVisibleItem,int visibleItemCount,int totalItemCount){
  if (mCurrentScrollState == SCROLL_STATE_TOUCH_SCROLL && mRefreshState != REFRESHING) {
    if (firstVisibleItem == 0) {
      mRefreshViewImage.setVisibility(View.VISIBLE);
      if ((mRefreshView.getBottom() >= mRefreshViewHeight + 20 || mRefreshView.getTop() >= 0) && mRefreshState != RELEASE_TO_REFRESH) {
        mRefreshViewText.setText(R.string.pull_to_refresh_release_label);
        mRefreshViewImage.clearAnimation();
        mRefreshViewImage.startAnimation(mFlipAnimation);
        mRefreshState=RELEASE_TO_REFRESH;
      }
 else       if (mRefreshView.getBottom() < mRefreshViewHeight + 20 && mRefreshState != PULL_TO_REFRESH) {
        mRefreshViewText.setText(R.string.pull_to_refresh_pull_label);
        if (mRefreshState != TAP_TO_REFRESH) {
          mRefreshViewImage.clearAnimation();
          mRefreshViewImage.startAnimation(mReverseFlipAnimation);
        }
        mRefreshState=PULL_TO_REFRESH;
      }
    }
 else {
      mRefreshViewImage.setVisibility(View.GONE);
      resetHeader();
    }
  }
 else   if (mCurrentScrollState == SCROLL_STATE_FLING && firstVisibleItem == 0 && mRefreshState != REFRESHING) {
    setSelection(1);
    mBounceHack=true;
  }
 else   if (mBounceHack && mCurrentScrollState == SCROLL_STATE_FLING) {
    setSelection(1);
  }
  if (mOnScrollListener != null) {
    mOnScrollListener.onScroll(view,firstVisibleItem,visibleItemCount,totalItemCount);
  }
}
 

Example 9

From project andlytics, under directory /actionbarsherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  29 
vote

public void onScrollStateChanged(AbsListView view,int scrollState){
  if (scrollState == SCROLL_STATE_TOUCH_SCROLL && !isInputMethodNotNeeded() && mPopup.getContentView() != null) {
    mHandler.removeCallbacks(mResizePopupRunnable);
    mResizePopupRunnable.run();
  }
}
 

Example 10

From project Android-automation, under directory /Tmts_Java/src/com/taobao/tmts/framework/utils/.

Source file: ScrollUtils.java

  29 
vote

/** 
 * Scrolls a list.
 * @param listIndex the list to be scrolled
 * @param direction the direction to be scrolled
 * @return {@code true} if more scrolling can be done
 */
public <T extends AbsListView>boolean scrollList(Class<T> classToFilterBy,int listIndex,int direction,ArrayList<T> listViews){
  final T listView=viewUtils.getView(classToFilterBy,listViews,listIndex);
  if (listView == null)   Assert.assertTrue("No ListView with index " + listIndex + " is found!",false);
  if (direction == DOWN) {
    if (listView.getLastVisiblePosition() >= listView.getCount() - 1) {
      scrollListToLine(listView,listView.getLastVisiblePosition());
      return false;
    }
    if (listView.getFirstVisiblePosition() != listView.getLastVisiblePosition())     scrollListToLine(listView,listView.getLastVisiblePosition());
 else     scrollListToLine(listView,listView.getFirstVisiblePosition() + 1);
  }
 else   if (direction == UP) {
    if (listView.getFirstVisiblePosition() < 2) {
      scrollListToLine(listView,0);
      return false;
    }
    final int lines=listView.getLastVisiblePosition() - listView.getFirstVisiblePosition();
    int lineToScrollTo=listView.getFirstVisiblePosition() - lines;
    if (lineToScrollTo == listView.getLastVisiblePosition())     lineToScrollTo--;
    if (lineToScrollTo < 0)     lineToScrollTo=0;
    scrollListToLine(listView,lineToScrollTo);
  }
  sleeper.sleep();
  return true;
}
 

Example 11

From project android-pulltorefresh, under directory /library/src/com/handmark/pulltorefresh/library/.

Source file: PullToRefreshAdapterViewBase.java

  29 
vote

public final void onScroll(final AbsListView view,final int firstVisibleItem,final int visibleItemCount,final int totalItemCount){
  if (DEBUG) {
    Log.d(LOG_TAG,"First Visible: " + firstVisibleItem + ". Visible Count: "+ visibleItemCount+ ". Total Items: "+ totalItemCount);
  }
  if (null != mOnLastItemVisibleListener) {
    final int lastVisibleItemIndex=firstVisibleItem + visibleItemCount;
    if (visibleItemCount > 0 && (lastVisibleItemIndex + 1) == totalItemCount) {
      if (lastVisibleItemIndex != mSavedLastVisibleIndex) {
        mSavedLastVisibleIndex=lastVisibleItemIndex;
        mOnLastItemVisibleListener.onLastItemVisible();
      }
    }
  }
  if (getShowIndicatorInternal()) {
    updateIndicatorViewsVisibility();
  }
  if (null != mOnScrollListener) {
    mOnScrollListener.onScroll(view,firstVisibleItem,visibleItemCount,totalItemCount);
  }
}
 

Example 12

From project android-viewflow, under directory /viewflow/src/org/taptwo/android/widget/.

Source file: ViewFlow.java

  29 
vote

private View setupChild(View child,boolean addToEnd,boolean recycle){
  ViewGroup.LayoutParams p=(ViewGroup.LayoutParams)child.getLayoutParams();
  if (p == null) {
    p=new AbsListView.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT,0);
  }
  if (recycle)   attachViewToParent(child,(addToEnd ? -1 : 0),p);
 else   addViewInLayout(child,(addToEnd ? -1 : 0),p,true);
  return child;
}
 

Example 13

From project AndroidDevWeekendDub-BookLibrary, under directory /src/org/curiouscreature/android/shelves/activity/.

Source file: BooksAdapter.java

  29 
vote

public void bindView(View view,Context context,Cursor c){
  BookViewHolder holder=(BookViewHolder)view.getTag();
  String bookId=c.getString(mInternalIdIndex);
  holder.bookId=bookId;
  holder.sortTitle=c.getString(mSortTitleIndex);
  final ShelvesActivity activity=mActivity;
  if (activity.getScrollState() == AbsListView.OnScrollListener.SCROLL_STATE_FLING || activity.isPendingCoversUpdate()) {
    holder.title.setCompoundDrawablesWithIntrinsicBounds(null,null,null,mDefaultCover);
    holder.queryCover=true;
  }
 else {
    holder.title.setCompoundDrawablesWithIntrinsicBounds(null,null,null,ImageUtilities.getCachedCover(bookId,mDefaultCover));
    holder.queryCover=false;
  }
  final CharArrayBuffer buffer=holder.buffer;
  c.copyStringToBuffer(mTitleIndex,buffer);
  final int size=buffer.sizeCopied;
  if (size != 0) {
    holder.title.setText(buffer.data,0,size);
  }
}
 

Example 14

From project androidZenWriter, under directory /library/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  29 
vote

public void onScrollStateChanged(AbsListView view,int scrollState){
  if (scrollState == SCROLL_STATE_TOUCH_SCROLL && !isInputMethodNotNeeded() && mPopup.getContentView() != null) {
    mHandler.removeCallbacks(mResizePopupRunnable);
    mResizePopupRunnable.run();
  }
}
 

Example 15

From project andstatus, under directory /src/org/andstatus/app/.

Source file: TimelineActivity.java

  29 
vote

public void onScroll(AbsListView view,int firstVisibleItem,int visibleItemCount,int totalItemCount){
  mTotalItemCount=totalItemCount;
  if (positionRestored && !isLoading()) {
    boolean loadMore=(visibleItemCount > 0) && (firstVisibleItem > 0) && (firstVisibleItem + visibleItemCount >= totalItemCount);
    if (loadMore) {
      setIsLoading(true);
      MyLog.d(TAG,"Start Loading more items, total=" + totalItemCount);
      mListFooter.setVisibility(View.VISIBLE);
      Thread thread=new Thread(mLoadListItems);
      thread.start();
    }
  }
}
 

Example 16

From project andtweet, under directory /src/com/xorcode/andtweet/.

Source file: MessageListActivity.java

  29 
vote

@Override public void onScrollStateChanged(AbsListView view,int scrollState){
  if (mIsLoading) {
    return;
  }
switch (scrollState) {
case SCROLL_STATE_IDLE:
    if (view.getLastVisiblePosition() >= mTotalItemCount - 1 && mTotalItemCount > 0) {
      if (getListView().getFooterViewsCount() == 1 && !mIsLoading) {
        mIsLoading=true;
        setProgressBarIndeterminateVisibility(true);
        mListFooter.setVisibility(View.VISIBLE);
        Thread thread=new Thread(mLoadListItems);
        thread.start();
      }
    }
  break;
case SCROLL_STATE_TOUCH_SCROLL:
break;
case SCROLL_STATE_FLING:
break;
}
}
 

Example 17

From project apps-for-android, under directory /RingsExtended/src/com/example/android/rings_extended/.

Source file: FastScrollView.java

  29 
vote

public void onScroll(AbsListView view,int firstVisibleItem,int visibleItemCount,int totalItemCount){
  if (totalItemCount - visibleItemCount > 0 && !mDragging) {
    mThumbY=((getHeight() - mThumbH) * firstVisibleItem) / (totalItemCount - visibleItemCount);
    if (mChangedBounds) {
      final int viewWidth=getWidth();
      mCurrentThumb.setBounds(viewWidth - mThumbW,0,viewWidth,mThumbH);
      mChangedBounds=false;
    }
  }
  mScrollCompleted=true;
  if (firstVisibleItem == mVisibleItem) {
    return;
  }
  mVisibleItem=firstVisibleItem;
  if (!mThumbVisible || mScrollFade.mStarted) {
    mThumbVisible=true;
    mCurrentThumb.setAlpha(ScrollFade.ALPHA_MAX);
  }
  mHandler.removeCallbacks(mScrollFade);
  mScrollFade.mStarted=false;
  if (!mDragging) {
    mHandler.postDelayed(mScrollFade,1500);
  }
}
 

Example 18

From project BBC-News-Reader, under directory /src/com/digitallizard/bbcnewsreader/.

Source file: CategoryChooserActivity.java

  29 
vote

@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  this.setContentView(R.layout.category_choice);
  listView=(ListView)this.findViewById(R.id.categoryChoiceListView);
  allCategoryNames=getResources().getStringArray(R.array.category_names);
  listView.setAdapter(new ArrayAdapter<String>(this,R.layout.category_choice_item,allCategoryNames));
  listView.setChoiceMode(AbsListView.CHOICE_MODE_MULTIPLE);
  boolean[] categoryBooleans=getIntent().getBooleanArrayExtra(KEY_CATEGORY_BOOLEANS);
  for (int i=0; i < categoryBooleans.length; i++) {
    listView.setItemChecked(i,categoryBooleans[i]);
  }
}
 

Example 19

From project beintoo-android-sdk, under directory /BeintooSDK/src/com/beintoo/activities/leaderboard/.

Source file: Leaderboard.java

  29 
vote

@Override public void onScroll(AbsListView view,int firstVisibleItem,int visibleItemCount,int totalItemCount){
  try {
    if (leader_kind != null && leader_kind.equals("CLOSEST"))     return;
    if (!isLoading && !hasReachedEnd) {
      if (firstVisibleItem != 0 && (firstVisibleItem > totalItemCount - visibleItemCount - 1)) {
        isLoading=true;
        listView.addFooterView(loadingFooter());
        startLoadingMore();
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
 

Example 20

From project Book-Catalogue, under directory /src/com/eleybourn/bookcatalogue/.

Source file: FastScroller.java

  29 
vote

public FastScroller(Context context,AbsListView listView){
  mList=listView;
  int overlaySize;
  try {
    final float scale=context.getResources().getDisplayMetrics().scaledDensity;
    mLargeTextScaledSize=(int)(mLargeTextSpSize * scale);
    overlaySize=(int)(3 * mLargeTextScaledSize);
  }
 catch (  Exception e) {
    mLargeTextScaledSize=mLargeTextSpSize;
    overlaySize=(int)(3 * mLargeTextScaledSize);
  }
  mOverlaySize=overlaySize;
  init(context);
}
 

Example 21

From project Catroid-maven-playground, under directory /src/main/java/at/tugraz/ist/catroid/ui/dialogs/.

Source file: CustomIconContextMenu.java

  29 
vote

public View getView(int position,View convertView,ViewGroup parent){
  CustomContextMenuItem item=(CustomContextMenuItem)getItem(position);
  Resources resource=activity.getResources();
  if (convertView == null) {
    TextView tempTextView=new TextView(context);
    AbsListView.LayoutParams param=new AbsListView.LayoutParams(AbsListView.LayoutParams.FILL_PARENT,AbsListView.LayoutParams.WRAP_CONTENT);
    tempTextView.setLayoutParams(param);
    tempTextView.setPadding((int)toPixel(resource,15),0,(int)toPixel(resource,15),0);
    tempTextView.setGravity(android.view.Gravity.CENTER_VERTICAL);
    Theme theme=context.getTheme();
    TypedValue typedValue=new TypedValue();
    if (theme.resolveAttribute(android.R.attr.textAppearanceLargeInverse,typedValue,true)) {
      tempTextView.setTextAppearance(context,typedValue.resourceId);
    }
    tempTextView.setMinHeight(LIST_HEIGHT);
    tempTextView.setCompoundDrawablePadding((int)toPixel(resource,14));
    convertView=tempTextView;
  }
  TextView textView=(TextView)convertView;
  textView.setTextColor(Color.BLACK);
  textView.setTag(item);
  textView.setText(item.text);
  textView.setCompoundDrawablesWithIntrinsicBounds(item.icon,null,null,null);
  textView.setBackgroundResource(R.color.contextmenu_item_background);
  return textView;
}
 

Example 22

From project com.juick.android, under directory /src/com/juick/android/.

Source file: MessagesFragment.java

  29 
vote

@Override public void onScroll(AbsListView view,int firstVisibleItem,int visibleItemCount,int totalItemCount){
  if (visibleItemCount < totalItemCount && (firstVisibleItem + visibleItemCount == totalItemCount) && loading == false) {
    loadMore();
  }
  if (mCurrentScrollState == SCROLL_STATE_TOUCH_SCROLL && mRefreshState != REFRESHING) {
    if (firstVisibleItem == 0) {
      mRefreshViewImage.setVisibility(View.VISIBLE);
      if ((mRefreshView.getBottom() >= mRefreshViewHeight + 20 || mRefreshView.getTop() >= 0) && mRefreshState != RELEASE_TO_REFRESH) {
        mRefreshViewText.setText(R.string.pull_to_refresh_release_label);
        mRefreshViewImage.clearAnimation();
        mRefreshViewImage.startAnimation(mFlipAnimation);
        mRefreshState=RELEASE_TO_REFRESH;
      }
 else       if (mRefreshView.getBottom() < mRefreshViewHeight + 20 && mRefreshState != PULL_TO_REFRESH) {
        mRefreshViewText.setText(R.string.pull_to_refresh_pull_label);
        if (mRefreshState != TAP_TO_REFRESH) {
          mRefreshViewImage.clearAnimation();
          mRefreshViewImage.startAnimation(mReverseFlipAnimation);
        }
        mRefreshState=PULL_TO_REFRESH;
      }
    }
 else {
      mRefreshViewImage.setVisibility(View.GONE);
      resetHeader();
    }
  }
 else   if (mCurrentScrollState == SCROLL_STATE_FLING && firstVisibleItem == 0 && mRefreshState != REFRESHING) {
    setSelection(1);
    mBounceHack=true;
  }
 else   if (mBounceHack && mCurrentScrollState == SCROLL_STATE_FLING) {
    setSelection(1);
  }
}
 

Example 23

From project Common-Sense-Net-2, under directory /AndroidBarSherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  29 
vote

public void onScrollStateChanged(AbsListView view,int scrollState){
  if (scrollState == SCROLL_STATE_TOUCH_SCROLL && !isInputMethodNotNeeded() && mPopup.getContentView() != null) {
    mHandler.removeCallbacks(mResizePopupRunnable);
    mResizePopupRunnable.run();
  }
}
 

Example 24

From project cow, under directory /libs/ActionBarSherlock/library/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  29 
vote

public void onScrollStateChanged(AbsListView view,int scrollState){
  if (scrollState == SCROLL_STATE_TOUCH_SCROLL && !isInputMethodNotNeeded() && mPopup.getContentView() != null) {
    mHandler.removeCallbacks(mResizePopupRunnable);
    mResizePopupRunnable.run();
  }
}
 

Example 25

From project creamed_glacier_app_settings, under directory /src/com/android/settings/.

Source file: AccessibilityTutorialActivity.java

  29 
vote

@Override public void onScroll(AbsListView view,int firstVisibleItem,int visibleItemCount,int totalItemCount){
  if (hasFlag(FLAG_SCROLL_LIST) && !hasFlag(FLAG_COMPLETED_TUTORIAL)) {
    if (mInitialVisibleItem < 0) {
      mInitialVisibleItem=firstVisibleItem;
    }
    final int scrollCount=Math.abs(mInitialVisibleItem - firstVisibleItem);
    if ((mScrollCount == scrollCount) || (scrollCount <= 0)) {
      return;
    }
 else {
      mScrollCount=scrollCount;
    }
    if (mScrollCount >= DONE_SCROLL_COUNT) {
      final CharSequence finishText=getContext().getText(R.string.accessibility_tutorial_finish);
      addInstruction(R.string.accessibility_tutorial_lesson_2_text_4,finishText);
      setFlag(FLAG_COMPLETED_TUTORIAL,true);
      setFinishVisible(true);
    }
 else     if (mScrollCount == MORE_SCROLL_COUNT) {
      addInstruction(R.string.accessibility_tutorial_lesson_2_text_3_more);
    }
  }
}
 

Example 26

From project cw-omnibus, under directory /external/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  29 
vote

public void onScrollStateChanged(AbsListView view,int scrollState){
  if (scrollState == SCROLL_STATE_TOUCH_SCROLL && !isInputMethodNotNeeded() && mPopup.getContentView() != null) {
    mHandler.removeCallbacks(mResizePopupRunnable);
    mResizePopupRunnable.run();
  }
}
 

Example 27

From project danbooru-gallery-android, under directory /src/tw/idv/palatis/danboorugallery/.

Source file: MainActivity.java

  29 
vote

@Override public void onScroll(AbsListView view,int firstVisibleItem,int visibleItemCount,int totalItemCount){
  if (fetcher.hasMorePost() && firstVisibleItem + visibleItemCount > totalItemCount - fetch_threshold) {
    toast_loading.show();
    fetcher.fetchNextPage(adapter);
  }
}
 

Example 28

From project DeskSMS, under directory /ActionBarSherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  29 
vote

public void onScrollStateChanged(AbsListView view,int scrollState){
  if (scrollState == SCROLL_STATE_TOUCH_SCROLL && !isInputMethodNotNeeded() && mPopup.getContentView() != null) {
    mHandler.removeCallbacks(mResizePopupRunnable);
    mResizePopupRunnable.run();
  }
}
 

Example 29

From project DigitbooksExamples, under directory /DigitbooksExamples/src/fr/digitbooks/android/examples/chapitre06/.

Source file: AsynchronousListActivity.java

  29 
vote

public void onScrollStateChanged(AbsListView view,int scrollState){
  if (getListView() == view) {
    if (Config.INFO_LOGS_ENABLED) {
      Log.i(LOG_TAG,"'scrollState' vient de changer  " + scrollState);
    }
    mScrollState=scrollState;
    if (scrollState == OnScrollListener.SCROLL_STATE_FLING) {
      clearImageFetching();
    }
 else {
      processImageFetching();
    }
  }
}
 

Example 30

From project dmix, under directory /ActionBarSherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  29 
vote

public void onScrollStateChanged(AbsListView view,int scrollState){
  if (scrollState == SCROLL_STATE_TOUCH_SCROLL && !isInputMethodNotNeeded() && mPopup.getContentView() != null) {
    mHandler.removeCallbacks(mResizePopupRunnable);
    mResizePopupRunnable.run();
  }
}
 

Example 31

From project dreamDroid, under directory /libraries/ABS/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  29 
vote

public void onScrollStateChanged(AbsListView view,int scrollState){
  if (scrollState == SCROLL_STATE_TOUCH_SCROLL && !isInputMethodNotNeeded() && mPopup.getContentView() != null) {
    mHandler.removeCallbacks(mResizePopupRunnable);
    mResizePopupRunnable.run();
  }
}
 

Example 32

From project dungbeetle, under directory /src/edu/stanford/mobisocial/dungbeetle/ui/fragments/.

Source file: AppsViewFragment.java

  29 
vote

@Override public void onScroll(AbsListView view,int firstVisible,int visibleCount,int totalCount){
  if (mObjects == null)   return;
  boolean loadMore=firstVisible + visibleCount >= mObjects.getTotalQueried();
  if (loadMore) {
    mLoader.cancelLoad();
    if (getActivity() instanceof Filterable) {
      Filterable context=(Filterable)getActivity();
      if (context != null) {
        List<String> filterTypes=new ArrayList<String>();
        for (int x=0; x < context.getFilterTypes().length; x++) {
          if (context.getFilterCheckboxes()[x]) {
            Log.w(TAG,"adding " + context.getFilterTypes()[x]);
            filterTypes.add(context.getFilterTypes()[x]);
          }
        }
        mLoader=mObjects.queryLaterObjects(getActivity(),mFeedUri,totalCount,filterTypes.toArray(new String[filterTypes.size()]));
      }
    }
 else {
      mLoader=mObjects.queryLaterObjects(getActivity(),mFeedUri,totalCount,null);
    }
  }
}
 

Example 33

From project examples_2, under directory /SearchView/actionbarsherlock-lib/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  29 
vote

public void onScrollStateChanged(AbsListView view,int scrollState){
  if (scrollState == SCROLL_STATE_TOUCH_SCROLL && !isInputMethodNotNeeded() && mPopup.getContentView() != null) {
    mHandler.removeCallbacks(mResizePopupRunnable);
    mResizePopupRunnable.run();
  }
}
 

Example 34

From project fanfoudroid, under directory /src/com/ch_linghu/fanfoudroid/ui/module/.

Source file: MyListView.java

  29 
vote

@Override public void onScroll(AbsListView view,int firstVisibleItem,int visibleItemCount,int totalItemCount){
  if (mOnNeedMoreListener == null) {
    return;
  }
  if (firstVisibleItem != mFirstVisibleItem) {
    if (firstVisibleItem + visibleItemCount >= totalItemCount) {
      mOnNeedMoreListener.needMore();
    }
  }
 else {
    mFirstVisibleItem=firstVisibleItem;
  }
}
 

Example 35

From project farebot, under directory /libs/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  29 
vote

public void onScrollStateChanged(AbsListView view,int scrollState){
  if (scrollState == SCROLL_STATE_TOUCH_SCROLL && !isInputMethodNotNeeded() && mPopup.getContentView() != null) {
    mHandler.removeCallbacks(mResizePopupRunnable);
    mResizePopupRunnable.run();
  }
}
 

Example 36

From project filemanager, under directory /FileManager/src/org/openintents/filemanager/bookmarks/.

Source file: BookmarkListFragment.java

  29 
vote

@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  getListView().setOnScrollListener(new AbsListView.OnScrollListener(){
    @Override public void onScrollStateChanged(    AbsListView view,    int scrollState){
      if (scrollState == OnScrollListener.SCROLL_STATE_IDLE) {
        ((BookmarkListAdapter)getListAdapter()).setScrolling(false);
      }
 else       ((BookmarkListAdapter)getListAdapter()).setScrolling(true);
    }
    @Override public void onScroll(    AbsListView view,    int firstVisibleItem,    int visibleItemCount,    int totalItemCount){
    }
  }
);
  getListView().requestFocus();
  getListView().requestFocusFromTouch();
  setEmptyText(getString(R.string.bookmark_empty));
  if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    registerForContextMenu(getListView());
  }
 else {
    BookmarkMultiChoiceModeHelper.listView_setMultiChoiceModeListener(getListView(),getActivity());
    getListView().setChoiceMode(ListView.CHOICE_MODE_MULTIPLE_MODAL);
  }
}
 

Example 37

From project finch, under directory /libs/JakeWharton-ActionBarSherlock-2eabf25/library/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  29 
vote

public void onScrollStateChanged(AbsListView view,int scrollState){
  if (scrollState == SCROLL_STATE_TOUCH_SCROLL && !isInputMethodNotNeeded() && mPopup.getContentView() != null) {
    mHandler.removeCallbacks(mResizePopupRunnable);
    mResizePopupRunnable.run();
  }
}
 

Example 38

From project friendica-for-android, under directory /libpulltorefresh/src/com/handmark/pulltorefresh/library/.

Source file: PullToRefreshAdapterViewBase.java

  29 
vote

public final void onScroll(final AbsListView view,final int firstVisibleItem,final int visibleItemCount,final int totalItemCount){
  if (DEBUG) {
    Log.d(LOG_TAG,"First Visible: " + firstVisibleItem + ". Visible Count: "+ visibleItemCount+ ". Total Items: "+ totalItemCount);
  }
  if (null != mOnLastItemVisibleListener) {
    final int lastVisibleItemIndex=firstVisibleItem + visibleItemCount;
    if (visibleItemCount > 0 && (lastVisibleItemIndex + 1) == totalItemCount) {
      if (lastVisibleItemIndex != mSavedLastVisibleIndex) {
        mSavedLastVisibleIndex=lastVisibleItemIndex;
        mOnLastItemVisibleListener.onLastItemVisible();
      }
    }
  }
  if (getShowIndicatorInternal()) {
    updateIndicatorViewsVisibility();
  }
  if (null != mOnScrollListener) {
    mOnScrollListener.onScroll(view,firstVisibleItem,visibleItemCount,totalItemCount);
  }
}
 

Example 39

From project gh4a, under directory /src/com/gh4a/.

Source file: CommitListActivity.java

  29 
vote

@Override public void onScrollStateChanged(AbsListView view,int scrollState){
  if (mReload && scrollState == SCROLL_STATE_IDLE) {
    new LoadCommitListTask(this).execute("false");
    mReload=false;
  }
}
 

Example 40

From project Gibberbot, under directory /src/info/guardianproject/otr/app/im/app/.

Source file: ChatListAdapter.java

  29 
vote

public void onScrollStateChanged(AbsListView view,int scrollState){
  int oldState=mScrollState;
  mScrollState=scrollState;
  if (oldState == OnScrollListener.SCROLL_STATE_FLING) {
  }
}
 

Example 41

From project GnucashMobile, under directory /com_actionbarsherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  29 
vote

public void onScrollStateChanged(AbsListView view,int scrollState){
  if (scrollState == SCROLL_STATE_TOUCH_SCROLL && !isInputMethodNotNeeded() && mPopup.getContentView() != null) {
    mHandler.removeCallbacks(mResizePopupRunnable);
    mResizePopupRunnable.run();
  }
}
 

Example 42

From project Google-Tasks-Client, under directory /actionbarsherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  29 
vote

public void onScrollStateChanged(AbsListView view,int scrollState){
  if (scrollState == SCROLL_STATE_TOUCH_SCROLL && !isInputMethodNotNeeded() && mPopup.getContentView() != null) {
    mHandler.removeCallbacks(mResizePopupRunnable);
    mResizePopupRunnable.run();
  }
}
 

Example 43

From project HeLauncher, under directory /src/com/handlerexploit/launcher_reloaded/.

Source file: Folder.java

  29 
vote

@Override protected void onFinishInflate(){
  super.onFinishInflate();
  mContent=(AbsListView)findViewById(R.id.folder_content);
  mContent.setOnItemClickListener(this);
  mContent.setOnItemLongClickListener(this);
  mCloseButton=(Button)findViewById(R.id.folder_close);
  mCloseButton.setOnClickListener(this);
  mCloseButton.setOnLongClickListener(this);
}
 

Example 44

From project HSR-Timetable, under directory /ActionBarSherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  29 
vote

public void onScrollStateChanged(AbsListView view,int scrollState){
  if (scrollState == SCROLL_STATE_TOUCH_SCROLL && !isInputMethodNotNeeded() && mPopup.getContentView() != null) {
    mHandler.removeCallbacks(mResizePopupRunnable);
    mResizePopupRunnable.run();
  }
}
 

Example 45

From project iosched_3, under directory /android/src/com/google/android/apps/iosched/ui/.

Source file: SocialStreamFragment.java

  29 
vote

@Override public void onScrollStateChanged(AbsListView listView,int scrollState){
  if (scrollState == AbsListView.OnScrollListener.SCROLL_STATE_FLING || scrollState == AbsListView.OnScrollListener.SCROLL_STATE_TOUCH_SCROLL) {
    mImageFetcher.setPauseDiskCache(true);
  }
 else {
    mImageFetcher.setPauseDiskCache(false);
  }
}
 

Example 46

From project iPhoroidUI, under directory /src/org/klab/iphoroid/widget/flowview/.

Source file: FlowView.java

  29 
vote

private View setupChild(View child,boolean addToEnd,boolean recycle){
  ViewGroup.LayoutParams p=child.getLayoutParams();
  if (p == null) {
    p=new AbsListView.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT,0);
  }
  if (recycle)   attachViewToParent(child,(addToEnd ? -1 : 0),p);
 else   addViewInLayout(child,(addToEnd ? -1 : 0),p,true);
  return child;
}
 

Example 47

From project IRC-Client, under directory /actionbarsherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  29 
vote

public void onScrollStateChanged(AbsListView view,int scrollState){
  if (scrollState == SCROLL_STATE_TOUCH_SCROLL && !isInputMethodNotNeeded() && mPopup.getContentView() != null) {
    mHandler.removeCallbacks(mResizePopupRunnable);
    mResizePopupRunnable.run();
  }
}
 

Example 48

From project maven-android-plugin-samples, under directory /apidemos-android-10/application/src/main/java/com/example/android/apis/view/.

Source file: ExpandableList1.java

  29 
vote

public TextView getGenericView(){
  AbsListView.LayoutParams lp=new AbsListView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,64);
  TextView textView=new TextView(ExpandableList1.this);
  textView.setLayoutParams(lp);
  textView.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT);
  textView.setPadding(36,0,0,0);
  return textView;
}
 

Example 49

From project mediaphone, under directory /src/ac/robinson/mediaphone/activity/.

Source file: NarrativeBrowserActivity.java

  29 
vote

public void onScrollStateChanged(AbsListView view,int scrollState){
  if (mScrollState == ScrollManager.SCROLL_STATE_FLING && scrollState != ScrollManager.SCROLL_STATE_FLING) {
    mPendingIconsUpdate=true;
    final Handler handler=mScrollHandler;
    handler.removeMessages(R.id.msg_update_narrative_icons);
    final Message message=handler.obtainMessage(R.id.msg_update_narrative_icons,NarrativeBrowserActivity.this);
    handler.sendMessageDelayed(message,mFingerUp ? 0 : MediaPhone.ANIMATION_ICON_SHOW_DELAY);
  }
 else   if (scrollState == ScrollManager.SCROLL_STATE_FLING) {
    mPendingIconsUpdate=false;
    mScrollHandler.removeMessages(R.id.msg_update_narrative_icons);
  }
  mScrollState=scrollState;
}
 

Example 50

From project MensaUPB, under directory /libs/ActionbarSherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  29 
vote

public void onScrollStateChanged(AbsListView view,int scrollState){
  if (scrollState == SCROLL_STATE_TOUCH_SCROLL && !isInputMethodNotNeeded() && mPopup.getContentView() != null) {
    mHandler.removeCallbacks(mResizePopupRunnable);
    mResizePopupRunnable.run();
  }
}
 

Example 51

From project MIT-Mobile-for-Android, under directory /src/edu/mit/mitmobile2/.

Source file: SimpleSpinnerAdapter.java

  29 
vote

public View getDropDownView(int position,View convertView,ViewGroup parent){
  if (position == 0) {
    if (mEmptyView == null) {
      mEmptyView=new View(mContext);
      mEmptyView.setLayoutParams(new AbsListView.LayoutParams(LayoutParams.FILL_PARENT,0));
    }
    return mEmptyView;
  }
  if (convertView == null || convertView == mEmptyView) {
    LayoutInflater inflator=(LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    convertView=inflator.inflate(R.layout.boring_action_row,null);
  }
  TwoLineActionRow actionRow=(TwoLineActionRow)convertView;
  actionRow.setTitle(mValues.get(position - 1));
  return actionRow;
}
 

Example 52

From project mWater-Android-App, under directory /android/actionbarsherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  29 
vote

public void onScrollStateChanged(AbsListView view,int scrollState){
  if (scrollState == SCROLL_STATE_TOUCH_SCROLL && !isInputMethodNotNeeded() && mPopup.getContentView() != null) {
    mHandler.removeCallbacks(mResizePopupRunnable);
    mResizePopupRunnable.run();
  }
}
 

Example 53

From project MyHeath-Android, under directory /actionbarlib/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  29 
vote

public void onScrollStateChanged(AbsListView view,int scrollState){
  if (scrollState == SCROLL_STATE_TOUCH_SCROLL && !isInputMethodNotNeeded() && mPopup.getContentView() != null) {
    mHandler.removeCallbacks(mResizePopupRunnable);
    mResizePopupRunnable.run();
  }
}
 

Example 54

From project NFC-Contact-Exchanger, under directory /src/com/tonchidot/nfc_contact_exchanger/widgets/.

Source file: IconContextMenu.java

  29 
vote

@Override public View getView(int position,View convertView,ViewGroup parent){
  IconContextMenuItem item=(IconContextMenuItem)getItem(position);
  Resources res=context.getResources();
  if (convertView == null) {
    TextView temp=new TextView(context);
    AbsListView.LayoutParams param=new AbsListView.LayoutParams(AbsListView.LayoutParams.FILL_PARENT,AbsListView.LayoutParams.WRAP_CONTENT);
    temp.setLayoutParams(param);
    temp.setPadding((int)toPixel(res,15),0,(int)toPixel(res,15),0);
    temp.setGravity(android.view.Gravity.CENTER_VERTICAL);
    Theme th=context.getTheme();
    TypedValue tv=new TypedValue();
    if (th.resolveAttribute(android.R.attr.textAppearanceLargeInverse,tv,true)) {
      temp.setTextAppearance(context,tv.resourceId);
    }
    temp.setMinHeight(LIST_PREFERED_HEIGHT);
    temp.setCompoundDrawablePadding((int)toPixel(res,14));
    temp.setTextColor(context.getResources().getColor(R.color.black));
    convertView=temp;
  }
  TextView textView=(TextView)convertView;
  textView.setTag(item);
  textView.setText(item.text);
  textView.setCompoundDrawablesWithIntrinsicBounds(item.image,null,null,null);
  return textView;
}
 

Example 55

From project NFCShopping, under directory /mobile phone client/NFCShopping/src/scut/bgooo/ui/.

Source file: CollectionListActivity.java

  29 
vote

@Override public void onScroll(AbsListView view,int firstVisibleItem,int visibleItemCount,int totalItemCount){
  if (mItems.size() == 0) {
    return;
  }
  int lastItem=firstVisibleItem + visibleItemCount - 1;
  int middleItem=(lastItem + firstVisibleItem) / 2;
  if (isReady) {
    SimpleDateFormat formater=new SimpleDateFormat("yyyy-MM-dd");
    Date scanDate=new Date(mItems.get(middleItem).getTimestamp());
    String grouping=formater.format(scanDate);
    if (!isShowing && !groupString.equals(grouping)) {
      isShowing=true;
      dialogText.setVisibility(View.VISIBLE);
    }
    dialogText.setText(grouping);
    handler.removeCallbacks(removeWindow);
    handler.postDelayed(removeWindow,2000);
    groupString=grouping;
  }
}
 

Example 56

From project NotePad, under directory /NotePad/src/org/openintents/notepad/noteslist/.

Source file: NotesList.java

  29 
vote

public void onScrollStateChanged(AbsListView view,int scrollState){
switch (scrollState) {
case OnScrollListener.SCROLL_STATE_IDLE:
    Log.i(TAG,"idle");
  mAdapter.mBusy=false;
if (!NotesListCursor.mEncryptedStringList.isEmpty()) {
  String encryptedString=NotesListCursor.mEncryptedStringList.remove(0);
  Log.i(TAG,"Decrypt idle: " + encryptedString);
  decryptTitle(encryptedString);
}
break;
case OnScrollListener.SCROLL_STATE_TOUCH_SCROLL:
mAdapter.mBusy=true;
break;
case OnScrollListener.SCROLL_STATE_FLING:
mAdapter.mBusy=true;
break;
}
}
 

Example 57

From project onebusaway-android, under directory /ActionBarSherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  29 
vote

public void onScrollStateChanged(AbsListView view,int scrollState){
  if (scrollState == SCROLL_STATE_TOUCH_SCROLL && !isInputMethodNotNeeded() && mPopup.getContentView() != null) {
    mHandler.removeCallbacks(mResizePopupRunnable);
    mResizePopupRunnable.run();
  }
}
 

Example 58

From project open311-android, under directory /ActionBarSherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  29 
vote

public void onScrollStateChanged(AbsListView view,int scrollState){
  if (scrollState == SCROLL_STATE_TOUCH_SCROLL && !isInputMethodNotNeeded() && mPopup.getContentView() != null) {
    mHandler.removeCallbacks(mResizePopupRunnable);
    mResizePopupRunnable.run();
  }
}
 

Example 59

From project packages_apps_Calendar, under directory /src/com/android/calendar/agenda/.

Source file: AgendaFragment.java

  29 
vote

@Override public void onScroll(AbsListView view,int firstVisibleItem,int visibleItemCount,int totalItemCount){
  int julianDay=mAgendaListView.getJulianDayFromPosition(firstVisibleItem - mAgendaListView.getHeaderViewsCount());
  if (julianDay == 0) {
    return;
  }
  if (mJulianDayOnTop != julianDay) {
    mJulianDayOnTop=julianDay;
    Time t=new Time(mTimeZone);
    t.setJulianDay(mJulianDayOnTop);
    mController.setTime(t.toMillis(true));
    if (!mIsTabletConfig) {
      view.post(new Runnable(){
        @Override public void run(){
          Time t=new Time(mTimeZone);
          t.setJulianDay(mJulianDayOnTop);
          mController.sendEvent(this,EventType.UPDATE_TITLE,t,t,null,-1,ViewType.CURRENT,0,null,null);
        }
      }
);
    }
  }
}
 

Example 60

From project packages_apps_Camera_1, under directory /src/com/android/camera/ui/.

Source file: BasicSettingPopup.java

  29 
vote

public void initialize(IconListPreference preference){
  mPreference=preference;
  Context context=getContext();
  CharSequence[] entries=mPreference.getEntries();
  int[] iconIds=mPreference.getImageIds();
  if (iconIds == null) {
    iconIds=mPreference.getLargeIconIds();
  }
  mTitle.setText(mPreference.getTitle());
  ArrayList<HashMap<String,Object>> listItem=new ArrayList<HashMap<String,Object>>();
  for (int i=0; i < entries.length; ++i) {
    HashMap<String,Object> map=new HashMap<String,Object>();
    map.put("text",entries[i].toString());
    if (iconIds != null)     map.put("image",iconIds[i]);
    listItem.add(map);
  }
  SimpleAdapter listItemAdapter=new SimpleAdapter(context,listItem,R.layout.setting_item,new String[]{"text","image"},new int[]{R.id.text,R.id.image});
  ((AbsListView)mSettingList).setAdapter(listItemAdapter);
  ((AbsListView)mSettingList).setOnItemClickListener(this);
  reloadPreference();
}
 

Example 61

From project packages_apps_Camera_2, under directory /src/com/android/camera/ui/.

Source file: BasicSettingPopup.java

  29 
vote

public void initialize(IconListPreference preference){
  mPreference=preference;
  Context context=getContext();
  CharSequence[] entries=mPreference.getEntries();
  int[] iconIds=mPreference.getImageIds();
  if (iconIds == null) {
    iconIds=mPreference.getLargeIconIds();
  }
  mTitle.setText(mPreference.getTitle());
  ArrayList<HashMap<String,Object>> listItem=new ArrayList<HashMap<String,Object>>();
  for (int i=0; i < entries.length; ++i) {
    HashMap<String,Object> map=new HashMap<String,Object>();
    map.put("text",entries[i].toString());
    if (iconIds != null)     map.put("image",iconIds[i]);
    listItem.add(map);
  }
  SimpleAdapter listItemAdapter=new SimpleAdapter(context,listItem,R.layout.setting_item,new String[]{"text","image"},new int[]{R.id.text,R.id.image});
  ((AbsListView)mSettingList).setAdapter(listItemAdapter);
  ((AbsListView)mSettingList).setOnItemClickListener(this);
  reloadPreference();
}
 

Example 62

From project platform_packages_apps_browser, under directory /src/com/android/browser/.

Source file: BrowserHistoryPage.java

  29 
vote

private void inflateTwoPane(ViewStub stub){
  stub.setLayoutResource(R.layout.preference_list_content);
  stub.inflate();
  mGroupList=(ListView)mRoot.findViewById(android.R.id.list);
  mPrefsContainer=(ViewGroup)mRoot.findViewById(R.id.prefs_frame);
  mFragmentBreadCrumbs=(FragmentBreadCrumbs)mRoot.findViewById(android.R.id.title);
  mFragmentBreadCrumbs.setMaxVisible(1);
  mFragmentBreadCrumbs.setActivity(getActivity());
  mPrefsContainer.setVisibility(View.VISIBLE);
  mGroupList.setAdapter(new HistoryGroupWrapper(mAdapter));
  mGroupList.setOnItemClickListener(mGroupItemClickListener);
  mGroupList.setChoiceMode(AbsListView.CHOICE_MODE_SINGLE);
  mChildWrapper=new HistoryChildWrapper(mAdapter);
  mChildList=new ListView(getActivity());
  mChildList.setAdapter(mChildWrapper);
  mChildList.setOnItemClickListener(mChildItemClickListener);
  registerForContextMenu(mChildList);
  ViewGroup prefs=(ViewGroup)mRoot.findViewById(R.id.prefs);
  prefs.addView(mChildList);
}
 

Example 63

From project platform_packages_apps_calendar, under directory /src/com/android/calendar/agenda/.

Source file: AgendaFragment.java

  29 
vote

@Override public void onScroll(AbsListView view,int firstVisibleItem,int visibleItemCount,int totalItemCount){
  int julianDay=mAgendaListView.getJulianDayFromPosition(firstVisibleItem - mAgendaListView.getHeaderViewsCount());
  if (julianDay == 0) {
    return;
  }
  if (mJulianDayOnTop != julianDay) {
    mJulianDayOnTop=julianDay;
    Time t=new Time(mTimeZone);
    t.setJulianDay(mJulianDayOnTop);
    mController.setTime(t.toMillis(true));
    if (!mIsTabletConfig) {
      view.post(new Runnable(){
        @Override public void run(){
          Time t=new Time(mTimeZone);
          t.setJulianDay(mJulianDayOnTop);
          mController.sendEvent(this,EventType.UPDATE_TITLE,t,t,null,-1,ViewType.CURRENT,0,null,null);
        }
      }
);
    }
  }
}
 

Example 64

From project platform_packages_apps_camera, under directory /src/com/android/camera/ui/.

Source file: BasicSettingPopup.java

  29 
vote

public void initialize(IconListPreference preference){
  mPreference=preference;
  Context context=getContext();
  CharSequence[] entries=mPreference.getEntries();
  int[] iconIds=mPreference.getImageIds();
  if (iconIds == null) {
    iconIds=mPreference.getLargeIconIds();
  }
  mTitle.setText(mPreference.getTitle());
  ArrayList<HashMap<String,Object>> listItem=new ArrayList<HashMap<String,Object>>();
  for (int i=0; i < entries.length; ++i) {
    HashMap<String,Object> map=new HashMap<String,Object>();
    map.put("text",entries[i].toString());
    if (iconIds != null)     map.put("image",iconIds[i]);
    listItem.add(map);
  }
  SimpleAdapter listItemAdapter=new BasicSettingAdapter(context,listItem,R.layout.setting_item,new String[]{"text","image"},new int[]{R.id.text,R.id.image});
  ((AbsListView)mSettingList).setAdapter(listItemAdapter);
  ((AbsListView)mSettingList).setOnItemClickListener(this);
  reloadPreference();
}
 

Example 65

From project platform_packages_apps_contacts, under directory /src/com/android/contacts/.

Source file: BackScrollManager.java

  29 
vote

@Override public void onScroll(AbsListView view,int firstVisibleItem,int visibleItemCount,int totalItemCount){
  if (firstVisibleItem != 0) {
    mHeader.setOffset(mHeader.getMaximumScrollableHeaderOffset());
    return;
  }
  View firstVisibleItemView=view.getChildAt(firstVisibleItem);
  if (firstVisibleItemView == null) {
    return;
  }
  int offset=Math.min((int)-view.getChildAt(firstVisibleItem).getY(),mHeader.getMaximumScrollableHeaderOffset());
  mHeader.setOffset(offset);
}
 

Example 66

From project platform_packages_apps_im, under directory /src/com/android/im/app/.

Source file: ChatView.java

  29 
vote

public void onScrollStateChanged(AbsListView view,int scrollState){
  int oldState=mScrollState;
  mScrollState=scrollState;
  if (mChatSession != null) {
    try {
      mChatSession.markAsRead();
    }
 catch (    RemoteException e) {
      mHandler.showServiceErrorAlert();
    }
  }
  if (oldState == OnScrollListener.SCROLL_STATE_FLING) {
    if (mNeedRequeryCursor) {
      requeryCursor();
    }
 else {
      notifyDataSetChanged();
    }
  }
}
 

Example 67

From project platform_packages_apps_launcher, under directory /src/com/android/launcher/.

Source file: Folder.java

  29 
vote

@Override protected void onFinishInflate(){
  super.onFinishInflate();
  mContent=(AbsListView)findViewById(R.id.content);
  mContent.setOnItemClickListener(this);
  mContent.setOnItemLongClickListener(this);
  mCloseButton=(Button)findViewById(R.id.close);
  mCloseButton.setOnClickListener(this);
  mCloseButton.setOnLongClickListener(this);
}
 

Example 68

From project platform_packages_apps_mms, under directory /src/com/android/mms/ui/.

Source file: MessageListAdapter.java

  29 
vote

public MessageListAdapter(Context context,Cursor c,ListView listView,boolean useDefaultColumnsMap,Pattern highlight){
  super(context,c,FLAG_REGISTER_CONTENT_OBSERVER);
  mContext=context;
  mHighlight=highlight;
  mInflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  mMessageItemCache=new MessageItemCache(CACHE_SIZE);
  if (useDefaultColumnsMap) {
    mColumnsMap=new ColumnsMap();
  }
 else {
    mColumnsMap=new ColumnsMap(c);
  }
  listView.setRecyclerListener(new AbsListView.RecyclerListener(){
    @Override public void onMovedToScrapHeap(    View view){
      if (view instanceof MessageListItem) {
        MessageListItem mli=(MessageListItem)view;
        mli.unbind();
      }
    }
  }
);
}
 

Example 69

From project platform_packages_apps_VideoEditor, under directory /src/com/android/videoeditor/.

Source file: BaseAdapterWithImages.java

  29 
vote

/** 
 * Constructor
 * @param context The context
 * @param listView The list view
 */
public BaseAdapterWithImages(Context context,AbsListView listView){
  mContext=context;
  mListView=listView;
  mLoadingImages=new HashSet<K>();
  mViewHolders=new ArrayList<ImageViewHolder<K>>();
  mListView.setRecyclerListener(new AbsListView.RecyclerListener(){
    @Override @SuppressWarnings("unchecked") public void onMovedToScrapHeap(    View view){
      final ImageViewHolder<K> viewHolder=(ImageViewHolder<K>)view.getTag();
      mViewHolders.remove(viewHolder);
      viewHolder.setKey(null);
      final BitmapDrawable drawable=(BitmapDrawable)viewHolder.mImageView.getDrawable();
      if (drawable != null && drawable.getBitmap() != null) {
        viewHolder.mImageView.setImageDrawable(null);
        drawable.getBitmap().recycle();
      }
    }
  }
);
}
 

Example 70

From project proxydroid, under directory /src/org/proxydroid/.

Source file: AppManager.java

  29 
vote

@Override public void handleMessage(Message msg){
switch (msg.what) {
case MSG_LOAD_START:
    pd=ProgressDialog.show(AppManager.this,"",getString(R.string.loading),true,true);
  break;
case MSG_LOAD_FINISH:
listApps.setAdapter(adapter);
listApps.setOnScrollListener(new OnScrollListener(){
boolean visible;
@Override public void onScrollStateChanged(AbsListView view,int scrollState){
  visible=true;
  if (scrollState == ListView.OnScrollListener.SCROLL_STATE_IDLE) {
    overlay.setVisibility(View.INVISIBLE);
  }
}
@Override public void onScroll(AbsListView view,int firstVisibleItem,int visibleItemCount,int totalItemCount){
  if (visible) {
    String name=apps[firstVisibleItem].getName();
    if (name != null && name.length() > 1)     overlay.setText(apps[firstVisibleItem].getName().substring(0,1));
 else     overlay.setText("*");
    overlay.setVisibility(View.VISIBLE);
  }
}
}
);
if (pd != null) {
pd.dismiss();
pd=null;
}
break;
}
super.handleMessage(msg);
}
 

Example 71

From project Racenet-for-Android, under directory /src/org/racenet/models/.

Source file: NewsListAdapter.java

  29 
vote

public View getChildView(int groupPosition,int childPosition,boolean isLastChild,View convertView,ViewGroup parent){
  AbsListView.LayoutParams lp=new AbsListView.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT);
  TextView textView=new TextView(context);
  textView.setLayoutParams(lp);
  textView.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT);
  textView.setPadding(10,10,10,10);
  textView.setText(getChild(groupPosition,childPosition).toString());
  return textView;
}
 

Example 72

From project ratebeer-for-Android, under directory /RateBeerForAndroid/src/com/ratebeer/android/gui/fragments/.

Source file: UserRatingsFragment.java

  29 
vote

@Override public void onScroll(AbsListView view,int firstVisibleItem,int visibleItemCount,int totalItemCount){
  boolean loadMore=totalItemCount > 0 && firstVisibleItem + visibleItemCount >= totalItemCount;
  if (loadMore && !loading) {
    pageNr++;
    loadRatings();
  }
}
 

Example 73

From project ratebeerforandroid, under directory /RateBeerForAndroid/src/com/ratebeer/android/gui/fragments/.

Source file: UserRatingsFragment.java

  29 
vote

@Override public void onScroll(AbsListView view,int firstVisibleItem,int visibleItemCount,int totalItemCount){
  boolean loadMore=totalItemCount > 0 && firstVisibleItem + visibleItemCount >= totalItemCount;
  if (loadMore && !loading) {
    pageNr++;
    loadRatings();
  }
}
 

Example 74

From project RA_Launcher, under directory /src/com/android/ra/launcher/.

Source file: ActivityPickerActivity.java

  29 
vote

public MyExpandableListAdapter(List<PackageInfo> g){
  super();
  groups=g;
  leftPadding=getResources().getDimensionPixelSize(android.R.dimen.app_icon_size);
  lpGroup=new AbsListView.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT);
  lpChild=new AbsListView.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,leftPadding);
}
 

Example 75

From project rbb, under directory /src/com/btmura/android/reddit/app/.

Source file: ThingListFragment.java

  29 
vote

public void onScroll(AbsListView view,int firstVisibleItem,int visibleItemCount,int totalItemCount){
  if (visibleItemCount <= 0 || scrollLoading) {
    return;
  }
  if (firstVisibleItem + visibleItemCount * 2 >= totalItemCount) {
    if (getLoaderManager().getLoader(0) != null) {
      if (!adapter.isEmpty()) {
        String more=adapter.getMoreThingId();
        if (!TextUtils.isEmpty(more)) {
          sync=true;
          scrollLoading=true;
          Bundle b=new Bundle(1);
          b.putString(LOADER_ARG_MORE,more);
          getLoaderManager().restartLoader(0,b,this);
        }
      }
    }
  }
}
 

Example 76

From project RebeLauncher, under directory /src/com/dirtypepper/rebelauncher/.

Source file: ActivityPickerActivity.java

  29 
vote

public MyExpandableListAdapter(List<PackageInfo> g){
  super();
  groups=g;
  leftPadding=getResources().getDimensionPixelSize(android.R.dimen.app_icon_size);
  lpGroup=new AbsListView.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT);
  lpChild=new AbsListView.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,leftPadding);
}
 

Example 77

From project RoboBinding, under directory /robobinding/src/main/java/org/robobinding/viewattribute/listview/.

Source file: HeaderAttributes.java

  29 
vote

@Override protected void addSubView(View subView,Context context){
  LinearLayout outerLinearLayout=new LinearLayout(context);
  AbsListView.LayoutParams layoutParams=new AbsListView.LayoutParams(AbsListView.LayoutParams.FILL_PARENT,AbsListView.LayoutParams.WRAP_CONTENT);
  outerLinearLayout.setLayoutParams(layoutParams);
  outerLinearLayout.setOrientation(LinearLayout.VERTICAL);
  outerLinearLayout.addView(subView);
  view.addHeaderView(outerLinearLayout);
}
 

Example 78

From project ROM-Updater, under directory /src/org/elegosproject/romupdater/.

Source file: RepositoriesList.java

  29 
vote

public TextView getGenericView(){
  AbsListView.LayoutParams lp=new AbsListView.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,74);
  TextView textView=new TextView(RepositoriesList.this);
  textView.setLayoutParams(lp);
  textView.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT);
  textView.setPadding(56,0,0,0);
  return textView;
}
 

Example 79

From project Schedule, under directory /libs/android/sherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  29 
vote

public void onScrollStateChanged(AbsListView view,int scrollState){
  if (scrollState == SCROLL_STATE_TOUCH_SCROLL && !isInputMethodNotNeeded() && mPopup.getContentView() != null) {
    mHandler.removeCallbacks(mResizePopupRunnable);
    mResizePopupRunnable.run();
  }
}
 

Example 80

From project SchoolPlanner4Untis, under directory /src/com/tani/app/ui/.

Source file: IconContextMenu.java

  29 
vote

@Override public View getView(int position,View convertView,ViewGroup parent){
  IconContextMenuItem item=(IconContextMenuItem)getItem(position);
  Resources res=parentActivity.getResources();
  if (convertView == null) {
    TextView temp=new TextView(context);
    AbsListView.LayoutParams param=new AbsListView.LayoutParams(AbsListView.LayoutParams.FILL_PARENT,AbsListView.LayoutParams.WRAP_CONTENT);
    temp.setLayoutParams(param);
    temp.setPadding((int)toPixel(res,15),0,(int)toPixel(res,15),0);
    temp.setGravity(android.view.Gravity.CENTER_VERTICAL);
    Theme th=context.getTheme();
    TypedValue tv=new TypedValue();
    if (th.resolveAttribute(android.R.attr.textAppearanceLargeInverse,tv,true)) {
      temp.setTextAppearance(context,tv.resourceId);
    }
    temp.setMinHeight(LIST_PREFERED_HEIGHT);
    temp.setCompoundDrawablePadding((int)toPixel(res,14));
    convertView=temp;
  }
  TextView textView=(TextView)convertView;
  textView.setTag(item);
  textView.setText(item.text);
  textView.setCompoundDrawablesWithIntrinsicBounds(item.image,null,null,null);
  return textView;
}
 

Example 81

From project SeriesGuide, under directory /ActionBarSherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  29 
vote

public void onScrollStateChanged(AbsListView view,int scrollState){
  if (scrollState == SCROLL_STATE_TOUCH_SCROLL && !isInputMethodNotNeeded() && mPopup.getContentView() != null) {
    mHandler.removeCallbacks(mResizePopupRunnable);
    mResizePopupRunnable.run();
  }
}
 

Example 82

From project SMSSync, under directory /abslib/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  29 
vote

public void onScrollStateChanged(AbsListView view,int scrollState){
  if (scrollState == SCROLL_STATE_TOUCH_SCROLL && !isInputMethodNotNeeded() && mPopup.getContentView() != null) {
    mHandler.removeCallbacks(mResizePopupRunnable);
    mResizePopupRunnable.run();
  }
}
 

Example 83

From project SOCIETIES-SCE-Services, under directory /3rdPartyServices/StudentServices/NearMe/Android/src/com/asocom/tools/.

Source file: IconContextMenu.java

  29 
vote

public View getView(int position,View convertView,ViewGroup parent){
  IconContextMenuItem item=(IconContextMenuItem)getItem(position);
  Resources res=parentActivity.getResources();
  if (convertView == null) {
    TextView temp=new TextView(context);
    AbsListView.LayoutParams param=new AbsListView.LayoutParams(AbsListView.LayoutParams.FILL_PARENT,AbsListView.LayoutParams.WRAP_CONTENT);
    temp.setLayoutParams(param);
    temp.setPadding((int)toPixel(res,15),0,(int)toPixel(res,15),0);
    temp.setGravity(android.view.Gravity.CENTER_VERTICAL);
    Theme th=context.getTheme();
    TypedValue tv=new TypedValue();
    if (th.resolveAttribute(android.R.attr.textAppearanceLargeInverse,tv,true)) {
      temp.setTextAppearance(context,tv.resourceId);
    }
    temp.setMinHeight(LIST_PREFERED_HEIGHT);
    temp.setCompoundDrawablePadding((int)toPixel(res,14));
    convertView=temp;
  }
  TextView textView=(TextView)convertView;
  textView.setTag(item);
  textView.setText(item.text);
  textView.setCompoundDrawablesWithIntrinsicBounds(item.image,null,null,null);
  return textView;
}
 

Example 84

From project Something-Awful-Android, under directory /libraries/pulltorefresh/src/com/markupartist/android/widget/.

Source file: PullToRefreshListView.java

  29 
vote

@Override public void onScroll(AbsListView view,int firstVisibleItem,int visibleItemCount,int totalItemCount){
  if (mCurrentScrollState == SCROLL_STATE_TOUCH_SCROLL && mRefreshState != REFRESHING) {
    if (firstVisibleItem == 0) {
      mRefreshViewImage.setVisibility(View.VISIBLE);
      if ((mRefreshView.getBottom() >= mRefreshViewHeight + 20 || mRefreshView.getTop() >= 0) && mRefreshState != RELEASE_TO_REFRESH) {
        mRefreshViewText.setText(R.string.pull_to_refresh_release_label);
        mRefreshViewImage.clearAnimation();
        mRefreshViewImage.startAnimation(mFlipAnimation);
        mRefreshState=RELEASE_TO_REFRESH;
      }
 else       if (mRefreshView.getBottom() < mRefreshViewHeight + 20 && mRefreshState != PULL_TO_REFRESH) {
        mRefreshViewText.setText(R.string.pull_to_refresh_pull_label);
        if (mRefreshState != TAP_TO_REFRESH) {
          mRefreshViewImage.clearAnimation();
          mRefreshViewImage.startAnimation(mReverseFlipAnimation);
        }
        mRefreshState=PULL_TO_REFRESH;
      }
    }
 else {
      mRefreshViewImage.setVisibility(View.GONE);
      resetHeader();
    }
  }
 else   if (mCurrentScrollState == SCROLL_STATE_FLING && firstVisibleItem == 0 && mRefreshState != REFRESHING) {
    setSelection(1);
    mBounceHack=true;
  }
 else   if (mBounceHack && mCurrentScrollState == SCROLL_STATE_FLING) {
    setSelection(1);
  }
  if (mOnScrollListener != null) {
    mOnScrollListener.onScroll(view,firstVisibleItem,visibleItemCount,totalItemCount);
  }
}
 

Example 85

From project SpeakBird, under directory /src/com/lorenzobraghetto/speakbird/View/.

Source file: Mentions.java

  29 
vote

public void onScroll(AbsListView view,int firstVisibleItem,int visibleItemCount,int totalItemCount){
  if (started) {
    if (firstVisibleItem > 1)     nottop=true;
 else     nottop=false;
    getSherlockActivity().invalidateOptionsMenu();
    if (loading) {
      if (totalItemCount > previousTotal) {
        loading=false;
        previousTotal=totalItemCount;
      }
    }
    if (!loading && (totalItemCount - visibleItemCount) <= (firstVisibleItem + visibleThreshold)) {
      new mentionsUpdate(true).execute();
      loading=true;
    }
  }
}
 

Example 86

From project SqueezeControl, under directory /src/com/squeezecontrol/.

Source file: AbstractMusicBrowserActivity.java

  29 
vote

@Override public void onScroll(AbsListView view,int firstVisibleItem,int visibleItemCount,int totalItemCount){
  int startPage=firstVisibleItem / PAGE_SIZE;
  int endPage=(firstVisibleItem + visibleItemCount) / PAGE_SIZE;
  if (!mLoadedPages.contains(startPage))   try {
    mPageLoadQueue.put(new PageLoadCommand(mQueryVersion,startPage));
  }
 catch (  InterruptedException e) {
  }
  if (startPage != endPage && !mLoadedPages.contains(endPage)) {
    try {
      mPageLoadQueue.put(new PageLoadCommand(mQueryVersion,endPage));
    }
 catch (    InterruptedException e) {
    }
  }
}
 

Example 87

From project SVQCOM, under directory /Core/src/com/ushahidi/android/app/ui/.

Source file: PullToRefreshListView.java

  29 
vote

public void onScroll(AbsListView view,int firstVisibleItem,int visibleItemCount,int totalItemCount){
  if (mCurrentScrollState == SCROLL_STATE_TOUCH_SCROLL && mRefreshState != REFRESHING) {
    if (firstVisibleItem == 0) {
      mRefreshViewImage.setVisibility(View.VISIBLE);
      if ((mRefreshView.getBottom() > mRefreshViewHeight + 20 || mRefreshView.getTop() >= 0) && mRefreshState != RELEASE_TO_REFRESH) {
        mRefreshViewText.setText(R.string.pull_to_refresh_release_label);
        mRefreshViewImage.clearAnimation();
        mRefreshViewImage.startAnimation(mFlipAnimation);
        mRefreshState=RELEASE_TO_REFRESH;
      }
 else       if (mRefreshView.getBottom() < mRefreshViewHeight + 20 && mRefreshState != PULL_TO_REFRESH) {
        mRefreshViewText.setText(R.string.pull_to_refresh_pull_label);
        if (mRefreshState != TAP_TO_REFRESH) {
          mRefreshViewImage.clearAnimation();
          mRefreshViewImage.startAnimation(mReverseFlipAnimation);
        }
        mRefreshState=PULL_TO_REFRESH;
      }
    }
 else {
      mRefreshViewImage.setVisibility(View.GONE);
      resetHeader();
    }
  }
 else   if (mCurrentScrollState == SCROLL_STATE_FLING && firstVisibleItem == 0 && mRefreshState != REFRESHING) {
    setSelection(1);
  }
}
 

Example 88

From project SWE12-Drone, under directory /catroid/src/at/tugraz/ist/catroid/ui/dialogs/.

Source file: CustomIconContextMenu.java

  29 
vote

public View getView(int position,View convertView,ViewGroup parent){
  CustomContextMenuItem item=(CustomContextMenuItem)getItem(position);
  Resources resource=activity.getResources();
  if (convertView == null) {
    TextView tempTextView=new TextView(context);
    AbsListView.LayoutParams param=new AbsListView.LayoutParams(AbsListView.LayoutParams.FILL_PARENT,AbsListView.LayoutParams.WRAP_CONTENT);
    tempTextView.setLayoutParams(param);
    tempTextView.setPadding((int)toPixel(resource,15),0,(int)toPixel(resource,15),0);
    tempTextView.setGravity(android.view.Gravity.CENTER_VERTICAL);
    Theme theme=context.getTheme();
    TypedValue typedValue=new TypedValue();
    if (theme.resolveAttribute(android.R.attr.textAppearanceLargeInverse,typedValue,true)) {
      tempTextView.setTextAppearance(context,typedValue.resourceId);
    }
    tempTextView.setMinHeight(LIST_HEIGHT);
    tempTextView.setCompoundDrawablePadding((int)toPixel(resource,14));
    convertView=tempTextView;
  }
  TextView textView=(TextView)convertView;
  textView.setTextColor(Color.BLACK);
  textView.setTag(item);
  textView.setText(item.text);
  textView.setCompoundDrawablesWithIntrinsicBounds(item.icon,null,null,null);
  textView.setBackgroundResource(R.color.contextmenu_item_background);
  return textView;
}
 

Example 89

From project The-Reverse-Recipe-Book, under directory /actionbarsherlock4.0/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  29 
vote

public void onScrollStateChanged(AbsListView view,int scrollState){
  if (scrollState == SCROLL_STATE_TOUCH_SCROLL && !isInputMethodNotNeeded() && mPopup.getContentView() != null) {
    mHandler.removeCallbacks(mResizePopupRunnable);
    mResizePopupRunnable.run();
  }
}
 

Example 90

From project titanium_modules, under directory /beintoosdk/mobile/android/src/com/beintoo/activities/leaderboard/.

Source file: Leaderboard.java

  29 
vote

@Override public void onScroll(AbsListView view,int firstVisibleItem,int visibleItemCount,int totalItemCount){
  try {
    if (!isLoading && !hasReachedEnd) {
      if (firstVisibleItem != 0 && (firstVisibleItem > totalItemCount - 10)) {
        isLoading=true;
        listView.addFooterView(loadingFooter());
        startLoadingMore();
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
 

Example 91

From project ToolkitForAndroid, under directory /src/main/java/com/apkits/android/ui/.

Source file: HolderViewFiller.java

  29 
vote

/** 
 * </br><b>description :</b>?????????View? </br><b>time :</b> 2012-7-18 ???7:41:55
 * @param view
 * @param data
 */
public void update(AbsListView view,List<T> data){
  HolderAdapter<T> holderAdapter=exportAdapter(view);
  if (null != holderAdapter) {
    holderAdapter.update(data);
  }
}
 

Example 92

From project twidere, under directory /src/com/handmark/pulltorefresh/library/.

Source file: PullToRefreshAdapterViewBase.java

  29 
vote

@Override public final void onScroll(final AbsListView view,final int firstVisibleItem,final int visibleItemCount,final int totalItemCount){
  if (DEBUG) {
    Log.d(LOG_TAG,"First Visible: " + firstVisibleItem + ". Visible Count: "+ visibleItemCount+ ". Total Items: "+ totalItemCount);
  }
  if (null != mOnLastItemVisibleListener) {
    final int lastVisibleItemIndex=firstVisibleItem + visibleItemCount;
    if (visibleItemCount > 0 && lastVisibleItemIndex + 1 == totalItemCount) {
      if (lastVisibleItemIndex != mSavedLastVisibleIndex) {
        mSavedLastVisibleIndex=lastVisibleItemIndex;
        mOnLastItemVisibleListener.onLastItemVisible();
      }
    }
  }
  if (null != mOnScrollListener) {
    mOnScrollListener.onScroll(view,firstVisibleItem,visibleItemCount,totalItemCount);
  }
}