Android Open Source - gridView Item Button






From Project

Back to project page gridView.

License

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.

Java Source Code

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);
    }
}




Java Source Code List

com.datayumyum.pos.CategoryAdapter.java
com.datayumyum.pos.DownloadImageTask.java
com.datayumyum.pos.GridViewActivity.java
com.datayumyum.pos.ItemButton.java
com.datayumyum.pos.ItemRepository.java
com.datayumyum.pos.Item.java
com.datayumyum.pos.SwipeDismissListViewTouchListener.java
com.datayumyum.pos.SwipeDismissTouchListener.java
com.datayumyum.pos.SwipeListener.java