com.nostra13.universalimageloader.core.listener.PauseOnScrollListener Java Examples

The following examples show how to use com.nostra13.universalimageloader.core.listener.PauseOnScrollListener. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ContactFragment.java    From sctalk with Apache License 2.0 6 votes vote down vote up
/**
 * @Description 初始化界面资源
 */
private void initRes() {
    // 设置顶部标题栏
    showContactTopBar();
    hideTopBar();

    super.init(curView);
    showProgressBar();

    sortSideBar = (SortSideBar) curView.findViewById(R.id.sidrbar);
    dialog = (TextView) curView.findViewById(R.id.dialog);
    sortSideBar.setTextView(dialog);
    sortSideBar.setOnTouchingLetterChangedListener(this);

    allContactListView = (ListView) curView.findViewById(R.id.all_contact_list);
    departmentContactListView = (ListView) curView.findViewById(R.id.department_contact_list);

    //this is critical, disable loading when finger sliding, otherwise you'll find sliding is not very smooth
    allContactListView.setOnScrollListener(new PauseOnScrollListener(ImageLoader.getInstance(), true, true));
    departmentContactListView.setOnScrollListener(new PauseOnScrollListener(ImageLoader.getInstance(), true, true));
    // todo eric
    // showLoadingProgressBar(true);
}
 
Example #2
Source File: ImageGridFragment.java    From MutiPhotoChoser with Mozilla Public License 2.0 6 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View contentView = inflater.inflate(R.layout.fragment_image_grid_layout, null);
    imageGridView = (HeaderGridView) contentView.findViewById(R.id.gridGallery);
    int numColumns = (getResources().getDisplayMetrics().widthPixels - DisplayUtils.dip2px(6, getActivity())) / DisplayUtils.dip2px(116, getActivity());
    imageGridView.setNumColumns(numColumns);
    imageGridView.setVerticalScrollBarEnabled(false);

    View footerView = new View(getActivity());
    LayoutParams lp = new LayoutParams(LayoutParams.WRAP_CONTENT, DisplayUtils.dip2px(82, getActivity()));
    footerView.setLayoutParams(lp);
    imageGridView.addFooterView(footerView, null, false);

    mAdapter = new ImageGridAdapter(getActivity(), options);
    mAdapter.setChoseImageListener(mViewImageListener);
    mAdapter.swapDatas(mImages);
    PauseOnScrollListener listener = new PauseOnScrollListener(ImageLoader.getInstance(), true, true);
    imageGridView.setOnScrollListener(listener);
    imageGridView.setOnItemClickListener(this);
    imageGridView.setAdapter(mAdapter);
    return contentView;
}
 
Example #3
Source File: ChatFragment.java    From sctalk with Apache License 2.0 5 votes vote down vote up
private void initContactListView() {
    contactListView = (ListView) curView.findViewById(R.id.ContactListView);
    contactListView.setOnItemClickListener(this);
    contactListView.setOnItemLongClickListener(this);
    contactAdapter = new  ChatAdapter(getActivity());
    contactListView.setAdapter(contactAdapter);

    // this is critical, disable loading when finger sliding, otherwise
    // you'll find sliding is not very smooth
    contactListView.setOnScrollListener(new PauseOnScrollListener(ImageLoader.getInstance(),
            true, true));
}
 
Example #4
Source File: GroupManagerFragment.java    From sctalk with Apache License 2.0 5 votes vote down vote up
private void initAdapter(){
    logger.d("groupmgr#initAdapter");

    gridView = (GridView) curView.findViewById(R.id.group_manager_grid);
    gridView.setSelector(new ColorDrawable(Color.TRANSPARENT));// 去掉点击时的黄色背影
    gridView.setOnScrollListener(new PauseOnScrollListener(ImageLoader.getInstance(), true, true));

    adapter = new GroupManagerAdapter(getActivity(),imService,peerEntity);
    gridView.setAdapter(adapter);
}
 
Example #5
Source File: MainActivity.java    From Gank with Apache License 2.0 5 votes vote down vote up
private void initViews() {
    mToolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(mToolbar);

    DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
    ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, mToolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
    drawer.setDrawerListener(toggle);
    toggle.syncState();

    NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
    View headerView= navigationView.inflateHeaderView(R.layout.nav_header_main);
    navigationView.setNavigationItemSelectedListener(this);

    headerView.findViewById(R.id.head_img).setOnClickListener(this);
    headerView.findViewById(R.id.head_web).setOnClickListener(this);
    headerView.findViewById(R.id.head_name).setOnClickListener(this);

    mRefreshLayout = (RefreshLayout) findViewById(R.id.id_swipe_ly);
    mRefreshLayout.setOnRefreshListener(this);
    mRefreshLayout.setOnLoadListener(this);

    mAdapter = new GankCommonAdapter(MainActivity.this,null);
    mListView = (ListView) findViewById(R.id.id_listview);
    mListView.setAdapter(mAdapter);
    mListView.setOnItemClickListener(this);
    mListView.setOnScrollListener(new PauseOnScrollListener(ImageLoader.getInstance(), true, false));
}
 
Example #6
Source File: MediaShowActivity.java    From BigApp_WordPress_Android with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.zg_activity_media_show);
	mTV_catalog_name = (TextView) findViewById(R.id.tv_catalog_name);
	mTV_catalog_name.setOnClickListener(this);
	mTV_catalog_name.setEnabled(false);

	mTV_preview = (TextView) findViewById(R.id.tv_preview);
	mTV_preview.setOnClickListener(this);

	mTv_right = (TextView) findViewById(R.id.tv_right);
	mTv_right.setOnClickListener(this);

	findViewById(R.id.iv_left).setOnClickListener(this);

	initMode();

	mImageLoader = ImageLoader.getInstance();
	mGridView = (GridView) findViewById(R.id.gridview);
	mGridView.setFastScrollEnabled(true);
	PauseOnScrollListener listener = new PauseOnScrollListener(
			mImageLoader, true, true);
	mGridView.setOnScrollListener(listener);
	mMediaAdapter = new AdapterMediaShow(this, mediaType, mSelectedList);
	mGridView.setAdapter(mMediaAdapter);
	mGridView.setOnItemClickListener(this);

	new Thread(new getMediaInfoTask(null)).start();
}
 
Example #7
Source File: ChatActivity.java    From LoveTalkClient with Apache License 2.0 5 votes vote down vote up
private void initListView() {
	mAdapter = new ChatMsgAdapter(ctx, mMsgs);
	mAdapter.setDatas(mMsgs);
	xListView.setAdapter(mAdapter);
	xListView.setPullRefreshEnable(true);
	xListView.setPullLoadEnable(false);
	xListView.setXListViewListener(this);
	xListView.setOnScrollListener(
			new PauseOnScrollListener(UserService.imageLoader, true, true));
}
 
Example #8
Source File: NewsListFragment.java    From 4pdaClient-plus with Apache License 2.0 5 votes vote down vote up
@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    getListView().setDivider(null);
    getListView().setDividerHeight(0);
    getListView().setOnScrollListener(new PauseOnScrollListener(ImageLoader.getInstance(), false, true));
}
 
Example #9
Source File: MainActivity.java    From android-open-project-demo with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    DisplayMetrics metrics = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(metrics);
    gridView = (GridView) findViewById(R.id.grid_photo);
    PhotoAdapter adapter = new PhotoAdapter(this);
    gridView.setAdapter(adapter);
    gridView.setOnItemClickListener(photoClickListener);
    gridView.setOnScrollListener(new PauseOnScrollListener(ImageLoader.getInstance(), false, true));
}
 
Example #10
Source File: AbsListViewBaseFragment.java    From Android-Universal-Image-Loader-Modify with Apache License 2.0 4 votes vote down vote up
private void applyScrollListener() {
	listView.setOnScrollListener(new PauseOnScrollListener(ImageLoader.getInstance(), pauseOnScroll, pauseOnFling));
}
 
Example #11
Source File: QmsContactsList.java    From 4pdaClient-plus with Apache License 2.0 4 votes vote down vote up
@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    getListView().setOnScrollListener(new PauseOnScrollListener(ImageLoader.getInstance(), false, true));
    registerForContextMenu(getListView());
}
 
Example #12
Source File: DevDbModelsFragment.java    From 4pdaClient-plus with Apache License 2.0 4 votes vote down vote up
@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    getListView().setOnScrollListener(new PauseOnScrollListener(ImageLoader.getInstance(), false, true));
}