Search in sources :

Example 1 with PhotoChoice

use of org.aisen.android.common.utils.PhotoChoice in project AisenWeiBo by wangdan.

the class APublishFragment method layoutInit.

@Override
protected void layoutInit(LayoutInflater inflater, Bundle savedInstanceState) {
    super.layoutInit(inflater, savedInstanceState);
    //		getActivity().getActionBar().setSubtitle(AppContext.getUser().getScreen_name());
    btnLocation.setVisibility(View.GONE);
    if (savedInstanceState == null) {
        if (getArguments() != null)
            mBean = (PublishBean) getArguments().getSerializable("bean");
    } else {
        mBean = (PublishBean) savedInstanceState.getSerializable("bean");
    }
    if (mBean == null)
        mBean = newPublishBean();
    if (savedInstanceState == null) {
        emotionFragment = EmotionFragment.newInstance();
        getActivity().getFragmentManager().beginTransaction().add(R.id.layEmotion, emotionFragment, "EmotionFragemnt").commit();
    } else {
        emotionFragment = (EmotionFragment) getActivity().getFragmentManager().findFragmentByTag("EmotionFragemnt");
    }
    emotionFragment.setOnEmotionListener(this);
    // 内容编辑
    editContent.addTextChangedListener(editContentWatcher);
    // 更换表情
    editContent.setFilters(new InputFilter[] { emotionFilter });
    editContent.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            hideEmotionView(true);
        }
    });
    ObjectAnimator animIn = ObjectAnimator.ofFloat(null, "translationY", SystemUtils.getScreenHeight(getActivity()), emotionHeight).setDuration(transitioner.getDuration(LayoutTransition.APPEARING));
    transitioner.setAnimator(LayoutTransition.APPEARING, animIn);
    ObjectAnimator animOut = ObjectAnimator.ofFloat(null, "translationY", emotionHeight, SystemUtils.getScreenHeight(getActivity())).setDuration(transitioner.getDuration(LayoutTransition.DISAPPEARING));
    transitioner.setAnimator(LayoutTransition.DISAPPEARING, animOut);
    layRoot.setLayoutTransition(transitioner);
    refreshUI();
    String albumPath = SystemUtils.getSdcardPath() + File.separator + "/DCIM/Camera/";
    File albumFile = new File(albumPath);
    if (!albumFile.exists())
        albumFile.mkdirs();
    photoChoice = new PhotoChoice(getActivity(), APublishFragment.this, albumPath);
    if (savedInstanceState != null)
        tempFilePath = savedInstanceState.getString("tempFilePath");
    photoChoice.setFileName(tempFilePath);
    photoChoice.setMode(PhotoChoice.PhotoChoiceMode.uriType);
}
Also used : PublishBean(org.aisen.weibo.sina.support.bean.PublishBean) ObjectAnimator(android.animation.ObjectAnimator) SpannableString(android.text.SpannableString) PhotoChoice(org.aisen.android.common.utils.PhotoChoice) ImageView(android.widget.ImageView) HorizontalScrollView(android.widget.HorizontalScrollView) View(android.view.View) TextView(android.widget.TextView) File(java.io.File)

Aggregations

ObjectAnimator (android.animation.ObjectAnimator)1 SpannableString (android.text.SpannableString)1 View (android.view.View)1 HorizontalScrollView (android.widget.HorizontalScrollView)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 File (java.io.File)1 PhotoChoice (org.aisen.android.common.utils.PhotoChoice)1 PublishBean (org.aisen.weibo.sina.support.bean.PublishBean)1