Jesse's Blog

不管怎样,明天又是全新的一天。

0%

  • html: 文档元数据、内容区域标签、文本内容标签、内联文本语义标签、图片与多媒体标签、表格内容标签、表单标签

  • css: 基本语法、块级/内联元素、图片样式、背景图样式、盒子模型、边框与背景、字体样式、CSS嵌入方式、CSS优先级、定位、浮动、基础选择器、分组选择器、组合选择器、伪类选择器、溢出属性、颜色值标注、em/rem/px单位

CSS

块级/内联元素

https://blog.csdn.net/xuanfuhuo4769/article/details/81326457

块级元素 内联元素
独占一行,默认情况下,其宽度自动填满其父元素宽度 相邻的行内元素会排列在同一行里,直到一行排不下,才会换行,其宽度随元素的内容而变化
可以设置width,height属性 行内元素设置width,height属性无效
可以设置margin和padding属性 行内元素起边距作用的只有margin-left、margin-right、padding-left、padding-right,其它属性不会起边距效果。
对应于display:block 对应于display:inline;
阅读全文 »

容器属性

  • justify-content

    定义了项目在主轴上的对齐方式。

    1
    justify-content: flex-start | flex-end | center |space-between | space-around
  • align-items

    定义项目在交叉轴上如何对齐。

    1
    align-items:flex-start | flex-end | center | baseline | stretch
  • align-content

    定义了多根轴线的对齐方式。如果项目只有一根轴线,该属性不起作用。

    1
    align-content: flex-start | flex-end | center | space-between |space-around | stretch
    阅读全文 »

作用域的种类

Spring 容器在初始化一个 Bean 实例时,同时会指定该实例的作用域。Spring 5 支持以下 6 种作用域。
  • 1)singleton

    默认值,单例模式,表示在 Spring 容器中只有一个 Bean 实例,Bean 以单例的方式存在。

  • 2)prototype

    原型模式,表示每次通过 Spring 容器获取 Bean 时,容器都会创建一个 Bean 实例。

  • 3)request

阅读全文 »

spring 定义

通常情况下,Spring 的配置文件使用 XML 格式。
Spring 配置文件支持两种格式,即 XML 文件格式和 Properties 文件格式。
Properties 配置文件主要以 key-value 键值对的形式存在,只能赋值,不能进行其他操作,适用于简单的属性配置。
XML 配置文件是树形结构,相对于 Properties 文件来说更加灵活。XML 配置文件结构清晰,但是内容比较繁琐,适用于大型复杂的项目。
  • id Bean 的唯一标识符,Spring 容器对 Bean 的配置和管理都通过该属性完成。id 的值必须以字母开始,可以使用字母、数字、下划线等符号。
  • name
阅读全文 »

Spring 内核

  • 控制反转 IoC

    系统的耦合性降低,不用再去创建对象。

  • 面向切面编程 AOP

    AOP 模块:提供了面向切面编程实现,提供比如日志记录、权限控制、性能统计等通用功能和业务逻辑分离的技术,并且能动态的把这些功能添加到需要的代码中,这样各司其职,降低业务逻辑和通用功能的耦合。

阅读全文 »

Multimedia(2):Camera

调用相机

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
public class MainActivity extends AppCompatActivity {

public static final int TAKE_PHOTO = 1;
private ImageView picture;
private Uri imageUri;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button takePhoto = findViewById(R.id.take_photo);
picture = findViewById(R.id.picture);
takePhoto.setOnClickListener(v -> {
//getExternalCacheDir得到缓存目录
File outputImage = new File(getExternalCacheDir(), "output_image.jpg");
try {
if (outputImage.exists()) {
outputImage.delete();
}
outputImage.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
if (Build.VERSION.SDK_INT >= 24) {
//getUriForFile将file对象转换成一个Uri对象
imageUri = FileProvider.getUriForFile(this, "com.example.cameratest.fileprovider", outputImage);
} else {
//Uri标识着真实的路径(不安全)
imageUri = Uri.fromFile(outputImage);
}
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
// Intent intent = new Intent("android.media.ACTION_IMAGE_CAPTURE");
// Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri);//putExtra指定图片输出地址
startActivityForResult(intent, TAKE_PHOTO);
});
}

@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
// Log.e("requestCode", ""+requestCode);
// Log.e("result_ok", ""+ Activity.RESULT_OK);
// Log.e("result_code", ""+resultCode);
switch (requestCode) {
case TAKE_PHOTO:
if (resultCode == RESULT_OK) {
try {
Log.e("tips", "---------------try block-------------------");
Bitmap bitmap = BitmapFactory.decodeStream(getContentResolver().openInputStream(imageUri));//将图片解析成Bitmap对象
picture.setImageBitmap(bitmap);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
break;
default:
break;
}
}
}
阅读全文 »

Multimedia(1): Notification

使用通知

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button sendNotice = findViewById(R.id.send_notice);
Intent intent = new Intent(this, NotificationActivity.class); //启动NotificationActivity的意图
PendingIntent pi = PendingIntent.getActivity(this, 0, intent, 0); //获取PendingIntent实例
sendNotice.setOnClickListener(v ->{
NotificationManager manager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
Notification notification = new NotificationCompat.Builder(this).setContentTitle("Content Title")
.setContentText("Content Text")
.setWhen(System.currentTimeMillis())
.setSmallIcon(R.mipmap.ic_launcher)
.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher))
.setContentIntent(pi)
.setAutoCancel(true)//点击后自动取消通知
.build();
manager.notify(1, notification);
});
}
阅读全文 »