Search in sources :

Example 1 with RichMessageActionProcessor

use of com.applozic.mobicomkit.uiwidgets.conversation.richmessaging.RichMessageActionProcessor in project Applozic-Android-SDK by AppLozic.

the class MobiComConversationFragment method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    geoApiKey = Applozic.getInstance(getContext()).getGeoApiKey();
    String jsonString = FileUtils.loadSettingsJsonFile(ApplozicService.getContext(getContext()));
    if (!TextUtils.isEmpty(jsonString)) {
        alCustomizationSettings = (AlCustomizationSettings) GsonUtils.getObjectFromJson(jsonString, AlCustomizationSettings.class);
    } else {
        alCustomizationSettings = new AlCustomizationSettings();
    }
    richMessageActionProcessor = new RichMessageActionProcessor(this);
    restrictedWords = FileUtils.loadRestrictedWordsFile(getContext());
    conversationUIService = new ConversationUIService(getActivity());
    syncCallService = SyncCallService.getInstance(getActivity());
    appContactService = new AppContactService(getActivity());
    messageDatabaseService = new MessageDatabaseService(getActivity());
    fileClientService = new FileClientService(getActivity());
    setHasOptionsMenu(true);
    imageThumbnailLoader = new ImageLoader(getContext(), ImageUtils.getLargestScreenDimension((Activity) getContext())) {

        @Override
        protected Bitmap processBitmap(Object data) {
            return fileClientService.downloadAndSaveThumbnailImage(getContext(), (Message) data, getImageLayoutParam(false).width, getImageLayoutParam(false).height);
        }
    };
    imageCache = ImageCache.getInstance((getActivity()).getSupportFragmentManager(), 0.1f);
    imageThumbnailLoader.setImageFadeIn(false);
    imageThumbnailLoader.addImageCache((getActivity()).getSupportFragmentManager(), 0.1f);
    messageImageLoader = new ImageLoader(getContext(), ImageUtils.getLargestScreenDimension((Activity) getContext())) {

        @Override
        protected Bitmap processBitmap(Object data) {
            return fileClientService.loadMessageImage(getContext(), (String) data);
        }
    };
    messageImageLoader.setImageFadeIn(false);
    messageImageLoader.addImageCache((getActivity()).getSupportFragmentManager(), 0.1f);
    applozicAudioRecordManager = new ApplozicAudioRecordManager(getActivity());
    mDetector = new GestureDetectorCompat(getContext(), this);
}
Also used : AlCustomizationSettings(com.applozic.mobicomkit.uiwidgets.AlCustomizationSettings) ConversationUIService(com.applozic.mobicomkit.uiwidgets.conversation.ConversationUIService) AppContactService(com.applozic.mobicomkit.contact.AppContactService) AlRichMessage(com.applozic.mobicomkit.uiwidgets.conversation.richmessaging.AlRichMessage) Message(com.applozic.mobicomkit.api.conversation.Message) FileClientService(com.applozic.mobicomkit.api.attachment.FileClientService) GestureDetectorCompat(androidx.core.view.GestureDetectorCompat) Bitmap(android.graphics.Bitmap) RichMessageActionProcessor(com.applozic.mobicomkit.uiwidgets.conversation.richmessaging.RichMessageActionProcessor) ImageLoader(com.applozic.mobicommons.commons.image.ImageLoader) MessageDatabaseService(com.applozic.mobicomkit.api.conversation.database.MessageDatabaseService) ApplozicAudioRecordManager(com.applozic.mobicomkit.uiwidgets.attachmentview.ApplozicAudioRecordManager)

Aggregations

Bitmap (android.graphics.Bitmap)1 GestureDetectorCompat (androidx.core.view.GestureDetectorCompat)1 FileClientService (com.applozic.mobicomkit.api.attachment.FileClientService)1 Message (com.applozic.mobicomkit.api.conversation.Message)1 MessageDatabaseService (com.applozic.mobicomkit.api.conversation.database.MessageDatabaseService)1 AppContactService (com.applozic.mobicomkit.contact.AppContactService)1 AlCustomizationSettings (com.applozic.mobicomkit.uiwidgets.AlCustomizationSettings)1 ApplozicAudioRecordManager (com.applozic.mobicomkit.uiwidgets.attachmentview.ApplozicAudioRecordManager)1 ConversationUIService (com.applozic.mobicomkit.uiwidgets.conversation.ConversationUIService)1 AlRichMessage (com.applozic.mobicomkit.uiwidgets.conversation.richmessaging.AlRichMessage)1 RichMessageActionProcessor (com.applozic.mobicomkit.uiwidgets.conversation.richmessaging.RichMessageActionProcessor)1 ImageLoader (com.applozic.mobicommons.commons.image.ImageLoader)1