File tree Expand file tree Collapse file tree 7 files changed +60
-9
lines changed Expand file tree Collapse file tree 7 files changed +60
-9
lines changed Original file line number Diff line number Diff line change 11apply plugin : ' com.android.application'
2+ apply plugin : ' kotlin-android'
3+ apply plugin : ' kotlin-android-extensions'
24
35android {
46 compileSdkVersion 28
@@ -27,4 +29,6 @@ dependencies {
2729 implementation ' com.hjq:titlebar:6.0'
2830 // 悬浮窗:https://github.com/getActivity/XToast
2931 implementation ' com.hjq:xtoast:2.6'
30- }
32+ implementation ' com.android.support.constraint:constraint-layout:1.1.3'
33+ implementation " org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version "
34+ }
Original file line number Diff line number Diff line change 22<manifest xmlns : android =" http://schemas.android.com/apk/res/android"
33 package =" com.hjq.toast.demo" >
44
5- <uses-permission android : name =" android.permission.SYSTEM_ALERT_WINDOW" />
5+ <uses-permission android : name =" android.permission.SYSTEM_ALERT_WINDOW" />
66
77 <application
88 android : name =" .ToastApplication"
99 android : icon =" @mipmap/ic_launcher"
1010 android : label =" @string/app_name"
1111 android : roundIcon =" @mipmap/ic_launcher_round"
1212 android : theme =" @style/AppTheme" >
13+ <activity android : name =" .ToastKotlinActivity" >
14+ <intent-filter >
15+ <action android : name =" android.intent.action.MAIN" />
16+ <action android : name =" android.intent.action.VIEW" />
1317
18+ <category android : name =" android.intent.category.LAUNCHER" />
19+ </intent-filter ></activity >
1420 <activity android : name =" .ToastActivity" >
1521 <intent-filter >
1622 <action android : name =" android.intent.action.MAIN" />
1925 <category android : name =" android.intent.category.LAUNCHER" />
2026 </intent-filter >
2127 </activity >
22-
2328 </application >
2429
2530</manifest >
Original file line number Diff line number Diff line change 1+ package com.hjq.toast.demo
2+
3+ import android.support.v7.app.AppCompatActivity
4+ import android.os.Bundle
5+ import com.hjq.toast.toastMe
6+ import kotlinx.android.synthetic.main.activity_toast_kotlin.*
7+
8+ class ToastKotlinActivity : AppCompatActivity () {
9+
10+ override fun onCreate (savedInstanceState : Bundle ? ) {
11+ super .onCreate(savedInstanceState)
12+ setContentView(R .layout.activity_toast_kotlin)
13+
14+ btnShow.setOnClickListener {
15+ toastMe(" 2;obkv8jyu54v8" )
16+ }
17+ }
18+ }
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" utf-8" ?>
2+ <LinearLayout
3+ xmlns : android =" http://schemas.android.com/apk/res/android"
4+ xmlns : app =" http://schemas.android.com/apk/res-auto"
5+ xmlns : tools =" http://schemas.android.com/tools"
6+ android : layout_width =" match_parent"
7+ android : layout_height =" match_parent"
8+ tools : context =" .ToastKotlinActivity" >
9+
10+ <Button
11+ android : id =" @+id/btnShow"
12+ android : layout_width =" match_parent"
13+ android : layout_height =" wrap_content"
14+ android : text =" show toast" />
15+
16+
17+ </LinearLayout >
Original file line number Diff line number Diff line change 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.61'
5+
46 repositories {
57 jcenter()
68 google()
79 }
810 dependencies {
9- classpath ' com.android.tools.build:gradle:3.1 .3'
11+ classpath ' com.android.tools.build:gradle:3.5 .3'
1012 classpath ' com.novoda:bintray-release:0.8.0'
11- }
13+ classpath " org.jetbrains.kotlin:kotlin-gradle-plugin: $k otlin_version " }
1214}
1315
1416allprojects {
1517 repositories {
1618 jcenter()
1719 google()
18- maven {url " https://jitpack.io" }
20+ maven {url " https://jitpack.io" }
1921 }
2022
2123 // 解决app:mockableAndroidJar错误的问题
@@ -30,4 +32,4 @@ allprojects {
3032
3133task clean (type : Delete ) {
3234 delete rootProject. buildDir
33- }
35+ }
Original file line number Diff line number Diff line change @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33distributionPath =wrapper/dists
44zipStoreBase =GRADLE_USER_HOME
55zipStorePath =wrapper/dists
6- distributionUrl =https\://services.gradle.org/distributions/gradle-4.4 -all.zip
6+ distributionUrl =https\://services.gradle.org/distributions/gradle-5.4.1 -all.zip
Original file line number Diff line number Diff line change 11// 文件开头配置
22apply plugin : ' com.android.library'
33apply plugin : ' com.novoda.bintray-release'
4+ apply plugin : ' kotlin-android'
45
56android {
67 compileSdkVersion 26
@@ -16,6 +17,10 @@ android {
1617 }
1718}
1819
20+ dependencies {
21+ compileOnly " org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version "
22+ }
23+
1924publish {
2025 userOrg = ' getactivity' // 填写bintray用户名,注意大小写
2126 groupId = ' com.hjq' // 定义的maven group id最终引用形式
You can’t perform that action at this time.
0 commit comments