-
Notifications
You must be signed in to change notification settings - Fork 12
/
MainActivity.java
31 lines (25 loc) · 1.17 KB
/
MainActivity.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.blikoon.app132;
/*
Drawing completely custom views-----------API 1
*Must implement 3 override methods:
# void onMeasure(int widthMeasureSpec, heightMeasureSpec)
# void onSizeChanged(int w, int h,int oldw, int oldh)
# void onDraw(Canvas canvas)
*Measurement Constraints:
# AT_MOST : used when the layout parameters of your view( from xml of Java code) are
match parent.You set the width and height of the view here to match
the layout param
#EXACTLY : used when in layout params, the width or height is set to a fixed value
again you set the width or height to values that work for you here.
#UNSPECIFIED : used when the view is unconstrained and you need to figure out how big
it should be.A good example is when the layout param is wrap_content
*/
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}