Skip to content

Commit 7c13d8f

Browse files
committed
增加myglide模块,glide的使用示例
1 parent 1c24b8f commit 7c13d8f

32 files changed

Lines changed: 680 additions & 3 deletions

File tree

49 Bytes
Binary file not shown.

‎.idea/misc.xml‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/modules.xml‎

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎build.gradle‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

3-
buildscript {
3+
buildscript {
4+
ext.kotlin_version = '1.3.31'
5+
46
ext.kotlin_version = '1.3.11'
57

68
ext.kotlin_version = '1.3.21'

‎buildsrc/src/main/groovy/com/feifei/second/codeinject/CodeInjects.groovy‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public class CodeInjects {
1515

1616

1717
//project.android.bootClasspath 加入android.jar,不然找不到android相关的所有类
18+
//println "android.jar 位置:"+project.android.bootClasspath[0].toString()
1819
pool.appendClassPath(project.android.bootClasspath[0].toString())
1920

2021
pool.importPackage("android.os.Bundle");

‎myglide/.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

‎myglide/build.gradle‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
apply plugin: 'com.android.application'
2+
apply plugin: 'kotlin-android'
3+
apply plugin: 'kotlin-android-extensions'
4+
android {
5+
compileSdkVersion 29
6+
buildToolsVersion "29.0.0"
7+
8+
9+
defaultConfig {
10+
applicationId "com.example.myglide"
11+
minSdkVersion 15
12+
targetSdkVersion 29
13+
versionCode 1
14+
versionName "1.0"
15+
16+
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
17+
18+
}
19+
20+
buildTypes {
21+
release {
22+
minifyEnabled false
23+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
24+
}
25+
}
26+
27+
}
28+
29+
dependencies {
30+
implementation fileTree(dir: 'libs', include: ['*.jar'])
31+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
32+
implementation 'com.android.support:appcompat-v7:28.0.0'
33+
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
34+
// testImplementation 'junit:junit:4.12'
35+
// androidTestImplementation 'com.android.support.test:runner:1.0.2'
36+
// androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
37+
38+
implementation 'com.github.bumptech.glide:glide:3.7.0'
39+
// implementation 'com.android.support:support-v4:23.2.1'
40+
}

‎myglide/proguard-rules.pro‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.example.myglide
2+
3+
import android.support.test.InstrumentationRegistry
4+
import android.support.test.runner.AndroidJUnit4
5+
6+
import org.junit.Test
7+
import org.junit.runner.RunWith
8+
9+
import org.junit.Assert.*
10+
11+
/**
12+
* Instrumented test, which will execute on an Android device.
13+
*
14+
* See [testing documentation](http://d.android.com/tools/testing).
15+
*/
16+
@RunWith(AndroidJUnit4::class)
17+
class ExampleInstrumentedTest {
18+
@Test
19+
fun useAppContext() {
20+
// Context of the app under test.
21+
val appContext = InstrumentationRegistry.getTargetContext()
22+
assertEquals("com.example.myglide", appContext.packageName)
23+
}
24+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.example.myglide">
4+
<uses-permission android:name="android.permission.INTERNET" />
5+
<application
6+
android:allowBackup="true"
7+
android:icon="@mipmap/ic_launcher"
8+
android:label="@string/app_name"
9+
android:roundIcon="@mipmap/ic_launcher_round"
10+
android:supportsRtl="true"
11+
android:theme="@style/AppTheme">
12+
<activity android:name=".MainActivity">
13+
<intent-filter>
14+
<action android:name="android.intent.action.MAIN" />
15+
16+
<category android:name="android.intent.category.LAUNCHER" />
17+
</intent-filter>
18+
</activity>
19+
</application>
20+
21+
</manifest>

0 commit comments

Comments
 (0)