Android Open Source - polygons Square






From Project

Back to project page polygons.

License

The source code is released under:

GNU General Public License

If you think the Android project polygons 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.github.polygons.figures;
/*from  w  w w  . j a  va 2  s .co  m*/
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.RectF;
import android.util.AttributeSet;

import com.nobcatz.android.polygons.R;

/**
 * Created by Marta on 13/11/2013.
 */
public class Square extends Figure{


    public Square(Context context) {
        super(context);
        this.id = 1;
    }

    public Square(Context context, AttributeSet attrs) {
        super(context, attrs);
        this.id = 0;
    }

    public Square(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        this.id = 0;
    }

    @Override
    public void drawFigure(Canvas canvas) {
        canvas.drawRect(0, 0, canvas.getWidth(), canvas.getWidth(), this.paint);

        paint.setColor(getResources().getColor(R.color.base3));

        canvas.drawRect(10,10, canvas.getWidth()-10, canvas.getWidth()-10, this.paint);
    }


}




Java Source Code List

com.github.polygons.FigureListActivity.java
com.github.polygons.GameActivity.java
com.github.polygons.LevelActivity.java
com.github.polygons.LostActivity.java
com.github.polygons.MainActivity.java
com.github.polygons.figures.Figure.java
com.github.polygons.figures.Oval.java
com.github.polygons.figures.Square.java
com.github.polygons.figures.Triangle.java
com.github.polygons.logic.CustomAudioManager.java
com.github.polygons.logic.FigureGenerator.java
com.github.polygons.logic.Keeper.java
com.google.example.games.basegameutils.BaseGameActivity.java
com.google.example.games.basegameutils.GameHelper.java