Java realizes the App_java of the speech line of the collection name

Source: Internet
Author: User

Let the people you like in anime, the lines you like, the words you forget, keep them in your phone.

/** * Create dialoguefragment View */@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);
  Wrap String Dialogue = Macg.getdialogue () from the following punctuation mark (). 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); Separate the sentences from the application with the sentences added by the user if (Macg.getid () < Acglistfragment.system_dialodue_lenght) {Mheadimageview.setimageres
   Ource (Integer.parseint (Macg.gethead ())); Mheadimageview.setonclicklistener (New View.onclicklistener () {@Override public void OnClick (View v) {//T Odo auto-generated Method Stub//Set Water wave animation Animation anim = Animationutils.loadanimation (Getactivity (), R.
     Anim.anim_ripple);
 
     Mrippleimageview.startanimation (ANIM);
    Acgdialoguefragment.getplayer (). Play (Getactivity (), Integer.parseint (Macg.getsound ()));
  }
   });
   else {//Picture path does not exist or the file File = new file (Macg.gethead ()) is not set; if (Macg.gethead (). IsEmpty () | | (!file.exists ()))
   {//Set default picture 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//Set Water wave animation 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, Toas
      T.length_short). Show ();
      else {Acgdialoguefragment.getplayer (). Play (Getactivity (), Macg.getsound ());
  }
     }
    }
   });
 } return v; }

Demo diagram:

The above mentioned is the entire content of this article, I hope to be able to master the Java Development app to help.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.