안 드 로 이 드 서명 낙서 손 글씨 판 구현
레이아웃 파일
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:id="@+id/fl_signature"
android:layout_width="fill_parent"
android:layout_height="200dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp"
android:background="@drawable/singature_bg"
android:gravity="top">
</FrameLayout>
<ImageView
android:id="@+id/iv_signature"
android:layout_width="fill_parent"
android:layout_height="200dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp"
android:background="@drawable/signature_shape"
android:gravity="top"
android:visibility="gone"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp">
<TextView
android:id="@+id/tv_revert_signature"
android:layout_width="100dp"
android:layout_height="35dp"
android:layout_alignParentRight="true"
android:layout_marginRight="140dp"
android:background="@drawable/btn_order_details_pay_bg"
android:gravity="center"
android:paddingLeft="30dp"
android:paddingRight="30dp"
android:text=" "
android:textColor="@color/code_number_bg"
android:textSize="@dimen/text_title_word" />
<TextView
android:id="@+id/tv_signature_save"
android:layout_width="100dp"
android:layout_height="35dp"
android:layout_alignParentRight="true"
android:layout_marginRight="20dp"
android:background="@drawable/bt_bg"
android:gravity="center"
android:paddingLeft="30dp"
android:paddingRight="30dp"
android:text=" "
android:textColor="@color/white"
android:textSize="@dimen/text_title_word" />
</RelativeLayout>
</LinearLayout>
//서명 시작
private void StartSignature() {
//
DisplayMetrics mDisplayMetrics = new DisplayMetrics();
getWindow().getWindowManager().getDefaultDisplay().getMetrics(mDisplayMetrics);
}
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if(hasFocus&&mPaintView==null){
int screenWidth = mFl_signature.getMeasuredWidth();
int screenHeight = mFl_signature.getMeasuredHeight();
mPaintView=new PaintView(getApplicationContext(),screenWidth, screenHeight);
mFl_signature.addView(mPaintView);
mPaintView.requestFocus();
}
}
//서명 파일 만 들 기
private void createSignFile() {
FileOutputStream fos = null;
File file = null;
try {
path= generateImgePath();
file = new File(path);
fos = new FileOutputStream(file);
//
mPaintBitmap.compress(Bitmap.CompressFormat.JPEG, 100, fos);
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (fos != null) {
fos.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
//다시 서명
if (mPaintView.getPath().isEmpty()){
ToastUtils.showShort(this," ");
}else {
mPaintView.clear();
}
이상 이 바로 본 고의 모든 내용 입 니 다.여러분 의 학습 에 도움 이 되 고 저 희 를 많이 응원 해 주 셨 으 면 좋 겠 습 니 다.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Bitrise에서 배포 어플리케이션 설정 테스트하기이 글은 Bitrise 광고 달력의 23일째 글입니다. 자체 또는 당사 등에서 Bitrise 구축 서비스를 사용합니다. 그나저나 며칠 전 Bitrise User Group Meetup #3에서 아래 슬라이드를 발표했...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.