java完成珍藏名言語句台詞的app。本站提示廣大學習愛好者:(java完成珍藏名言語句台詞的app)文章只能為提供參考,不一定能成為您想要的結果。以下是java完成珍藏名言語句台詞的app正文
讓動漫中那些愛好的人、愛好的台詞,讓你難忘的話語,都保存在你的手機中吧
/** * 創立DialogueFragment視圖 * */ @TargetApi(Build.VERSION_CODES.HONEYCOMB) @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // TODO Auto-generated method stub View v = inflater.inflate(R.layout.fragment_acg_dialogue, container, false); int id = (Integer) getArguments().getSerializable(EXTRA_ACG_ID); mAcg = AcgLab.get(getActivity()).getAcg(id); mDialogueTextView = (TextView) v.findViewById(R.id.dialogue_tv); // 從以下標點符號處換行 String dialogue = mAcg.getDialogue().replace(",", "\n"); dialogue = dialogue.replace("。", "\n"); dialogue = dialogue.replace("?", "\n"); dialogue = dialogue.replace("!", "\n"); mDialogueTextView.setText(dialogue); mPersonageTextView = (TextView) v.findViewById(R.id.personage_tv); if (!mAcg.getPersonage().isEmpty()) { mPersonageTextView.setText("--" + mAcg.getPersonage()); } else { mPersonageTextView.setText(""); } mHeadImageView = (ImageView) v.findViewById(R.id.avatar_iv); mRippleImageView = (ImageView) v.findViewById(R.id.ripple_iv); // 將該運用法式自帶的句子和用戶添加的句子離開處置 if (mAcg.getId() < AcgListFragment.SYSTEM_DIALODUE_LENGHT) { mHeadImageView.setImageResource(Integer.parseInt(mAcg.getHead())); mHeadImageView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub // 設置水動搖畫 Animation anim = AnimationUtils.loadAnimation( getActivity(), R.anim.anim_ripple); mRippleImageView.startAnimation(anim); AcgDialogueFragment.getPlayer().play(getActivity(), Integer.parseInt(mAcg.getSound())); } }); } else { // 圖片途徑不存在或許未設置 File file = new File(mAcg.getHead()); if (mAcg.getHead().isEmpty() || (!file.exists())) { // 設置默許圖片 mHeadImageView.setImageResource(R.drawable.saber); } else { Bitmap bmp = PictureUtils.getScaledBitmapFromPath( getActivity(), mAcg.getHead()); bmp = PictureUtils.getRoundBitmap(bmp); mHeadImageView.setImageBitmap(bmp); } mHeadImageView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub // 設置水動搖畫 Animation anim = AnimationUtils.loadAnimation( getActivity(), R.anim.anim_ripple); mRippleImageView.startAnimation(anim); if (mAcg.getId() < AcgListFragment.SYSTEM_DIALODUE_LENGHT) { AcgDialogueFragment.getPlayer().play(getActivity(), Integer.parseInt(mAcg.getSound())); } else { if (mAcg.getSound().isEmpty()) { Toast.makeText(getActivity(), R.string.tip_not_sound, Toast.LENGTH_SHORT) .show(); } else { AcgDialogueFragment.getPlayer().play(getActivity(), mAcg.getSound()); } } } }); } return v; }
演示圖:
以上所述就是本文的全體內容了,願望可以或許對年夜家闇練控制java開辟app有所贊助。