parent
ddf89e35da
commit
6a4f80f8e6
Binary file not shown.
@ -0,0 +1,65 @@
|
||||
package com.diary.showme.diary.ui;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.os.Environment;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.diary.showme.Course.AddCourseActivity;
|
||||
import com.diary.showme.Course.Course;
|
||||
import com.diary.showme.Course.CourseActivity;
|
||||
import com.diary.showme.R;
|
||||
|
||||
|
||||
public class CardActivity extends AppCompatActivity {
|
||||
|
||||
private Button card1;
|
||||
|
||||
private Button card2;
|
||||
|
||||
private Button card3;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.card);
|
||||
|
||||
card1 = findViewById(R.id.card1);
|
||||
card2 = findViewById(R.id.card2);
|
||||
card3 = findViewById(R.id.card3);
|
||||
card1.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
startActivityForResult(new Intent(CardActivity.this, AddDiaryActivity.class), 0);
|
||||
}
|
||||
});
|
||||
card2.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
startActivityForResult(new Intent(CardActivity.this, AddDiaryActivity.class), 0);
|
||||
}
|
||||
});
|
||||
card3.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
startActivityForResult(new Intent(CardActivity.this, AddDiaryActivity.class), 0);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void startActivity(Context context) {
|
||||
Intent intent = new Intent(context, CardActivity.class);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<Button
|
||||
android:id="@+id/card1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="#A4CF2626"
|
||||
android:text="今天有遇到什么开心的事情吗?"
|
||||
/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/card2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="#77CFAE34"
|
||||
android:text="今天天气如何?"
|
||||
/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/card3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="#8A6ECA34"
|
||||
android:text="今天有没有做一件有意义的事?"
|
||||
/>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue