Search in sources :

Example 1 with ChangedProfilePictureEvent

use of com.waz.zclient.core.controllers.tracking.events.settings.ChangedProfilePictureEvent in project wire-android by wireapp.

the class ZetaPreferencesActivity method onBitmapSelected.

@Override
public void onBitmapSelected(final ImageAsset imageAsset, boolean imageFromCamera, CameraContext cameraContext) {
    if (cameraContext != CameraContext.SETTINGS) {
        return;
    }
    getStoreFactory().getNetworkStore().doIfHasInternetOrNotifyUser(new NetworkAction() {

        @Override
        public void execute(NetworkMode networkMode) {
            getStoreFactory().getProfileStore().setUserPicture(imageAsset);
            getControllerFactory().getBackgroundController().setImageAsset(imageAsset);
            injectJava(GlobalTrackingController.class).tagEvent(new ChangedProfilePictureEvent());
        }

        @Override
        public void onNoNetwork() {
            ViewUtils.showAlertDialog(ZetaPreferencesActivity.this, R.string.alert_dialog__no_network__header, R.string.profile_pic__no_network__message, R.string.alert_dialog__confirmation, null, true);
        }
    });
    getSupportFragmentManager().popBackStack(CameraFragment.TAG, FragmentManager.POP_BACK_STACK_INCLUSIVE);
}
Also used : ChangedProfilePictureEvent(com.waz.zclient.core.controllers.tracking.events.settings.ChangedProfilePictureEvent) NetworkMode(com.waz.api.NetworkMode) NetworkAction(com.waz.zclient.core.stores.network.NetworkAction)

Aggregations

NetworkMode (com.waz.api.NetworkMode)1 ChangedProfilePictureEvent (com.waz.zclient.core.controllers.tracking.events.settings.ChangedProfilePictureEvent)1 NetworkAction (com.waz.zclient.core.stores.network.NetworkAction)1