Search in sources :

Example 16 with HelperToolbar

use of net.iGap.helper.HelperToolbar in project iGap-Android by KianIranian-STDG.

the class FragmentCPayEdit method initToolbar.

private void initToolbar() {
    HelperToolbar toolbar = HelperToolbar.create().setContext(getContext()).setLifecycleOwner(getViewLifecycleOwner()).setLogoShown(true).setDefaultTitle(getString(R.string.c_pay_title)).setLeftIcon(R.string.icon_back).setListener(this);
    binding.fceToolbar.addView(toolbar.getView());
}
Also used : HelperToolbar(net.iGap.helper.HelperToolbar)

Example 17 with HelperToolbar

use of net.iGap.helper.HelperToolbar in project iGap-Android by KianIranian-STDG.

the class FragmentCPayInquiry method initToolbar.

private void initToolbar() {
    HelperToolbar toolbar = HelperToolbar.create().setContext(getContext()).setLifecycleOwner(getViewLifecycleOwner()).setLogoShown(true).setDefaultTitle(getString(R.string.c_pay_title)).setLeftIcon(R.string.icon_back).setListener(this);
    binding.fciToolbar.addView(toolbar.getView());
}
Also used : HelperToolbar(net.iGap.helper.HelperToolbar)

Example 18 with HelperToolbar

use of net.iGap.helper.HelperToolbar in project iGap-Android by KianIranian-STDG.

the class ChatRightsFragment method onCreateView.

@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    if (getContext() == null)
        return super.onCreateView(inflater, container, savedInstanceState);
    HelperToolbar helperToolbar = HelperToolbar.create();
    String title = currentMode == 0 || currentMode == 1 ? getResources().getString(R.string.admin_rights) : isRoom() ? getResources().getString(R.string.edit_room_rights) : getResources().getString(R.string.edit_member_rights);
    View toolBar = helperToolbar.setContext(getContext()).setLogoShown(true).setListener(this).setRightIcons(R.string.icon_check_ok).setLeftIcon(R.string.icon_back).setDefaultTitle(getString(R.string.new_channel)).setDefaultTitle(title).getView();
    FrameLayout rootView = new FrameLayout(getContext());
    rootView.setBackgroundColor(Theme.getInstance().getDividerColor(getContext()));
    rootView.addView(toolBar, LayoutCreator.createFrame(LayoutCreator.MATCH_PARENT, LayoutCreator.WRAP_CONTENT, Gravity.TOP));
    progressView = new ProgressBar(getContext());
    progressView.setVisibility(View.GONE);
    rootView.addView(recyclerListView = new RecyclerListView(getContext()), LayoutCreator.createFrame(LayoutCreator.MATCH_PARENT, LayoutCreator.MATCH_PARENT, Gravity.TOP, 0, LayoutCreator.getDimen(R.dimen.toolbar_height), 0, 0));
    rootView.addView(progressView, LayoutCreator.createFrame(LayoutCreator.WRAP_CONTENT, LayoutCreator.WRAP_CONTENT, Gravity.CENTER));
    recyclerListView.setLayoutManager(new LinearLayoutManager(getContext(), RecyclerView.VERTICAL, false));
    recyclerListView.setAdapter(new ListAdapter());
    recyclerListView.setClipToPadding(false);
    recyclerListView.setPadding(0, 0, 0, LayoutCreator.dp(30));
    return rootView;
}
Also used : FrameLayout(android.widget.FrameLayout) HelperToolbar(net.iGap.helper.HelperToolbar) RecyclerListView(net.iGap.module.customView.RecyclerListView) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) RecyclerListView(net.iGap.module.customView.RecyclerListView) ProgressBar(android.widget.ProgressBar) Nullable(androidx.annotation.Nullable)

Example 19 with HelperToolbar

use of net.iGap.helper.HelperToolbar in project iGap-Android by KianIranian-STDG.

the class DailNumberFragment method onViewCreated.

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    HelperToolbar t = HelperToolbar.create().setContext(getContext()).setLeftIcon(R.string.icon_back).setLogoShown(true).setListener(new ToolbarListener() {

        @Override
        public void onLeftIconClickListener(View view) {
            if (getActivity() != null) {
                getActivity().onBackPressed();
            }
        }
    });
    binding.toolbar.addView(t.getView());
}
Also used : ToolbarListener(net.iGap.observers.interfaces.ToolbarListener) HelperToolbar(net.iGap.helper.HelperToolbar) View(android.view.View)

Example 20 with HelperToolbar

use of net.iGap.helper.HelperToolbar in project iGap-Android by KianIranian-STDG.

the class EditGroupFragment method onViewCreated.

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    viewModel.onCreateFragment(this);
    HelperToolbar mHelperToolbar = HelperToolbar.create().setContext(getContext()).setLifecycleOwner(getViewLifecycleOwner()).setLogoShown(true).setLeftIcon(R.string.icon_back).setRightIcons(R.string.icon_sent).setDefaultTitle(G.context.getResources().getString(R.string.tab_edit)).setListener(new ToolbarListener() {

        @Override
        public void onLeftIconClickListener(View view) {
            popBackStackFragment();
        }

        @Override
        public void onRightIconClickListener(View view) {
            viewModel.setData(binding.groupNameEditText.getEditableText().toString(), binding.groupDescriptionEditText.getEditableText().toString());
            hideKeyboard();
        }
    });
    binding.toolbar.addView(mHelperToolbar.getView());
    // mHelperToolbar.getTextViewLogo().setText(R.string.tab_edit);
    attachFile = new AttachFile(G.fragmentActivity);
    viewModel.goToMembersPage.observe(getViewLifecycleOwner(), b -> {
        if (b != null && b) {
            showListForCustomRole(ProtoGroupGetMemberList.GroupGetMemberList.FilterRole.ALL.toString());
        }
    });
    viewModel.goToAdministratorPage.observe(getViewLifecycleOwner(), b -> {
        if (b != null && b) {
            showListForCustomRole(ProtoGroupGetMemberList.GroupGetMemberList.FilterRole.ADMIN.toString());
        }
    });
    viewModel.goToPermissionPage.observe(getViewLifecycleOwner(), new Observer<Boolean>() {

        @Override
        public void onChanged(@Nullable Boolean b) {
        }
    });
    viewModel.goBack.observe(getViewLifecycleOwner(), aBoolean -> popBackStackFragment());
    viewModel.showSelectImageDialog.observe(getViewLifecycleOwner(), aBoolean -> {
        if (aBoolean != null && aBoolean) {
            startDialogSelectPicture();
        }
    });
    viewModel.closePageImediatly.observe(getViewLifecycleOwner(), isClose -> {
        if (isClose == null || !isClose)
            return;
        popBackStackFragment();
    });
    viewModel.showDialogChatHistory.observe(getViewLifecycleOwner(), aBoolean -> {
        if (getActivity() != null && aBoolean != null && aBoolean) {
            showDialog();
        }
    });
    viewModel.goToModeratorPage.observe(getViewLifecycleOwner(), aBoolean -> showListForCustomRole(ProtoGroupGetMemberList.GroupGetMemberList.FilterRole.MODERATOR.toString()));
    viewModel.initEmoji.observe(getViewLifecycleOwner(), aBoolean -> {
    // if (aBoolean != null) {
    // emojiPopup.toggle();
    // }
    });
    viewModel.showDialogLeaveGroup.observe(getViewLifecycleOwner(), aBoolean -> {
        if (aBoolean != null && aBoolean) {
            groupLeft();
        }
    });
    viewModel.goToRoomListPage.observe(getViewLifecycleOwner(), go -> {
        if (getActivity() instanceof ActivityMain && go != null && go) {
            ((ActivityMain) getActivity()).removeAllFragmentFromMain();
        }
    });
    viewModel.getOnGroupAvatarUpdated().observe(getViewLifecycleOwner(), roomId -> {
        if (roomId != null && roomId == viewModel.roomId) {
            setAvatar();
        }
    });
    // setUpEmojiPopup();
    setAvatar();
}
Also used : ToolbarListener(net.iGap.observers.interfaces.ToolbarListener) ActivityMain(net.iGap.activities.ActivityMain) AttachFile(net.iGap.module.AttachFile) HelperToolbar(net.iGap.helper.HelperToolbar) View(android.view.View)

Aggregations

HelperToolbar (net.iGap.helper.HelperToolbar)32 View (android.view.View)21 ToolbarListener (net.iGap.observers.interfaces.ToolbarListener)17 LinearLayout (android.widget.LinearLayout)14 RecyclerView (androidx.recyclerview.widget.RecyclerView)9 LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)8 TextView (android.widget.TextView)7 Bundle (android.os.Bundle)6 ViewGroup (android.view.ViewGroup)6 Nullable (androidx.annotation.Nullable)6 MaterialDialog (com.afollestad.materialdialogs.MaterialDialog)4 HelperFragment (net.iGap.helper.HelperFragment)4 LayoutInflater (android.view.LayoutInflater)3 FrameLayout (android.widget.FrameLayout)3 ProgressBar (android.widget.ProgressBar)3 NonNull (androidx.annotation.NonNull)3 DataBindingUtil (androidx.databinding.DataBindingUtil)3 ViewModelProviders (androidx.lifecycle.ViewModelProviders)3 GridLayoutManager (androidx.recyclerview.widget.GridLayoutManager)3 R (net.iGap.R)3