开发者

Quick guru interpretation of beginner android tutorial instructions!

I am following this tutorial:

http://knol.google.com/k/suk-woo-heo/creating-user-interfaces/1oqzmo14sfklf/20#

Have got to step 4 where it says: 4. With the resources defined, you’re ready to customize the TodoListItemView appearance. Create new private instance variables to store the Paint objects you’ll use to draw the paper background and margin. Also create variables for the paper color and margin width values. Fill in the init method to get instances of the resources you created in the last two steps and create the Paint objects.

Can anyone tell me what this means? 'Create new private instance variables to store the Paint objects'

Shoul开发者_运维技巧d this be created as a new class in eclipse under src? My existing class I had already calls lots of these things like init(), so it starts spitting errors if I put it in there...


Looks like they are modifying/adding to the existing TodoListItemView class created in step 1.

Something like this:

public class TodoListItemView extends TextView {

  private Paint marginPaint;
  private Paint linePaint;
  private int paperColor;
  private float margin;

  public TodoListItemView (Context context, AttributeSet ats, int ds) {
    super(context, ats, ds);
    init();
  }

  private void init() {
    // Get a reference to our resource table.
    // ....
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜