/** * Whether child view can scroll up * @return */ public boolean canChildScrollUp() { if (mTargetView == null) { return false; } if (Build.VERSION.SDK_INT < 14) { if (mTargetView instanceof AbsListView) { final AbsListView absListView = (AbsListView) mTargetView; return absListView.getChildCount() > 0 && (absListView.getFirstVisiblePosition() > 0 || absListView.getChildAt(0) .getTop() < absListView.getPaddingTop()); } else { return ViewCompat.canScrollVertically(mTargetView, -1) || mTargetView.getScrollY() > 0; } } else { return ViewCompat.canScrollVertically(mTargetView, -1); } }
@Override public void onScrollStateChanged(AbsListView view, int scrollState) { Log.d("onScrollStateChanged", "totalItemCount = " + totalItemCount + " lastVisibleItem = " + lastVisibleItem + " scrollState = " + scrollState); if (totalItemCount + getHeaderViewsCount() + getFooterViewsCount() == lastVisibleItem && scrollState == SCROLL_STATE_IDLE) { if (!isLoading) { isLoading = true; footer.findViewById(R.id.load_layout).setVisibility(View.VISIBLE); // 加载更多 if (iLoadListener != null && !isLoadFinish) { iLoadListener.onLoad(); } else { //所有内容加载完毕 loadComplete(true); } } } }
/** * 隐藏或展示Item * * @param visible */ public void setItemVisible(boolean visible) { if (null != itemView) { if (visible) { if (null != itemView.getLayoutParams()) { itemView.getLayoutParams().width = AbsListView.LayoutParams.MATCH_PARENT; itemView.getLayoutParams().height = AbsListView.LayoutParams.WRAP_CONTENT; } else { itemView.setLayoutParams(new AbsListView.LayoutParams(AbsListView.LayoutParams.MATCH_PARENT, AbsListView.LayoutParams.WRAP_CONTENT)); } itemView.setVisibility(View.VISIBLE); } else { if (null != itemView.getLayoutParams()) { itemView.getLayoutParams().width = -1; itemView.getLayoutParams().height = 1; } else { itemView.setLayoutParams(new AbsListView.LayoutParams(-1, 1)); } itemView.setVisibility(View.GONE); } } }
public boolean canChildScrollDown() { if (android.os.Build.VERSION.SDK_INT < 14) { if (mTarget instanceof AbsListView) { final AbsListView absListView = (AbsListView) mTarget; View lastChild = absListView.getChildAt(absListView.getChildCount() - 1); if (lastChild != null) { return (absListView.getLastVisiblePosition() == (absListView.getCount() - 1)) && lastChild.getBottom() > absListView.getPaddingBottom(); } else { return false; } } else { return mTarget.getHeight() - mTarget.getScrollY() > 0; } } else { return ViewCompat.canScrollVertically(mTarget, 1); } }
public static boolean canChildScrollUp(View view) { if (Build.VERSION.SDK_INT < 14) { if (view instanceof AbsListView) { final AbsListView absListView = (AbsListView) view; return absListView.getChildCount() > 0 && (absListView.getFirstVisiblePosition() > 0 || absListView.getChildAt(0).getTop() < absListView.getPaddingTop()); } else { return ViewCompat.canScrollVertically(view, -1) || view.getScrollY() > 0; } } else { if (Build.VERSION.SDK_INT < 26) return ViewCompat.canScrollVertically(view, -1); else return view.canScrollVertically(-1); } }
private void highlightItems(List<String> items) { if (items == null) return; if (items.size() > 1) { // Required for us to select all the new items. Gets reset to normal when one is selected. mListView.setChoiceMode(AbsListView.CHOICE_MODE_MULTIPLE); } int minIndex = Integer.MAX_VALUE; for (String path: items) { BookOrShelf item = _bookCollection.getBookByPath(path); int bookIndex = _bookCollection.indexOf(item); if (bookIndex >= 0) { mListView.setItemChecked(bookIndex, true); minIndex = Math.min(minIndex, bookIndex); } } if (minIndex < Integer.MAX_VALUE) { mListView.smoothScrollToPosition(minIndex); } }
public void onScrollStateChanged(AbsListView view, int scrollState) { switch (scrollState) { case 0: this.imageLoader.resume(); break; case 1: if (this.pauseOnScroll) { this.imageLoader.pause(); break; } break; case 2: if (this.pauseOnFling) { this.imageLoader.pause(); break; } break; } if (this.externalListener != null) { this.externalListener.onScrollStateChanged(view, scrollState); } }
/** * 用来判断是否可以下拉 */ public static boolean canChildScrollUp(View mChildView) { if (mChildView == null) { return false; } if (Build.VERSION.SDK_INT < 14) { if (mChildView instanceof AbsListView) { final AbsListView absListView = (AbsListView) mChildView; return absListView.getChildCount() > 0 && (absListView.getFirstVisiblePosition() > 0 || absListView.getChildAt(0) .getTop() < absListView.getPaddingTop()); } else { return ViewCompat.canScrollVertically(mChildView, -1) || mChildView.getScrollY() > 0; } } else { return ViewCompat.canScrollVertically(mChildView, -1); } }
/** * 递归遍历子view,记录所有的AbsListView, ScrollView * * @param absListViews * @param parent */ private void getAllCanScrollView(List<AbsListView> absListViews, List<ScrollView> scrollViews, ViewGroup parent) { int childCount = parent.getChildCount(); for (int i = 0; i < childCount; i++) { View child = parent.getChildAt(i); if (child instanceof AbsListView) { absListViews.add((AbsListView) child); } else if (child instanceof ScrollView) { scrollViews.add((ScrollView) child); } else { if (child instanceof ViewGroup) { // 递归遍历子View getAllCanScrollView(absListViews, scrollViews, (ViewGroup) child); } } } }
private static boolean scrollToTop(View view) { if (Build.VERSION.SDK_INT < 14) { if (view instanceof AbsListView) { final AbsListView absListView = (AbsListView) view; return absListView.getChildCount() > 0 && (absListView.getLastVisiblePosition() < absListView.getChildCount() - 1 || absListView.getChildAt(absListView.getChildCount() - 1).getBottom() > absListView.getPaddingBottom()); } else { return ViewCompat.canScrollVertically(view, 1) || view.getScrollY() < 0; } } else { return ViewCompat.canScrollVertically(view, 1); } }
@Override public void fling(int velocity) { if (mScrollableView instanceof ScrollView) { ((ScrollView) mScrollableView).fling(velocity); } else if (mScrollableView instanceof AbsListView) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { ((AbsListView) mScrollableView).fling(velocity); } } else if (mScrollableView instanceof WebView) { ((WebView) mScrollableView).flingScroll(0, velocity); } else if (mScrollableView instanceof RecyclerView) { ((RecyclerView) mScrollableView).fling(0, velocity); } else if (mScrollableView instanceof NestedScrollView) { ((NestedScrollView) mScrollableView).fling(velocity); } }
@Override public boolean onItemLongClick(AdapterView<?> view, View row, int position, long id) { if (mMode == null) { getGridView().setChoiceMode(AbsListView.CHOICE_MODE_MULTIPLE); getGridView().invalidateViews(); mMode = mContext.startSupportActionMode(this); } else { getGridView().setChoiceMode(AbsListView.CHOICE_MODE_SINGLE); getGridView().invalidateViews(); mMode.finish(); } return (true); }
/** * 当滚动状态改变时回调 */ @Override public void onScrollStateChanged(AbsListView view, int scrollState) { if (onScrollListener != null) { onScrollListener.onScrollStateChanged(view, scrollState); } if (scrollState == SCROLL_STATE_IDLE || scrollState == SCROLL_STATE_FLING) { // 判断当前是否已经到了底部 if (footerView != null) if (isScrollToBottom && !isLoadingMore) { isLoadingMore = true; // 当前到底部 Log.i(TAG, "加载更多数据"); footerView.setPadding(0, 0, 0, 0); listView.setSelection(listView.getCount()); if (mOnRefershListener != null) { mOnRefershListener.onLoadingMore(); } } } }
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { mCurrentFirstVisibleItem = firstVisibleItem; mCurrentVisibleItemCount = visibleItemCount; mPreviousFirstVisibleItem = (mPreviousFirstVisibleItem == -1) ? mCurrentFirstVisibleItem : mPreviousFirstVisibleItem; mPreviousVisibleItemCount = (mPreviousVisibleItemCount == -1) ? mCurrentVisibleItemCount : mPreviousVisibleItemCount; checkAndHandleFirstVisibleCellChange(); checkAndHandleLastVisibleCellChange(); mPreviousFirstVisibleItem = mCurrentFirstVisibleItem; mPreviousVisibleItemCount = mCurrentVisibleItemCount; if (isPostHoneycomb() && mWobbleInEditMode) { updateWobbleState(visibleItemCount); } if (mUserScrollListener != null) { mUserScrollListener.onScroll(view, firstVisibleItem, visibleItemCount, totalItemCount); } }
@Override public final boolean onCreateActionMode(ActionMode actionMode, Menu menu) { if (mListener.onCreateActionMode(actionMode, menu)) { mActionMode = actionMode; // Keep a reference to the existing OnItemClickListener so we can restore it mOldItemClickListener = mListView.getOnItemClickListener(); // Set-up the ListView to emulate CHOICE_MODE_MULTIPLE_MODAL mListView.setOnItemClickListener(this); mListView.setChoiceMode(AbsListView.CHOICE_MODE_MULTIPLE); mListView.removeCallbacks(mSetChoiceModeNoneRunnable); // If there are some items to check, do it now if (mItemsToCheck != null) { for (Pair<Integer, Long> posAndId : mItemsToCheck) { mListView.setItemChecked(posAndId.first, true); // Notify the listener that the item has been checked mListener.onItemCheckedStateChanged(mActionMode, posAndId.first, posAndId.second, true); } } return true; } return false; }
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); } /** * Set whether the Last Item is Visible. lastVisibleItemIndex is a * zero-based index, so we minus one totalItemCount to check */ if (null != mOnLastItemVisibleListener) { mLastItemVisible = (totalItemCount > 0) && (firstVisibleItem + visibleItemCount >= totalItemCount - 1); } // If we're showing the indicator, check positions... if (getShowIndicatorInternal()) { updateIndicatorViewsVisibility(); } // Finally call OnScrollListener if we have one if (null != mOnScrollListener) { mOnScrollListener.onScroll(view, firstVisibleItem, visibleItemCount, totalItemCount); } }
private int getMeasuredRowHeight(ATableViewCell cell, NSIndexPath indexPath, boolean cache) { // closes #12, use table width instead cell since sometimes returns zero // for WRAP_CONTENT height cells. int widthMeasureSpec = MeasureSpec.makeMeasureSpec( mTableView.getWidth(), MeasureSpec.EXACTLY); int heightMeasureSpec = MeasureSpec.makeMeasureSpec( AbsListView.LayoutParams.WRAP_CONTENT, MeasureSpec.EXACTLY); cell.measure(widthMeasureSpec, heightMeasureSpec); // add measured height to cache, so we don't have to recalculate every // time. int height = (int) (cell.getMeasuredHeight() / cell.getResources() .getDisplayMetrics().density); if (cache) { mRowsHeight.get(indexPath.getSection()).set(indexPath.getRow(), height); } return height; }
/** * Wraps the given <var>scrollableView</var> into scrollable wrapper implementation that best * suits to the type of the given view. * * @param scrollableView The scrollable view to be wrapped into scrollable wrapper. * @return New scrollable wrapper instance. See description of this class for supported wrappers. */ @SuppressWarnings("unchecked") public static <V extends View> ScrollableWrapper<V> wrapScrollableView(@NonNull V scrollableView) { if (scrollableView instanceof AbsListView) { return new AbsListViewWrapper((AbsListView) scrollableView); } else if (scrollableView instanceof RecyclerView) { return new RecyclerViewWrapper((RecyclerView) scrollableView); } else if (scrollableView instanceof ScrollView) { return new ScrollViewWrapper((ScrollView) scrollableView); } else if (scrollableView instanceof HorizontalScrollView) { return new HorizontalScrollViewWrapper((HorizontalScrollView) scrollableView); } else if (scrollableView instanceof ViewPager) { return new ViewPagerWrapper((ViewPager) scrollableView); } else if (scrollableView instanceof WebView) { return new WebViewWrapper((WebView) scrollableView); } return new ViewWrapper(scrollableView); }
@Override public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { if(loading) { if(totalItemCount > previousTotal) { loading = false; previousTotal = totalItemCount; currentPage++; } } if(!loading && (totalItemCount - visibleItemCount) <= (firstVisibleItem + visibleThreshold)) { query.setPage(currentPage); new ConnectionSearchTask(context).execute(query); loading = true; } }
public void onScrollStateChanged(AbsListView view, int scrollState) { if (scrollState == SCROLL_STATE_FLING) { // User fling is always preceded by a touch scroll if (mPreviousScrollState == SCROLL_STATE_TOUCH_SCROLL) { mMyScrollState = MY_SCROLL_STATE_USER; } else { // Fling state is due to a call to smoothScroll() mMyScrollState = MY_SCROLL_STATE_AUTO; } } else if (scrollState == SCROLL_STATE_TOUCH_SCROLL) { // Touch scroll is always done by the user mMyScrollState = MY_SCROLL_STATE_USER; } else { mMyScrollState = MY_SCROLL_STATE_IDLE; } mPreviousScrollState = scrollState; }
/** * Find out the scrollable child view * 这里添加了常用的一些可滑动类,特殊类需要添加 * * @param target targetView */ private void findScrollView(ViewGroup target) { final int count = target.getChildCount(); if (count > 0) { for (int i = 0; i < count; i++) { final View child = target.getChildAt(i); if (child instanceof AbsListView || isInstanceOfClass(child, ScrollView.class.getName()) || isInstanceOfClass(child, NestedScrollView.class.getName()) || isInstanceOfClass(child, RecyclerView.class.getName()) || child instanceof HorizontalScrollView || child instanceof ViewPager || child instanceof WebView) { mScrollChild = child; break; } else if (child instanceof ViewGroup) { findScrollView((ViewGroup) child); } } } if (mScrollChild == null) mScrollChild = target; }
/** * 判断目标View是否滑动到顶部-还能否继续滑动 * * @return */ public boolean isChildScrollToTop() { if (Build.VERSION.SDK_INT < 14) { if (mTarget instanceof AbsListView) { final AbsListView absListView = (AbsListView) mTarget; return !(absListView.getChildCount() > 0 && (absListView .getFirstVisiblePosition() > 0 || absListView .getChildAt(0).getTop() < absListView.getPaddingTop())); } else { return !(mTarget.getScrollY() > 0); } } else { return !ViewCompat.canScrollVertically(mTarget, -1); } }
@Override public View getView(final int position, final View convertView, ViewGroup parent) { final Button img = new Button(context); int width = ScreenUtils.getScreenWidth(context) - DensityUtils.dp2px(context, 45);// 获取屏幕宽度 int height = 0; width = width / 5;// 对当前的列数进行设置imgView的宽度 height = width * 5 / 6; if (!weeklist[position]) { img.setBackgroundResource(R.color.new_grty); } else { img.setBackgroundResource(R.color.colorPrimary); } img.setText(String.valueOf(position + 1)); img.setTextColor(Color.WHITE); AbsListView.LayoutParams layout = new AbsListView.LayoutParams(width, height); img.setLayoutParams(layout); img.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (type == SHOW_COURSE) return; if (weeklist[position]) { img.setBackgroundResource(R.color.new_grty); weeklist[position] = false; } else if (!weeklist[position]) { img.setBackgroundResource(R.color.colorPrimary); weeklist[position] = true; } } }); return img; }
/** * 当滚动时调用 * * @param firstVisibleItem 当前屏幕显示在顶部的item的position * @param visibleItemCount 当前屏幕显示了多少个条目的总数 * @param totalItemCount ListView的总条目的总数 */ @Override public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { if (onScrollListener != null) { onScrollListener.onScroll(view, firstVisibleItem, visibleItemCount, totalItemCount); } firstVisibleItemPosition = firstVisibleItem; if (listView.getLastVisiblePosition() == (totalItemCount - 1)) { isScrollToBottom = true; } else { isScrollToBottom = false; } }
@Override public void requestDisallowInterceptTouchEvent(boolean b) { // if this is a List < L or another view that doesn't support nested // scrolling, ignore this request so that the vertical scroll event // isn't stolen if ((android.os.Build.VERSION.SDK_INT < 21 && mTarget instanceof AbsListView) || (mTarget != null && !ViewCompat.isNestedScrollingEnabled(mTarget))) { // Nope. } else { super.requestDisallowInterceptTouchEvent(b); } }
@Override public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { View childAt = view.getChildAt(0); if (childAt == null) return; int scrollY = firstVisibleItem * childAt.getHeight() - childAt.getTop(); if (scrollY <= (mScreenHeight / 3f)) { float alpha = 1f - (scrollY / (mScreenHeight / 3f)); Log.e("CSDN_LQR", "scrollY = " + scrollY); Log.e("CSDN_LQR", "alpha = " + alpha); mToolbar.setAlpha(alpha); } }
/** * Whether it is possible for the child view of this layout to * scroll down. Override this if the child view is a custom view. * * @return */ protected boolean canChildScrollDown() { if (android.os.Build.VERSION.SDK_INT < 14) { if (mTargetView instanceof AbsListView) { final AbsListView absListView = (AbsListView) mTargetView; return absListView.getChildCount() > 0 && (absListView.getLastVisiblePosition() < absListView.getChildCount() - 1 || absListView.getChildAt(absListView.getChildCount() - 1).getBottom() > absListView.getPaddingBottom()); } else { return ViewCompat.canScrollVertically(mTargetView, 1) || mTargetView.getScrollY() < 0; } } else { return ViewCompat.canScrollVertically(mTargetView, 1); } }
public void onScrollStateChanged(AbsListView view, int scrollState) { if (scrollState == 0) { this.mIsScroll = false; notifyDataSetChanged(); } else if (scrollState == 1) { this.mIsScroll = true; } else if (scrollState == 2) { this.mIsScroll = true; } }
public void onScrollStateChanged(AbsListView view, int scrollState) { if (this.isQuickSearch) { KeyBoardUtils.closeAll(this.ctx); } if (scrollState == 0 && this.mTotalcount == this.mLastindex && this.mPage <= 10 && this .mPage > this.mCurrentPage) { this.mCurrentPage = this.mPage; loadData(this.mQueryString); } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_contacts_picker); listView = (ListView) findViewById(R.id.list_view); listView.setOnItemClickListener(this); listView.setChoiceMode(AbsListView.CHOICE_MODE_NONE); if (ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_CONTACTS) != PackageManager.PERMISSION_GRANTED) ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_CONTACTS}, 0); else loadData(); }
/** * @return Whether it is possible for the child view of this layout to * scroll up. Override this if the child view is a custom view. */ public boolean canChildScrollUp() { if (android.os.Build.VERSION.SDK_INT < 14) { if (mTarget instanceof AbsListView) { final AbsListView absListView = (AbsListView) mTarget; return absListView.getChildCount() > 0 && (absListView.getFirstVisiblePosition() > 0 || absListView.getChildAt(0) .getTop() < absListView.getPaddingTop()); } else { return ViewCompat.canScrollVertically(mTarget, -1) || mTarget.getScrollY() > 0; } } else { return ViewCompat.canScrollVertically(mTarget, -1); } }
private TabView createTabView(Tab tab, boolean forAdapter) { TabView tabView = new TabView(getContext(), tab, forAdapter); if (forAdapter) { tabView.setBackgroundDrawable(null); tabView.setLayoutParams(new AbsListView.LayoutParams(-1, this.mContentHeight)); } else { tabView.setFocusable(true); if (this.mTabClickListener == null) { this.mTabClickListener = new TabClickListener(); } tabView.setOnClickListener(this.mTabClickListener); } return tabView; }
/** * Updates the title and selected month if the view has moved to a new * month. */ @Override public void onScroll( AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { MonthView child = (MonthView) view.getChildAt(0); if (child == null) { return; } // Figure out where we are long currScroll = view.getFirstVisiblePosition() * child.getHeight() - child.getBottom(); mPreviousScrollPosition = currScroll; mPreviousScrollState = mCurrentScrollState; }
private void createListView() { root = (FrameLayout) inflater.inflate(R.layout.qrh__listview_container, null); root.addView(content); listView.getViewTreeObserver().addOnGlobalLayoutListener(this); ListViewScrollObserver observer = new ListViewScrollObserver(listView); // listView.setOnScrollListener(this); observer.setOnScrollUpAndDownListener(new OnListViewScrollListener() { @Override public void onScrollUpDownChanged(int delta, int scrollPosition, boolean exact) { onNewScroll(delta); snap(headerTop == scrollPosition); } @Override public void onScrollIdle() { QuickReturnHeaderHelper.this.onScrollIdle(); } }); root.addView(realHeader, realHeaderLayoutParams); dummyHeader = new View(context); AbsListView.LayoutParams params = new AbsListView.LayoutParams( LayoutParams.MATCH_PARENT, headerHeight); dummyHeader.setLayoutParams(params); listView.addHeaderView(dummyHeader); }
public static boolean isAbsListViewToBottom(AbsListView absListView) { if (absListView != null && absListView.getAdapter() != null && absListView.getChildCount() > 0 && absListView.getLastVisiblePosition() == absListView.getAdapter().getCount() - 1) { View lastChild = absListView.getChildAt(absListView.getChildCount() - 1); return lastChild.getBottom() >= absListView.getMeasuredHeight(); //return true; } return false; }
private boolean performAdapterViewItemLongClick() { if (getOpenStatus() != Status.Close) return false; ViewParent t = getParent(); if (t instanceof AdapterView) { AdapterView view = (AdapterView) t; int p = view.getPositionForView(SwipeLayout.this); if (p == AdapterView.INVALID_POSITION) return false; long vId = view.getItemIdAtPosition(p); boolean handled = false; try { Method m = AbsListView.class.getDeclaredMethod("performLongPress", View.class, int.class, long.class); m.setAccessible(true); handled = (boolean) m.invoke(view, SwipeLayout.this, p, vId); } catch (Exception e) { e.printStackTrace(); if (view.getOnItemLongClickListener() != null) { handled = view.getOnItemLongClickListener().onItemLongClick(view, SwipeLayout.this, p, vId); } if (handled) { view.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS); } } return handled; } return false; }
@Override protected boolean canChildScrollUp() { if (android.os.Build.VERSION.SDK_INT < 14) { if (mTarget instanceof AbsListView) { final AbsListView absListView = (AbsListView) mTarget; return absListView.getChildCount() > 0 && (absListView.getFirstVisiblePosition() > 0 || absListView.getChildAt(0) .getTop() < absListView.getPaddingTop()); } else { return ViewCompat.canScrollVertically(mTarget, -1) || mTarget.getScrollY() > 0; } } else { return ViewCompat.canScrollVertically(mTarget, -1); } }
public static boolean isAbsListViewToTop(AbsListView absListView) { if (absListView != null) { int firstChildTop = 0; if (absListView.getChildCount() > 0) { // 如果AdapterView的子控件数量不为0,获取第一个子控件的top firstChildTop = absListView.getChildAt(0).getTop() - absListView.getPaddingTop(); } if (absListView.getFirstVisiblePosition() == 0 && firstChildTop == 0) { return true; } } return false; }
public static boolean isAbsListViewToBottom(AbsListView absListView) { if (absListView != null && absListView.getAdapter() != null && absListView.getChildCount() > 0 && absListView.getLastVisiblePosition() == absListView.getAdapter().getCount() - 1) { View lastChild = absListView.getChildAt(absListView.getChildCount() - 1); return lastChild.getBottom() <= absListView.getMeasuredHeight(); } return false; }
/** * This call is exposed for the benefit of the animators. * * @param height The height of the current view. */ public void setHeight(int height) { AbsListView.LayoutParams params = (AbsListView.LayoutParams) getLayoutParams(); if (params == null) { params = new AbsListView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, height); } else { if (params.height == height) return; params.height = height; } setLayoutParams(params); }