public boolean googleLoginEnabled() { return !StringChecker.isNullOrEmpty(googleWebClientKey) && googleLoginEnabled; }
public boolean twitterLoginEnabled() { return !StringChecker.isNullOrEmpty(twitterKey) && !StringChecker.isNullOrEmpty(twitterSecret) && twitterLoginEnabled; }
public void updateSendButton () { if(StringChecker.isNullOrEmpty(getMessageText()) && audioModeEnabled) { btnSend.setImageResource(R.drawable.ic_36_mic); recordOnPress = true; } else { btnSend.setImageResource(R.drawable.ic_36_send); recordOnPress = false; } }
public String getDisplayName () { // Either get the name or return the names of the participants if(!StringChecker.isNullOrEmpty(getName())) { return getName(); } else { return getUserListString(); } }
protected void setSubtitleText(String text) { if(StringChecker.isNullOrEmpty(text)) { if(thread.typeIs(ThreadType.Private1to1)) { text = getString(R.string.tap_here_for_contact_info); } else { text = ""; for(User u : thread.getUsers()) { if(!u.isMe()) { String name = u.getName(); if (name != null && name.length() > 0) { text += name + ", "; } } } if(text.length() > 0) { text = text.substring(0, text.length() - 2); } } } final String finalText = text; new Handler(getMainLooper()).post(() -> subtitleTextView.setText(finalText)); }
public static Single<Uri> getImageUriForThread(final Context context, final Thread thread) { return Single.create(e -> { if(!StringChecker.isNullOrEmpty(thread.getImageUrl())) { e.onSuccess(Uri.parse(thread.getImageUrl())); return; if(!StringChecker.isNullOrEmpty(u.getAvatarURL()) && !u.isMe()) { urls.add(u.getAvatarURL());
public static Completable pushUpdated (final String path, final String entityID, final String key) { return Completable.create(e -> { Timber.v(path +'/'+entityID+'/'+key); if(StringChecker.isNullOrEmpty(path) || StringChecker.isNullOrEmpty(entityID) || StringChecker.isNullOrEmpty(key)) { e.onComplete(); return; } DatabaseReference ref = FirebasePaths.firebaseRef().child(path).child(entityID).child(FirebasePaths.UpdatedPath).child(key); ref.setValue(ServerValue.TIMESTAMP, (databaseError, databaseReference) -> { if(databaseError == null) { e.onComplete(); } else { e.onError(databaseError.toException()); } }); }); }
public static Single<Bitmap> bitmapForURL (final Context context, final String url) { return Single.create((SingleOnSubscribe<Bitmap>) e -> { if(!StringChecker.isNullOrEmpty(url)) { Uri uri = Uri.parse(url); ImageRequest request = ImageRequestBuilder .newBuilderWithSource(uri) .build(); ImagePipeline pipeline = Fresco.getImagePipeline(); DataSource dataSource = pipeline.fetchDecodedImage(request, context); dataSource.subscribe(new BaseBitmapDataSubscriber() { @Override protected void onNewResultImpl(Bitmap bitmap) { // We need to copy the bitmap because in some cases, Fresco is recycling the bitmap // which causes a crash later on. Seen this problem in Android 5 e.onSuccess(bitmap.copy(bitmap.getConfig(), true)); } @Override protected void onFailureImpl(DataSource<CloseableReference<CloseableImage>> dataSource) { e.onError(new Throwable(context.getString(R.string.unable_to_load_image))); } }, CallerThreadExecutor.getInstance()); } else { e.onError(new Throwable("Unable to load image")); } }).subscribeOn(AndroidSchedulers.mainThread()); } }
if (!StringChecker.isNullOrEmpty(name) && StringChecker.isNullOrEmpty(model.getName())) { model.setName(name); if (!StringChecker.isNullOrEmpty(email) && StringChecker.isNullOrEmpty(model.getEmail())) { model.setEmail(email); if (!StringChecker.isNullOrEmpty(phoneNumber) && StringChecker.isNullOrEmpty(model.getPhoneNumber())) { model.setPhoneNumber(phoneNumber); if (!StringChecker.isNullOrEmpty(profileURL) && StringChecker.isNullOrEmpty(model.getAvatarURL())) { model.setAvatarURL(profileURL);
String userEntityID = user.getPushChannel(); if (!user.isMe() && !StringChecker.isNullOrEmpty(userEntityID) && !StringChecker.isNullOrEmpty(userName)) { if(!user.getIsOnline() || !ChatSDK.config().onlySendPushToOfflineUsers) { users.put(userEntityID, userName); data.put("threadId", message.getThread().getEntityID()); data.put("action", ChatSDK.config().pushNotificationAction != null ? ChatSDK.config().pushNotificationAction : QuickReplyNotificationCategory); if(!StringChecker.isNullOrEmpty(ChatSDK.config().pushNotificationSound)) { data.put("sound", ChatSDK.config().pushNotificationSound);
if(!StringChecker.isNullOrEmpty(ChatSDK.config().debugUsername)) { usernameEditText.setText(ChatSDK.config().debugUsername); if(!StringChecker.isNullOrEmpty(ChatSDK.config().debugPassword)) { passwordEditText.setText(ChatSDK.config().debugPassword);
setViewVisibility(addOrDeleteButton, visible); setRowVisible(R.id.ivLocation, R.id.tvLocation, !StringChecker.isNullOrEmpty(user.getLocation())); setRowVisible(R.id.ivPhone, R.id.tvPhone, !StringChecker.isNullOrEmpty(user.getPhoneNumber())); setRowVisible(R.id.ivEmail, R.id.tvEmail, !StringChecker.isNullOrEmpty(user.getEmail())); setRowVisible(R.id.ivFollows, R.id.tvFollows, !StringChecker.isNullOrEmpty(user.getPresenceSubscription())); setRowVisible(R.id.ivFollowed, R.id.tvFollowed, !StringChecker.isNullOrEmpty(user.getPresenceSubscription())); if (!StringChecker.isNullOrEmpty(status)) { setViewText(statusTextView, status); } else {
if(!StringChecker.isNullOrEmpty(ChatSDK.config().firebaseStorageUrl)) { storage = FirebaseStorage.getInstance(ChatSDK.config().firebaseStorageUrl);
mediaSelector.handleResult(activity, result12.requestCode, result12.resultCode, result12.data); }, throwable -> { if(!StringChecker.isNullOrEmpty(throwable.getLocalizedMessage())) { Toast.makeText(activity, throwable.getLocalizedMessage(), Toast.LENGTH_SHORT).show();