Skip to content

Commit

Permalink
hzuapps#7 hzuapps#1702 实验七代码
Browse files Browse the repository at this point in the history
  • Loading branch information
HxKillua committed May 4, 2019
1 parent 059f4aa commit 8fe4efd
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 7 deletions.
4 changes: 4 additions & 0 deletions students/com1714080901120/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
android:supportsRtl="true"
android:theme="@style/AppTheme">

<activity
android:name=".Com1714080901120Activity3"
android:label="@string/camera"
android:theme="@style/AppTheme.NoActionBar"></activity>
<activity
android:name=".Com1714080901120Activity2"
android:label="@string/file_save"></activity>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.com_1714080901120_activity);
linear = findViewById(R.id.linear);
changeText = findViewById(R.id.text_background);
b = findViewById(R.id.createButton);
b = findViewById(R.id.createButton2);
b.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Com1714080901120Activity.this, Com1714080901120Activity2.class);
Intent intent = new Intent(Com1714080901120Activity.this, Com1714080901120Activity3.class);
startActivity(intent);
}
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package edu.hzuapps.androidlabs.com1714080901120;

import android.content.Intent;
import android.os.Bundle;
import android.provider.MediaStore;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

public class Com1714080901120Activity3 extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.com_1714080901120_activity3); }
public void startCamera(View view){
Intent intent=new Intent(MediaStore.ACTION_IMAGE_CAPTURE );
startActivity(intent);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
android:text="@string/file_save"
android:textSize="20sp" />

<Button
android:id="@+id/createButton2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/camera"
android:textSize="20sp" />

<TextView
android:id="@+id/text_background"
Expand All @@ -44,7 +50,7 @@
android:layout_alignBottom="@+id/createButton"
android:layout_centerInParent="true"
android:layout_toRightOf="@+id/createButton"
android:text="@string/bg_change"
android:text="@string/text_change"
android:textColor="@color/colorPrimary"
android:textSize="15sp" />

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="edu.hzuapps.androidlabs.com1714080901120.Com1714080901120Activity3"
>

<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="startCamera"
android:text="camera"/>
</LinearLayout>
7 changes: 3 additions & 4 deletions students/com1714080901120/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

<resources>
<string name="app_name">生日管家</string>
<string name="bg_change">更换背景</string>
<string name="file_save">生日存储</string>
<string name="text_change">更改背景图片</string>
<string name="file_save">生日存储 </string>
<string name="camera">拍摄手写卡片祝福</string>
</resources>

0 comments on commit 8fe4efd

Please sign in to comment.