Search in sources :

Example 1 with VelocityListView

use of org.qii.weiciyuan.support.lib.VelocityListView in project weiciyuan by qii.

the class AbstractTimeLineFragment method loadMiddleMsg.

public void loadMiddleMsg(String beginId, String endId, int position) {
    getLoaderManager().destroyLoader(NEW_MSG_LOADER_ID);
    getLoaderManager().destroyLoader(OLD_MSG_LOADER_ID);
    getPullToRefreshListView().onRefreshComplete();
    dismissFooterView();
    Bundle bundle = new Bundle();
    bundle.putString("beginId", beginId);
    bundle.putString("endId", endId);
    bundle.putInt("position", position);
    VelocityListView velocityListView = (VelocityListView) getListView();
    bundle.putBoolean("towardsBottom", velocityListView.getTowardsOrientation() == VelocityListView.TOWARDS_BOTTOM);
    getLoaderManager().restartLoader(MIDDLE_MSG_LOADER_ID, bundle, msgAsyncTaskLoaderCallback);
}
Also used : VelocityListView(org.qii.weiciyuan.support.lib.VelocityListView) Bundle(android.os.Bundle)

Example 2 with VelocityListView

use of org.qii.weiciyuan.support.lib.VelocityListView in project weiciyuan by qii.

the class FriendsTimeLineFragment method startDownloadingOtherPicturesOnWifiNetworkEnvironment.

private void startDownloadingOtherPicturesOnWifiNetworkEnvironment() {
    if (backgroundWifiDownloadPicThread == null && Utility.isWifi(getActivity()) && SettingUtility.getEnableBigPic() && SettingUtility.isWifiAutoDownloadPic()) {
        final int position = getListView().getFirstVisiblePosition();
        int listVewOrientation = ((VelocityListView) getListView()).getTowardsOrientation();
        WifiAutoDownloadPictureRunnable runnable = new WifiAutoDownloadPictureRunnable(getList(), position, listVewOrientation);
        backgroundWifiDownloadPicThread = new Thread(runnable);
        backgroundWifiDownloadPicThread.start();
        AppLogger.i("WifiAutoDownloadPictureRunnable startDownloadingOtherPicturesOnWifiNetworkEnvironment");
    }
}
Also used : VelocityListView(org.qii.weiciyuan.support.lib.VelocityListView) WifiAutoDownloadPictureRunnable(org.qii.weiciyuan.othercomponent.WifiAutoDownloadPictureRunnable)

Example 3 with VelocityListView

use of org.qii.weiciyuan.support.lib.VelocityListView in project weiciyuan by qii.

the class RepostsByIdTimeLineFragment method loadMiddleMsg.

@Override
public void loadMiddleMsg(String beginId, String endId, int position) {
    getLoaderManager().destroyLoader(NEW_MSG_LOADER_ID);
    getLoaderManager().destroyLoader(OLD_MSG_LOADER_ID);
    getPullToRefreshListView().onRefreshComplete();
    dismissFooterView();
    Bundle bundle = new Bundle();
    bundle.putString("beginId", beginId);
    bundle.putString("endId", endId);
    bundle.putInt("position", position);
    VelocityListView velocityListView = (VelocityListView) getListView();
    bundle.putBoolean("towardsBottom", velocityListView.getTowardsOrientation() == VelocityListView.TOWARDS_BOTTOM);
    getLoaderManager().restartLoader(MIDDLE_MSG_LOADER_ID, bundle, msgAsyncTaskLoaderCallback);
}
Also used : VelocityListView(org.qii.weiciyuan.support.lib.VelocityListView) Bundle(android.os.Bundle)

Example 4 with VelocityListView

use of org.qii.weiciyuan.support.lib.VelocityListView in project weiciyuan by qii.

the class StatusListAdapter method setTopTipBar.

public void setTopTipBar(TopTipBar bar) {
    this.topTipBar = bar;
    AutoScrollListView autoScrollListView = (AutoScrollListView) listView;
    autoScrollListView.setOnScrollListener(new AbsListView.OnScrollListener() {

        @Override
        public void onScrollStateChanged(AbsListView view, int scrollState) {
        }

        @Override
        public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
            VelocityListView velocityListView = (VelocityListView) view;
            //                if (velocityListView.getVelocity() < 0) {
            //                    topTipBar.hideCount();
            //                } else if (velocityListView.getVelocity() > 0) {
            //                    if (topTipBar.getValues().size() == 0) {
            //                        return;
            //                    }
            View childView = Utility.getListViewItemViewFromPosition(listView, firstVisibleItem);
            if (childView == null) {
                return;
            }
            int position = firstVisibleItem - ((ListView) view).getHeaderViewsCount();
            if (childView.getTop() == 0 && position <= 0) {
                topTipBar.clearAndReset();
            } else {
                handle(position + 1);
            }
        //                }
        }

        private void handle(int position) {
            if (position > 0 && topTipBar != null && position < bean.size()) {
                MessageBean next = bean.get(position);
                if (next != null) {
                    MessageBean helperMsg = bean.get(position - 1);
                    long helperId = 0L;
                    if (helperMsg != null) {
                        helperId = helperMsg.getIdLong();
                    }
                    topTipBar.handle(next.getIdLong(), helperId);
                }
            }
        }
    });
}
Also used : MessageBean(org.qii.weiciyuan.bean.MessageBean) VelocityListView(org.qii.weiciyuan.support.lib.VelocityListView) AutoScrollListView(org.qii.weiciyuan.support.lib.AutoScrollListView) VelocityListView(org.qii.weiciyuan.support.lib.VelocityListView) AbsListView(android.widget.AbsListView) AutoScrollListView(org.qii.weiciyuan.support.lib.AutoScrollListView) ListView(android.widget.ListView) AbsListView(android.widget.AbsListView) VelocityListView(org.qii.weiciyuan.support.lib.VelocityListView) AbsListView(android.widget.AbsListView) AutoScrollListView(org.qii.weiciyuan.support.lib.AutoScrollListView) View(android.view.View) ListView(android.widget.ListView)

Aggregations

VelocityListView (org.qii.weiciyuan.support.lib.VelocityListView)4 Bundle (android.os.Bundle)2 View (android.view.View)1 AbsListView (android.widget.AbsListView)1 ListView (android.widget.ListView)1 MessageBean (org.qii.weiciyuan.bean.MessageBean)1 WifiAutoDownloadPictureRunnable (org.qii.weiciyuan.othercomponent.WifiAutoDownloadPictureRunnable)1 AutoScrollListView (org.qii.weiciyuan.support.lib.AutoScrollListView)1