Search in sources :

Example 1 with MediaPickerFragment

use of im.actor.sdk.controllers.tools.MediaPickerFragment in project actor-platform by actorapp.

the class AttachFragment method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup fcontainer, @Nullable Bundle savedInstanceState) {
    if (savedInstanceState == null) {
        getChildFragmentManager().beginTransaction().add(new MediaPickerFragment(), "picker").commitNow();
    }
    root = new FrameLayout(getContext()) {

        @Override
        protected void onSizeChanged(int w, int h, int oldw, int oldh) {
            super.onSizeChanged(w, h, oldw, oldh);
            if (h != oldh && shareButtons != null) {
                shareButtons.getLayoutParams().height = root.getHeight() - Screen.dp(135);
                shareButtons.requestLayout();
            }
        }
    };
    root.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
    root.setBackgroundColor(getActivity().getResources().getColor(R.color.dialog_overlay));
    root.setVisibility(View.INVISIBLE);
    isLoaded = false;
    return root;
}
Also used : MediaPickerFragment(im.actor.sdk.controllers.tools.MediaPickerFragment) FrameLayout(android.widget.FrameLayout) Nullable(android.support.annotation.Nullable)

Example 2 with MediaPickerFragment

use of im.actor.sdk.controllers.tools.MediaPickerFragment in project actor-platform by actorapp.

the class GroupEditFragment method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View res = inflater.inflate(R.layout.fragment_edit_info, container, false);
    res.findViewById(R.id.rootContainer).setBackgroundColor(style.getBackyardBackgroundColor());
    res.findViewById(R.id.topContainer).setBackgroundColor(style.getMainBackgroundColor());
    avatarView = (AvatarView) res.findViewById(R.id.avatar);
    avatarView.init(Screen.dp(52), 24);
    avatarView.bind(groupVM.getAvatar().get(), groupVM.getName().get(), groupId);
    avatarView.setOnClickListener(v -> {
        onAvatarClicked();
    });
    titleEditText = (MaterialEditText) res.findViewById(R.id.name);
    titleEditText.setTextColor(style.getTextPrimaryColor());
    titleEditText.setBaseColor(style.getAccentColor());
    titleEditText.setMetHintTextColor(style.getTextHintColor());
    titleEditText.setText(groupVM.getName().get());
    titleEditText.addTextChangedListener(new TextWatcher() {

        @Override
        public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
        }

        @Override
        public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
        }

        @Override
        public void afterTextChanged(Editable editable) {
            avatarView.updatePlaceholder(editable.toString(), groupId);
        }
    });
    descriptionEditText = (EditText) res.findViewById(R.id.description);
    descriptionEditText.setTextColor(style.getTextPrimaryColor());
    descriptionEditText.setHintTextColor(style.getTextHintColor());
    descriptionEditText.setText(groupVM.getAbout().get());
    // Media Picker
    getChildFragmentManager().beginTransaction().add(new MediaPickerFragment(), "picker").commitNow();
    return res;
}
Also used : MediaPickerFragment(im.actor.sdk.controllers.tools.MediaPickerFragment) TextWatcher(android.text.TextWatcher) Editable(android.text.Editable) AvatarView(im.actor.sdk.view.avatar.AvatarView) View(android.view.View) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

MediaPickerFragment (im.actor.sdk.controllers.tools.MediaPickerFragment)2 Nullable (android.support.annotation.Nullable)1 Editable (android.text.Editable)1 TextWatcher (android.text.TextWatcher)1 View (android.view.View)1 FrameLayout (android.widget.FrameLayout)1 AvatarView (im.actor.sdk.view.avatar.AvatarView)1 Nullable (org.jetbrains.annotations.Nullable)1