android - Draw in a fragment -
i want add own graphics in fragment. possible add example circle in fragment? have code:
public static class dummysectionfragment extends fragment { /** * fragment argument representing section number * fragment. */ public static final string arg_section_number = "section_number"; public static final string arg_object = "object"; public static final string arg_data = "data"; public dummysectionfragment() { } @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { bundle args = getarguments(); int position = args.getint(arg_object); string data=args.getstring(arg_data); int tablayout = 0; switch (position) { case 0: tablayout = r.layout.fragment_company_products; break; case 1: tablayout = r.layout.fragment_main_dummy; break; case 2: tablayout = r.layout.fragment_main_dummy; break; case 3: tablayout = r.layout.fragment_main_dummy; break; } view rootview = inflater.inflate(tablayout, container, false); textview dummytextview = (textview) rootview.findviewbyid(r.id.section_label); //dummytextview.settext(args.getint(arg_object)+"\n"+data+"asd"); return rootview; } }
i asked because want change on each fragment graphics, , on of fragments should add 2d graphics circle or arc or rectangle. possible? thank in advance
it possible add view
subclass fragment
's layout , custom drawing in ondraw
.
Comments
Post a Comment