'Programming/Android'에 해당되는 글 4건

  1. 2010.08.02 리스너
  2. 2010.08.02 Memo
  3. 2010.07.09 PaintTest 3
  4. 2010.07.05 레이아웃
Programming/Android2010. 8. 2. 22:14
mEdit.addTextChangeListener(mWatcher);


TextWatcher mWatcher = new TextWatcher(){
     public void afterTextChanged(Editable s){
     }
    
     public void beforeTextChanged(CharSequence s, int start, int count,
     int after){
     }
    
     public void onTextChanged(CharSequence s, int start, int before, int count){
     mText.setText("echo: " + s);
     }
    };

'Programming > Android' 카테고리의 다른 글

Memo  (0) 2010.08.02
PaintTest  (3) 2010.07.09
레이아웃  (0) 2010.07.05
Posted by zzibong
Programming/Android2010. 8. 2. 22:06
// 매니페스트
<activity android:windowSoftInputMode="adjustResize" />

mEdit.setFilters(new InputFilter[]{
         new InputFilter.LengthFilter(5)
        });

'Programming > Android' 카테고리의 다른 글

리스너  (0) 2010.08.02
PaintTest  (3) 2010.07.09
레이아웃  (0) 2010.07.05
Posted by zzibong
Programming/Android2010. 7. 9. 00:35

public void onDraw(Canvas canvas){
     Paint Pnt = new Paint();
     canvas.drawColor(Color.WHITE);

     // 캡 모양 테스트
     Pnt.setColor(Color.BLUE);
     Pnt.setStrokeWidth(14);
     canvas.drawLine(10, 10, 200, 10, Pnt);
     Pnt.setStrokeCap(Paint.Cap.ROUND);
     canvas.drawLine(10, 30, 200, 30, Pnt);
     Pnt.setStrokeCap(Paint.Cap.SQUARE);
     canvas.drawLine(10, 50, 200, 50, Pnt);
    
     // 조인 모양 테스트
     Pnt.setColor(Color.BLACK);
     Pnt.setStrokeWidth(15);
     Pnt.setStyle(Paint.Style.STROKE);
     Pnt.setStrokeJoin(Paint.Join.MITER);
     canvas.drawRect(10, 80, 60, 130, Pnt);
     Pnt.setStrokeJoin(Paint.Join.BEVEL);
     canvas.drawRect(80, 80, 130, 130, Pnt);
     Pnt.setStrokeJoin(Paint.Join.ROUND);
     canvas.drawRect(150, 80, 200, 130, Pnt);
    
     // 스타일 테스트
     Pnt.setStrokeWidth(5);
     Pnt.setColor(Color.RED);
     Pnt.setStyle(Paint.Style.FILL);
     canvas.drawCircle(30, 180, 20, Pnt);
     Pnt.setStyle(Paint.Style.STROKE);
     canvas.drawCircle(80, 180, 20, Pnt);
     Pnt.setStyle(Paint.Style.FILL_AND_STROKE);
     canvas.drawCircle(130, 180, 20, Pnt);
     Pnt.setColor(Color.BLUE);
     canvas.drawCircle(180, 180, 20, Pnt);
     Pnt.setStyle(Paint.Style.FILL);
     Pnt.setColor(Color.RED);
     Pnt.setStyle(Paint.Style.STROKE);
     canvas.drawCircle(180, 180, 20, Pnt);
     }

출처 - 안드로이드 프로그래밍 정복

'Programming > Android' 카테고리의 다른 글

리스너  (0) 2010.08.02
Memo  (0) 2010.08.02
레이아웃  (0) 2010.07.05
Posted by zzibong
Programming/Android2010. 7. 5. 21:37


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff"
>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<Button
android:id="@+id/btnpage1"  
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:text="Page 1"
/>
<Button
android:id="@+id/btnpage2"  
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:text="Page 2"
/>
<Button
android:id="@+id/btnpage3"  
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:text="Page 3"
/>
</LinearLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<LinearLayout
android:id="@+id/page1"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffff00"
>
<TextView  
android:layout_width="match_parent" 
android:layout_height="wrap_content"
android:textColor="#000000" 
android:text="첫 번째 페이지"
/>
<ImageView  
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:src="@drawable/pride"
/>
</LinearLayout>
<RelativeLayout
android:id="@+id/page2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="invisible"
android:background="#00ff00"
>
<EditText
android:layout_width="wrap_content" 
android:layout_height="wrap_content"
android:layout_alignParentRight="true" 
android:text="두번째 페이지"
/>
<Button
android:layout_width="wrap_content" 
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" 
android:text="Button"
/>
</RelativeLayout>
<TableLayout
android:id="@+id/page3"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="invisible"
android:background="#0000ff"
>
<TableRow>
<TextView android:text="국어" android:textSize="15pt" android:padding="10px" />
<TextView android:text="영어" android:textSize="15pt" android:padding="10px" />
<TextView android:text="수학" android:textSize="15pt" android:padding="10px" />
</TableRow>
<TableRow>
<TextView android:text="88" android:textSize="15pt" android:padding="10px" />
<TextView android:text="92" android:textSize="15pt" android:padding="10px" />
<TextView android:text="76" android:textSize="15pt" android:padding="10px" />
</TableRow>
</TableLayout>
</FrameLayout>
</LinearLayout>


참고서 - 안드로이드 프로그래밍 정복

'Programming > Android' 카테고리의 다른 글

리스너  (0) 2010.08.02
Memo  (0) 2010.08.02
PaintTest  (3) 2010.07.09
Posted by zzibong