This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Dagger2_basic_guide_line_part1 | |
/** | |
* author: jixiaoyong | |
* email: jixiaoyong1995@gmail.com | |
* website: https://jixiaoyong.github.io | |
* date: 2019/1/25 | |
* description: 介绍了Dagger 2 中的 @Inject 和 @Component 的使用 | |
*/ | |
class Service @Inject constructor() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Dagger2_basic_guide_line_part2 | |
/** | |
* author: jixiaoyong | |
* email: jixiaoyong1995@gmail.com | |
* website: https://jixiaoyong.github.io | |
* date: 2019/1/26 | |
* description: 介绍了Dagger 2 中的 @Inject 、 @Component | |
@Module 和 @Provides 的使用 | |
当 @Component 在搜索Service的构造方法时,会先从 @Module 中搜索; | |
如果搜索不到再到 @Inject 修饰的类中查找。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Dagger2_basic_guide_line_part3 | |
/** | |
* author: jixiaoyong | |
* email: jixiaoyong1995@gmail.com | |
* website: https://jixiaoyong.github.io | |
* date: 2019/1/26 | |
* description: 介绍了Dagger 2 中的 @Inject 、 @Component 、 | |
@Module 、 @Provides 、@Named 和 @Qualifier 的使用 | |
并且实现了自己的注解 @Choose 支持有多个构造函数的Service类 | |
这一点可以从 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* author: jixiaoyong | |
* email: jixiaoyong1995@gmail.com | |
* website: https://jixiaoyong.github.io | |
* date: 2019/1/27 | |
* description: todo | |
*/ | |
class MainApplication : HasActivityInjector, Application() { | |
override fun onCreate() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* author: jixiaoyong | |
* email: jixiaoyong1995@gmail.com | |
* website: https://jixiaoyong.github.io | |
* date: 2019/1/27 | |
* description: todo | |
*/ | |
class MainApplication : HasActivityInjector, Application() { | |
override fun onCreate() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* author: jixiaoyong | |
* email: jixiaoyong1995@gmail.com | |
* website: https://jixiaoyong.github.io | |
* date: 2019/1/27 | |
* description: 这里演示的是将Fragment加入到AppComponent中; | |
将将Fragment加入到Activity中Dagger2官方文档有,不再赘述 | |
详见:https://google.github.io/dagger/android | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (C) 2017 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.github.jixiaoyong.sample; | |
/** | |
* Created by jixiaoyong1995@gmail.com | |
* Data: 2019/4/22. | |
* Description:拷贝自 https://sharewind.iteye.com/blog/1582869 | |
*/ | |
import java.io.BufferedInputStream; | |
import java.io.ByteArrayOutputStream; | |
import java.io.File; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_marginTop="20dp"> | |
<Button | |
android:layout_width="200px" | |
android:layout_height="200px" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context | |
import androidx.lifecycle.LiveData | |
import androidx.lifecycle.Observer | |
import androidx.work.* | |
/** | |
* Created by jixiaoyong1995@gmail.com | |
* Data: 2019/11/21. | |
* Description: WorkManager使用示例 | |
* |
OlderNewer