use of hugo.weaving.DebugLog in project Rocket.Chat.Android by RocketChat.
the class RocketChatWebSocketThread method terminate.
/**
* terminate WebSocket thread.
*/
@DebugLog
public Single<Boolean> terminate() {
if (isAlive()) {
return Single.fromEmitter(emitter -> {
new Handler(getLooper()).post(() -> {
RCLog.d("thread %s: terminated()", Thread.currentThread().getId());
unregisterListeners();
connectivityManager.notifyConnectionLost(hostname, ConnectivityManagerInternal.REASON_CLOSED_BY_USER);
RocketChatWebSocketThread.super.quit();
emitter.onSuccess(true);
});
});
} else {
connectivityManager.notifyConnectionLost(hostname, ConnectivityManagerInternal.REASON_NETWORK_ERROR);
super.quit();
return Single.just(true);
}
}
use of hugo.weaving.DebugLog in project Rocket.Chat.Android by RocketChat.
the class SessionObserver method onLogin.
@DebugLog
private void onLogin() {
streamNotifyMessage.register();
// update push info
pushHelper.pushSetUser(new RocketChatCache(context).getOrCreatePushId()).continueWith(new LogIfError());
}
use of hugo.weaving.DebugLog in project wire-android by wireapp.
the class PickUserFragment method loadStartUi.
//////////////////////////////////////////////////////////////////////////////////////////
//
// List and grid helpers
//
//////////////////////////////////////////////////////////////////////////////////////////
@DebugLog
public void loadStartUi() {
if (searchResultAdapter.getItemCount() == 0) {
getContainer().getLoadingViewIndicator().show(LoadingIndicatorView.SPINNER);
} else {
getContainer().getLoadingViewIndicator().show(LoadingIndicatorView.INFINITE_LOADING_BAR, showLoadingBarDelay);
}
String filter = getControllerFactory().getPickUserController().getSearchFilter();
boolean hasSelectedUsers = getControllerFactory().getPickUserController().hasSelectedUsers();
switch(getDataState(hasSelectedUsers)) {
case SHOW_ALL_USERS_TO_ADD_TO_CONVERSATION:
filter = "";
case SHOW_SEARCH_RESULTS_TO_ADD_TO_CONVERSATION:
String[] excludedUsers = getStoreFactory().getPickUserStore().getExcludedUsers();
UserSearchResult usersSearchResult = getStoreFactory().getZMessagingApiStore().getApi().search().getConnectionsByName(filter, NUM_SEARCH_RESULTS_ADD_TO_CONV, excludedUsers);
usersSearchModelObserver.setAndUpdate(usersSearchResult);
break;
case SHOW_SEARCH_RESULTS:
getStoreFactory().getPickUserStore().loadSearchByFilter(filter, NUM_SEARCH_RESULTS_LIST, false);
if (!hasSelectedUsers) {
getStoreFactory().getPickUserStore().searchContacts(filter);
}
((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(new EnteredSearchEvent(isAddingToConversation(), filter));
break;
case SHOW_TOP_USERS_AS_LIST:
case SHOW_TOP_USERS_AND_RECOMMENDED:
boolean excludeConversationParticipants = isAddingToConversation() && getArguments().getBoolean(ARGUMENT_GROUP_CONVERSATION);
getStoreFactory().getPickUserStore().loadTopUserList(NUM_SEARCH_RESULTS_TOP_USERS, excludeConversationParticipants);
break;
}
}
use of hugo.weaving.DebugLog in project ocreader by schaal.
the class ArticleWebView method getHtml.
@DebugLog
private String getHtml() {
final Context context = getContext();
final String font = Preferences.ARTICLE_FONT.getString(PreferenceManager.getDefaultSharedPreferences(context));
Document document = Jsoup.parse(item.getBody());
document = cleaner.clean(document);
String firstImgString = extractFirstImg(document);
prepareDocument(document);
document.outputSettings().prettyPrint(false);
return context.getString(R.string.article_html_template, FaviconLoader.getCssColor(defaultLinkColor), FaviconLoader.getCssColor(fontColor), FaviconLoader.getCssColor(backgroundColor), FaviconLoader.getCssColor(ContextCompat.getColor(context, R.color.selected_background)), StringUtils.nullToEmpty(item.getUrl()), item.getTitle(), StringUtils.getByLine(context, "<p class=\"byline\">%s</p>", item.getAuthor()), document.body().html(), firstImgString, !"system".equals(font) ? context.getString(R.string.crimson_font_css) : "");
}
use of hugo.weaving.DebugLog in project Rocket.Chat.Android by RocketChat.
the class CurrentUserObserver method onLogin.
@DebugLog
private void onLogin(RealmUser user) {
if (listeners != null) {
onLogout();
}
listeners = new ArrayList<>();
final String userId = user.getId();
// get and observe Room subscriptions.
methodCall.getRoomSubscriptions().onSuccess(task -> {
if (listeners != null) {
Registrable listener = new StreamNotifyUserSubscriptionsChanged(context, hostname, realmHelper, ddpClientRef, userId);
listener.register();
listeners.add(listener);
}
return null;
}).continueWith(new LogIfError());
}
Aggregations