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);
}
Aggregations