当前位置: 首页>>代码示例>>Java>>正文


Java BitmapAjaxCallback类代码示例

本文整理汇总了Java中com.androidquery.callback.BitmapAjaxCallback的典型用法代码示例。如果您正苦于以下问题:Java BitmapAjaxCallback类的具体用法?Java BitmapAjaxCallback怎么用?Java BitmapAjaxCallback使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BitmapAjaxCallback类属于com.androidquery.callback包,在下文中一共展示了BitmapAjaxCallback类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: image

import com.androidquery.callback.BitmapAjaxCallback; //导入依赖的package包/类
protected T image(String url, boolean memCache, boolean fileCache, int targetWidth, int fallbackId, Bitmap preset, int animId, float ratio, int round, String networkUrl)
{
	if (view instanceof ImageView)
	{
		BitmapAjaxCallback.async(act, getContext(), (ImageView) view, url, memCache, fileCache, targetWidth, fallbackId, preset, animId, ratio, AQuery.ANCHOR_DYNAMIC, progress, ah, policy, round, proxy, networkUrl);
		reset();
	}
	return self();
}
 
开发者ID:libit,项目名称:lr_dialer,代码行数:10,代码来源:AbstractAQuery.java

示例2: getCachedImage

import com.androidquery.callback.BitmapAjaxCallback; //导入依赖的package包/类
/**
 * Return bitmap cached by image requests. Returns null if url is not cached.
 *
 * @param url
 * @param targetWidth The desired downsampled width.
 * @return Bitmap
 */
public Bitmap getCachedImage(String url, int targetWidth)
{
	Bitmap result = BitmapAjaxCallback.getMemoryCached(url, targetWidth);
	if (result == null)
	{
		File file = getCachedFile(url);
		if (file != null)
		{
			result = BitmapAjaxCallback.getResizedImage(file.getAbsolutePath(), null, targetWidth, true, 0);
		}
	}
	return result;
}
 
开发者ID:libit,项目名称:lr_dialer,代码行数:21,代码来源:AbstractAQuery.java

示例3: shouldDelay

import com.androidquery.callback.BitmapAjaxCallback; //导入依赖的package包/类
public static boolean shouldDelay(int groupPosition, int childPosition, View convertView, ViewGroup parent, String url)
{
	if (url == null || BitmapAjaxCallback.isMemoryCached(url))
	{
		return false;
	}
	AbsListView lv = (AbsListView) parent;
	OnScrollListener sl = (OnScrollListener) parent.getTag(AQuery.TAG_SCROLL_LISTENER);
	if (sl == null)
	{
		sl = new Common();
		lv.setOnScrollListener(sl);
		parent.setTag(AQuery.TAG_SCROLL_LISTENER, sl);
	}
	Integer scrollState = (Integer) lv.getTag(AQuery.TAG_NUM);
	if (scrollState == null || scrollState == OnScrollListener.SCROLL_STATE_IDLE || scrollState == OnScrollListener.SCROLL_STATE_TOUCH_SCROLL)
	{
		return false;
	}
	long packed = childPosition;
	if (parent instanceof ExpandableListView)
	{
		packed = ExpandableListView.getPackedPositionForChild(groupPosition, childPosition);
	}
	convertView.setTag(AQuery.TAG_NUM, packed);
	//TODO add draw count and skip drawing list if possible
	return true;
}
 
开发者ID:libit,项目名称:lr_dialer,代码行数:29,代码来源:Common.java

示例4: shouldDelayGallery

import com.androidquery.callback.BitmapAjaxCallback; //导入依赖的package包/类
private static boolean shouldDelayGallery(int position, View convertView, ViewGroup parent, String url)
{
	if (url == null || BitmapAjaxCallback.isMemoryCached(url))
	{
		return false;
	}
	Gallery gallery = (Gallery) parent;
	Integer selected = (Integer) gallery.getTag(AQuery.TAG_NUM);
	if (selected == null)
	{
		selected = 0;
		gallery.setTag(AQuery.TAG_NUM, 0);
		gallery.setCallbackDuringFling(false);
		Common common = new Common();
		common.listen(gallery);
	}
	int first = gallery.getFirstVisiblePosition();
	int last = gallery.getLastVisiblePosition();
	int diff = last - first;
	int delta = (diff / 2) + 1;
	int from = selected - delta;
	int to = selected + delta;
	if (from < 0)
	{
		//shift window back to positive region
		to = to - from;
		from = 0;
	}
	if ((position >= from && position <= to))
	{
		//AQUtility.debug("yes", position + ":" + from + "." + to);
		convertView.setTag(AQuery.TAG_NUM, position);
		return false;
	}
	//AQUtility.debug("no", position + ":" + from + "." + to);
	convertView.setTag(AQuery.TAG_NUM, null);
	return true;
}
 
开发者ID:libit,项目名称:lr_dialer,代码行数:39,代码来源:Common.java

示例5: image

import com.androidquery.callback.BitmapAjaxCallback; //导入依赖的package包/类
protected T image(String url, boolean memCache, boolean fileCache, int targetWidth, int fallbackId, Bitmap preset, int animId, float ratio, int round, String networkUrl){
	
	if(view instanceof ImageView){		
		BitmapAjaxCallback.async(act, getContext(), (ImageView) view, url, memCache, fileCache, targetWidth, fallbackId, preset, animId, ratio, AQuery.ANCHOR_DYNAMIC, progress, ah, policy, round, proxy, networkUrl);			
		reset();
	}
	
	return self();
}
 
开发者ID:bblue000,项目名称:ExoPlayerDemo,代码行数:10,代码来源:AbstractAQuery.java

示例6: getCachedImage

import com.androidquery.callback.BitmapAjaxCallback; //导入依赖的package包/类
/**
 * Return bitmap cached by image requests. Returns null if url is not cached.
 *
 * @param url 
 * @param targetWidth The desired downsampled width.
 * 
 * @return Bitmap
 */
public Bitmap getCachedImage(String url, int targetWidth){
	
	Bitmap result = BitmapAjaxCallback.getMemoryCached(url, targetWidth);
	if(result == null){
		File file = getCachedFile(url);
		if(file != null){
			result = BitmapAjaxCallback.getResizedImage(file.getAbsolutePath(), null, targetWidth, true, 0);
		}
	}
	
	return result;
}
 
开发者ID:bblue000,项目名称:ExoPlayerDemo,代码行数:21,代码来源:AbstractAQuery.java

示例7: shouldDelay

import com.androidquery.callback.BitmapAjaxCallback; //导入依赖的package包/类
public static boolean shouldDelay(int groupPosition, int childPosition, View convertView, ViewGroup parent, String url){
	
	if(url == null || BitmapAjaxCallback.isMemoryCached(url)){
		return false;
	}
	
	AbsListView lv = (AbsListView) parent;
	
	
	OnScrollListener sl = (OnScrollListener) parent.getTag(AQuery.TAG_SCROLL_LISTENER);
	
	if(sl == null){
		sl = new Common();
		lv.setOnScrollListener(sl);
		parent.setTag(AQuery.TAG_SCROLL_LISTENER, sl);
	}
	
	Integer scrollState = (Integer) lv.getTag(AQuery.TAG_NUM);
	
	if(scrollState == null || scrollState == OnScrollListener.SCROLL_STATE_IDLE || scrollState == OnScrollListener.SCROLL_STATE_TOUCH_SCROLL){
		return false;
	}
	
	long packed = childPosition;
	if(parent instanceof ExpandableListView){
		packed = ExpandableListView.getPackedPositionForChild(groupPosition, childPosition);
	}
	convertView.setTag(AQuery.TAG_NUM, packed);
	
	//TODO add draw count and skip drawing list if possible
	
	return true;
}
 
开发者ID:bblue000,项目名称:ExoPlayerDemo,代码行数:34,代码来源:Common.java

示例8: onPostExecute

import com.androidquery.callback.BitmapAjaxCallback; //导入依赖的package包/类
@Override
protected void onPostExecute(String result) {

    AQuery aQuery = new AQuery(mContext);
    aQuery.id(mImageView);
    aQuery.image(new File(result),true, mWidth, new BitmapAjaxCallback());
}
 
开发者ID:learnNcode,项目名称:MediaChooser,代码行数:8,代码来源:ImageLoadAsync.java

示例9: fillIcon

import com.androidquery.callback.BitmapAjaxCallback; //导入依赖的package包/类
public static void fillIcon(int imageIcon, AQuery aq, String filename, Context context) {
	String hash = getIconHash(context, filename);

	if (TextUtils.isEmpty(hash) || !hash.equals(aq.id(imageIcon).getTag())) {
		BitmapAjaxCallback callback = new BitmapAjaxCallback();
		File file = getBitmapFile(context, filename);
		callback
		// .animation(android.R.anim.slide_in_left)
		.memCache(true).fallback(R.drawable.dummy_icon).file(file).url(filename);
		aq.id(imageIcon).image(callback).tag(hash);
	}
}
 
开发者ID:snuk182,项目名称:aceim,代码行数:13,代码来源:ViewUtils.java

示例10: shouldDelay

import com.androidquery.callback.BitmapAjaxCallback; //导入依赖的package包/类
public static boolean shouldDelay(int groupPosition, int childPosition, View convertView, ViewGroup parent, String url){
	
	if(url == null || BitmapAjaxCallback.isMemoryCached(url)){
		return false;
	}
	
	AbsListView lv = (AbsListView) parent;
	
	
	OnScrollListener sl = (OnScrollListener) parent.getTag(AQuery.TAG_SCROLL_LISTENER);
	
	if(sl == null){
		sl = new ExpandableGridScrollListener();
		lv.setOnScrollListener(sl);
		parent.setTag(AQuery.TAG_SCROLL_LISTENER, sl);
	}
	
	Integer scrollState = (Integer) lv.getTag(AQuery.TAG_NUM);
	
	if(scrollState == null || scrollState == OnScrollListener.SCROLL_STATE_IDLE || scrollState == OnScrollListener.SCROLL_STATE_TOUCH_SCROLL){
		return false;
	}
	
	/*long packed = childPosition;
	if(parent instanceof ExpandableListView){
		packed = ExpandableListView.getPackedPositionForChild(groupPosition, childPosition);
	}
	convertView.setTag(AQuery.TAG_NUM, packed);*/
	
	//TODO add draw count and skip drawing list if possible
	
	return true;
}
 
开发者ID:snuk182,项目名称:aceim,代码行数:34,代码来源:AQueryUtils.java

示例11: prepareImagesCache

import com.androidquery.callback.BitmapAjaxCallback; //导入依赖的package包/类
/**
 * This method initializes cache with common image resources, 
 * so they can be used despite of the context the particular view is built within. 
 */
private void prepareImagesCache() {
	BitmapAjaxCallback.setCacheLimit(Integer.MAX_VALUE);
	
	BitmapAjaxCallback.getMemoryCached(getBaseContext(), R.drawable.dummy_icon);
	BitmapAjaxCallback.getMemoryCached(getBaseContext(), R.drawable.btn_check_off);
	BitmapAjaxCallback.getMemoryCached(getBaseContext(), R.drawable.btn_check_off_disable);
	BitmapAjaxCallback.getMemoryCached(getBaseContext(), R.drawable.btn_check_on);
	BitmapAjaxCallback.getMemoryCached(getBaseContext(), R.drawable.btn_check_on_disable);
	BitmapAjaxCallback.getMemoryCached(getBaseContext(), R.drawable.btn_check_on_selected);
}
 
开发者ID:snuk182,项目名称:aceim,代码行数:15,代码来源:MainActivity.java

示例12: getView

import com.androidquery.callback.BitmapAjaxCallback; //导入依赖的package包/类
@Override
public View getView(int position, View view, ViewGroup parent) {
    ViewHolder holder;
    
    if (view == null) {
        LayoutInflater vi = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        view = vi.inflate(R.layout.list_item_book, null);
        aq.recycle(view);
        holder = new ViewHolder();
        holder.author = aq.id(R.id.author).getTextView();
        holder.title = aq.id(R.id.title).getTextView();
        holder.imgCover = aq.id(R.id.imgCover).getImageView();
        view.setTag(holder);
    } else {
        aq.recycle(view);
        holder = (ViewHolder) view.getTag();
    }

    JSONObject book = getItem(position);

    // Book cover
    String bookId = book.optString("id");
    String coverUrl = serverUrl + "/api/book/" + bookId + "/cover";
    if (aq.shouldDelay(position, view, parent, coverUrl)) {
        aq.id(holder.imgCover).image((Bitmap) null);
    } else {
        aq.id(holder.imgCover).image(new BitmapAjaxCallback()
                .url(coverUrl)
                .animation(AQuery.FADE_IN_NETWORK)
                .cookie("auth_token", authToken)
        );
    }

    // Filling book data
    holder.author.setText(book.optString("author"));
    holder.title.setText(book.optString("title"));

    return view;
}
 
开发者ID:sismics,项目名称:books,代码行数:40,代码来源:BooksAdapter.java

示例13: onLowMemory

import com.androidquery.callback.BitmapAjaxCallback; //导入依赖的package包/类
/**
 * Called when the overall system is running low on memory
 */
@Override
public void onLowMemory() {
	super.onLowMemory();
	BitmapAjaxCallback.clearCache();
	Log.w(TAG, "System is running low on memory");
}
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:10,代码来源:App.java

示例14: onCreate

import com.androidquery.callback.BitmapAjaxCallback; //导入依赖的package包/类
@Override
public void onCreate() {
	super.onCreate();

	// set the max size of the memory cache, default is 1M pixels (4MB)
	BitmapAjaxCallback.setMaxPixelLimit(2000000);

	setupAlarms();
}
 
开发者ID:KoljaTM,项目名称:HoebApp,代码行数:10,代码来源:HoebAppApplication.java

示例15: onCreate

import com.androidquery.callback.BitmapAjaxCallback; //导入依赖的package包/类
@Override
public void onCreate() {
	// https://github.com/androidquery/androidquery
	if (getResources().getInteger(R.integer.development) == 1) {
		AQUtility.setDebug(true);
	}

	AQUtility.cleanCacheAsync(this, 10000000, 5000000);

	// set the max number of concurrent network connections, default is 4
	AjaxCallback.setNetworkLimit(20);

	// set the max number of icons (image width <= 50) to be cached in
	// memory, default is 20
	BitmapAjaxCallback.setIconCacheLimit(20);

	// set the max number of images (image width > 50) to be cached in
	// memory, default is 20
	BitmapAjaxCallback.setCacheLimit(40);

	// set the max size of an image to be cached in memory, default is 1600
	// pixels (ie. 400x400)
	BitmapAjaxCallback.setPixelLimit(600 * 600);

	// set the max size of the memory cache, default is 1M pixels (4MB)
	BitmapAjaxCallback.setMaxPixelLimit(4000000);
	super.onCreate();
}
 
开发者ID:entertailion,项目名称:Slideshow-for-GTV,代码行数:29,代码来源:SlideshowApplication.java


注:本文中的com.androidquery.callback.BitmapAjaxCallback类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。