Merge pull request '合并添加图片,画板,改背景' (#8) from develop into master
@ -0,0 +1,46 @@
|
||||
package net.micode.notes.ui;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.ImageButton;
|
||||
|
||||
import net.micode.notes.PaintView;
|
||||
import net.micode.notes.R;
|
||||
|
||||
public class BoardActivity extends Activity {
|
||||
private PaintView paintView;
|
||||
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState); //调用父类的功能
|
||||
this.setContentView(R.layout.activity_paint);
|
||||
//根据id获取添加图片按钮
|
||||
final ImageButton undo = (ImageButton) findViewById(R.id.undo);
|
||||
//为点击图片按钮设置监听器
|
||||
undo.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
paintView.undo();
|
||||
}
|
||||
});
|
||||
|
||||
final ImageButton paint_reset = (ImageButton) findViewById(R.id.paint_reset);
|
||||
//为点击图片按钮设置监听器
|
||||
paint_reset.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
paintView.redo();
|
||||
}
|
||||
});
|
||||
|
||||
final ImageButton paint_delete = (ImageButton) findViewById(R.id.paint_delete);
|
||||
//为点击图片按钮设置监听器
|
||||
paint_delete.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
paintView.removeAllPaint();
|
||||
}
|
||||
});
|
||||
paintView = (PaintView)findViewById(R.id.paint_layout);
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/drawable-hdpi.iml" filepath="$PROJECT_DIR$/.idea/drawable-hdpi.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
Before Width: | Height: | Size: 771 KiB After Width: | Height: | Size: 179 KiB |
Before Width: | Height: | Size: 121 KiB After Width: | Height: | Size: 242 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 5.6 KiB |
After Width: | Height: | Size: 5.3 KiB |
After Width: | Height: | Size: 5.6 KiB |
After Width: | Height: | Size: 5.9 KiB |
@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
>
|
||||
|
||||
<net.micode.notes.PaintView
|
||||
android:id="@+id/paint_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"></net.micode.notes.PaintView>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/paint_reset"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="240dp"
|
||||
android:layout_marginTop="0dp"
|
||||
android:layout_marginBottom="0dp"
|
||||
android:src="@drawable/paint_reset" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/paint_clor"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="80dp"
|
||||
android:layout_marginTop="0dp"
|
||||
android:layout_marginBottom="0dp"
|
||||
android:src="@drawable/paint_clor" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/paint"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="0dp"
|
||||
android:layout_marginTop="0dp"
|
||||
android:layout_marginBottom="0dp"
|
||||
android:src="@drawable/paint" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/paint_delete"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="320dp"
|
||||
android:layout_marginTop="0dp"
|
||||
android:layout_marginBottom="0dp"
|
||||
android:src="@drawable/paint_delete" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/undo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="160dp"
|
||||
android:layout_marginTop="0dp"
|
||||
android:layout_marginBottom="0dp"
|
||||
android:src="@drawable/undo" />
|
||||
|
||||
</RelativeLayout>
|
@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<item name="menu_young" type="id">menu_young</item>
|
||||
</resources>
|