master
parent
e990592579
commit
533cb5aeed
Binary file not shown.
Binary file not shown.
@ -0,0 +1,27 @@
|
|||||||
|
<?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"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:padding="20dp"
|
||||||
|
tools:context=".add">
|
||||||
|
|
||||||
|
|
||||||
|
<EditText xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:id="@+id/mt"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="请输入要发布的公告内容"
|
||||||
|
android:imeOptions="actionDone"
|
||||||
|
android:inputType="textPassword"
|
||||||
|
android:maxLines="5"
|
||||||
|
android:textSize="20sp" />
|
||||||
|
<Button
|
||||||
|
android:id="@+id/conf"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:text="确定" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
@ -0,0 +1,38 @@
|
|||||||
|
package com.example.hamburger;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.EditText;
|
||||||
|
|
||||||
|
import com.example.hamburger.R;
|
||||||
|
import com.example.hamburger.notifications;
|
||||||
|
import com.example.hamburger.ui.notifications.NotificationsFragment;
|
||||||
|
|
||||||
|
public class add extends AppCompatActivity {
|
||||||
|
|
||||||
|
EditText mytext;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_add);
|
||||||
|
mytext = findViewById(R.id.mt);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Confirm() {
|
||||||
|
Button button = (Button) findViewById(R.id.conf);
|
||||||
|
|
||||||
|
button.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
Intent intent = new Intent();
|
||||||
|
intent.setClass(add.this, NotificationsFragment.class);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
package com.example.hamburger;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
public class notifications extends AppCompatActivity {
|
||||||
|
|
||||||
|
private TextView tv;
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.fragment_notifications);
|
||||||
|
|
||||||
|
Button button = (Button) findViewById(R.id.btn1);
|
||||||
|
button.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
Intent intent = new Intent();
|
||||||
|
intent.setClass(notifications.this, add.class);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in new issue