Search in sources :

Example 1 with R.string.array_Delete_photo

use of net.iGap.R.string.array_Delete_photo in project iGap-Android by KianIranian-STDG.

the class FragmentShowAvatars method initComponent.

private void initComponent(View view) {
    // ViewGroup rooShowImage = (ViewGroup) view.findViewById(R.id.rooShowImage);
    // rooShowImage.setBackgroundColor(G.fragmentActivity.getResources().getColor(R.color.black));
    RippleView rippleBack = view.findViewById(R.id.asi_ripple_back);
    rippleBack.setOnRippleCompleteListener(new RippleView.OnRippleCompleteListener() {

        @Override
        public void onComplete(RippleView rippleView) {
            G.fragmentActivity.onBackPressed();
        }
    });
    RippleView rippleMenu = view.findViewById(R.id.asi_ripple_menu);
    rippleMenu.setOnRippleCompleteListener(rippleView -> {
        if (getContext() == null)
            return;
        List<Integer> items = new ArrayList<>();
        items.add(R.string.save_to_gallery);
        switch(from) {
            case setting:
                items.add(R.string.array_Delete_photo);
                break;
            case group:
                if (roleGroup == GroupChatRole.OWNER || roleGroup == GroupChatRole.ADMIN) {
                    items.add(R.string.array_Delete_photo);
                }
                break;
            case channel:
                if (roleChannel == ChannelChatRole.OWNER || roleChannel == ChannelChatRole.ADMIN) {
                    items.add(R.string.array_Delete_photo);
                }
                break;
        }
        new TopSheetDialog(getContext()).setListDataWithResourceId(items, -1, position -> {
            if (items.get(position) == R.string.save_to_gallery) {
                saveToGallery();
            } else if (items.get(position) == array_Delete_photo) {
                switch(from) {
                    case setting:
                        deletePhotoSetting();
                        break;
                    case group:
                        deletePhotoGroup();
                        break;
                    case channel:
                        deletePhotoChannel();
                        break;
                    case chat:
                        deletePhotoChat();
                        break;
                }
            }
        }).show();
    });
    viewPager = view.findViewById(R.id.asi_view_pager);
    txtImageNumber = view.findViewById(R.id.asi_txt_image_number);
    toolbarShowImage = view.findViewById(R.id.showAvatarToolbar);
    initViewPager();
}
Also used : TopSheetDialog(net.iGap.module.dialog.topsheet.TopSheetDialog) LinearLayout(android.widget.LinearLayout) Bundle(android.os.Bundle) AppUtils(net.iGap.module.AppUtils) OnGroupAvatarDelete(net.iGap.observers.interfaces.OnGroupAvatarDelete) RequestGroupAvatarGetList(net.iGap.request.RequestGroupAvatarGetList) ProtoFileDownload(net.iGap.proto.ProtoFileDownload) MessageProgress(net.iGap.messageprogress.MessageProgress) OnUserAvatarDelete(net.iGap.observers.interfaces.OnUserAvatarDelete) G(net.iGap.G) GroupChatRole(net.iGap.module.enums.GroupChatRole) DialogAnimation(net.iGap.module.DialogAnimation) R.string.array_Delete_photo(net.iGap.R.string.array_Delete_photo) View(android.view.View) Log(android.util.Log) HelperImageBackColor(net.iGap.helper.HelperImageBackColor) RequestUserAvatarGetList(net.iGap.request.RequestUserAvatarGetList) HelperCalander(net.iGap.helper.HelperCalander) Status(net.iGap.module.downloader.Status) OnComplete(net.iGap.observers.interfaces.OnComplete) RealmRoom(net.iGap.realm.RealmRoom) BitmapDrawable(android.graphics.drawable.BitmapDrawable) Downloader(net.iGap.module.downloader.Downloader) RealmStory(net.iGap.realm.RealmStory) ViewGroup(android.view.ViewGroup) HelperLog(net.iGap.helper.HelperLog) List(java.util.List) TextView(android.widget.TextView) Nullable(androidx.annotation.Nullable) RealmRegisteredInfo(net.iGap.realm.RealmRegisteredInfo) Sort(io.realm.Sort) MaterialDialog(com.afollestad.materialdialogs.MaterialDialog) NotNull(org.jetbrains.annotations.NotNull) DownloadObject(net.iGap.module.downloader.DownloadObject) RealmChangeListener(io.realm.RealmChangeListener) Context(android.content.Context) AttachmentObject(net.iGap.structs.AttachmentObject) RippleView(net.iGap.libs.rippleeffect.RippleView) AndroidUtils(net.iGap.module.AndroidUtils) PagerAdapter(androidx.viewpager.widget.PagerAdapter) AccountManager(net.iGap.module.accountManager.AccountManager) ViewPager(androidx.viewpager.widget.ViewPager) ArrayList(java.util.ArrayList) Toast(android.widget.Toast) LayoutCreator(net.iGap.helper.LayoutCreator) AvatarHandler(net.iGap.helper.avatar.AvatarHandler) RequestChannelAvatarGetList(net.iGap.request.RequestChannelAvatarGetList) RequestChannelAvatarDelete(net.iGap.request.RequestChannelAvatarDelete) HelperDownloadFile(net.iGap.helper.HelperDownloadFile) LayoutInflater(android.view.LayoutInflater) PhotoView(com.github.chrisbanes.photoview.PhotoView) RealmResults(io.realm.RealmResults) RequestUserAvatarDelete(net.iGap.request.RequestUserAvatarDelete) TopSheetDialog(net.iGap.module.dialog.topsheet.TopSheetDialog) RequestGroupAvatarDelete(net.iGap.request.RequestGroupAvatarDelete) File(java.io.File) OnChannelAvatarDelete(net.iGap.observers.interfaces.OnChannelAvatarDelete) Color(android.graphics.Color) RealmAvatar(net.iGap.realm.RealmAvatar) Glide(com.bumptech.glide.Glide) HelperSaveFile(net.iGap.helper.HelperSaveFile) ProtoGlobal(net.iGap.proto.ProtoGlobal) R(net.iGap.R) ChannelChatRole(net.iGap.module.enums.ChannelChatRole) DbManager(net.iGap.module.accountManager.DbManager) RealmAttachment(net.iGap.realm.RealmAttachment) ArrayList(java.util.ArrayList) RippleView(net.iGap.libs.rippleeffect.RippleView)

Aggregations

Context (android.content.Context)1 Color (android.graphics.Color)1 BitmapDrawable (android.graphics.drawable.BitmapDrawable)1 Bundle (android.os.Bundle)1 Log (android.util.Log)1 LayoutInflater (android.view.LayoutInflater)1 View (android.view.View)1 ViewGroup (android.view.ViewGroup)1 LinearLayout (android.widget.LinearLayout)1 TextView (android.widget.TextView)1 Toast (android.widget.Toast)1 Nullable (androidx.annotation.Nullable)1 PagerAdapter (androidx.viewpager.widget.PagerAdapter)1 ViewPager (androidx.viewpager.widget.ViewPager)1 MaterialDialog (com.afollestad.materialdialogs.MaterialDialog)1 Glide (com.bumptech.glide.Glide)1 PhotoView (com.github.chrisbanes.photoview.PhotoView)1 RealmChangeListener (io.realm.RealmChangeListener)1 RealmResults (io.realm.RealmResults)1 Sort (io.realm.Sort)1