主页

编写规范

创建文章 发表一篇文章,只需要在 /_posts 文件夹中新建一个md文件,文件命名很重要,遵循给以下格式 年-月-日-标题.md 内容相关 所有博客文章顶部必须有一段 YAML 头信息(YAML front-matter)。 为了提高文章的阅读和书写体验,TeXt 在 Markdown 原有的基础上做了一些增强。 --- layout: article title: Document - Writing Posts mathjax: true title: 编写规范 tags: TeXt --- 在 --- 之间你可以设置属性的值,可以把它...

阅读更多

android 通知

NotificationManager manager=(NotificationManager)getSystemService(NOTIFICATION_SERVICE); String id="channel_1"; String name=getString(R.string.app_name); NotificationChannel notificationChannel=new NotificationChannel(id,name,NotificationManager .IMPORTANCE_HIGH); ...

阅读更多

android 补间动画

android 补间动画 study drom https://www.jianshu.com/p/c0ad225a30c0?tdsourcetag=s_pctim_aiomsg view动画方是由一个参数到另一个参数,在一定时间内的转变,可以理解为pr中的两个关键帧 平移动画 缩放动画 选中动画 透明度动画 通过xml设置属性,在主方法中引用 src下新增一个anim文件夹 ,在其中新建一个头文件是set的xml文件 在其中设置一系列参数 , ​ 根据动画类型可以自己设置to from ​ android:duration=”2000” //持续时间 ​ android:fillAfte...

阅读更多

参数笔记

Android 学习笔记 day 3 month 3 year 2020 在线性布局中靠右靠右可以通过添加空白布局完成,权重高 让textview文字长度可长于显示范围:android:singleLine=”true”现在已经废弃,使用android:lines=”1” lines设置字能显示几行 控制文字过长时候如何显示android:ellipsize=”参数””start”—–省略号显示在开头;”end”——省略号显示在结尾;”middle”—-省略号显示在中间;”marquee” ——以跑马灯的方式显示(动画横向移动) android:marqueeRepeatLimit=”marquee_f...

阅读更多

android使用Notify的一些笔记

首先一个很重要的一点,google在Android8以后加入了通知渠道功能,可以方便用户更好的管控通知类型。 带NotificationChannel的使用方法如下 //拿到NotificationManager对象,因为是在fragment中写的需要getContext, //拿到的对象需要强转成NotificationManager mNotificationManager = (NotificationManager) getContext().getSystemService(Context.NOTIFICATION_SERVICE); //创建通知渠道对象 1:通知id ...

阅读更多

SharedPreference

SharedPreference 写入 //可以创建一个新的SharedPreference来对储存的文件进行操作 SharedPreferences sp=context.getSharedPreferences("名称", Context.MODE_PRIVATE); //像SharedPreference中写入数据需要使用Editor SharedPreference.Editor editor = sp.edit(); //类似键值对 editor.putString("name", "string"); editor.putInt("age", 0); editor.putBoolean("read", true); //editor.apply(); editor.co...

阅读更多

Adapter的使用

Adapter的使用 适配器在Android编程中经常用到,我记录以下我学习BaseAdapter的过程 BaseAdapter 创建三个java类,一个是主要的活动类,一个是数据类,一个是适配器类 数据类中需要填入所需的变量 package com.phc.a1801_penghaicen_listview; /** * @author PengHaiChen */ //该类代表人员信息 public class Person { int image; String name; String sex; String class_; String classRome; public voi...

阅读更多

view通过sqlite进行数据填充

view通过sqlite进行数据填充 这次的项目主要是有适配器和数据库和listview操作。 项目中需要注意的地方有listview的长按操作,不能与点击操作搞混,还有上下文菜单的重写需要写在主方法的外边,如果listview的 item中有butoon,可能会覆盖点击操作,这个需要注意 充分运用dialog界面来进行信息收集 源码界面 主界面 package com.phc.a2020_03_22; import androidx.annotation.NonNull; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; imp...

阅读更多