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.