android - How to use Layout Inflater with CardUI -
i'm working cardui found here.
i inflate these cards own layout xml not understand how to.
here code mainactivity creating cards
mycard facebookcard = new mycard("continue facebook"); mycard nosignincard = new mycard("continue without log in"); mcardview.addcard(facebookcard); mcardview.addcard(nosignincard); here class mycard
package com.kc.umassguide; import android.content.context; import android.view.layoutinflater; import android.view.view; import android.widget.textview; import com.fima.cardsui.objects.card; public class mycard extends card { public mycard(string title){ super(title); } @override public view getcardcontent(context context) { view view = layoutinflater.from(context).inflate(r.layout.card_ex, null); ((textview) view.findviewbyid(r.id.title)).settext(title); return view; } } i believe supposed use getcardcontent inflating i'm sure how use context.
any appreciated.
you need replace r.layout.card_ex new layout. here example:
Comments
Post a Comment