Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#7#1703实验七代码 #1704

Merged
merged 1 commit into from
Apr 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions students/com1712070504104/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,34 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="edu.hzuapps.androidlabs.com1712070504104">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name="edu.hzuapps.androidlabs.com1712070504104.Com1712070504104Activity2"
android:label="@string/filesave">
</activity>
<activity android:name="edu.hzuapps.androidlabs.com1712070504104.Com1712070504104Activity">
<activity
android:name=".Com1712070504104Activity3"
android:label="@string/camera"
android:theme="@style/AppTheme.NoActionBar"></activity>
<activity
android:name=".Com1712070504104Activity2"
android:label="@string/file_save"></activity>
<activity android:name=".Com1712070504104Activity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class Com1712070504104Activity extends AppCompatActivity {
private LinearLayout linear;
private TextView changeText;
private Button b;
private String url_image="http://cms-bucket.nosdn.127.net/a2482c0b2b984dc88a479e6b7438da6020161219074944.jpeg";
private String url_image="https://ss0.bdstatic.com/94oJfD_bAAcT8t7mm9GUKT-xh_/timg?image&quality=100&size=b4000_4000&sec=1555679919&di=1245c0e9ffc7b91abeffa4d9f4b90b1a&src=http://b-ssl.duitang.com/uploads/item/201807/01/20180701121509_luutw.jpg";
private Handler handler=new Handler()
{
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
Expand All @@ -42,14 +42,15 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.com_1712070504104_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(Com1712070504104Activity.this,Com1712070504104Activity2.class);
Intent intent = new Intent(Com1712070504104Activity.this,Com1712070504104Activity3.class);
startActivity(intent);
}
});

changeText.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package edu.hzuapps.androidlabs.com1712070504104;

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

public class Com1712070504104Activity3 extends AppCompatActivity {



@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.com_1712070504104_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 @@ -31,7 +31,14 @@
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerInParent="true"
android:text="@string/filesave"
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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

<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.com1712070504104.Com1712070504104Activity3">

<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="startCamera"
android:text="camera"/>
</LinearLayout>

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<resources>
<string name="app_name">生日管家</string>
<string name="text_change">更改背景图片</string>
<string name="filesave">生日存储 </string>
<string name="file_save">生日存储 </string>
<string name="camera">拍摄手写卡片祝福</string>
</resources>