From b9d2f00161bac2e945eb089740dbbdd83b78693a Mon Sep 17 00:00:00 2001 From: MiaoZhangLotusflare <116794578+MiaoZhangLotusflare@users.noreply.github.com> Date: Sun, 1 Jan 2023 19:48:59 +0800 Subject: [PATCH 01/50] update plan --- .../2022\345\271\264\350\256\241\345\210\222.md" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/plan/\350\256\241\345\210\222/2022\345\271\264\350\256\241\345\210\222.md" "b/plan/\350\256\241\345\210\222/2022\345\271\264\350\256\241\345\210\222.md" index cdb89d3..5e12419 100644 --- "a/plan/\350\256\241\345\210\222/2022\345\271\264\350\256\241\345\210\222.md" +++ "b/plan/\350\256\241\345\210\222/2022\345\271\264\350\256\241\345\210\222.md" @@ -7,7 +7,7 @@ ``` * 视频 * 码牛-移动互联网高级开发正式课视频-音视频 - * Jetpack 动脑学院视频 https://www.bilibili.com/video/BV1Ry4y1t7Tj/?spm_id_from=333.999.0.0&vd_source=cd375d3428e3e8f7707053e56d4a5a58 + * Jetpack 动脑学院视频 https://www.bilibili.com/video/BV1Ry4y1t7Tj/?spm_id_from=333.999.0.0&vd_source=cd375d3428e3e8f7707053e56d4a5a58 - 完成 * 书籍 * 《Android 进阶之光》 ``` From 663436f25a790abe6e2cf2e4e1893bd7525c0f2e Mon Sep 17 00:00:00 2001 From: MiaoZhangLotusflare <116794578+MiaoZhangLotusflare@users.noreply.github.com> Date: Tue, 3 Jan 2023 16:44:24 +0800 Subject: [PATCH 02/50] update readme --- "Android/\351\237\263\350\247\206\351\242\221/README.md" | 4 ++++ Jetpack/compose/README.md | 4 ++++ flutter/README.md | 8 +++++++- .../2023\345\271\264\350\256\241\345\210\222.md" | 4 +--- "\345\260\217\347\250\213\345\272\217/README.md" | 5 +++++ 5 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 Jetpack/compose/README.md create mode 100644 "\345\260\217\347\250\213\345\272\217/README.md" diff --git "a/Android/\351\237\263\350\247\206\351\242\221/README.md" "b/Android/\351\237\263\350\247\206\351\242\221/README.md" index e22ca1f..542248d 100644 --- "a/Android/\351\237\263\350\247\206\351\242\221/README.md" +++ "b/Android/\351\237\263\350\247\206\351\242\221/README.md" @@ -1,5 +1,9 @@ # 音视频 +1.1.mac 账号:1006299425 密码:181501,播放器下载地址:http://www.drmsoft.net/playernet/down.asp + +1.2.链接:https://pan.baidu.com/s/1eN2BdtnwW17VTu4e7EXT0A?pwd=d0sx 提取码:d0sx + ## C 语言基础 ### C 语言初探 diff --git a/Jetpack/compose/README.md b/Jetpack/compose/README.md new file mode 100644 index 0000000..555af3b --- /dev/null +++ b/Jetpack/compose/README.md @@ -0,0 +1,4 @@ +# Compose + +* 布局 + * https://loac.cc/archives/jetpackcompose Jetpack Compose:线性布局与帧布局 diff --git a/flutter/README.md b/flutter/README.md index 30b7a0e..8275d1d 100644 --- a/flutter/README.md +++ b/flutter/README.md @@ -29,4 +29,10 @@ ## 资料收集 -1. [《Flutter实战·第二版》](https://book.flutterchina.club/) \ No newline at end of file +1. [《Flutter实战·第二版》](https://book.flutterchina.club/) +1. Flutter中文网 https://flutterchina.club/ +1. https://github.com/AweiLoveAndroid/Flutter-learning Flutter-learning +1. https://zhuanlan.zhihu.com/flutter flutter 学习指南 +1. https://flutter.cn/docs 官方文档 +1. http://www.flutterj.com/ flutter 教程网 +1. 视频 https://www.bilibili.com/video/BV1S4411E7LY?p=1 \ No newline at end of file diff --git "a/plan/\350\256\241\345\210\222/2023\345\271\264\350\256\241\345\210\222.md" "b/plan/\350\256\241\345\210\222/2023\345\271\264\350\256\241\345\210\222.md" index 1813271..9d820b2 100644 --- "a/plan/\350\256\241\345\210\222/2023\345\271\264\350\256\241\345\210\222.md" +++ "b/plan/\350\256\241\345\210\222/2023\345\271\264\350\256\241\345\210\222.md" @@ -28,9 +28,7 @@ https://www.bilibili.com/video/BV1uo4y1y7ZF/?spm_id_from=333.999.0.0&vd_source=c #### 实施 -* 202201 - 动脑学院 kotlin 视频学习 70/148,完成 47% -* 202202 - 动脑学院 kotlin 视频学习 141/148,完成 95% -* 202204 - 动脑学院 kotlin 视频学习 148/148,完成 100% +* ### 1.3. Jetpack diff --git "a/\345\260\217\347\250\213\345\272\217/README.md" "b/\345\260\217\347\250\213\345\272\217/README.md" new file mode 100644 index 0000000..335d4d2 --- /dev/null +++ "b/\345\260\217\347\250\213\345\272\217/README.md" @@ -0,0 +1,5 @@ +# 小程序 + +## 资料收集 + +1. https://cloud.tencent.com/edu/paths/series/applet \ No newline at end of file From 6867a3f763c82d9a3eee738929eb39337d33abc1 Mon Sep 17 00:00:00 2001 From: MiaoZhangLotusflare <116794578+MiaoZhangLotusflare@users.noreply.github.com> Date: Tue, 14 Feb 2023 10:12:41 +0800 Subject: [PATCH 03/50] =?UTF-8?q?2023=E8=AE=A1=E5=88=921=E6=9C=88=E5=AE=9E?= =?UTF-8?q?=E6=96=BD=E6=83=85=E5=86=B5=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2023\345\271\264\350\256\241\345\210\222.md" | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git "a/plan/\350\256\241\345\210\222/2023\345\271\264\350\256\241\345\210\222.md" "b/plan/\350\256\241\345\210\222/2023\345\271\264\350\256\241\345\210\222.md" index 9d820b2..e0335c9 100644 --- "a/plan/\350\256\241\345\210\222/2023\345\271\264\350\256\241\345\210\222.md" +++ "b/plan/\350\256\241\345\210\222/2023\345\271\264\350\256\241\345\210\222.md" @@ -85,7 +85,7 @@ https://www.bilibili.com/video/BV1uo4y1y7ZF/?spm_id_from=333.999.0.0&vd_source=c #### 实施 -* +* 202301 - 8 次 ### 2.2. 绘画 @@ -96,7 +96,7 @@ https://www.bilibili.com/video/BV1uo4y1y7ZF/?spm_id_from=333.999.0.0&vd_source=c #### 实施 -* +* 202301 - 7 张 ### 2.3. 尤克里里 @@ -106,7 +106,7 @@ https://www.bilibili.com/video/BV1uo4y1y7ZF/?spm_id_from=333.999.0.0&vd_source=c #### 实施 -* +* 202301 - 1 次 @@ -116,3 +116,5 @@ https://www.bilibili.com/video/BV1uo4y1y7ZF/?spm_id_from=333.999.0.0&vd_source=c *《微习惯》 ``` +* 202301 - 电影《满江红》 +* 202301 - 电视剧《孤独又璀璨的神 - 鬼怪》 From 6f94e0b5d13debb2af77ae5c9f93306c31a120c3 Mon Sep 17 00:00:00 2001 From: MiaoZhangLotusflare <116794578+MiaoZhangLotusflare@users.noreply.github.com> Date: Tue, 28 Feb 2023 17:19:48 +0800 Subject: [PATCH 04/50] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=94=99=E5=88=AB?= =?UTF-8?q?=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\260\217\346\233\277\346\215\242\345\216\237\345\210\231.md" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/BookNote/\350\256\276\350\256\241\346\250\241\345\274\217\344\271\213\347\246\205/\347\254\2542\347\253\240-\351\207\214\346\260\217\346\233\277\346\215\242\345\216\237\345\210\231.md" "b/BookNote/\350\256\276\350\256\241\346\250\241\345\274\217\344\271\213\347\246\205/\347\254\2542\347\253\240-\351\207\214\346\260\217\346\233\277\346\215\242\345\216\237\345\210\231.md" index 8e81ff0..26ad0d5 100644 --- "a/BookNote/\350\256\276\350\256\241\346\250\241\345\274\217\344\271\213\347\246\205/\347\254\2542\347\253\240-\351\207\214\346\260\217\346\233\277\346\215\242\345\216\237\345\210\231.md" +++ "b/BookNote/\350\256\276\350\256\241\346\250\241\345\274\217\344\271\213\347\246\205/\347\254\2542\347\253\240-\351\207\214\346\260\217\346\233\277\346\215\242\345\216\237\345\210\231.md" @@ -38,7 +38,7 @@ 3. 覆盖或实现父类的方法时输入参数可以被放大 -  里氏替换原则要求指定一个契约,就是制定好双方的开发协议,然后再各自实现,也就是父类或接口,这种设计放啊也叫做 Design by Contract (契约设计)。契约制定了,也就同时制定了前置条件和后置条件,前置条件就是你要我执行,就必须满足我的条件;后置条件就是我执行完了需要反馈,标准是什么。 +  里氏替换原则要求指定一个契约,就是制定好双方的开发协议,然后再各自实现,也就是父类或接口,这种设计方法也叫做 Design by Contract (契约设计)。契约制定了,也就同时制定了前置条件和后置条件,前置条件就是你要我执行,就必须满足我的条件;后置条件就是我执行完了需要反馈,标准是什么。   方法中的输入参数成为前置条件。 From bb722c37f341fca2650fffd5906fd656db490e8b Mon Sep 17 00:00:00 2001 From: MiaoZhangLotusflare <116794578+MiaoZhangLotusflare@users.noreply.github.com> Date: Tue, 28 Feb 2023 17:20:08 +0800 Subject: [PATCH 05/50] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...OkHttp\345\237\272\347\241\200\347\237\245\350\257\206.md" | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git "a/OpenSourceLibrary/OkHttp/OkHttp\345\237\272\347\241\200\347\237\245\350\257\206.md" "b/OpenSourceLibrary/OkHttp/OkHttp\345\237\272\347\241\200\347\237\245\350\257\206.md" index ff53470..81201aa 100644 --- "a/OpenSourceLibrary/OkHttp/OkHttp\345\237\272\347\241\200\347\237\245\350\257\206.md" +++ "b/OpenSourceLibrary/OkHttp/OkHttp\345\237\272\347\241\200\347\237\245\350\257\206.md" @@ -112,6 +112,6 @@ call.enqueue(new Callback() ## 3. 参考文章 -[Android OkHttp完全解析 是时候来了解OkHttp了](https://blog.csdn.net/lmj623565791/article/details/47911083) +1. [Android OkHttp完全解析 是时候来了解OkHttp了](https://blog.csdn.net/lmj623565791/article/details/47911083) -[OkHttp深入分析——基础认知部分](https://www.jianshu.com/p/b38bd9d1ae76) \ No newline at end of file +2. [OkHttp深入分析——基础认知部分](https://www.jianshu.com/p/b38bd9d1ae76) \ No newline at end of file From 1900d43fa1d32f334ab600d360e51550649e28fd Mon Sep 17 00:00:00 2001 From: MiaoZhangLotusflare <116794578+MiaoZhangLotusflare@users.noreply.github.com> Date: Thu, 23 Mar 2023 15:25:11 +0800 Subject: [PATCH 06/50] =?UTF-8?q?navigation=E4=B9=8Bdeeplink?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Android/view/view/README.md | 8 +- .../Navigation\344\271\213DeepLink.md" | 315 ++++++++++++++++++ Jetpack/navigation/README.md | 7 +- 3 files changed, 327 insertions(+), 3 deletions(-) create mode 100644 "Jetpack/navigation/Navigation\344\271\213DeepLink.md" diff --git a/Android/view/view/README.md b/Android/view/view/README.md index ab325c7..4f90b9f 100644 --- a/Android/view/view/README.md +++ b/Android/view/view/README.md @@ -2,4 +2,10 @@ ## Snackbars -* [Snackbars 常见问题] \ No newline at end of file +* [Snackbars 常见问题] + + + +## 知识收集 + +* https://www.jianshu.com/p/9a7e518bfbea 关于TextView autolink的点击拦截和字体样式更改问题 \ No newline at end of file diff --git "a/Jetpack/navigation/Navigation\344\271\213DeepLink.md" "b/Jetpack/navigation/Navigation\344\271\213DeepLink.md" new file mode 100644 index 0000000..dba123c --- /dev/null +++ "b/Jetpack/navigation/Navigation\344\271\213DeepLink.md" @@ -0,0 +1,315 @@ +# Navigation 之 DeepLink + +Navigation 中的 DeepLink 又叫做深层链接。在 Android 中,深层链接是指:将用户直接转到应用内特定目的地的链接。 + +在日常生活中很容易看到的应用:微信消息通知,点击后直接进入某人或者群聊的界面。借助 Navigation 组件可以比较轻松的完成这个效果。在 Navigation 组件中根据其使用方式的不同,可以分为两种不同类型的深层链接:显式深层链接和隐式深层链接。其分类如下面表格所示: + +| 深层链接 | 说明 | +| ------------ | ------------------------------------------------------------ | +| 显式深层链接 | 使用 PendingIntent 将用户转到应用内的特定位置。 | +| 隐式深层链接 | 通过 URI、intent 操作和 MIME 类型匹配深层链接。可以为单个深层链接指定多个匹配类型,但请注意,匹配的优先顺序依次是 URI 参数、intent 操作和 MIME 类型。 | + +从上面的表格中不难看出,深层链接类似于 Activity 的显式和隐式跳转逻辑。 + +## 1. 显式深层链接 + +### 1.1. 环境 + +首先还是引入 navigation、viewmodel 和 live data 的依赖: + +```groovy +// navigation +def nav_version = "2.4.2" +implementation("androidx.navigation:navigation-fragment-ktx:$nav_version") +implementation("androidx.navigation:navigation-ui-ktx:$nav_version") + +// https://mvnrepository.com/ +implementation 'androidx.lifecycle:lifecycle-viewmodel:2.3.1' +implementation 'androidx.lifecycle:lifecycle-livedata:2.3.1' +``` + +对应的,在 res 目录下,创建一个 navigation 类型的 xml 配置文件(nav_graph.xml)。然后添加 AFragment、BFragment、CFragment 三个页面,并配置在 nav_graph.xml 中的行为动作为: + +![在这里插入图片描述](https://img-blog.csdnimg.cn/5728e408bbb744d481b9b28b5cfea20d.png) + +然后,添加返回按钮的支持。即在 MainActivity 的 xml 布局文件中添加: + +```xml +app:defaultNavHost="true" +``` + +然后在 Activity 中通过 NavigationUI 配置显式,最后重写 onSupportNavigationUp 方法。 + +```kotlin + ... + navController = this.findNavController(R.id.fragmentContainerView) + NavigationUI.setupActionBarWithNavController(this, navController) +} + +override fun onSupportNavigateUp(): Boolean { + return navController.navigateUp() || super.onSupportNavigateUp() +} +``` + +然后对应的为每个 Fragment 的 TextView 添加到下个页面的点击事件。类似于这种: + +```kotlin +override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + view.findViewById(R.id.a_fargment_textview).setOnClickListener { + Navigation.findNavController(view) + .navigate(R.id.action_AFragment_to_BFragment) + } +} +``` + +至此,环境配置完成。 + +### 1.2. 使用 DeepLink + +上面的环境配置完毕后,可以达到的效果为 AFragment 点击文本后可以进入 BFragment,点击文本后进入 CF ragment。 + +显式深层链接是深层链接的一个实例,该实例使用 PendingIntent 将用户转到应用内的特定位置。所以这里需要构建 PendingIntent 对象。注意到创建深层链接有两种方式: + +* 使用 NavController.createDeepLink() 创建深层链接。 +* 使用 NavDeepLinkBuilder 类构造深层链接。 + +#### 1.2.1. NavController.createDeepLink() + +通过 NavController 实例对象来创建一个 DeepLink,进而可以得到 PendingIntent 对象。 + +```kotlin +// 设置PendingIntent +val pendingIntent: PendingIntent = this.findNavController().createDeepLink() + .setGraph(R.navigation.nav_graph) // 指定导航图 + .setDestination(R.id.CFragment) // 去往CFragment + .setComponentName(MainActivity::class.java) // 指定Fragment所在的Activity + .setArguments(Bundle().apply { // 传递参数 + putString("Key", "Value") + }) + .createPendingIntent() + +``` + +#### 1.2.2. NavDeepLinkBuilder(context) + +```kotlin +// 设置PendingIntent +val pendingIntent: PendingIntent = NavDeepLinkBuilder(requireContext()) + .addDestination(R.id.CFragment, Bundle().apply { // 传递参数 + putString("Key", "Value") + }) + .setGraph(R.navigation.nav_graph) // 指定导航图 + .setComponentName(MainActivity::class.java) // 指定Fragment所在的Activity + .createPendingIntent() +``` + +#### 1.2.3. 完整案例 + +在 AFragment 中点击按钮创建一个通知,然后在通知中使用 DeepLink: + +```kotlin +class AFragment : Fragment() { + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + return inflater.inflate(R.layout.fragment_a, container, false) + } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + view.findViewById(R.id.a_fargment_textview).setOnClickListener { + Navigation.findNavController(view) + .navigate(R.id.action_AFragment_to_BFragment) + } + // 使用参数 + if(arguments != null) { + Log.e("TAG", "onViewCreated: ${ requireArguments().getString("Key") }", ) + } + + view.findViewById