Back to project page gridView.
The source code is released under:
Apache License
If you think the Android project gridView listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.datayumyum.pos; /*from w w w . j a v a2 s .c o m*/ import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.view.ViewGroup; import android.widget.LinearLayout; import android.widget.TextView; /** * Created by sto on 3/14/14. */ public class ItemButton extends TextView { String name; public ItemButton(Context context, String name) { super(context); this.name = name; LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); setLayoutParams(params); } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); Paint p = new Paint(); p.setColor(Color.BLACK); canvas.drawText(name, 10, 10, p); } }