Search in sources :

Example 16 with Toolbar

use of net.iGap.messenger.ui.toolBar.Toolbar in project iGap-Android by KianIranian-STDG.

the class FragmentBlockedUser method onViewCreated.

@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    blockedUserToolbar = new Toolbar(getContext());
    blockedUserToolbar.setBackIcon(new BackDrawable(false));
    blockedUserToolbar.setTitle(getString(R.string.Block_Users));
    blockedUserToolbar.setListener(i -> {
        switch(i) {
            case -1:
                popBackStackFragment();
                break;
        }
    });
    ViewGroup layoutToolbar = view.findViewById(R.id.fbu_layout_toolbar);
    layoutToolbar.addView(blockedUserToolbar, LayoutCreator.createLinear(LayoutCreator.MATCH_PARENT, LayoutCreator.dp(56), Gravity.TOP));
    RecyclerView realmRecyclerView = view.findViewById(R.id.fbu_realm_recycler_view);
    realmRecyclerView.setItemViewCacheSize(100);
    realmRecyclerView.setItemAnimator(null);
    realmRecyclerView.setLayoutManager(new LinearLayoutManager(G.fragmentActivity));
    RealmResults<RealmRegisteredInfo> results = DbManager.getInstance().doRealmTask(realm -> {
        return realm.where(RealmRegisteredInfo.class).equalTo("blockUser", true).findAll();
    });
    BlockListAdapter blockListAdapter = new BlockListAdapter(results.sort("displayName"));
    realmRecyclerView.setAdapter(blockListAdapter);
    fastScroller = view.findViewById(R.id.fast_scroller);
    if (realmRecyclerView.getAdapter().getItemCount() > 0) {
        fastScroller.setRecyclerView(realmRecyclerView);
    } else {
        fastScroller.setVisibility(View.GONE);
    }
}
Also used : ViewGroup(android.view.ViewGroup) BackDrawable(net.iGap.messenger.ui.toolBar.BackDrawable) RecyclerView(androidx.recyclerview.widget.RecyclerView) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) RealmRegisteredInfo(net.iGap.realm.RealmRegisteredInfo) Toolbar(net.iGap.messenger.ui.toolBar.Toolbar)

Example 17 with Toolbar

use of net.iGap.messenger.ui.toolBar.Toolbar in project iGap-Android by KianIranian-STDG.

the class FragmentDataUsage method onViewCreated.

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    dataUsageToolbar = new Toolbar(getContext());
    dataUsageToolbar.setBackIcon(new BackDrawable(false));
    dataUsageToolbar.setListener(i -> {
        switch(i) {
            case -1:
                if (getActivity() != null) {
                    getActivity().onBackPressed();
                }
                break;
        }
    });
    ViewGroup layoutToolbar = view.findViewById(R.id.fdu_layout_toolbar);
    layoutToolbar.addView(dataUsageToolbar, LayoutCreator.createLinear(LayoutCreator.MATCH_PARENT, LayoutCreator.dp(56), Gravity.TOP));
    type = getArguments().getBoolean("TYPE", false);
    initData(type);
    usageArrayList.add(new DataUsageStruct(1, 0, 0, 0, 0, "Total"));
    usageArrayList.add(new DataUsageStruct(2, 0, 0, 0, 0, "ClearData"));
    RecyclerView rcDataUsage = view.findViewById(R.id.rcDataUsage);
    adapter = new DataUsageAdapter(usageArrayList, totalReceivedByte, totalSendByte, type, this);
    rcDataUsage.setAdapter(adapter);
}
Also used : ViewGroup(android.view.ViewGroup) DataUsageStruct(net.iGap.module.structs.DataUsageStruct) BackDrawable(net.iGap.messenger.ui.toolBar.BackDrawable) RecyclerView(androidx.recyclerview.widget.RecyclerView) Toolbar(net.iGap.messenger.ui.toolBar.Toolbar) DataUsageAdapter(net.iGap.adapter.DataUsageAdapter)

Example 18 with Toolbar

use of net.iGap.messenger.ui.toolBar.Toolbar in project iGap-Android by KianIranian-STDG.

the class DataStorageFragment method onViewCreated.

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    dataStorageToolbar = new Toolbar(getContext());
    dataStorageToolbar.setBackIcon(new BackDrawable(false));
    dataStorageToolbar.setTitle(getString(R.string.data_storage));
    dataStorageToolbar.setListener(i -> {
        switch(i) {
            case -1:
                if (getActivity() != null) {
                    getActivity().onBackPressed();
                }
                popBackStackFragment();
                break;
        }
    });
    binding.toolbar.addView(dataStorageToolbar, LayoutCreator.createLinear(LayoutCreator.MATCH_PARENT, LayoutCreator.dp(56), Gravity.TOP));
    viewModel.getGoToDataUsagePage().observe(getViewLifecycleOwner(), isWifiData -> {
        if (getActivity() instanceof ActivityManageSpace && isWifiData != null) {
            Bundle bundle = new Bundle();
            bundle.putBoolean("TYPE", isWifiData);
            FragmentDataUsage fragmentDataUsage = new FragmentDataUsage();
            fragmentDataUsage.setArguments(bundle);
            ((ActivityManageSpace) getActivity()).loadFragment(fragmentDataUsage);
        }
    });
    viewModel.getShowDialogKeepMedia().observe(getViewLifecycleOwner(), selectedPosition -> {
        if (getContext() != null && selectedPosition != null) {
            new MaterialDialog.Builder(getContext()).title(R.string.st_keepMedia).titleGravity(GravityEnum.START).titleColor(getResources().getColor(android.R.color.black)).items(R.array.keepMedia).itemsCallbackSingleChoice(selectedPosition, (dialog, itemView, which, text) -> false).positiveText(R.string.B_ok).negativeText(R.string.B_cancel).onPositive((dialog, which) -> viewModel.setKeepMediaTime(dialog.getSelectedIndex())).show();
        }
    });
    viewModel.getShowAutoDownloadDataDialog().observe(getViewLifecycleOwner(), values -> {
        if (getContext() != null && values != null) {
            new MaterialDialog.Builder(getContext()).title(R.string.title_auto_download_data).items(R.array.auto_download_data).itemsCallbackMultiChoice(values, (dialog, which, text) -> true).positiveText(getResources().getString(R.string.B_ok)).onPositive((dialog, which) -> viewModel.setAutoDownloadOverData(Objects.requireNonNull(dialog.getSelectedIndices()))).negativeText(getResources().getString(R.string.B_cancel)).show();
        }
    });
    viewModel.getShowAutoDownloadWifiDialog().observe(getViewLifecycleOwner(), values -> {
        if (getContext() != null && values != null) {
            new MaterialDialog.Builder(getContext()).title(R.string.title_auto_download_wifi).items(R.array.auto_download_data).itemsCallbackMultiChoice(values, (dialog, which, text) -> true).positiveText(R.string.B_ok).onPositive((dialog, which) -> viewModel.setAutoDownloadOverWifi(Objects.requireNonNull(dialog.getSelectedIndices()))).negativeText(R.string.cancel).show();
        }
    });
    viewModel.getShowAutoDownloadRoamingDialog().observe(getViewLifecycleOwner(), values -> {
        if (getContext() != null && values != null) {
            new MaterialDialog.Builder(getContext()).title(R.string.title_auto_download_roaming).items(R.array.auto_download_data).itemsCallbackMultiChoice(values, (dialog, which, text) -> true).positiveText(R.string.B_ok).onPositive((dialog, which) -> viewModel.setAutoDownloadOverRoaming(Objects.requireNonNull(dialog.getSelectedIndices()))).negativeText(R.string.B_cancel).show();
        }
    });
    viewModel.getShowClearCashDialog().observe(getViewLifecycleOwner(), data -> {
        if (getContext() != null && data != null && data.length == 7) {
            MaterialDialog dialog = new MaterialDialog.Builder(getContext()).title(R.string.st_title_Clear_Cache).customView(R.layout.st_dialog_clear_cach, true).positiveText(R.string.st_title_Clear_Cache).show();
            View dialogView = dialog.getCustomView();
            assert dialogView != null;
            AppCompatCheckBox checkBoxAll = dialogView.findViewById(R.id.all);
            AppCompatCheckBox checkBoxPhoto = dialogView.findViewById(R.id.photo);
            AppCompatCheckBox checkBoxVideo = dialogView.findViewById(R.id.video);
            AppCompatCheckBox checkBoxDocument = dialogView.findViewById(R.id.document);
            AppCompatCheckBox checkBoxAudio = dialogView.findViewById(R.id.audio);
            AppCompatCheckBox checkBoxMap = dialogView.findViewById(R.id.map);
            AppCompatCheckBox checkBoxOtherFiles = dialogView.findViewById(R.id.other);
            AppCompatTextView txtTotalSize = dialogView.findViewById(R.id.allFileSize);
            AppCompatTextView photo = dialogView.findViewById(R.id.photoFileSize);
            AppCompatTextView video = dialogView.findViewById(R.id.videoFileSize);
            AppCompatTextView document = dialogView.findViewById(R.id.documentFileSize);
            AppCompatTextView txtAudio = dialogView.findViewById(R.id.audioFileSize);
            AppCompatTextView txtMap = dialogView.findViewById(R.id.mapFileSize);
            AppCompatTextView txtOtherFiles = dialogView.findViewById(R.id.otherFileSize);
            txtTotalSize.setText(data[0]);
            photo.setText(data[1]);
            video.setText(data[2]);
            document.setText(data[3]);
            txtAudio.setText(data[4]);
            txtMap.setText(data[5]);
            txtOtherFiles.setText(data[6]);
            checkBoxAll.setOnClickListener(v -> {
                boolean tmp = ((AppCompatCheckBox) v).isChecked();
                checkBoxPhoto.setChecked(tmp);
                checkBoxVideo.setChecked(tmp);
                checkBoxDocument.setChecked(tmp);
                checkBoxAudio.setChecked(tmp);
                checkBoxMap.setChecked(tmp);
                checkBoxOtherFiles.setChecked(tmp);
            });
            checkBoxAll.setOnCheckedChangeListener((buttonView, isChecked) -> {
            });
            checkBoxPhoto.setOnCheckedChangeListener((buttonView, isChecked) -> {
                boolean state = checkBoxAudio.isChecked() && checkBoxPhoto.isChecked() && checkBoxVideo.isChecked() && checkBoxDocument.isChecked() && checkBoxOtherFiles.isChecked() && checkBoxMap.isChecked();
                checkBoxAll.setChecked(state);
            });
            checkBoxVideo.setOnCheckedChangeListener((buttonView, isChecked) -> {
                boolean state = checkBoxAudio.isChecked() && checkBoxPhoto.isChecked() && checkBoxVideo.isChecked() && checkBoxDocument.isChecked() && checkBoxOtherFiles.isChecked() && checkBoxMap.isChecked();
                checkBoxAll.setChecked(state);
            });
            checkBoxDocument.setOnCheckedChangeListener((buttonView, isChecked) -> {
                boolean state = checkBoxAudio.isChecked() && checkBoxPhoto.isChecked() && checkBoxVideo.isChecked() && checkBoxDocument.isChecked() && checkBoxOtherFiles.isChecked() && checkBoxMap.isChecked();
                checkBoxAll.setChecked(state);
            });
            checkBoxAudio.setOnCheckedChangeListener((buttonView, isChecked) -> {
                boolean state = checkBoxAudio.isChecked() && checkBoxPhoto.isChecked() && checkBoxVideo.isChecked() && checkBoxDocument.isChecked() && checkBoxOtherFiles.isChecked() && checkBoxMap.isChecked();
                checkBoxAll.setChecked(state);
            });
            checkBoxMap.setOnCheckedChangeListener((buttonView, isChecked) -> {
                boolean state = checkBoxAudio.isChecked() && checkBoxPhoto.isChecked() && checkBoxVideo.isChecked() && checkBoxDocument.isChecked() && checkBoxOtherFiles.isChecked() && checkBoxMap.isChecked();
                checkBoxAll.setChecked(state);
            });
            checkBoxOtherFiles.setOnCheckedChangeListener((buttonView, isChecked) -> {
                boolean state = checkBoxAudio.isChecked() && checkBoxPhoto.isChecked() && checkBoxVideo.isChecked() && checkBoxDocument.isChecked() && checkBoxOtherFiles.isChecked() && checkBoxMap.isChecked();
                checkBoxAll.setChecked(state);
            });
            dialog.getActionButton(DialogAction.POSITIVE).setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View view) {
                    viewModel.setClearCashData(checkBoxPhoto.isChecked(), checkBoxVideo.isChecked(), checkBoxDocument.isChecked(), checkBoxAudio.isChecked(), checkBoxMap.isChecked(), checkBoxOtherFiles.isChecked());
                    dialog.dismiss();
                }
            });
        /*dialog.setOnDismissListener(dialog1 -> onCacheCheckedChanged = null);*/
        }
    });
    viewModel.getShowClearAllDialog().observe(getViewLifecycleOwner(), isShow -> {
        if (getContext() != null && isShow != null && isShow) {
            MaterialDialog inDialog = new MaterialDialog.Builder(getContext()).customView(R.layout.dialog_content_custom, true).build();
            View dialogView = inDialog.getCustomView();
            inDialog.show();
            assert dialogView != null;
            TextView txtTitle = dialogView.findViewById(R.id.txtDialogTitle);
            txtTitle.setText(R.string.clean_up_chat_rooms);
            TextView iconTitle = dialogView.findViewById(R.id.iconDialogTitle);
            iconTitle.setTypeface(ResourcesCompat.getFont(iconTitle.getContext(), R.font.font_icons));
            iconTitle.setText(R.string.icon_clearing);
            TextView txtContent = dialogView.findViewById(R.id.txtDialogContent);
            txtContent.setText(R.string.do_you_want_to_clean_all_data_in_chat_rooms);
            TextView txtCancel = dialogView.findViewById(R.id.txtDialogCancel);
            TextView txtOk = dialogView.findViewById(R.id.txtDialogOk);
            txtOk.setOnClickListener(v -> {
                viewModel.clearAll();
                inDialog.dismiss();
            });
            txtCancel.setOnClickListener(v -> inDialog.dismiss());
        }
    });
    viewModel.getShowActiveSDCardDialog().observe(getViewLifecycleOwner(), isShow -> {
        if (getContext() != null && isShow != null && isShow) {
            new MaterialDialog.Builder(getContext()).title(R.string.are_you_sure).negativeText(R.string.B_cancel).content(R.string.change_storage_place).positiveText(R.string.B_ok).onPositive((dialog, which) -> viewModel.setActiveSDCard()).show();
        }
    });
    viewModel.getNeedToGetStoragePermission().observe(getViewLifecycleOwner(), new Observer<Boolean>() {

        @RequiresApi(api = Build.VERSION_CODES.R)
        @Override
        public void onChanged(Boolean aBoolean) {
            try {
                getPermission();
            } catch (IOException ioException) {
                ioException.printStackTrace();
            }
        }
    });
}
Also used : RequiresApi(androidx.annotation.RequiresApi) AppCompatTextView(androidx.appcompat.widget.AppCompatTextView) Bundle(android.os.Bundle) ResourcesCompat(androidx.core.content.res.ResourcesCompat) PackageManager(android.content.pm.PackageManager) NonNull(androidx.annotation.NonNull) GravityEnum(com.afollestad.materialdialogs.GravityEnum) ViewModel(androidx.lifecycle.ViewModel) FragmentStorageDataBinding(net.iGap.databinding.FragmentStorageDataBinding) AppCompatCheckBox(androidx.appcompat.widget.AppCompatCheckBox) G(net.iGap.G) Manifest(android.Manifest) DataStorageViewModel(net.iGap.viewmodel.DataStorageViewModel) HelperPermission(net.iGap.helper.HelperPermission) MODE_PRIVATE(android.content.Context.MODE_PRIVATE) View(android.view.View) ViewModelProviders(androidx.lifecycle.ViewModelProviders) LayoutCreator(net.iGap.helper.LayoutCreator) Build(android.os.Build) ContextCompat(androidx.core.content.ContextCompat) Toolbar(net.iGap.messenger.ui.toolBar.Toolbar) DataBindingUtil(androidx.databinding.DataBindingUtil) ViewModelProvider(androidx.lifecycle.ViewModelProvider) LayoutInflater(android.view.LayoutInflater) DialogAction(com.afollestad.materialdialogs.DialogAction) IOException(java.io.IOException) ViewGroup(android.view.ViewGroup) ActivityManageSpace(net.iGap.activities.ActivityManageSpace) Objects(java.util.Objects) Gravity(android.view.Gravity) Observer(androidx.lifecycle.Observer) TextView(android.widget.TextView) Nullable(androidx.annotation.Nullable) BackDrawable(net.iGap.messenger.ui.toolBar.BackDrawable) SHP_SETTING(net.iGap.module.SHP_SETTING) OnGetPermission(net.iGap.observers.interfaces.OnGetPermission) R(net.iGap.R) FileUtils(net.iGap.module.FileUtils) MaterialDialog(com.afollestad.materialdialogs.MaterialDialog) MaterialDialog(com.afollestad.materialdialogs.MaterialDialog) Bundle(android.os.Bundle) AppCompatTextView(androidx.appcompat.widget.AppCompatTextView) BackDrawable(net.iGap.messenger.ui.toolBar.BackDrawable) IOException(java.io.IOException) AppCompatTextView(androidx.appcompat.widget.AppCompatTextView) View(android.view.View) TextView(android.widget.TextView) AppCompatCheckBox(androidx.appcompat.widget.AppCompatCheckBox) ActivityManageSpace(net.iGap.activities.ActivityManageSpace) RequiresApi(androidx.annotation.RequiresApi) AppCompatTextView(androidx.appcompat.widget.AppCompatTextView) TextView(android.widget.TextView) Toolbar(net.iGap.messenger.ui.toolBar.Toolbar)

Example 19 with Toolbar

use of net.iGap.messenger.ui.toolBar.Toolbar in project iGap-Android by KianIranian-STDG.

the class FragmentChat method onCreateView.

@Nullable
@Override
public View onCreateView(@NotNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    isNeedResume = true;
    G.locationListener = this;
    StickerRepository.getInstance().getUserStickersGroup();
    notifyFrameLayout = new NotifyFrameLayout(context) {

        @Override
        public boolean dispatchKeyEventPreIme(KeyEvent event) {
            if (event != null && event.getKeyCode() == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_UP) {
                if (topFragmentIsChat() && keyboardViewVisible) {
                    showPopup(-1);
                    return true;
                }
                return false;
            }
            return super.dispatchKeyEventPreIme(event);
        }
    };
    Bundle extras = getArguments();
    if (extras != null) {
        mRoomId = extras.getLong("RoomId");
        if (mustCheckPermission())
            currentRoomAccess = DbManager.getInstance().doRealmTask(realm -> {
                return realm.where(RealmRoomAccess.class).equalTo("id", mRoomId + "_" + AccountManager.getInstance().getCurrentUser().getId()).findFirst();
            });
    }
    notifyFrameLayout.setListener(this::onScreenSizeChanged);
    rootView = (FrameLayout) inflater.inflate(R.layout.fragment_chat, container, false);
    chatContainer = rootView.findViewById(R.id.chatMainContainer);
    mediaContainer = new FragmentMediaContainer(getActivity(), this);
    mediaContainer.setListener(i -> {
        switch(i) {
            case FragmentMediaContainer.CALL_TAG:
                getActivity().startActivity(new Intent(getContext(), CallActivity.class));
                break;
            case FragmentMediaContainer.MEDIA_TAG:
                if (!MusicPlayer.isVoice) {
                    Intent intent = new Intent(context, ActivityMain.class);
                    intent.putExtra(ActivityMain.openMediaPlayer, true);
                    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                    getActivity().startActivity(intent);
                }
                break;
            case FragmentMediaContainer.PLAY_TAG:
                break;
        }
    });
    // mediaContainer.setVisibility(View.GONE);
    chatContainer.addView(mediaContainer, LayoutCreator.createLinear(LayoutCreator.MATCH_PARENT, 39, Gravity.TOP | Gravity.LEFT, 0, 59, 0, 0));
    mToolbar = new Toolbar(context);
    searchFieldItem = mToolbar.addItem(searchFieldTag, R.string.icon_search, Theme.getInstance().getTitleTextColor(getContext())).setIsSearchBox(true).setActionBarMenuItemSearchListener(new ToolbarItem.ActionBarMenuItemSearchListener() {

        int textLength;

        @Override
        public void onSearchExpand() {
            if (layoutMute != null) {
                layoutMute.setVisibility(View.GONE);
            }
            if (viewAttachFile != null) {
                viewAttachFile.setVisibility(View.GONE);
            }
            if (rootView.findViewById(R.id.ac_ll_join).getVisibility() == View.VISIBLE) {
                rootView.findViewById(R.id.ac_ll_join).setVisibility(View.GONE);
            }
            if (pinedMessageLayout != null) {
                changePinnedMessageVisibility(true, false, MusicPlayer.isMusicPlyerEnable, CallManager.getInstance().isCallAlive());
            }
            if (vgSpamUser != null) {
                vgSpamUser.setVisibility(View.GONE);
            }
            isSearchVisible = true;
        }

        @Override
        public void onTextChanged(EditText editText) {
            String text = editText.getText().toString();
            if (text.length() > 0 && !text.startsWith("#")) {
                if (!initHash) {
                    initHash = true;
                    initHashView();
                }
                searchHash.setHashString(editText.getText().toString());
                searchHash.setPosition("");
                if (searchFragment != null) {
                    searchFragment.onSearchCollapsed();
                }
                if (ll_navigateHash != null) {
                    ll_navigateHash.setVisibility(View.VISIBLE);
                }
                if (viewAttachFile != null) {
                    viewAttachFile.setVisibility(View.GONE);
                }
            } else if (text.startsWith("#") && text.length() < 2) {
                if (text.length() > textLength) {
                    searchFragment = SearchFragment.newInstance(mRoomId, text, true);
                    getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.chatContainer, searchFragment).commit();
                }
                if (keyboardContainer != null) {
                    keyboardContainer.setVisibility(View.GONE);
                }
                if (ll_navigateHash != null) {
                    ll_navigateHash.setVisibility(View.GONE);
                }
                if (txtFloatingTime != null) {
                    txtFloatingTime.setVisibility(View.GONE);
                }
            } else if (text.startsWith("#") && text.length() > 1) {
                if (searchFragment != null && searchFragment.isAdded()) {
                    searchFragment.onTextChanged(editText.getText().toString());
                }
            } else {
                hideKeyboardView();
                if (ll_navigateHash != null) {
                    ll_navigateHash.setVisibility(View.GONE);
                }
                if (searchFragment != null && searchFragment.isAdded()) {
                    searchFragment.onSearchCollapsed();
                }
            }
            textLength = editText.getText().length();
        }

        @Override
        public void onSearchCollapse() {
            if (muteIcon != null) {
                muteIcon.setVisibility(getRoom().getMute() ? View.VISIBLE : View.GONE);
            }
            if (verifiedIcon != null) {
                RealmChannelRoom channelRoom = getRoom().getChannelRoom();
                boolean isVerified = false;
                if (channelRoom != null) {
                    isVerified = channelRoom.isVerified();
                }
                verifiedIcon.setVisibility(isVerified ? View.VISIBLE : View.GONE);
            }
            if (avatarItem != null) {
                avatarItem.setVisibility(View.VISIBLE);
            }
            if (pinedMessageLayout != null) {
                if (isPinAvailable) {
                    changePinnedMessageVisibility(true, true, MusicPlayer.isMusicPlyerEnable, CallManager.getInstance().isCallAlive());
                }
            }
            if (isNotJoin) {
                rootView.findViewById(R.id.ac_ll_join).setVisibility(View.VISIBLE);
            }
            if (searchFragment != null) {
                searchFragment.onSearchCollapsed();
            }
            if (vgSpamUser != null) {
                showSpamBar();
            }
            goneSearchHashFooter();
            hideKeyboardView();
            searchFieldItem.setVisibility(View.GONE);
            isSearchVisible = false;
        }
    });
    searchFieldItem.setVisibility(View.GONE);
    mToolbar.setOnClickListener(view -> {
        hideKeyboard();
        goToProfile();
    });
    mToolbar.setListener(i -> {
        switch(i) {
            case -1:
                if (mToolbar.isActionModeShowed()) {
                    mAdapter.deselect();
                    return;
                }
                if (webViewChatPage != null) {
                    closeWebViewForSpecialUrlChat(false);
                    return;
                }
                hideKeyboard();
                if (chatType == CHANNEL && !floatingHidden) {
                    if (channelRole == ChannelChatRole.OWNER && !isRecording) {
                        hideFloatingButton(true);
                        micAndAddStoryAnimateVisible(false);
                    }
                    return;
                }
                if (currentRoomAccess != null) {
                    if (currentRoomAccess != null) {
                        if (!currentRoomAccess.getRealmPostMessageRights().isCanSendText()) {
                            G.runOnUiThread(() -> {
                                viewAttachFile.setVisibility(View.GONE);
                            });
                        }
                    }
                }
                if (G.twoPaneMode) {
                    if (getActivity() instanceof ActivityMain) {
                        ((ActivityMain) getActivity()).goToTabletEmptyPage();
                    }
                } else {
                    if (!mToolbar.isSearchFieldVisible()) {
                        popBackStackFragment();
                    }
                }
                break;
            case searchItem:
                initLayoutSearchNavigation();
                if (!initHash) {
                    initHash = true;
                    initHashView();
                }
                openSearchBox(null);
                showPopup(KeyboardView.MODE_KEYBOARD);
                G.handler.postDelayed(() -> editTextRequestFocus(searchEditText), 300);
                break;
            case voiceCallTag:
                if (CallManager.getInstance().getCallPeerId() == chatPeerId) {
                    Intent activityIntent = new Intent(getActivity(), CallActivity.class);
                    activityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                    startActivity(activityIntent);
                } else if (!CallManager.getInstance().isCallAlive()) {
                    CallSelectFragment selectFragment = CallSelectFragment.getInstance(chatPeerId, false, null);
                    if (getFragmentManager() != null)
                        selectFragment.show(getFragmentManager(), null);
                    if (keyboardViewVisible) {
                        hideKeyboard();
                    }
                } else {
                    Toast.makeText(getContext(), "NOT ALLOWED", Toast.LENGTH_SHORT).show();
                }
                break;
            case moreTag:
                createMoreItems();
                break;
            case clearHistoryItem:
                new MaterialDialog.Builder(G.fragmentActivity).title(R.string.clear_history).content(R.string.clear_history_content).positiveText(R.string.yes).onPositive((dialog, which) -> clearHistory(mRoomId)).negativeText(R.string.no).show();
                break;
            case deleteItem:
                new MaterialDialog.Builder(G.fragmentActivity).title(R.string.delete_chat).content(R.string.delete_chat_content).positiveText(R.string.yes).onPositive((dialog, which) -> deleteChat(mRoomId)).negativeText(R.string.no).show();
                break;
            case muteItem:
            case unMuteItem:
                muteNotification(mRoomId);
                break;
            case chatToGroupItem:
                new MaterialDialog.Builder(G.fragmentActivity).title(R.string.convert_chat_to_group_title).content(R.string.convert_chat_to_group_content).positiveText(R.string.yes).negativeText(R.string.no).onPositive((dialog, which) -> {
                    // finish();
                    finishChat();
                    dialog.dismiss();
                    G.handler.post(() -> G.onConvertToGroup.openFragmentOnActivity("ConvertToGroup", mRoomId));
                }).show();
                break;
            case cleanUpItem:
                resetMessagingValue();
                setDownBtnGone();
                setCountNewMessageZero();
                DbManager.getInstance().doRealmTask(realm -> {
                    RealmRoomMessage.ClearAllMessageRoomAsync(realm, mRoomId, () -> {
                        recyclerView.addOnScrollListener(scrollListener);
                        saveMessageIdPositionState(0, 0);
                        /**
                         * get history from server
                         */
                        topMore = true;
                        getOnlineMessage(0, 0, UP);
                    });
                });
                break;
            case reportItem:
                dialogReport(false, 0, 0);
                break;
            case sendMoneyItem:
                showPaymentDialog();
                break;
            case exportChatItem:
                if (HelperPermission.grantedUseStorage()) {
                    exportChat();
                } else {
                    try {
                        HelperPermission.getStoragePermission(G.fragmentActivity, new OnGetPermission() {

                            @Override
                            public void Allow() {
                                exportChat();
                            }

                            @Override
                            public void deny() {
                                Toast.makeText(G.currentActivity, R.string.export_message, Toast.LENGTH_SHORT).show();
                            }
                        });
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
                break;
            case stopItem:
                new MaterialDialog.Builder(G.fragmentActivity).title(R.string.stop).content(R.string.stop_message_bot).positiveText(R.string.yes).onPositive((dialog, which) -> {
                    // onSelectRoomMenu("txtClearHistory", mRoomId);
                    closeWebViewForSpecialUrlChat(true);
                // popBackStackFragment();
                }).negativeText(R.string.no).show();
                break;
            case copyMessageTag:
                copySelectedItemTextToClipboard();
                break;
            case forwardMessageTag:
                // forward selected messages to room list for selecting room
                if (mAdapter != null && mAdapter.getSelectedItems().size() > 0) {
                    onForwardClick(null);
                }
                break;
            case replyMessageTag:
                if (mAdapter != null && !mAdapter.getSelectedItems().isEmpty() && mAdapter.getSelectedItems().size() == 1) {
                    reply(mAdapter.getSelectedItems().iterator().next().messageObject, false);
                }
                break;
            case deleteMessageTag:
                messageIds = new ArrayList<>();
                documentIds = new ArrayList<>();
                bothDeleteMessageId = new ArrayList<>();
                G.handler.post(() -> {
                    for (final AbstractMessage item : mAdapter.getSelectedItems()) {
                        if (mAdapter.getSelectedItems().size() == 1) {
                            confirmAndDeleteMessage(item.messageObject, true);
                            return;
                        }
                        try {
                            if (item != null && item.messageObject != null) {
                                Long messageId = item.messageObject.id;
                                Long documentId = item.messageObject.documentId;
                                messageIds.add(messageId);
                                documentIds.add(documentId);
                                boolean bothDelete = RealmRoomMessage.isBothDelete(item.messageObject.getUpdateOrCreateTime());
                                if (bothDelete)
                                    bothDeleteMessageId.add(messageId);
                            }
                        } catch (NullPointerException e) {
                            e.printStackTrace();
                        }
                    }
                    if (chatType == CHAT && !isCloudRoom && bothDeleteMessageId.size() > 0 && mAdapter.getSelectedItems().iterator().next().messageObject.userId == AccountManager.getInstance().getCurrentUser().getId()) {
                        String delete;
                        String textCheckBox = getContext().getResources().getString(R.string.st_checkbox_delete) + " " + title;
                        delete = getContext().getResources().getString(R.string.st_desc_deletes);
                        new MaterialDialog.Builder(getContext()).content(delete).title(R.string.message).positiveText(R.string.ok).negativeText(R.string.cancel).onPositive((dialog, which) -> {
                            if (!dialog.isPromptCheckBoxChecked()) {
                                bothDeleteMessageId = null;
                            }
                            getMessageController().deleteSelectedMessage(chatType.getNumber(), mRoomId, messageIds, documentIds, bothDeleteMessageId);
                        // deleteSelectedMessageFromAdapter(messageIds);
                        }).checkBoxPrompt(textCheckBox, false, null).show();
                    } else {
                        new MaterialDialog.Builder(getActivity()).title(R.string.message).content(getActivity().getResources().getString(R.string.st_desc_deletes)).positiveText(R.string.ok).negativeText(R.string.cancel).onPositive((dialog, which) -> {
                            bothDeleteMessageId = null;
                            getMessageController().deleteSelectedMessage(chatType.getNumber(), mRoomId, messageIds, documentIds, bothDeleteMessageId);
                        // deleteSelectedMessageFromAdapter(messageIds);
                        }).show();
                    }
                });
                break;
        }
    });
    searchEditText = searchFieldItem.getSearchEditText();
    mToolbar.setBackIcon(new BackDrawable(false));
    verifiedIcon = mToolbar.addVerifiedChannelsIcon();
    muteIcon = mToolbar.addMuteIcon();
    ToolbarItems toolbarItems = mToolbar.createToolbarItems();
    toolbarItems.setBackground(null);
    moreItem = toolbarItems.addItemWithWidth(moreTag, R.string.icon_other_vertical_dots, 48);
    callItem = toolbarItems.addItemWithWidth(voiceCallTag, R.string.icon_voice_call, 48);
    createActionMode();
    rootView.addView(mToolbar, LayoutCreator.createFrame(LayoutCreator.MATCH_PARENT, 60, Gravity.TOP));
    notifyFrameLayout.addView(rootView, LayoutCreator.createFrame(LayoutCreator.MATCH_PARENT, LayoutCreator.MATCH_PARENT));
    keyboardContainer = rootView.findViewById(R.id.fl_chat_keyboardContainer);
    sendMoney = rootView.findViewById(R.id.btn_chatRoom_wallet);
    /**
     * init chat box edit text and send item because we need change this color in dark mode!
     */
    edtChat = rootView.findViewById(R.id.et_chatRoom_writeMessage);
    edtChat.setGravity(Gravity.CENTER_VERTICAL);
    edtChat.setListener(this::chatMotionEvent);
    imvSendButton = rootView.findViewById(R.id.btn_chatRoom_send);
    editTextProgress = rootView.findViewById(R.id.editTextProgress);
    chatRoom_send_container = rootView.findViewById(R.id.chatRoom_send_container);
    getEventManager().addObserver(EventManager.CALL_STATE_CHANGED, this);
    getEventManager().addObserver(EventManager.EMOJI_LOADED, this);
    getEventManager().addObserver(EventManager.ON_MESSAGE_DELETE, this);
    getEventManager().addObserver(EventManager.ON_EDIT_MESSAGE, this);
    getEventManager().addObserver(EventManager.ON_PINNED_MESSAGE, this);
    getEventManager().addObserver(EventManager.CHAT_CLEAR_MESSAGE, this);
    getEventManager().addObserver(EventManager.CHANNEL_ADD_VOTE, this);
    getEventManager().addObserver(EventManager.CHANNEL_GET_VOTE, this);
    getEventManager().addObserver(EventManager.CHANNEL_UPDATE_VOTE, this);
    getEventManager().addObserver(EventManager.CHANNEL_UPDATE_VOTE, this);
    getEventManager().addObserver(EventManager.CHAT_UPDATE_STATUS, this);
    getEventManager().addObserver(EventManager.MEDIA_PLAYER_STATE_CHANGED, this);
    getEventManager().addObserver(EventManager.NEXT_VOICE, this);
    getEventManager().addObserver(EventManager.ON_FILE_PICKED_FROM_INTENT, this);
    if (twoPaneMode)
        EventManager.getInstance(AccountManager.selectedAccount).addObserver(EventManager.CHAT_BACKGROUND_CHANGED, this);
    return attachToSwipeBack(notifyFrameLayout);
}
Also used : ThumbnailUtils(android.media.ThumbnailUtils) Bundle(android.os.Bundle) HelperNotification(net.iGap.helper.HelperNotification) StructBottomSheetForward(net.iGap.module.structs.StructBottomSheetForward) ProgressBar(android.widget.ProgressBar) NonNull(androidx.annotation.NonNull) FileLog(net.iGap.helper.FileLog) UploadObject(net.iGap.module.upload.UploadObject) IMAGE_VALUE(net.iGap.proto.ProtoGlobal.RoomMessageType.IMAGE_VALUE) ToolbarItem(net.iGap.messenger.ui.toolBar.ToolbarItem) AppCompatCheckBox(androidx.appcompat.widget.AppCompatCheckBox) NewChatItemHolder(net.iGap.adapter.items.chat.NewChatItemHolder) GroupChatRole(net.iGap.module.enums.GroupChatRole) HelperSetAction(net.iGap.helper.HelperSetAction) OnBotClick(net.iGap.observers.interfaces.OnBotClick) Handler(android.os.Handler) MediaStore(android.provider.MediaStore) Map(java.util.Map) OnChatSendMessageResponse(net.iGap.observers.interfaces.OnChatSendMessageResponse) ClipboardManager(android.content.ClipboardManager) CallActivity(net.iGap.activities.CallActivity) HelperError(net.iGap.helper.HelperError) DOWN(net.iGap.proto.ProtoClientGetRoomHistory.ClientGetRoomHistory.Direction.DOWN) GIF_TEXT(net.iGap.proto.ProtoGlobal.RoomMessageType.GIF_TEXT) RequestClientSubscribeToRoom(net.iGap.request.RequestClientSubscribeToRoom) ContextCompat(androidx.core.content.ContextCompat) HelperFragment(net.iGap.helper.HelperFragment) Log(android.util.Log) R.id.ac_ll_parent(net.iGap.R.id.ac_ll_parent) Realm(io.realm.Realm) HelperCalander(net.iGap.helper.HelperCalander) NumberTextView(net.iGap.messenger.ui.toolBar.NumberTextView) RealmObjectChangeListener(io.realm.RealmObjectChangeListener) RealmRoom(net.iGap.realm.RealmRoom) CHAT(net.iGap.proto.ProtoGlobal.Room.Type.CHAT) VIDEO(net.iGap.proto.ProtoGlobal.RoomMessageType.VIDEO) CHANNEL(net.iGap.proto.ProtoGlobal.Room.Type.CHANNEL) SoundPool(android.media.SoundPool) CountDownLatch(java.util.concurrent.CountDownLatch) RequestChatUpdateDraft(net.iGap.request.RequestChatUpdateDraft) OnHelperSetAction(net.iGap.observers.interfaces.OnHelperSetAction) AttachFile.getFilePathFromUri(net.iGap.module.AttachFile.getFilePathFromUri) CLIPBOARD_SERVICE(android.content.Context.CLIPBOARD_SERVICE) RequestChatGetRoom(net.iGap.request.RequestChatGetRoom) RealmCallConfig(net.iGap.realm.RealmCallConfig) SuggestedStickerAdapter(net.iGap.fragments.emoji.SuggestedStickerAdapter) ActivityMain(net.iGap.activities.ActivityMain) BottomSheetBehavior(com.google.android.material.bottomsheet.BottomSheetBehavior) HelperUrl(net.iGap.helper.HelperUrl) AccountManager(net.iGap.module.accountManager.AccountManager) ChatAttachmentPopup(net.iGap.module.dialog.ChatAttachmentPopup) RealmContacts(net.iGap.realm.RealmContacts) ParamWithInitBitmap(net.iGap.helper.avatar.ParamWithInitBitmap) Calendar(java.util.Calendar) WebSettings(android.webkit.WebSettings) ItemTouchHelper(androidx.recyclerview.widget.ItemTouchHelper) Toast(android.widget.Toast) ImageLoadingServiceInjector(net.iGap.module.imageLoaderService.ImageLoadingServiceInjector) IMAGE_TEXT(net.iGap.proto.ProtoGlobal.RoomMessageType.IMAGE_TEXT) AudioItem(net.iGap.adapter.items.chat.AudioItem) RealmRoomAccess(net.iGap.realm.RealmRoomAccess) MessageObject(net.iGap.structs.MessageObject) VideoWithTextItem(net.iGap.adapter.items.chat.VideoWithTextItem) G.twoPaneMode(net.iGap.G.twoPaneMode) AppCompatDelegate(androidx.appcompat.app.AppCompatDelegate) AttachFile.request_code_VIDEO_CAPTURED(net.iGap.module.AttachFile.request_code_VIDEO_CAPTURED) IOException(java.io.IOException) FragmentMediaContainer(net.iGap.messenger.ui.components.FragmentMediaContainer) IResendMessage(net.iGap.observers.interfaces.IResendMessage) EventEditText(net.iGap.module.customView.EventEditText) SharedPreferences(android.content.SharedPreferences) AUDIO_VALUE(net.iGap.proto.ProtoGlobal.RoomMessageType.AUDIO_VALUE) HelperMimeType(net.iGap.helper.HelperMimeType) RoomObject(net.iGap.helper.RoomObject) NotifyFrameLayout(net.iGap.libs.emojiKeyboard.NotifyFrameLayout) EditText(android.widget.EditText) FileListerDialog(net.iGap.module.FileListerDialog.FileListerDialog) RequestUserContactsBlock(net.iGap.request.RequestUserContactsBlock) ISendPosition(net.iGap.observers.interfaces.ISendPosition) BottomSheetDialog(com.google.android.material.bottomsheet.BottomSheetDialog) JsonObject(com.google.gson.JsonObject) LinearLayout(android.widget.LinearLayout) RequestClientUnsubscribeFromRoom(net.iGap.request.RequestClientUnsubscribeFromRoom) AppUtils(net.iGap.module.AppUtils) PackageManager(android.content.pm.PackageManager) WindowManager(android.view.WindowManager) StickerDialogFragment(net.iGap.fragments.emoji.add.StickerDialogFragment) Animator(android.animation.Animator) Theme(net.iGap.module.Theme) GIF_VALUE(net.iGap.proto.ProtoGlobal.RoomMessageType.GIF_VALUE) G(net.iGap.G) StatusTextFragment(net.iGap.story.StatusTextFragment) AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) RequestClientGetRoomHistory(net.iGap.request.RequestClientGetRoomHistory) IntentRequests(net.iGap.module.IntentRequests) RealmUserInfo(net.iGap.realm.RealmUserInfo) ACTION_STATE_SWIPE(androidx.recyclerview.widget.ItemTouchHelper.ACTION_STATE_SWIPE) ContentResolver(android.content.ContentResolver) UnreadMessage(net.iGap.adapter.items.chat.UnreadMessage) HelperPermission(net.iGap.helper.HelperPermission) IMessageItem(net.iGap.observers.interfaces.IMessageItem) Gson(com.google.gson.Gson) KeyboardView(net.iGap.libs.emojiKeyboard.KeyboardView) RecyclerView(androidx.recyclerview.widget.RecyclerView) RealmString(net.iGap.realm.RealmString) HelperImageBackColor(net.iGap.helper.HelperImageBackColor) VIDEO_VALUE(net.iGap.proto.ProtoGlobal.RoomMessageType.VIDEO_VALUE) ParamWithAvatarType(net.iGap.helper.avatar.ParamWithAvatarType) UP(net.iGap.proto.ProtoClientGetRoomHistory.ClientGetRoomHistory.Direction.UP) ProgressWaiting(net.iGap.adapter.items.chat.ProgressWaiting) VIDEO_TEXT(net.iGap.proto.ProtoGlobal.RoomMessageType.VIDEO_TEXT) MessageController(net.iGap.controllers.MessageController) Status(net.iGap.module.downloader.Status) ProtoChannelGetMessagesStats(net.iGap.proto.ProtoChannelGetMessagesStats) ItemBottomSheetForward(net.iGap.adapter.items.ItemBottomSheetForward) DisplayMetrics(android.util.DisplayMetrics) GIF_TEXT_VALUE(net.iGap.proto.ProtoGlobal.RoomMessageType.GIF_TEXT_VALUE) STORY_REPLY_VALUE(net.iGap.proto.ProtoGlobal.RoomMessageType.STORY_REPLY_VALUE) OnClientGetRoomMessage(net.iGap.observers.interfaces.OnClientGetRoomMessage) Disposable(io.reactivex.disposables.Disposable) RealmRegisteredInfo(net.iGap.realm.RealmRegisteredInfo) MusicPlayer(net.iGap.module.MusicPlayer) OnGetPermission(net.iGap.observers.interfaces.OnGetPermission) StickerRepository(net.iGap.repository.StickerRepository) ActivityTrimVideo(net.iGap.activities.ActivityTrimVideo) LocationManager(android.location.LocationManager) EditorInfo(android.view.inputmethod.EditorInfo) IOnBackPressed(net.iGap.observers.interfaces.IOnBackPressed) RealmRoomMessageLocation(net.iGap.realm.RealmRoomMessageLocation) AppCompatTextView(androidx.appcompat.widget.AppCompatTextView) ActivityManager(android.app.ActivityManager) GridLayoutManager(androidx.recyclerview.widget.GridLayoutManager) CallManager(net.iGap.viewmodel.controllers.CallManager) HelperGetMessageState(net.iGap.helper.HelperGetMessageState) OnVoiceRecord(net.iGap.observers.interfaces.OnVoiceRecord) RealmList(io.realm.RealmList) RequestClientGetFavoriteMenu(net.iGap.request.RequestClientGetFavoriteMenu) RealmRoomMessage.makeUnreadMessage(net.iGap.realm.RealmRoomMessage.makeUnreadMessage) TimeUtils(net.iGap.module.TimeUtils) AudioManager(android.media.AudioManager) InputMethodManager(android.view.inputmethod.InputMethodManager) FragmentActivity(androidx.fragment.app.FragmentActivity) AnimationUtils(android.view.animation.AnimationUtils) HelperCalander.convertToUnicodeFarsiNumber(net.iGap.helper.HelperCalander.convertToUnicodeFarsiNumber) RequestUserContactsUnblock(net.iGap.request.RequestUserContactsUnblock) MODE_PRIVATE(android.content.Context.MODE_PRIVATE) Build(android.os.Build) RequestUserInfo(net.iGap.request.RequestUserInfo) EmojiView(net.iGap.libs.emojiKeyboard.EmojiView) RequestChannelUpdateDraft(net.iGap.request.RequestChannelUpdateDraft) RealmAdditional(net.iGap.realm.RealmAdditional) JsonSyntaxException(com.google.gson.JsonSyntaxException) LayoutInflater(android.view.LayoutInflater) BadgeView(net.iGap.adapter.items.chat.BadgeView) RealmResults(io.realm.RealmResults) DialogAction(com.afollestad.materialdialogs.DialogAction) MaterialDesignTextView(net.iGap.module.MaterialDesignTextView) IDispatchTochEvent(net.iGap.observers.interfaces.IDispatchTochEvent) Color(android.graphics.Color) CountDownTimer(android.os.CountDownTimer) FileItem(net.iGap.adapter.items.chat.FileItem) StructMessageOption(net.iGap.module.structs.StructMessageOption) Bitmap(android.graphics.Bitmap) HelperSaveFile(net.iGap.helper.HelperSaveFile) STICKER_VALUE(net.iGap.proto.ProtoGlobal.RoomMessageType.STICKER_VALUE) ViewTreeObserver(android.view.ViewTreeObserver) VIDEO_TEXT_VALUE(net.iGap.proto.ProtoGlobal.RoomMessageType.VIDEO_TEXT_VALUE) VOICE_VALUE(net.iGap.proto.ProtoGlobal.RoomMessageType.VOICE_VALUE) R(net.iGap.R) OnConnectionChangeStateChat(net.iGap.observers.interfaces.OnConnectionChangeStateChat) ProtoClientGetRoomHistory(net.iGap.proto.ProtoClientGetRoomHistory) StickerItem(net.iGap.adapter.items.chat.StickerItem) SHOW(net.iGap.module.enums.ProgressState.SHOW) Vibrator(android.os.Vibrator) Activity(android.app.Activity) FastItemAdapter(com.mikepenz.fastadapter.commons.adapters.FastItemAdapter) Arrays(java.util.Arrays) MyLinearLayoutManager(net.iGap.module.MyLinearLayoutManager) RequestClientJoinByUsername(net.iGap.request.RequestClientJoinByUsername) VoiceRecord(net.iGap.module.VoiceRecord) ProtoFileDownload(net.iGap.proto.ProtoFileDownload) Uri(android.net.Uri) FrameLayout(android.widget.FrameLayout) ImageView(android.widget.ImageView) LastSeenTimeUtil(net.iGap.module.LastSeenTimeUtil) Drawable(android.graphics.drawable.Drawable) Manifest(android.Manifest) ProtoClientRoomReport(net.iGap.proto.ProtoClientRoomReport) AdditionalType(net.iGap.module.additionalData.AdditionalType) HelperPermission.showDeniedPermissionMessage(net.iGap.helper.HelperPermission.showDeniedPermissionMessage) Looper(android.os.Looper) DialogAnimation(net.iGap.module.DialogAnimation) Fragment(androidx.fragment.app.Fragment) OnSetAction(net.iGap.observers.interfaces.OnSetAction) Canvas(android.graphics.Canvas) ProgressState(net.iGap.module.enums.ProgressState) RealmConstants(net.iGap.realm.RealmConstants) CardView(androidx.cardview.widget.CardView) OnDeleteChatFinishActivity(net.iGap.observers.interfaces.OnDeleteChatFinishActivity) HelperTracker(net.iGap.helper.HelperTracker) RequestGroupUpdateDraft(net.iGap.request.RequestGroupUpdateDraft) OnLastSeenUpdateTiming(net.iGap.observers.interfaces.OnLastSeenUpdateTiming) OnComplete(net.iGap.observers.interfaces.OnComplete) RealmRoomDraft(net.iGap.realm.RealmRoomDraft) WALLET_VALUE(net.iGap.proto.ProtoGlobal.RoomMessageType.WALLET_VALUE) Set(java.util.Set) ChatSendMessageUtil(net.iGap.module.ChatSendMessageUtil) ChatMoreItem(net.iGap.model.ChatMoreItem) BotInit(net.iGap.module.BotInit) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) RealmGroupRoom(net.iGap.realm.RealmGroupRoom) Uploader(net.iGap.module.upload.Uploader) StringRes(androidx.annotation.StringRes) JsonArray(com.google.gson.JsonArray) FontIconTextView(net.iGap.module.FontIconTextView) Nullable(androidx.annotation.Nullable) BackDrawable(net.iGap.messenger.ui.toolBar.BackDrawable) HIDE(net.iGap.module.enums.ProgressState.HIDE) Tuple(net.iGap.libs.Tuple) OnGroupAvatarResponse(net.iGap.observers.interfaces.OnGroupAvatarResponse) SHP_SETTING(net.iGap.module.SHP_SETTING) Sort(io.realm.Sort) MyWebViewClient(net.iGap.libs.MyWebViewClient) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) VoiceItem(net.iGap.adapter.items.chat.VoiceItem) InputFilter(android.text.InputFilter) EventManager(net.iGap.observers.eventbus.EventManager) DownloadObject(net.iGap.module.downloader.DownloadObject) TextWatcher(android.text.TextWatcher) OnMessageReceive(net.iGap.observers.interfaces.OnMessageReceive) EmojiManager(net.iGap.libs.emojiKeyboard.emoji.EmojiManager) Config(net.iGap.Config) AttachmentObject(net.iGap.structs.AttachmentObject) StoryViewFragment(net.iGap.story.viewPager.StoryViewFragment) AttachFile.request_code_pic_audi(net.iGap.module.AttachFile.request_code_pic_audi) ImageSpan(android.text.style.ImageSpan) Environment(android.os.Environment) RequestClientGetRoomMessage(net.iGap.request.RequestClientGetRoomMessage) OnChatMessageRemove(net.iGap.observers.interfaces.OnChatMessageRemove) Editable(android.text.Editable) LOCATION_SERVICE(android.content.Context.LOCATION_SERVICE) ArrayList(java.util.ArrayList) VibrationEffect(android.os.VibrationEffect) LOCATION_VALUE(net.iGap.proto.ProtoGlobal.RoomMessageType.LOCATION_VALUE) RealmChannelExtra(net.iGap.realm.RealmChannelExtra) ConnectionState(net.iGap.module.enums.ConnectionState) HelperGetAction(net.iGap.helper.HelperGetAction) LayoutCreator(net.iGap.helper.LayoutCreator) IMAGE_TEXT_VALUE(net.iGap.proto.ProtoGlobal.RoomMessageType.IMAGE_TEXT_VALUE) WebChromeClient(android.webkit.WebChromeClient) Toolbar(net.iGap.messenger.ui.toolBar.Toolbar) LogWallet(net.iGap.adapter.items.chat.LogWallet) AvatarHandler(net.iGap.helper.avatar.AvatarHandler) RESULT_CANCELED(android.app.Activity.RESULT_CANCELED) StructWebView(net.iGap.module.structs.StructWebView) StickerSettingFragment(net.iGap.fragments.emoji.remove.StickerSettingFragment) AnimatedStickerItem(net.iGap.adapter.items.chat.AnimatedStickerItem) OnChatEditMessageResponse(net.iGap.observers.interfaces.OnChatEditMessageResponse) File(java.io.File) IItemAdapter(com.mikepenz.fastadapter.IItemAdapter) Gravity(android.view.Gravity) StructIGSticker(net.iGap.fragments.emoji.struct.StructIGSticker) Configuration(android.content.res.Configuration) LocationListener(net.iGap.observers.interfaces.LocationListener) LocationItem(net.iGap.adapter.items.chat.LocationItem) DbManager(net.iGap.module.accountManager.DbManager) CardToCardItem(net.iGap.adapter.items.chat.CardToCardItem) ValueAnimator(android.animation.ValueAnimator) FILE_TEXT_VALUE(net.iGap.proto.ProtoGlobal.RoomMessageType.FILE_TEXT_VALUE) ImageHelper(net.iGap.helper.ImageHelper) AttachFile.request_code_pic_file(net.iGap.module.AttachFile.request_code_pic_file) IMAGE(net.iGap.proto.ProtoGlobal.RoomMessageType.IMAGE) RealmRoomMessage.makeSeenAllMessageOfRoom(net.iGap.realm.RealmRoomMessage.makeSeenAllMessageOfRoom) AppCompatImageView(androidx.appcompat.widget.AppCompatImageView) ResendMessage(net.iGap.module.ResendMessage) AttachFile(net.iGap.module.AttachFile) LOG_VALUE(net.iGap.proto.ProtoGlobal.RoomMessageType.LOG_VALUE) LogWalletCardToCard(net.iGap.adapter.items.chat.LogWalletCardToCard) OnGetFavoriteMenu(net.iGap.observers.interfaces.OnGetFavoriteMenu) RealmChannelRoom(net.iGap.realm.RealmChannelRoom) AUDIO_TEXT_VALUE(net.iGap.proto.ProtoGlobal.RoomMessageType.AUDIO_TEXT_VALUE) ContactItem(net.iGap.adapter.items.chat.ContactItem) LISTENED_VALUE(net.iGap.proto.ProtoGlobal.RoomMessageStatus.LISTENED_VALUE) BottomSheetFragment(net.iGap.module.dialog.bottomsheet.BottomSheetFragment) View(android.view.View) Animation(android.view.animation.Animation) WebView(android.webkit.WebView) OnChatMessageSelectionChanged(net.iGap.observers.interfaces.OnChatMessageSelectionChanged) RealmRoomMessageContact(net.iGap.realm.RealmRoomMessageContact) StoryPagerFragment(net.iGap.story.StoryPagerFragment) ContactUtils(net.iGap.module.ContactUtils) ParentChatMoneyTransferFragment(net.iGap.fragments.chatMoneyTransfer.ParentChatMoneyTransferFragment) MessagesAdapter(net.iGap.adapter.MessagesAdapter) FILE_VALUE(net.iGap.proto.ProtoGlobal.RoomMessageType.FILE_VALUE) AdapterDrBot(net.iGap.adapter.AdapterDrBot) OnUpdateUserOrRoomInfo(net.iGap.observers.interfaces.OnUpdateUserOrRoomInfo) RequestClientRoomReport(net.iGap.request.RequestClientRoomReport) HelperGetDataFromOtherApp(net.iGap.helper.HelperGetDataFromOtherApp) ObjectAnimator(android.animation.ObjectAnimator) PassCode(net.iGap.model.PassCode) StructMessageInfo(net.iGap.module.structs.StructMessageInfo) InputType(android.text.InputType) StructIGStickerGroup(net.iGap.fragments.emoji.struct.StructIGStickerGroup) ViewStubCompat(androidx.appcompat.widget.ViewStubCompat) Additional(net.iGap.module.enums.Additional) TEXT_VALUE(net.iGap.proto.ProtoGlobal.RoomMessageType.TEXT_VALUE) LogWalletTopup(net.iGap.adapter.items.chat.LogWalletTopup) ViewGroup(android.view.ViewGroup) OnForwardBottomSheet(net.iGap.observers.interfaces.OnForwardBottomSheet) OnUserUpdateStatus(net.iGap.observers.interfaces.OnUserUpdateStatus) HelperLog(net.iGap.helper.HelperLog) OnChatSendMessage(net.iGap.observers.interfaces.OnChatSendMessage) List(java.util.List) CompositeDisposable(io.reactivex.disposables.CompositeDisposable) TextView(android.widget.TextView) FragmentSettingAddStickers(net.iGap.fragments.emoji.add.FragmentSettingAddStickers) CONTACT_VALUE(net.iGap.proto.ProtoGlobal.RoomMessageType.CONTACT_VALUE) RequestQueue(net.iGap.request.RequestQueue) RelativeLayout(android.widget.RelativeLayout) TextItem(net.iGap.adapter.items.chat.TextItem) IUpdateLogItem(net.iGap.observers.interfaces.IUpdateLogItem) MaterialDialog(com.afollestad.materialdialogs.MaterialDialog) NotNull(org.jetbrains.annotations.NotNull) OpenBottomSheetItem(net.iGap.observers.interfaces.OpenBottomSheetItem) Context(android.content.Context) AndroidUtils(net.iGap.module.AndroidUtils) SEEN_VALUE(net.iGap.proto.ProtoGlobal.RoomMessageStatus.SEEN_VALUE) KeyEvent(android.view.KeyEvent) ResourcesCompat(androidx.core.content.res.ResourcesCompat) GifWithTextItem(net.iGap.adapter.items.chat.GifWithTextItem) RequestSignalingGetConfiguration(net.iGap.request.RequestSignalingGetConfiguration) OnChatDelete(net.iGap.observers.interfaces.OnChatDelete) Intent(android.content.Intent) HashMap(java.util.HashMap) RealmStickerItem(net.iGap.realm.RealmStickerItem) SUID(net.iGap.module.SUID) ClipData(android.content.ClipData) OnUserInfoResponse(net.iGap.observers.interfaces.OnUserInfoResponse) SuppressLint(android.annotation.SuppressLint) MotionEvent(android.view.MotionEvent) AnimatorSet(android.animation.AnimatorSet) TimeItem(net.iGap.adapter.items.chat.TimeItem) RealmRoomMessage(net.iGap.realm.RealmRoomMessage) Cursor(android.database.Cursor) LogWalletBill(net.iGap.adapter.items.chat.LogWalletBill) ACTIVITY_SERVICE(android.content.Context.ACTIVITY_SERVICE) CONTACT(net.iGap.proto.ProtoGlobal.RoomMessageType.CONTACT) ToolbarItems(net.iGap.messenger.ui.toolBar.ToolbarItems) FileWriter(java.io.FileWriter) ProtoResponse(net.iGap.proto.ProtoResponse) MessageLoader(net.iGap.module.MessageLoader) LogItem(net.iGap.adapter.items.chat.LogItem) HelperString(net.iGap.helper.HelperString) ViewMaker(net.iGap.adapter.items.chat.ViewMaker) StructBottomSheet(net.iGap.module.structs.StructBottomSheet) OnFileSelectedListener(net.iGap.module.FileListerDialog.OnFileSelectedListener) ProtoGlobal(net.iGap.proto.ProtoGlobal) ImageWithTextItem(net.iGap.adapter.items.chat.ImageWithTextItem) ChannelChatRole(net.iGap.module.enums.ChannelChatRole) GROUP(net.iGap.proto.ProtoGlobal.Room.Type.GROUP) Collections(java.util.Collections) MimeTypeMap(android.webkit.MimeTypeMap) AbstractMessage(net.iGap.adapter.items.chat.AbstractMessage) RealmAttachment(net.iGap.realm.RealmAttachment) RealmQuery(io.realm.RealmQuery) BackDrawable(net.iGap.messenger.ui.toolBar.BackDrawable) CallActivity(net.iGap.activities.CallActivity) RealmString(net.iGap.realm.RealmString) HelperString(net.iGap.helper.HelperString) OnGetPermission(net.iGap.observers.interfaces.OnGetPermission) KeyEvent(android.view.KeyEvent) ActivityMain(net.iGap.activities.ActivityMain) Toolbar(net.iGap.messenger.ui.toolBar.Toolbar) EventEditText(net.iGap.module.customView.EventEditText) EditText(android.widget.EditText) AbstractMessage(net.iGap.adapter.items.chat.AbstractMessage) MaterialDialog(com.afollestad.materialdialogs.MaterialDialog) FragmentMediaContainer(net.iGap.messenger.ui.components.FragmentMediaContainer) Bundle(android.os.Bundle) Intent(android.content.Intent) IOException(java.io.IOException) RealmChannelRoom(net.iGap.realm.RealmChannelRoom) ToolbarItems(net.iGap.messenger.ui.toolBar.ToolbarItems) NotifyFrameLayout(net.iGap.libs.emojiKeyboard.NotifyFrameLayout) Nullable(androidx.annotation.Nullable)

Example 20 with Toolbar

use of net.iGap.messenger.ui.toolBar.Toolbar in project iGap-Android by KianIranian-STDG.

the class FragmentCall method onViewCreated.

@Override
public void onViewCreated(@NotNull View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    HelperTracker.sendTracker(HelperTracker.TRACKER_CALL_PAGE);
    if (getContext() != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        StatusBarUtil.setColor(getActivity(), new Theme().getPrimaryDarkColor(getContext()), 50);
    }
    callToolbar = new Toolbar(getContext());
    callToolbar.setTitle(isAppRtl ? R.string.logo_igap_fa : R.string.logo_igap_en);
    ToolbarItems toolbarItems = callToolbar.createToolbarItems();
    toolbarItems.addItemWithWidth(createCallTag, R.string.icon_add, 54);
    toolbarItems.addItemWithWidth(codeScannerTag, R.string.icon_QR_code, 54);
    callToolbar.setListener(i -> {
        switch(i) {
            case -1:
                setViewState(!mIsMultiSelectEnable);
                hideActionMode();
                mSelectedLogList.clear();
                break;
            case createCallTag:
                showContactListForCall();
                break;
            case codeScannerTag:
                onCodeScannerClickListener();
                break;
            case deleteAllTag:
                if (getRequestManager().isUserLogin()) {
                    new MaterialDialog.Builder(getContext()).title(R.string.clean_log).content(R.string.are_you_sure_clear_call_logs).positiveText(R.string.B_ok).onPositive((dialog, which) -> {
                        DbManager.getInstance().doRealmTask(realm -> {
                            // ToDo: add callback to proto request
                            setViewState(false);
                            RealmCallLog realmCallLog = realm.where(RealmCallLog.class).findAll().sort("offerTime", Sort.DESCENDING).first();
                            new RequestSignalingClearLog().signalingClearLog(realmCallLog.getId());
                            view.findViewById(R.id.empty_layout).setVisibility(View.VISIBLE);
                            mSelectedLogList.clear();
                        });
                        hideActionMode();
                    }).negativeText(R.string.B_cancel).show();
                } else {
                    HelperError.showSnackMessage(getString(R.string.there_is_no_connection_to_server), false);
                }
                break;
            case deleteTag:
                if (mSelectedLogList.size() == 0) {
                    Toast.makeText(_mActivity, getString(R.string.no_item_selected), Toast.LENGTH_SHORT).show();
                    return;
                }
                if (getRequestManager().isUserLogin()) {
                    new MaterialDialog.Builder(getActivity()).title(R.string.clean_log).content(R.string.are_you_sure_clear_call_log).positiveText(R.string.B_ok).onPositive((dialog, which) -> {
                        try {
                            List<Long> logIds = new ArrayList<>();
                            for (int j = 0; j < mSelectedLogList.size(); j++) {
                                logIds.add(mSelectedLogList.get(j).getLogId());
                            }
                            new RequestSignalingClearLog().signalingClearLog(logIds);
                            setViewState(false);
                            mSelectedLogList.clear();
                            if (realmResults.size() == 0) {
                                view.findViewById(R.id.empty_layout).setVisibility(View.VISIBLE);
                            }
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                        hideActionMode();
                    }).negativeText(R.string.B_cancel).show();
                } else {
                    HelperError.showSnackMessage(getString(R.string.there_is_no_connection_to_server), false);
                }
                break;
        }
    });
    createToolbarActions();
    mediaContainer = new FragmentMediaContainer(getContext(), this);
    mediaContainer.setListener(i -> {
        switch(i) {
            case FragmentMediaContainer.CALL_TAG:
                getActivity().startActivity(new Intent(getContext(), CallActivity.class));
                break;
            case FragmentMediaContainer.MEDIA_TAG:
                if (!MusicPlayer.isVoice) {
                    Intent intent = new Intent(context, ActivityMain.class);
                    intent.putExtra(ActivityMain.openMediaPlayer, true);
                    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                    getActivity().startActivity(intent);
                }
                break;
            case FragmentMediaContainer.PLAY_TAG:
                break;
        }
    });
    ViewGroup layoutToolbar = view.findViewById(R.id.fc_layout_toolbar);
    layoutToolbar.addView(mediaContainer, LayoutCreator.createFrame(LayoutCreator.MATCH_PARENT, 38, Gravity.BOTTOM, 0, 60, 0, 0));
    layoutToolbar.addView(callToolbar, LayoutCreator.createFrame(LayoutCreator.MATCH_PARENT, 64, Gravity.TOP));
    mBtnAllCalls = view.findViewById(R.id.fc_btn_all_calls);
    mBtnMissedCalls = view.findViewById(R.id.fc_btn_missed_calls);
    mBtnCanceledCalls = view.findViewById(R.id.fc_btn_canceled_calls);
    mBtnIncomingCalls = view.findViewById(R.id.fc_btn_incoming_calls);
    mBtnOutgoingCalls = view.findViewById(R.id.fc_btn_outgoing_calls);
    progressBar = view.findViewById(R.id.fc_progress_bar_waiting);
    emptuListView = view.findViewById(R.id.empty_layout);
    progressBar = view.findViewById(R.id.fc_progress_bar_waiting);
    mRecyclerView = view.findViewById(R.id.fc_recycler_view_call);
    mFiltersLayout = view.findViewById(R.id.fc_layout_filters);
    setEnableButton(mSelectedStatus);
    mRecyclerView = view.findViewById(R.id.fc_recycler_view_call);
    mRecyclerView.setItemAnimator(null);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false));
    if (realmResults == null) {
        realmResults = DbManager.getInstance().doRealmTask(realm -> {
            return getRealmResult(mSelectedStatus, realm);
        });
    }
    realmResults.addChangeListener((realmCallLogs, changeSet) -> {
        checkListIsEmpty();
    });
    checkListIsEmpty();
    mRecyclerView.setAdapter(new CallAdapter(realmResults));
    mOffset = 0;
    getLogListWithOffset();
    mRecyclerView.getAdapter().registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() {

        @Override
        public void onItemRangeInserted(int positionStart, int itemCount) {
            super.onItemRangeInserted(positionStart, itemCount);
            checkListIsEmpty();
        }

        @Override
        public void onItemRangeRemoved(int positionStart, int itemCount) {
            super.onItemRangeRemoved(positionStart, itemCount);
            checkListIsEmpty();
        }
    });
    onScrollListener = new RecyclerView.OnScrollListener() {

        @Override
        public void onScrolled(@NotNull RecyclerView recyclerView, int dx, int dy) {
            super.onScrolled(recyclerView, dx, dy);
            if (isThereAnyMoreItemToLoad) {
                if (!isSendRequestForLoading) {
                    int lastVisiblePosition = ((LinearLayoutManager) recyclerView.getLayoutManager()).findLastVisibleItemPosition();
                    if (lastVisiblePosition + 15 >= mOffset) {
                        getLogListWithOffset();
                    }
                }
            }
        }
    };
    mRecyclerView.addOnScrollListener(onScrollListener);
    G.iSignalingGetCallLog = (size, signalingLogList) -> {
        if (signalingLogList != null) {
            G.handler.post(() -> progressBar.setVisibility(View.GONE));
        }
        if (size == -1) {
            if (attampOnError < 2) {
                isSendRequestForLoading = false;
                attampOnError++;
            } else {
                isThereAnyMoreItemToLoad = false;
                mRecyclerView.removeOnScrollListener(onScrollListener);
            }
        } else if (size == 0) {
            isThereAnyMoreItemToLoad = false;
            mRecyclerView.removeOnScrollListener(onScrollListener);
        } else {
            isSendRequestForLoading = false;
            mOffset += size;
        }
    };
    mBtnAllCalls.setOnClickListener(v -> {
        if (mSelectedStatus != ProtoSignalingGetLog.SignalingGetLog.Filter.ALL) {
            setEnableButton(ProtoSignalingGetLog.SignalingGetLog.Filter.ALL);
            getCallLogsFromRealm(ProtoSignalingGetLog.SignalingGetLog.Filter.ALL);
        }
    });
    mBtnMissedCalls.setOnClickListener(v -> {
        if (mSelectedStatus != ProtoSignalingGetLog.SignalingGetLog.Filter.MISSED) {
            setEnableButton(ProtoSignalingGetLog.SignalingGetLog.Filter.MISSED);
            getCallLogsFromRealm(ProtoSignalingGetLog.SignalingGetLog.Filter.MISSED);
        }
    });
    mBtnOutgoingCalls.setOnClickListener(v -> {
        if (mSelectedStatus != ProtoSignalingGetLog.SignalingGetLog.Filter.OUTGOING) {
            setEnableButton(ProtoSignalingGetLog.SignalingGetLog.Filter.OUTGOING);
            getCallLogsFromRealm(ProtoSignalingGetLog.SignalingGetLog.Filter.OUTGOING);
        }
    });
    mBtnIncomingCalls.setOnClickListener(v -> {
        if (mSelectedStatus != ProtoSignalingGetLog.SignalingGetLog.Filter.INCOMING) {
            setEnableButton(ProtoSignalingGetLog.SignalingGetLog.Filter.INCOMING);
            getCallLogsFromRealm(ProtoSignalingGetLog.SignalingGetLog.Filter.INCOMING);
        }
    });
    mBtnCanceledCalls.setOnClickListener(v -> {
        if (mSelectedStatus != ProtoSignalingGetLog.SignalingGetLog.Filter.CANCELED) {
            setEnableButton(ProtoSignalingGetLog.SignalingGetLog.Filter.CANCELED);
            getCallLogsFromRealm(ProtoSignalingGetLog.SignalingGetLog.Filter.CANCELED);
        }
    });
    // Todo: fixed it, cause load view with delay
    setViewState(mIsMultiSelectEnable);
}
Also used : Bundle(android.os.Bundle) DateUtils(android.text.format.DateUtils) AppUtils(net.iGap.module.AppUtils) ProgressBar(android.widget.ProgressBar) ToolbarItem(net.iGap.messenger.ui.toolBar.ToolbarItem) Animator(android.animation.Animator) Theme(net.iGap.module.Theme) G(net.iGap.G) G.isAppRtl(net.iGap.G.isAppRtl) Handler(android.os.Handler) Fragment(androidx.fragment.app.Fragment) View(android.view.View) CallActivity(net.iGap.activities.CallActivity) HelperError(net.iGap.helper.HelperError) RecyclerView(androidx.recyclerview.widget.RecyclerView) HelperFragment(net.iGap.helper.HelperFragment) VIDEO_CALLING(net.iGap.proto.ProtoSignalingOffer.SignalingOffer.Type.VIDEO_CALLING) HelperTracker(net.iGap.helper.HelperTracker) ParamWithAvatarType(net.iGap.helper.avatar.ParamWithAvatarType) Realm(io.realm.Realm) HelperCalander(net.iGap.helper.HelperCalander) ObjectAnimator(android.animation.ObjectAnimator) NumberTextView(net.iGap.messenger.ui.toolBar.NumberTextView) ProtoSignalingOffer(net.iGap.proto.ProtoSignalingOffer) ViewGroup(android.view.ViewGroup) List(java.util.List) TextView(android.widget.TextView) Nullable(androidx.annotation.Nullable) BackDrawable(net.iGap.messenger.ui.toolBar.BackDrawable) RealmRecyclerViewAdapter(io.realm.RealmRecyclerViewAdapter) MusicPlayer(net.iGap.module.MusicPlayer) Sort(io.realm.Sort) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) MaterialDialog(com.afollestad.materialdialogs.MaterialDialog) NotNull(org.jetbrains.annotations.NotNull) EmojiManager(net.iGap.libs.emojiKeyboard.emoji.EmojiManager) ResourcesCompat(androidx.core.content.res.ResourcesCompat) ActivityMain(net.iGap.activities.ActivityMain) AccountManager(net.iGap.module.accountManager.AccountManager) Intent(android.content.Intent) TimeUtils(net.iGap.module.TimeUtils) StatusBarUtil(net.iGap.module.StatusBarUtil) ArrayList(java.util.ArrayList) RealmCallLog(net.iGap.realm.RealmCallLog) MotionEvent(android.view.MotionEvent) Toast(android.widget.Toast) AnimatorSet(android.animation.AnimatorSet) LayoutCreator(net.iGap.helper.LayoutCreator) ProtoSignalingGetLog(net.iGap.proto.ProtoSignalingGetLog) Build(android.os.Build) Toolbar(net.iGap.messenger.ui.toolBar.Toolbar) AvatarHandler(net.iGap.helper.avatar.AvatarHandler) ToolbarItems(net.iGap.messenger.ui.toolBar.ToolbarItems) LayoutInflater(android.view.LayoutInflater) RequestSignalingClearLog(net.iGap.request.RequestSignalingClearLog) RealmResults(io.realm.RealmResults) CheckBox(net.iGap.module.customView.CheckBox) MaterialDesignTextView(net.iGap.module.MaterialDesignTextView) ScanCodeQRCodePaymentFragment(net.iGap.fragments.qrCodePayment.fragments.ScanCodeQRCodePaymentFragment) FragmentMediaContainer(net.iGap.messenger.ui.components.FragmentMediaContainer) CircleImageView(net.iGap.module.CircleImageView) Gravity(android.view.Gravity) ViewMaker(net.iGap.adapter.items.chat.ViewMaker) R(net.iGap.R) DbManager(net.iGap.module.accountManager.DbManager) RequestSignalingGetLog(net.iGap.request.RequestSignalingGetLog) FragmentMediaContainer(net.iGap.messenger.ui.components.FragmentMediaContainer) ViewGroup(android.view.ViewGroup) ArrayList(java.util.ArrayList) RequestSignalingClearLog(net.iGap.request.RequestSignalingClearLog) Intent(android.content.Intent) CallActivity(net.iGap.activities.CallActivity) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) RealmCallLog(net.iGap.realm.RealmCallLog) ToolbarItems(net.iGap.messenger.ui.toolBar.ToolbarItems) Theme(net.iGap.module.Theme) RecyclerView(androidx.recyclerview.widget.RecyclerView) Toolbar(net.iGap.messenger.ui.toolBar.Toolbar)

Aggregations

Toolbar (net.iGap.messenger.ui.toolBar.Toolbar)30 BackDrawable (net.iGap.messenger.ui.toolBar.BackDrawable)29 ViewGroup (android.view.ViewGroup)11 LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)11 HelperFragment (net.iGap.helper.HelperFragment)10 Bundle (android.os.Bundle)8 RecyclerView (androidx.recyclerview.widget.RecyclerView)8 Intent (android.content.Intent)7 MaterialDialog (com.afollestad.materialdialogs.MaterialDialog)7 FrameLayout (android.widget.FrameLayout)6 Nullable (androidx.annotation.Nullable)6 Fragment (androidx.fragment.app.Fragment)6 View (android.view.View)5 NonNull (androidx.annotation.NonNull)5 DialogAction (com.afollestad.materialdialogs.DialogAction)5 ToolbarItem (net.iGap.messenger.ui.toolBar.ToolbarItem)5 ToolbarItems (net.iGap.messenger.ui.toolBar.ToolbarItems)5 Theme (net.iGap.module.Theme)5 SuppressLint (android.annotation.SuppressLint)4 Gravity (android.view.Gravity)4