diff --git a/app/src/main/java/edu/hzuapps/androidworks/homeworks/net1314080903148/Net1314080903148MainActivity.java b/app/src/main/java/edu/hzuapps/androidworks/homeworks/net1314080903148/Net1314080903148MainActivity.java index 4542184c..b8187b7a 100644 --- a/app/src/main/java/edu/hzuapps/androidworks/homeworks/net1314080903148/Net1314080903148MainActivity.java +++ b/app/src/main/java/edu/hzuapps/androidworks/homeworks/net1314080903148/Net1314080903148MainActivity.java @@ -1,12 +1,11 @@ -package net1314080903148.homeworks.androidworks.hzuapps.edu.net1314080903148; +package edu.hzuapps.androidworks.homeworks.net1314080903148; -import android.support.v7.app.AppCompatActivity; -import android.os.Bundle; import android.hardware.SensorListener; import android.hardware.SensorManager; +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; import android.view.Menu; -import net1314080903148.homeworks.androidworks.hzuapps.edu.net1314080903148.R; @SuppressWarnings("deprecation") @@ -138,7 +137,6 @@ public void onSensorChanged(int sensor, float[] values) { mv.postInvalidate();//重绘MainView } } //传感器监听器类 - }; @Override diff --git a/app/src/main/java/edu/hzuapps/androidworks/homeworks/net1314080903148/Net1314080903148MainView.java b/app/src/main/java/edu/hzuapps/androidworks/homeworks/net1314080903148/Net1314080903148MainView.java index f7abf0a8..af34669a 100644 --- a/app/src/main/java/edu/hzuapps/androidworks/homeworks/net1314080903148/Net1314080903148MainView.java +++ b/app/src/main/java/edu/hzuapps/androidworks/homeworks/net1314080903148/Net1314080903148MainView.java @@ -1,7 +1,7 @@ -package net1314080903148.homeworks.androidworks.hzuapps.edu.net1314080903148; +package edu.hzuapps.androidworks.homeworks.net1314080903148; /** - * Created by zhuoxw on 2016/5/12. + * Created by zhuo on 2016/5/12. */ import android.content.Context; @@ -15,11 +15,10 @@ import android.util.AttributeSet; import android.view.View; -import net1314080903148.homeworks.androidworks.hzuapps.edu.net1314080903148.R; - public class Net1314080903148MainView extends View { + Paint paint = new Paint(); //画笔 - Bitmap shangBitmap1; //上面的大矩形 + Bitmap shangBitmap1; //上面的大矩形图 Bitmap shangBitmap2; //上面的气泡 Bitmap zuoBitmap1; //左面的大矩形图 Bitmap zuoBitmap2; //左面图的气泡 @@ -82,7 +81,6 @@ protected void onDraw(Canvas canvas){//重写的绘制方法 paint.setColor(Color.BLUE); //设置画笔颜色 paint.setStyle(Style.STROKE); //设置画笔为不填充 - //画背景矩形 canvas.drawBitmap(shangBitmap1, shang1_X,shang1_Y, paint); //上 canvas.drawBitmap(zuoBitmap1, zuo1_X,zuo1_Y, paint); //左 diff --git a/app/src/main/res/layout/activity_net1314080903148_main.xml b/app/src/main/res/layout/activity_net1314080903148_main.xml index 7ad6f1ac..80b4d9d3 100644 --- a/app/src/main/res/layout/activity_net1314080903148_main.xml +++ b/app/src/main/res/layout/activity_net1314080903148_main.xml @@ -7,9 +7,9 @@ android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" - tools:context="net1314080903148.homeworks.androidworks.hzuapps.edu.net1314080903148.Net1314080903148MainActivity"> + tools:context="edu.hzuapps.androidworks.homeworks.net1314080903148.Net1314080903148MainActivity"> - - + +