Java 类com.nostra13.universalimageloader.core.assist.PauseOnScrollListener 实例源码

项目:buddycloud-android    文件:GenericChannelsFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.channel_list, container, false);

    OnChildClickListener channelItemListener = new OnChildClickListener() {
        @Override
        public boolean onChildClick(ExpandableListView parent, View v,
                int groupPosition, int childPosition, long id) {
            JSONObject channelItem = (JSONObject) adapter.getChild(groupPosition, childPosition);
            channelSelected(channelItem);
            return true;
        }
    };

    ExpandableListView channelsView = (ExpandableListView) view.findViewById(R.id.channelListView);
    channelsView.setEmptyView(view.findViewById(R.id.channelListProgress));
    channelsView.setAdapter(adapter);
    channelsView.setOnChildClickListener(channelItemListener);

    PauseOnScrollListener listener = new PauseOnScrollListener(ImageLoader.getInstance(), true, true);
    channelsView.setOnScrollListener(listener);
    expandAll(view);

    return view;
}
项目:Broadsheet.ie-Android    文件:PostListFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View layout = super.onCreateView(inflater, container, savedInstanceState);

    // Get original ListView and Frame
    ListView originalLv = (ListView) layout.findViewById(android.R.id.list);
    ViewGroup frame = (ViewGroup) originalLv.getParent();

    // Remove old ListView
    frame.removeView(originalLv);

    // Create new PullToRefreshListView and add to Frame
    mPullRefreshListView = new PullToRefreshListView(getActivity());
    frame.addView(mPullRefreshListView, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
            ViewGroup.LayoutParams.MATCH_PARENT));

    mPullRefreshListView.setOnRefreshListener(new OnRefreshListener<ListView>() {
        @Override
        public void onRefresh(PullToRefreshBase<ListView> refreshView) {
            fetchPosts(null);
        }
    });

    boolean pauseOnScroll = false;
    boolean pauseOnFling = true;
    PauseOnScrollListener listener = new PauseOnScrollListener(ImageLoader.getInstance(), pauseOnScroll,
            pauseOnFling);
    mPullRefreshListView.setOnScrollListener(listener);

    return layout;
}
项目:Broadsheet.ie-Android    文件:CommentListActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_comment_list);

    if (savedInstanceState != null) {
        Log.d(TAG, "saved instance");
        mPost = (Post) savedInstanceState.getSerializable(CURRENT_POST);
    } else {
        Bundle extras = getIntent().getExtras();

        if (extras != null) {
            BroadsheetApplication app = (BroadsheetApplication) getApplication();

            if (app.getPosts().size() > 0) {
                mPost = app.getPosts().get(extras.getInt("item_id"));
            }
        }
    }

    ListView list = (ListView) findViewById(android.R.id.list);

    comments = new CommentAdapter(this, R.layout.comment_list_item, mPost.getSortedComments());
    comments.setReplyCommentListener(this);

    list.setAdapter(comments);

    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

    boolean pauseOnScroll = false;
    boolean pauseOnFling = true;
    PauseOnScrollListener listener = new PauseOnScrollListener(ImageLoader.getInstance(), pauseOnScroll,
            pauseOnFling);
    list.setOnScrollListener(listener);

    setTitle(getResources().getString(R.string.comment));
}
项目:Studddinv2_android    文件:CustomGalleryActivity.java   
private void init() {

        handler = new Handler();
        gridGallery = (GridView) findViewById(R.id.gridGallery);
        gridGallery.setFastScrollEnabled(true);
        adapter = new GalleryAdapter(getApplicationContext(), imageLoader);
        PauseOnScrollListener listener = new PauseOnScrollListener(imageLoader,
                true, true);
        gridGallery.setOnScrollListener(listener);

        if (action.equalsIgnoreCase(Action.ACTION_MULTIPLE_PICK)) {

            findViewById(R.id.llBottomContainer).setVisibility(View.VISIBLE);
            gridGallery.setOnItemClickListener(mItemMulClickListener);
            adapter.setMultiplePick(true);

        } else if (action.equalsIgnoreCase(Action.ACTION_PICK)) {

            findViewById(R.id.llBottomContainer).setVisibility(View.GONE);
            gridGallery.setOnItemClickListener(mItemSingleClickListener);
            adapter.setMultiplePick(false);

        }

        gridGallery.setAdapter(adapter);
        imgNoMedia = (ImageView) findViewById(R.id.imgNoMedia);

        btnGalleryOk = (Button) findViewById(R.id.btnGalleryOk);
        btnGalleryOk.setOnClickListener(mOkClickListener);

        new Thread() {

            @Override
            public void run() {
                Looper.prepare();
                handler.post(new Runnable() {

                    @Override
                    public void run() {
                        adapter.addAll(getGalleryPhotos());
                        checkImageStatus();
                    }
                });
                Looper.loop();
            }

            ;

        }.start();

    }
项目:MultipleImagePicker    文件:CustomGalleryActivity.java   
private void init() {

        handler = new Handler();
        gridGallery = (GridView) findViewById(R.id.gridGallery);
        gridGallery.setFastScrollEnabled(true);
        adapter = new CustomGalleryAdapter(getApplicationContext(), imageLoader);
        PauseOnScrollListener listener = new PauseOnScrollListener(imageLoader,
                true, true);
        gridGallery.setOnScrollListener(listener);

        if (action.equalsIgnoreCase(Action.ACTION_MULTIPLE_PICK)) {

            findViewById(R.id.llBottomContainer).setVisibility(View.VISIBLE);
            gridGallery.setOnItemClickListener(mItemMulClickListener);
            adapter.setMultiplePick(true);

        } else if (action.equalsIgnoreCase(Action.ACTION_PICK)) {

            findViewById(R.id.llBottomContainer).setVisibility(View.GONE);
            gridGallery.setOnItemClickListener(mItemSingleClickListener);
            adapter.setMultiplePick(false);

        }

        gridGallery.setAdapter(adapter);
        imgNoMedia = (ImageView) findViewById(R.id.imgNoMedia);

        btnGalleryOk = (Button) findViewById(R.id.btnGalleryOk);
        btnGalleryOk.setOnClickListener(mOkClickListener);

        new Thread() {

            @Override
            public void run() {
                Looper.prepare();
                handler.post(new Runnable() {

                    @Override
                    public void run() {
                        adapter.addAll(getGalleryPhotos());
                        checkImageStatus();
                    }
                });
                Looper.loop();
            };

        }.start();

    }
项目:malforandroid2    文件:AbstractListFragment.java   
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);


    animeAdapter.setSupplementaryTextFactory(getSupplementaryTextFactory());

    itemListView.setAdapter(animeAdapter);

    itemListView.setOnItemClickListener(this);

    PauseOnScrollListener listener = new PauseOnScrollListener(lazyLoader, false, true);
    itemListView.setOnScrollListener(listener);

    animeLoader = getLoaderManager().initLoader(0, null, this);
    animeLoader.forceLoad();

}
项目:semana-isw2013    文件:GalleryActivity.java   
private void applyScrollListener() {
    listView.setOnScrollListener(new PauseOnScrollListener(imageLoader, pauseOnScroll, pauseOnFling));
}
项目:Android-Universal-Image-Loader-Wrapper    文件:AbsListViewBaseActivity.java   
private void applyScrollListener() {
    listView.setOnScrollListener(new PauseOnScrollListener(imageLoader, pauseOnScroll, pauseOnFling));
}