use of com.moez.QKSMS.common.google.ThumbnailManager in project qksms by moezbhatti.
the class QKSMSAppBase method onCreate.
@Override
public void onCreate() {
super.onCreate();
if (Log.isLoggable(LogTag.STRICT_MODE_TAG, Log.DEBUG)) {
// Log tag for enabling/disabling StrictMode violation log. This will dump a stack
// in the log that shows the StrictMode violator.
// To enable: adb shell setprop log.tag.Mms:strictmode DEBUG
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().build());
}
sQKSMSApp = this;
loadDefaultPreferenceValues();
// Initialize analytics, leakcanary, and crittercism
AnalyticsManager.getInstance().init(this);
refWatcher = LeakCanary.install(this);
// Figure out the country *before* loading contacts and formatting numbers
Country country = new Country(Locale.getDefault().getCountry(), Country.COUNTRY_SOURCE_LOCALE);
mCountryIso = country.getCountryIso();
Context context = getApplicationContext();
mPduLoaderManager = new PduLoaderManager(context);
mThumbnailManager = new ThumbnailManager(context);
registerActivityLifecycleCallbacks(new LifecycleHandler());
ThemeManager.init(this);
MmsConfig.init(this);
Contact.init(this);
DraftCache.init(this);
Conversation.init(this);
DownloadManager.init(this);
RateController.init(this);
LayoutManager.init(this);
NotificationManager.init(this);
LiveViewManager.init(this);
QKPreferences.init(this);
activePendingMessages();
}
use of com.moez.QKSMS.common.google.ThumbnailManager in project qksms by moezbhatti.
the class MessageUtils method removeThumbnailsFromCache.
public static void removeThumbnailsFromCache(SlideshowModel slideshow) {
if (slideshow != null) {
ThumbnailManager thumbnailManager = QKSMSApp.getApplication().getThumbnailManager();
boolean removedSomething = false;
Iterator<SlideModel> iterator = slideshow.iterator();
while (iterator.hasNext()) {
SlideModel slideModel = iterator.next();
if (slideModel.hasImage()) {
thumbnailManager.removeThumbnail(slideModel.getImage().getUri());
removedSomething = true;
} else if (slideModel.hasVideo()) {
thumbnailManager.removeThumbnail(slideModel.getVideo().getUri());
removedSomething = true;
}
}
if (removedSomething) {
// HACK: the keys to the thumbnail cache are the part uris, such as mms/part/3
// Because the part table doesn't have auto-increment ids, the part ids are reused
// when a message or thread is deleted. For now, we're clearing the whole thumbnail
// cache so we don't retrieve stale images when part ids are reused. This will be
// fixed in the next release in the mms provider.
QKSMSApp.getApplication().getThumbnailManager().clearBackingStore();
}
}
}
use of com.moez.QKSMS.common.google.ThumbnailManager in project qksms by moezbhatti.
the class ImageModel method loadThumbnailBitmap.
public ItemLoadedFuture loadThumbnailBitmap(ItemLoadedCallback callback) {
ThumbnailManager thumbnailManager = QKSMSApp.getApplication().getThumbnailManager();
mItemLoadedFuture = thumbnailManager.getThumbnail(getUri(), callback);
return mItemLoadedFuture;
}
use of com.moez.QKSMS.common.google.ThumbnailManager in project qksms by moezbhatti.
the class VideoModel method loadThumbnailBitmap.
public ItemLoadedFuture loadThumbnailBitmap(ItemLoadedCallback callback) {
ThumbnailManager thumbnailManager = QKSMSApp.getApplication().getThumbnailManager();
mItemLoadedFuture = thumbnailManager.getVideoThumbnail(getUri(), callback);
return mItemLoadedFuture;
}
Aggregations