请选择 进入手机版 | 继续访问电脑版
  • 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java WebImageCache类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: ImagesHelper

import com.loopj.android.image.WebImageCache; //导入依赖的package包/类
public ImagesHelper(Context context) {
    this.context = context;
    this.sharedPreferences = this.context.getSharedPreferences(RainbowConst.SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
    // init cache
    this.imgCache = new WebImageCache(this.context);
    this.cacheSize = this.sharedPreferences.getInt(SHARED_CACHE_SIZE, 0);
    checkCacheSize();
}
 
开发者ID:lcasartelli,项目名称:rainbow-android,代码行数:9,代码来源:ImagesHelper.java


示例2: getCachedBitmap

import com.loopj.android.image.WebImageCache; //导入依赖的package包/类
public Bitmap getCachedBitmap() {
    WebImageCache cache = useCache ? getWebImageCache() : null;
    return cache != null ? cache.get(url) : null;
}
 
开发者ID:openhab,项目名称:openhab-android,代码行数:5,代码来源:MyWebImage.java


示例3: removeFromCache

import com.loopj.android.image.WebImageCache; //导入依赖的package包/类
public static void removeFromCache(String url) {
    WebImageCache cache = getWebImageCache();
    if (cache != null) {
        cache.remove(url);
    }
}
 
开发者ID:openhab,项目名称:openhab-android,代码行数:7,代码来源:MyWebImage.java


示例4: onOptionsItemSelected

import com.loopj.android.image.WebImageCache; //导入依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
        case R.id.mainmenu_openhab_preferences:
            Intent settingsIntent = new Intent(this.getApplicationContext(), OpenHABPreferencesActivity.class);
            startActivityForResult(settingsIntent, SETTINGS_REQUEST_CODE);
            Util.overridePendingTransition(this, false);
            return true;
        case R.id.mainmenu_openhab_selectsitemap:
            SharedPreferences settings =
                    PreferenceManager.getDefaultSharedPreferences(OpenHABMainActivity.this);
            SharedPreferences.Editor preferencesEditor = settings.edit();
            preferencesEditor.putString("default_openhab_sitemap", "");
            preferencesEditor.commit();
            selectSitemap(openHABBaseUrl, true);
            return true;
        case android.R.id.home:
            Log.d(TAG, "Home selected");
            if (pager.getCurrentItem() > 0) {
                pager.setCurrentItem(0);
            }
            return true;
        case R.id.mainmenu_openhab_clearcache:
            Log.d(TAG, "Restarting");
            // Get launch intent for application
            Intent restartIntent = getBaseContext().getPackageManager()
                    .getLaunchIntentForPackage( getBaseContext().getPackageName() );
            restartIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
            // Finish current activity
            finish();
            WebImageCache cache = new WebImageCache(getBaseContext());
            cache.clear();
            // Start launch activity
            startActivity(restartIntent);
            // Start launch activity
            return true;
        case R.id.mainmenu_openhab_writetag:
            Intent writeTagIntent = new Intent(this.getApplicationContext(), OpenHABWriteTagActivity.class);
            // TODO: get current display page url, which? how? :-/
            OpenHABWidgetListFragment currentFragment = pagerAdapter.getFragment(pager.getCurrentItem());
            writeTagIntent.putExtra("sitemapPage", currentFragment.getDisplayPageUrl());
            startActivityForResult(writeTagIntent, WRITE_NFC_TAG_REQUEST_CODE);
            Util.overridePendingTransition(this, false);
            return true;
        case R.id.mainmenu_openhab_info:
            Intent infoIntent = new Intent(this.getApplicationContext(), OpenHABInfoActivity.class);
            infoIntent.putExtra("openHABBaseUrl", openHABBaseUrl);
            infoIntent.putExtra("username", openHABUsername);
            infoIntent.putExtra("password", openHABPassword);
            startActivityForResult(infoIntent, INFO_REQUEST_CODE);
            Util.overridePendingTransition(this, false);
            return true;
        case R.id.mainmenu_voice_recognition:
            launchVoiceRecognition();
            return true;
        case R.id.mainmenu_openhab_flipper:
            this.startActivity(new Intent(this, MainActivity.class));
            return true;
        default:
            return super.onOptionsItemSelected(item);
    }
}
 
开发者ID:tonyalpskog,项目名称:OpenHAB_Room_Flipper,代码行数:63,代码来源:OpenHABMainActivity.java


示例5: onOptionsItemSelected

import com.loopj.android.image.WebImageCache; //导入依赖的package包/类
@Override
 public boolean onOptionsItemSelected(MenuItem item) {
 	switch (item.getItemId()) {
 	case R.id.mainmenu_openhab_preferences:
         Intent settingsIntent = new Intent(this.getApplicationContext(), OpenHABPreferencesActivity.class);
         Util.overridePendingTransition(this, false);
 		return true;
 	case R.id.mainmenu_openhab_selectsitemap:
SharedPreferences settings = 
PreferenceManager.getDefaultSharedPreferences(OpenHABWidgetListActivity.this);
Editor preferencesEditor = settings.edit();
preferencesEditor.putString("default_openhab_sitemap", "");
preferencesEditor.commit();
 		selectSitemap(openHABBaseUrl, true);
 		return true;
     case android.R.id.home:
         Log.d(HABApplication.getLogTag(), "Home selected - " + sitemapRootUrl);
// Get launch intent for application
Intent homeIntent = getBaseContext().getPackageManager()
            .getLaunchIntentForPackage( getBaseContext().getPackageName() );
homeIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
homeIntent.setAction("org.openhab.habdroid.ui.OpwnHABWidgetListActivity");
homeIntent.putExtra("displayPageUrl", sitemapRootUrl);
homeIntent.putExtra("openHABBaseUrl", openHABBaseUrl);
homeIntent.putExtra("sitemapRootUrl", sitemapRootUrl);
         Log.d(HABApplication.getLogTag(), String.format("openPage intent =>/ndisplayPageUrl = '%s'/nopenHABBaseUrl = '%s'/nsitemapRootUrl = '%s'", sitemapRootUrl, openHABBaseUrl, sitemapRootUrl));
// Finish current activity
finish();
// Start launch activity
startActivity(homeIntent);
Util.overridePendingTransition(this, true);		
         return true;
     case R.id.mainmenu_openhab_clearcache:
Log.d(HABApplication.getLogTag(), "Restarting");
// Get launch intent for application
Intent restartIntent = getBaseContext().getPackageManager()
            .getLaunchIntentForPackage( getBaseContext().getPackageName() );
restartIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
// Finish current activity
finish();
     	WebImageCache cache = new WebImageCache(getBaseContext());
     	cache.clear();
// Start launch activity
startActivity(restartIntent);
// Start launch activity
return true;
     case R.id.mainmenu_openhab_writetag:
         Intent writeTagIntent = new Intent(this.getApplicationContext(), OpenHABWriteTagActivity.class);
         writeTagIntent.putExtra("sitemapPage", this.displayPageUrl);
         startActivityForResult(writeTagIntent, 0);
         Util.overridePendingTransition(this, false);
 		return true;
     default:
 		return super.onOptionsItemSelected(item);
 	}
 }
 
开发者ID:tonyalpskog,项目名称:OpenHAB_Room_Flipper,代码行数:57,代码来源:OpenHABWidgetListActivity.java


示例6: getWebImageCache

import com.loopj.android.image.WebImageCache; //导入依赖的package包/类
/**
 * Returns the already initialized WebImageCache, if there's any. This method may return
 * null if {@link MyWebImage#getWebImageCache(Context ctx)} was not called so far.
 *
 * @return WebImageCache|null
 */
public static WebImageCache getWebImageCache() {
    return sWebImageCache;
}
 
开发者ID:openhab,项目名称:openhab-android,代码行数:10,代码来源:MyWebImage.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PropertiesRealm类代码示例发布时间:2022-05-16
下一篇:
Java DPT类代码示例发布时间:2022-05-16
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap