@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); String userEntityID = getIntent().getStringExtra(InterfaceManager.USER_ENTITY_ID); if (userEntityID != null && !userEntityID.isEmpty()) { user = StorageManager.shared().fetchUserWithEntityID(userEntityID); if (user == null) { ToastHelper.show(this, R.string.user_entity_id_not_set); finish(); return; } } gridPadding = getIntent().getIntExtra(BaseProfilePicturesHandler.KeyGridPadding, gridPadding); pictureMargin = getIntent().getIntExtra(BaseProfilePicturesHandler.KeyPictureMargin, maxPictures); picturesPerRow = getIntent().getIntExtra(BaseProfilePicturesHandler.KeyPicturesPerRow, picturesPerRow); maxPictures = getIntent().getIntExtra(BaseProfilePicturesHandler.KeyMaxPictures, maxPictures); hideButton = getIntent().getBooleanExtra(BaseProfilePicturesHandler.KeyHideButton, hideButton); String warning = getIntent().getStringExtra(BaseProfilePicturesHandler.KeyLimitWarning); if (warning != null) { limitWarning = warning; } }
public void createMessageNotification(final Context context, Intent resultIntent, String userEntityID, String title, String message) { int pushIcon = ChatSDK.config().pushNotificationImageDefaultResourceId; if(pushIcon <= 0) { pushIcon = R.drawable.icn_72_push_mask; } final int smallPushIcon = pushIcon; final Bitmap largePushIcon = BitmapFactory.decodeResource(context.getResources(), smallPushIcon); Uri alarmSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); if (userEntityID != null && !userEntityID.isEmpty()) { User user = StorageManager.shared().fetchUserWithEntityID(userEntityID); if (user != null) { ImageBuilder.bitmapForURL(context, user.getAvatarURL()).subscribe((bitmap, throwable) -> { if (throwable != null) { ChatSDK.logError(throwable); } if (bitmap == null) { bitmap = largePushIcon; } createAlertNotification(context, resultIntent, title, message, bitmap, smallPushIcon, alarmSound, -1); }); } else { createAlertNotification(context, resultIntent, title, message, largePushIcon, smallPushIcon, alarmSound, -1); } } }
@Override protected void onCreate (Bundle savedInstanceState) { super.onCreate(savedInstanceState); String userEntityID = getIntent().getStringExtra(InterfaceManager.USER_ENTITY_ID); if (userEntityID == null || userEntityID.isEmpty()) { showToast("User Entity ID not set"); finish(); return; } else { currentUser = StorageManager.shared().fetchUserWithEntityID(userEntityID); // Save a copy of the data to see if it has changed userMeta = new HashMap<>(currentUser.metaMap()); } setContentView(activityLayout()); initViews(); }
@Override protected void onCreate (Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.chat_sdk_profile_activity); String userEntityID = getIntent().getStringExtra(InterfaceManager.USER_ENTITY_ID); if (userEntityID != null && !userEntityID.isEmpty()) { user = StorageManager.shared().fetchUserWithEntityID(userEntityID); if (user != null) { ProfileFragment fragment = (ProfileFragment) getSupportFragmentManager().findFragmentById(R.id.profile_fragment); fragment.setUser(user); fragment.updateInterface(); return; } } ToastHelper.show(this, R.string.user_entity_id_not_set); finish(); }