Add Snackbar
This commit is contained in:
@ -2,6 +2,7 @@ package me.jj97181818.ch07_datetimepicker;
|
||||
|
||||
import android.app.DatePickerDialog;
|
||||
import android.app.TimePickerDialog;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
@ -51,8 +52,10 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
|
||||
else
|
||||
txDate.setText("日期:" + year + "/" + (month + 1) + "/" + dayOfMonth);
|
||||
|
||||
tos.setText("owo");
|
||||
tos.setText("我是一片吐司~~~");
|
||||
tos.show();
|
||||
|
||||
Snackbar.make(findViewById(R.id.root), "日期:" + year + "/" + (month + 1) + "/" + dayOfMonth, Snackbar.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -2,6 +2,7 @@
|
||||
<android.support.constraint.ConstraintLayout 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:id="@+id/root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".MainActivity">
|
||||
|
Reference in New Issue
Block a user