本文整理匯總了Java中com.netease.nim.uikit.common.framework.NimSingleThreadExecutor類的典型用法代碼示例。如果您正苦於以下問題:Java NimSingleThreadExecutor類的具體用法?Java NimSingleThreadExecutor怎麽用?Java NimSingleThreadExecutor使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
NimSingleThreadExecutor類屬於com.netease.nim.uikit.common.framework包,在下文中一共展示了NimSingleThreadExecutor類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: asyncLoadAvatarBitmapToCache
import com.netease.nim.uikit.common.framework.NimSingleThreadExecutor; //導入依賴的package包/類
/**
* 異步加載頭像位圖到Glide緩存中
*/
private void asyncLoadAvatarBitmapToCache(final String url) {
if (TextUtils.isEmpty(url)) {
return;
}
final int imageSize = HeadImageView.DEFAULT_AVATAR_THUMB_SIZE;
NimSingleThreadExecutor.getInstance().execute(new Runnable() {
@Override
public void run() {
Glide.with(context)
.load(url)
.downloadOnly(imageSize, imageSize);
}
});
}
示例2: buildDataCacheAsync
import com.netease.nim.uikit.common.framework.NimSingleThreadExecutor; //導入依賴的package包/類
/**
* 本地緩存構建(異步)
*/
public static void buildDataCacheAsync(final Context context, final Observer<Void> buildCompletedObserver) {
NimSingleThreadExecutor.getInstance().execute(new Runnable() {
@Override
public void run() {
buildDataCache();
// callback
if (context != null && buildCompletedObserver != null) {
new Handler(context.getMainLooper()).post(new Runnable() {
@Override
public void run() {
buildCompletedObserver.onEvent(null);
}
});
}
LogUtil.i(TAG, "build data cache completed");
}
});
}
示例3: buildDataCacheAsync
import com.netease.nim.uikit.common.framework.NimSingleThreadExecutor; //導入依賴的package包/類
/**
* 本地緩存構建(異步)
*/
public static void buildDataCacheAsync() {
NimSingleThreadExecutor.getInstance().execute(new Runnable() {
@Override
public void run() {
buildDataCache();
LogUtil.i(TAG, "build data cache completed");
}
});
}
示例4: asyncLoadAvatarBitmapToCache
import com.netease.nim.uikit.common.framework.NimSingleThreadExecutor; //導入依賴的package包/類
/**
* 異步加載頭像位圖到Glide緩存中
*/
private void asyncLoadAvatarBitmapToCache(final String account) {
NimSingleThreadExecutor.getInstance().execute(new Runnable() {
@Override
public void run() {
UserInfo userInfo = NimUIKit.getUserInfoProvider().getUserInfo(account);
if (userInfo != null) {
loadAvatarBitmapToCache(userInfo.getAvatar());
}
}
});
}
示例5: buildDataCacheAsync
import com.netease.nim.uikit.common.framework.NimSingleThreadExecutor; //導入依賴的package包/類
/**
* 本地緩存構建(異步)
*/
public static void buildDataCacheAsync() {
NimSingleThreadExecutor.getInstance().execute(new Runnable() {
@Override
public void run() {
buildDataCache();
LogUtil.i(TAG, "build data cache completed");
NimUIKitImpl.notifyCacheBuildComplete();
}
});
}