Search in sources :

Example 1 with StructBottomSheet

use of net.iGap.module.structs.StructBottomSheet in project iGap-Android by KianIranian-STDG.

the class CameraStoryFragment method showCamera.

private void showCamera() {
    AttachFile.getAllShownImagesPath(getActivity(), 1, new ChatAttachmentPopup.OnImagesGalleryPrepared() {

        @Override
        public void imagesList(ArrayList<StructBottomSheet> listOfAllImages) {
            G.runOnUiThread(new Runnable() {

                @Override
                public void run() {
                    if (listOfAllImages != null && listOfAllImages.size() > 0) {
                        Glide.with(getContext()).asDrawable().load(new File(listOfAllImages.get(0).getPath())).centerCrop().into(galleryIcon);
                    }
                // ImageLoadingServiceInjector.inject().loadImage(galleryIcon, listOfAllImages.get(0).getPath(), true);
                }
            });
        }
    });
    if (cameraView == null) {
        cameraView = new CameraView(getActivity(), true);
    }
    cameraView.setDelegate(new CameraView.CameraViewDelegate() {

        @Override
        public void onCameraCreated(Camera camera) {
            Log.e("dfdfsdfgds", "onCameraCreated: ");
        }

        @Override
        public void onCameraInit() {
            checkFlashMode();
            Log.e("dfdfsdfgds", "onCameraCreated: ");
        }
    });
    cameraView.initCamera();
    cameraView.setFocusable(true);
}
Also used : ChatAttachmentPopup(net.iGap.module.dialog.ChatAttachmentPopup) StructBottomSheet(net.iGap.module.structs.StructBottomSheet) Camera(android.hardware.Camera) AttachFile(net.iGap.module.AttachFile) File(java.io.File)

Example 2 with StructBottomSheet

use of net.iGap.module.structs.StructBottomSheet in project iGap-Android by KianIranian-STDG.

the class PhotoViewer method serFilterImage.

private void serFilterImage(String path) {
    int po = (viewPager.getCurrentItem());
    if (textImageList.containsKey(itemGalleryList.get(po).getPath())) {
        String message = textImageList.get(itemGalleryList.get(po).getPath()).getText();
        int id = textImageList.get(itemGalleryList.get(po).getPath()).getId();
        textImageList.remove(itemGalleryList.get(po).getPath());
        StructBottomSheet item = new StructBottomSheet();
        item.setPath(path);
        item.setText(message);
        item.setId(id);
        textImageList.put(path, item);
    }
    itemGalleryList.get(po).setPath(path);
}
Also used : StructBottomSheet(net.iGap.module.structs.StructBottomSheet) SuppressLint(android.annotation.SuppressLint)

Example 3 with StructBottomSheet

use of net.iGap.module.structs.StructBottomSheet in project iGap-Android by KianIranian-STDG.

the class PhotoViewer method setCreatedFinalBitmap.

private void setCreatedFinalBitmap(String path) {
    if (counter < itemGalleryList.size() && textImageList.containsKey(itemGalleryList.get(counter).getPath())) {
        String message = textImageList.get(itemGalleryList.get(counter).getPath()).getText();
        int id = textImageList.get(itemGalleryList.get(counter).getPath()).getId();
        textImageList.remove(itemGalleryList.get(counter).getPath());
        StructBottomSheet item = new StructBottomSheet();
        item.setPath(path);
        item.setText(message);
        item.setId(id);
        textImageList.put(path, item);
    }
    itemGalleryList.get(counter).setPath(path);
    finalBitmapsPaths.add(path);
    counter++;
    if (counter == itemGalleryList.size()) {
        if (isForRoom && listMode == 0) {
            new HelperFragment(getActivity().getSupportFragmentManager(), PhotoViewer.this).popBackStack(2);
            new HelperFragment(getActivity().getSupportFragmentManager(), new MyStatusStoryListFragment(finalBitmapsPaths, itemGalleryList, roomId, 0, roomTitle)).setReplace(false).load();
        } else if (isForRoom && listMode == 1) {
            new HelperFragment(getActivity().getSupportFragmentManager(), PhotoViewer.this).popBackStack(2);
            EventManager.getInstance(AccountManager.selectedAccount).postEvent(EventManager.STORY_ROOM_IMAGE_UPLOAD, finalBitmapsPaths, itemGalleryList, roomId, 1, roomTitle);
        } else {
            EventManager.getInstance(AccountManager.selectedAccount).postEvent(EventManager.STORY_UPLOAD, finalBitmapsPaths, itemGalleryList, isForRoom, roomId, listMode, roomTitle);
            new HelperFragment(getActivity().getSupportFragmentManager(), PhotoViewer.this).popBackStack(2);
        }
    }
}
Also used : StructBottomSheet(net.iGap.module.structs.StructBottomSheet) HelperFragment(net.iGap.helper.HelperFragment) SuppressLint(android.annotation.SuppressLint) MyStatusStoryListFragment(net.iGap.story.liststories.MyStatusStoryListFragment)

Example 4 with StructBottomSheet

use of net.iGap.module.structs.StructBottomSheet in project iGap-Android by KianIranian-STDG.

the class PhotoViewer method onViewCreated.

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
    addedViews = new HashMap<>();
    modes = new HashMap<>();
    redoViews = new ArrayList<>();
    path = getArguments().getString(PATH);
    this.isForRoom = getArguments().getBoolean(IS_ROOM, false);
    this.roomId = getArguments().getLong(ROOM_ID, 0);
    this.listMode = getArguments().getInt(LIST_MODE, 0);
    this.roomTitle = getArguments().getString(ROOM_TITLE, "");
    selectedPhotos = (List<GalleryItemModel>) getArguments().getSerializable(SELECTED_PHOTOS);
    brushConfigDialog = new BrushConfigDialog();
    brushConfigDialog.setPropertiesChangeListener(this);
    mode = StoryModes.NONE;
    modes.put(viewHolderPostion, StoryModes.NONE);
    if (!HelperPermission.grantedUseStorage()) {
        try {
            HelperPermission.getStoragePermission(getContext(), new OnGetPermission() {

                @Override
                public void Allow() throws IOException {
                    openPhotoForEdit(path, null, false);
                }

                @Override
                public void deny() {
                    showDeniedPermissionMessage(G.context.getString(R.string.permission_storage));
                }
            });
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    if (getActivity() != null) {
        emojiSharedPreferences = getActivity().getSharedPreferences(SHP_SETTING.EMOJI, MODE_PRIVATE);
    }
    if (path != null) {
        openPhotoForEdit(path, null, false);
    } else {
        openPhotoForEdit(selectedPhotos, null, false);
        for (int i = 0; i < itemGalleryList.size(); i++) {
            modes.put(i, StoryModes.NONE);
        }
    }
    captionEditText.setListener(new EventEditText.Listener() {

        @Override
        public void onInternalTouchEvent(MotionEvent event) {
            if (!isPopupShowing() && event.getAction() == MotionEvent.ACTION_DOWN) {
                showPopUPView(KeyboardView.MODE_KEYBOARD);
            }
        }
    });
    addTextView.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            showPopUPView(-1);
            viewPager.setPagingEnabled(true);
            paintTextView.setBackground(null);
            textStickersParentView = viewHolders.get(viewHolderPostion).findViewById(R.id.textstickerView);
            if (mode == StoryModes.PAINT || mode == StoryModes.ADD_TEXT || mode == StoryModes.EMOJI || mode == StoryModes.FILTER || mode == StoryModes.CROP) {
                textStickersParentView.setPaintMode(false, "");
            } else {
                textStickersParentView.setPaintMode(false, "");
                autoScaleImageToFitBounds();
            }
            mode = StoryModes.ADD_TEXT;
            modes.put(viewHolderPostion, StoryModes.ADD_TEXT);
            TextEditorDialogFragment textEditorDialogFragment = TextEditorDialogFragment.newInstance(requireActivity());
            textEditorDialogFragment.setOnTextEditorListener((inputText, colorCode, width) -> {
                FrameLayout rootView = new FrameLayout(context);
                stickerBorder = new FrameLayout(context);
                stickerBorder.setPadding(10, 10, 10, 10);
                rootView.addView(stickerBorder, LayoutCreator.createFrame(LayoutCreator.MATCH_PARENT, LayoutCreator.MATCH_PARENT, Gravity.CENTER, 8, 8, 8, 8));
                textTv = new TextView(context);
                textTv.setId(R.id.story_added_text);
                textTv.setTextColor(colorCode);
                textTv.setText(inputText);
                textTv.setGravity(Gravity.CENTER);
                textTv.setTypeface(ResourcesCompat.getFont(context, R.font.main_font_bold));
                textTv.setTextSize(30);
                TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration(textTv, 22, 30, 1, TypedValue.COMPLEX_UNIT_DIP);
                stickerBorder.addView(textTv, LayoutCreator.createFrame(LayoutCreator.WRAP_CONTENT, LayoutCreator.WRAP_CONTENT, Gravity.CENTER, 14, 14, 14, 14));
                onEditActions.addText(rootView, inputText, colorCode);
            });
        }
    });
    paintTextView.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            showPopUPView(-1);
            viewPager.setPagingEnabled(false);
            textStickersParentView = viewHolders.get(viewHolderPostion).findViewById(R.id.textstickerView);
            if (mode == StoryModes.PAINT || mode == StoryModes.ADD_TEXT || mode == StoryModes.EMOJI || mode == StoryModes.FILTER || mode == StoryModes.CROP) {
                textStickersParentView.setPaintMode(true, "");
            } else {
                textStickersParentView.setPaintMode(true, "");
            }
            mode = StoryModes.PAINT;
            modes.put(viewHolderPostion, StoryModes.PAINT);
            textStickersParentView.getmBrushDrawingView().setBrushViewChangeListener(PhotoViewer.this);
            String tag = brushConfigDialog.getTag();
            // Avoid IllegalStateException "Fragment already added"
            if (brushConfigDialog.isAdded())
                return;
            brushConfigDialog.setBrushColor(brushColor);
            brushConfigDialog.setBrushOpacity(opacitySize);
            brushConfigDialog.setBrushSize(brushSize);
            brushConfigDialog.show(getParentFragmentManager(), tag);
            onEditActions.paint();
            updateBrushParams();
        }
    });
    revertTextView.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            textStickersParentView = viewHolders.get(viewHolderPostion).findViewById(R.id.textstickerView);
            boolean revert = undo();
            if (addedViews.get(viewHolderPostion).size() == 0) {
                paintTextView.setBackground(null);
            }
            revertTextView.setVisibility(addedViews.get(viewHolderPostion).size() > 0 ? View.VISIBLE : View.GONE);
        }
    });
    rippleView.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            closeKeyboard();
            if (getActivity() != null) {
                new HelperFragment(getParentFragmentManager(), PhotoViewer.this).remove();
            }
        }
    });
    emoji.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            showPopUPView(-1);
            paintTextView.setBackground(null);
            viewPager.setPagingEnabled(true);
            textStickersParentView = viewHolders.get(viewHolderPostion).findViewById(R.id.textstickerView);
            if (mode == StoryModes.PAINT) {
                textStickersParentView.setPaintMode(false, "");
            } else if (mode == StoryModes.ADD_TEXT) {
                textStickersParentView.setPaintMode(false, "");
            } else {
                textStickersParentView.setPaintMode(false, "");
            }
            mode = StoryModes.EMOJI;
            modes.put(viewHolderPostion, StoryModes.EMOJI);
            EmojiDialogFrag emojiDialogFrag = new EmojiDialogFrag();
            emojiDialogFrag.setEmojiListener(PhotoViewer.this::onEmojiClick);
            emojiDialogFrag.show(getParentFragmentManager(), emojiDialogFrag.getTag());
            onEditActions.emoji();
        }
    });
    editTextView.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            showPopUPView(-1);
            paintTextView.setBackground(null);
            viewPager.setPagingEnabled(true);
            mode = StoryModes.FILTER;
            modes.put(viewHolderPostion, StoryModes.FILTER);
            new HelperFragment(getActivity().getSupportFragmentManager(), FragmentFilterImage.newInstance(itemGalleryList.get(viewHolderPostion).getPath())).setReplace(false).load();
        }
    });
    cropTextView.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            showPopUPView(-1);
            paintTextView.setBackground(null);
            viewPager.setPagingEnabled(true);
            mode = StoryModes.CROP;
            modes.put(viewHolderPostion, StoryModes.CROP);
            goToCropPage(view);
        }
    });
    updateImage = new UpdateImage() {

        @Override
        public void result(Bitmap finalBitmap) {
            textStickersParentView = viewHolders.get(viewHolderPostion).findViewById(R.id.textstickerView);
            textStickersParentView.updateImageBitmap(finalBitmap);
        }

        @Override
        public void resultWithPath(String path) {
            textStickersParentView = viewHolders.get(viewHolderPostion).findViewById(R.id.textstickerView);
            serFilterImage(path);
        }
    };
    pickerViewSendButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            HelperTracker.sendTracker(HelperTracker.TRACKER_MOMENTS_SUBMIT_PICTURE_PAGE);
            pickerViewSendButton.setVisibility(View.GONE);
            progressBar.setVisibility(VISIBLE);
            for (int i = 0; i < itemGalleryList.size(); i++) {
                if (viewHolders.get(i) != null) {
                    reservedView = viewHolders.get(i);
                    new SaveBitmapAsync(itemGalleryList.get(i).path, null, viewHolders.get(i).findViewById(R.id.textstickerView), modes.get(i)).execute();
                } else {
                    zoomLayout = new ZoomLayout(context);
                    zoomLayout.measure(View.MeasureSpec.makeMeasureSpec(viewPager.getMeasuredWidth(), View.MeasureSpec.EXACTLY), View.MeasureSpec.makeMeasureSpec(viewPager.getMeasuredHeight(), View.MeasureSpec.EXACTLY));
                    zoomLayout.layout(0, 0, viewPager.getMeasuredWidth(), viewPager.getMeasuredHeight());
                    textStickersParentView = new TextStickerView(context, false);
                    textStickersParentView.setId(R.id.textstickerView);
                    zoomLayout.addView(textStickersParentView);
                    if (itemGalleryList.get(i).path != null && !viewHolders.containsKey(i)) {
                        String oldPath = itemGalleryList.get(i).path;
                        String finalPath = attachFile.saveGalleryPicToLocal(oldPath);
                        // check if old path available in selected list , replace new path with that
                        if (!oldPath.equals(finalPath)) {
                            StructBottomSheet item = textImageList.get(oldPath);
                            if (item != null) {
                                textImageList.remove(oldPath);
                                textImageList.put(finalPath, item);
                            }
                        }
                        itemGalleryList.get(i).path = finalPath;
                        textStickersParentView.measure(View.MeasureSpec.makeMeasureSpec(viewPager.getMeasuredWidth(), View.MeasureSpec.EXACTLY), View.MeasureSpec.makeMeasureSpec(viewPager.getMeasuredHeight(), View.MeasureSpec.EXACTLY));
                        textStickersParentView.layout(0, 0, viewPager.getMeasuredWidth(), viewPager.getMeasuredHeight());
                        Palette palette = Palette.from(BitmapFactory.decodeFile(finalPath)).generate();
                        GradientDrawable gd = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[] { palette.getLightMutedColor(0xFF616261), palette.getMutedColor(0xFF616261), palette.getDarkMutedColor(0xFF616261) });
                        textStickersParentView.setBackground(gd);
                        textStickersParentView.setPaintMode(false, finalPath);
                        Bitmap b = Bitmap.createBitmap(textStickersParentView.getMeasuredWidth(), textStickersParentView.getMeasuredHeight(), Bitmap.Config.ARGB_8888);
                        Canvas mCanvas = new Canvas(b);
                        mCanvas.translate((-textStickersParentView.getScrollX()), (-textStickersParentView.getScrollY()));
                        textStickersParentView.draw(mCanvas);
                        new SaveBitmapAsync(itemGalleryList.get(i).path, b, textStickersParentView, modes.get(i)).execute();
                    }
                }
            }
        }
    });
    captionEditText.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            if (isPopupShowing()) {
                keyboardEmoji.performClick();
            }
        }
    });
    keyboardEmoji.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            if (!isPopupShowing()) {
                showPopUPView(KeyboardView.MODE_EMOJI);
            } else {
                showPopUPView(KeyboardView.MODE_KEYBOARD);
            }
        }
    });
    captionEditText.addTextChangedListener(new TextWatcher() {

        @Override
        public void beforeTextChanged(CharSequence s, int start, int count, int after) {
        }

        @Override
        public void onTextChanged(CharSequence s, int start, int before, int count) {
        }

        @Override
        public void afterTextChanged(Editable s) {
            StructBottomSheet item = new StructBottomSheet();
            item.setText(s.toString());
            item.setPath(itemGalleryList.get(viewHolderPostion).path);
            item.setId(itemGalleryList.get(viewHolderPostion).getId());
            itemGalleryList.get(viewHolderPostion).setText(s.toString());
            textImageList.put(itemGalleryList.get(viewHolderPostion).path, item);
        }
    });
}
Also used : Bundle(android.os.Bundle) ProgressBar(android.widget.ProgressBar) NonNull(androidx.annotation.NonNull) Uri(android.net.Uri) FrameLayout(android.widget.FrameLayout) ImageView(android.widget.ImageView) Drawable(android.graphics.drawable.Drawable) HelperPermission.showDeniedPermissionMessage(net.iGap.helper.HelperPermission.showDeniedPermissionMessage) SaveSettings(net.iGap.libs.photoEdit.SaveSettings) VISIBLE(android.view.View.VISIBLE) Canvas(android.graphics.Canvas) BrushDrawingView(net.iGap.libs.photoEdit.BrushDrawingView) ContextCompat(androidx.core.content.ContextCompat) HelperFragment(net.iGap.helper.HelperFragment) ViewCompat(androidx.core.view.ViewCompat) HelperTracker(net.iGap.helper.HelperTracker) BaseFragment(net.iGap.fragments.BaseFragment) BrushViewChangeListener(net.iGap.libs.photoEdit.BrushViewChangeListener) StringRes(androidx.annotation.StringRes) Nullable(androidx.annotation.Nullable) ConstraintLayout(androidx.constraintlayout.widget.ConstraintLayout) SHP_SETTING(net.iGap.module.SHP_SETTING) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) EventManager(net.iGap.observers.eventbus.EventManager) BitmapUtils(net.iGap.fragments.filterImage.BitmapUtils) TextWatcher(android.text.TextWatcher) EmojiManager(net.iGap.libs.emojiKeyboard.emoji.EmojiManager) FragmentEditImage(net.iGap.fragments.FragmentEditImage) RippleView(net.iGap.libs.rippleeffect.RippleView) Environment(android.os.Environment) AccountManager(net.iGap.module.accountManager.AccountManager) ViewPager(androidx.viewpager.widget.ViewPager) BitmapFactory(android.graphics.BitmapFactory) DrawableCompat(androidx.core.graphics.drawable.DrawableCompat) CropImageView(com.theartofdev.edmodo.cropper.CropImageView) Editable(android.text.Editable) UCrop(com.yalantis.ucrop.UCrop) ArrayList(java.util.ArrayList) CropImage(com.theartofdev.edmodo.cropper.CropImage) GradientDrawable(android.graphics.drawable.GradientDrawable) LayoutCreator(net.iGap.helper.LayoutCreator) FileOutputStream(java.io.FileOutputStream) TextUtils(android.text.TextUtils) IOException(java.io.IOException) File(java.io.File) Gravity(android.view.Gravity) StructIGSticker(net.iGap.fragments.emoji.struct.StructIGSticker) EventEditText(net.iGap.module.customView.EventEditText) SharedPreferences(android.content.SharedPreferences) TypedValue(android.util.TypedValue) OnRotateImage(net.iGap.observers.interfaces.OnRotateImage) NotifyFrameLayout(net.iGap.libs.emojiKeyboard.NotifyFrameLayout) TextViewCompat(androidx.core.widget.TextViewCompat) ImageHelper(net.iGap.helper.ImageHelper) LinearLayout(android.widget.LinearLayout) GalleryItemModel(net.iGap.model.GalleryItemModel) AttachFile(net.iGap.module.AttachFile) DrawableRes(androidx.annotation.DrawableRes) G(net.iGap.G) CheckBox(android.widget.CheckBox) HelperPermission(net.iGap.helper.HelperPermission) MyStatusStoryListFragment(net.iGap.story.liststories.MyStatusStoryListFragment) ActivityInfo(android.content.pm.ActivityInfo) ContextThemeWrapper(android.view.ContextThemeWrapper) View(android.view.View) KeyboardView(net.iGap.libs.emojiKeyboard.KeyboardView) RecyclerView(androidx.recyclerview.widget.RecyclerView) AsyncTask(android.os.AsyncTask) ViewGroup(android.view.ViewGroup) List(java.util.List) TextView(android.widget.TextView) OnGetPermission(net.iGap.observers.interfaces.OnGetPermission) RelativeLayout(android.widget.RelativeLayout) Toolbar(androidx.appcompat.widget.Toolbar) EditorInfo(android.view.inputmethod.EditorInfo) Typeface(android.graphics.Typeface) MutableLiveData(androidx.lifecycle.MutableLiveData) Context(android.content.Context) AndroidUtils(net.iGap.module.AndroidUtils) KeyEvent(android.view.KeyEvent) ResourcesCompat(androidx.core.content.res.ResourcesCompat) FragmentFilterImage(net.iGap.fragments.filterImage.FragmentFilterImage) RESULT_OK(android.app.Activity.RESULT_OK) PagerAdapter(androidx.viewpager.widget.PagerAdapter) Intent(android.content.Intent) HashMap(java.util.HashMap) SuppressLint(android.annotation.SuppressLint) MotionEvent(android.view.MotionEvent) MODE_PRIVATE(android.content.Context.MODE_PRIVATE) Build(android.os.Build) Palette(androidx.palette.graphics.Palette) EmojiView(net.iGap.libs.emojiKeyboard.EmojiView) LayoutInflater(android.view.LayoutInflater) MaterialDesignTextView(net.iGap.module.MaterialDesignTextView) Color(android.graphics.Color) Glide(com.bumptech.glide.Glide) Bitmap(android.graphics.Bitmap) StructBottomSheet(net.iGap.module.structs.StructBottomSheet) ViewTreeObserver(android.view.ViewTreeObserver) R(net.iGap.R) Collections(java.util.Collections) Palette(androidx.palette.graphics.Palette) OnGetPermission(net.iGap.observers.interfaces.OnGetPermission) Bitmap(android.graphics.Bitmap) TextWatcher(android.text.TextWatcher) Editable(android.text.Editable) TextView(android.widget.TextView) MaterialDesignTextView(net.iGap.module.MaterialDesignTextView) GalleryItemModel(net.iGap.model.GalleryItemModel) EventEditText(net.iGap.module.customView.EventEditText) Canvas(android.graphics.Canvas) StructBottomSheet(net.iGap.module.structs.StructBottomSheet) IOException(java.io.IOException) ImageView(android.widget.ImageView) BrushDrawingView(net.iGap.libs.photoEdit.BrushDrawingView) RippleView(net.iGap.libs.rippleeffect.RippleView) CropImageView(com.theartofdev.edmodo.cropper.CropImageView) View(android.view.View) KeyboardView(net.iGap.libs.emojiKeyboard.KeyboardView) RecyclerView(androidx.recyclerview.widget.RecyclerView) TextView(android.widget.TextView) EmojiView(net.iGap.libs.emojiKeyboard.EmojiView) MaterialDesignTextView(net.iGap.module.MaterialDesignTextView) SuppressLint(android.annotation.SuppressLint) GradientDrawable(android.graphics.drawable.GradientDrawable) MotionEvent(android.view.MotionEvent) FrameLayout(android.widget.FrameLayout) NotifyFrameLayout(net.iGap.libs.emojiKeyboard.NotifyFrameLayout) HelperFragment(net.iGap.helper.HelperFragment)

Example 5 with StructBottomSheet

use of net.iGap.module.structs.StructBottomSheet in project iGap-Android by KianIranian-STDG.

the class FragmentEditImage method serCropAndFilterImage.

private void serCropAndFilterImage(String path) {
    int po = (viewPager.getCurrentItem());
    if (po < itemGalleryList.size() && textImageList.containsKey(itemGalleryList.get(po).getPath())) {
        String message = textImageList.get(itemGalleryList.get(po).getPath()).getText();
        int id = textImageList.get(itemGalleryList.get(po).getPath()).getId();
        textImageList.remove(itemGalleryList.get(po).getPath());
        StructBottomSheet item = new StructBottomSheet();
        item.setPath(path);
        item.setText(message);
        item.setId(id);
        textImageList.put(path, item);
    }
    itemGalleryList.get(po).setPath(path);
    mAdapter.notifyDataSetChanged();
}
Also used : StructBottomSheet(net.iGap.module.structs.StructBottomSheet)

Aggregations

StructBottomSheet (net.iGap.module.structs.StructBottomSheet)19 ArrayList (java.util.ArrayList)8 SuppressLint (android.annotation.SuppressLint)6 HelperFragment (net.iGap.helper.HelperFragment)6 Uri (android.net.Uri)4 View (android.view.View)4 RecyclerView (androidx.recyclerview.widget.RecyclerView)4 IOException (java.io.IOException)4 Cursor (android.database.Cursor)3 Editable (android.text.Editable)3 TextWatcher (android.text.TextWatcher)3 TextView (android.widget.TextView)3 HelperString (net.iGap.helper.HelperString)3 AttachFile (net.iGap.module.AttachFile)3 Canvas (android.graphics.Canvas)2 LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)2 File (java.io.File)2 FragmentFilterImage (net.iGap.fragments.filterImage.FragmentFilterImage)2 OnGetPermission (net.iGap.observers.interfaces.OnGetPermission)2 RealmString (net.iGap.realm.RealmString)2