Skip to content

Commit

Permalink
迁移 JCenter 到 JitPack
Browse files Browse the repository at this point in the history
优化框架代码及补充一个字符串国际化
  • Loading branch information
getActivity committed May 1, 2021
1 parent 1e416cf commit c605246
Show file tree
Hide file tree
Showing 16 changed files with 81 additions and 67 deletions.
14 changes: 6 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
/.gradle
/.idea
/build
*/build
/captures
/.cxx
*/.cxx
/.externalNativeBuild
.gradle
.idea
.cxx
.externalNativeBuild
build
captures

._*
*.iml
Expand Down
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,24 @@

#### 集成步骤

```groovy
buildscript {
......
}
allprojects {
repositories {
// JitPack 远程仓库:https://jitpack.io
maven { url 'https://jitpack.io' }
}
}
```

* 在项目 app 模块下的 `build.gradle` 文件中加入

```groovy
dependencies {
// 日志调试框架:https://github.com/getActivity/Logcat
debugImplementation 'com.hjq:logcat:9.5'
debugImplementation 'com.github.getActivity:Logcat:9.6'
}
```

Expand Down Expand Up @@ -88,12 +102,12 @@ dependencies {

* Gson 解析容错:[GsonFactory](https://github.com/getActivity/GsonFactory)

#### Android技术讨论Q群:78797078

#### 微信公众号:Android轮子哥

![](https://raw.githubusercontent.com/getActivity/Donate/master/picture/official_ccount.png)

#### Android 技术分享 QQ 群:78797078

#### 如果您觉得我的开源库帮你节省了大量的开发时间,请扫描下方的二维码随意打赏,要是能打赏个 10.24 :monkey_face:就太:thumbsup:了。您的支持将鼓励我继续创作:octocat:

![](https://raw.githubusercontent.com/getActivity/Donate/master/picture/pay_ali.png) ![](https://raw.githubusercontent.com/getActivity/Donate/master/picture/pay_wechat.png)
Expand Down
16 changes: 12 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@ android {
applicationId "com.hjq.logcat.demo"
minSdkVersion 16
targetSdkVersion 30
versionCode 95
versionName "9.5"
versionCode 96
versionName "9.6"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

// 使用 JDK 1.8
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_8
}

buildTypes {
release {
minifyEnabled false
Expand All @@ -28,7 +35,8 @@ dependencies {
implementation 'com.google.android.material:material:1.2.1'

// 标题栏:https://github.com/getActivity/TitleBar
implementation 'com.hjq:titlebar:8.2'
implementation 'com.github.getActivity:TitleBar:8.5'

// 内存泄漏捕捉:https://github.com/square/leakcanary
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.5'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'
}
32 changes: 16 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
// 阿里云云效仓库:https://maven.aliyun.com/mvn/guide
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://maven.aliyun.com/repository/google' }
// 华为开源镜像:https://mirrors.huaweicloud.com/
maven { url 'https://repo.huaweicloud.com/repository/maven/' }
// JitPack 远程仓库:https://jitpack.io
maven { url 'https://jitpack.io' }
mavenCentral()
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.novoda:bintray-release:0.8.0'
classpath 'com.android.tools.build:gradle:4.1.2'
}
}

allprojects {
repositories {
jcenter()
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://repo.huaweicloud.com/repository/maven/' }
maven { url 'https://jitpack.io' }
mavenCentral()
google()
maven {url "https://jitpack.io"}
}

//解决app:mockableAndroidJar错误的问题
gradle.taskGraph.whenReady {
tasks.each { task ->
if (task.name.equals('mockableAndroidJar')) {
task.enabled = false
}
}
jcenter()
}
}

Expand Down
5 changes: 5 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@ org.gradle.jvmargs=-Xmx1536m
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

# 表示使用 AndroidX
android.useAndroidX = true
# 表示将第三方库迁移到 AndroidX
android.enableJetifier = true
11 changes: 5 additions & 6 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Wed Jul 18 11:21:06 CST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
zipStoreBase = GRADLE_USER_HOME
zipStorePath = wrapper/dists
distributionBase = GRADLE_USER_HOME
distributionPath = wrapper/dists
distributionUrl = https\://services.gradle.org/distributions/gradle-6.5-all.zip
19 changes: 4 additions & 15 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release'

android {

// 资源前缀限制
resourcePrefix "logcat_"

compileSdkVersion 30

defaultConfig {
minSdkVersion 14
//noinspection ExpiredTargetSdkVersion
targetSdkVersion 23
versionCode 95
versionName "9.5"
versionCode 96
versionName "9.6"
}

lintOptions {
Expand All @@ -22,16 +20,7 @@ android {

dependencies {
// 悬浮窗框架:https://github.com/getActivity/XToast
implementation 'com.hjq:xtoast:6.6'
}

publish {
userOrg = 'getactivity'
groupId = 'com.hjq'
artifactId = 'logcat'
version = '9.5'
description = 'This is to help developers quickly see the logging framework they want'
website = "https://github.com/getActivity/Logcat"
implementation 'com.github.getActivity:XToast:6.9'
}

tasks.withType(Javadoc) {
Expand Down
3 changes: 1 addition & 2 deletions library/src/main/java/com/hjq/logcat/ChooseWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import android.widget.AdapterView;
import android.widget.ListView;

import com.hjq.xtoast.OnClickListener;
import com.hjq.xtoast.XToast;

import java.util.ArrayList;
Expand All @@ -20,7 +19,7 @@
* time : 2020/01/24
* desc : 列表选择类
*/
final class ChooseWindow extends XToast implements AdapterView.OnItemClickListener, OnClickListener<View> {
final class ChooseWindow extends XToast<ChooseWindow> implements AdapterView.OnItemClickListener, XToast.OnClickListener<View> {

private final ChooseAdapter mAdapter;
private OnListener mListener;
Expand Down
3 changes: 1 addition & 2 deletions library/src/main/java/com/hjq/logcat/FloatingWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import android.view.View;
import android.widget.ImageView;

import com.hjq.xtoast.OnClickListener;
import com.hjq.xtoast.XToast;
import com.hjq.xtoast.draggable.SpringDraggable;

Expand All @@ -17,7 +16,7 @@
* time : 2020/01/24
* desc : 悬浮窗口
*/
final class FloatingWindow extends XToast<FloatingWindow> implements OnClickListener<View> {
final class FloatingWindow extends XToast<FloatingWindow> implements XToast.OnClickListener<View> {

FloatingWindow(Activity activity) {
super(activity);
Expand Down
2 changes: 1 addition & 1 deletion library/src/main/java/com/hjq/logcat/InitProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public boolean onCreate() {
if (context instanceof Application) {
FloatingLifecycle.with((Application) context);
} else {
Toast.makeText(context, "参数错误,无法启动 Logcat", Toast.LENGTH_LONG).show();
Toast.makeText(context, R.string.logcat_launch_error, Toast.LENGTH_LONG).show();
}
}
return true;
Expand Down
14 changes: 7 additions & 7 deletions library/src/main/res/drawable/logcat_bg_log_check.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 选中状态 -->
<item android:drawable="@drawable/logcat_ic_play" android:state_checked="true" />

<!-- 未选状态 -->
<item android:drawable="@drawable/logcat_ic_stop" android:state_enabled="true" />
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 选中状态 -->
<item android:drawable="@drawable/logcat_ic_play" android:state_checked="true" />

<!-- 未选状态 -->
<item android:drawable="@drawable/logcat_ic_stop" android:state_enabled="true" />
</selector>
3 changes: 0 additions & 3 deletions library/src/main/res/drawable/logcat_bg_log_roll.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<layer-list>
<!-- Shadow -->
<item android:top="1dp" android:right="1dp">
<layer-list>
<item>
Expand Down Expand Up @@ -224,8 +223,6 @@
</layer-list>
</item>

<!-- Blue button -->

<item>
<shape android:shape="oval">
<solid android:color="#03A9F4"/>
Expand Down
2 changes: 2 additions & 0 deletions library/src/main/res/values-en/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<resources>
<string name="logcat_launch_error">Error parameter. Unable to start Logcat</string>

<string name="logcat_search_hint">Please enter what you are looking for</string>

<string name="logcat_options_copy">Copy log</string>
Expand Down
2 changes: 2 additions & 0 deletions library/src/main/res/values-zh-rTW/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<resources>
<string name="logcat_launch_error">參數錯誤,無法啓動 Logcat</string>

<string name="logcat_search_hint">請輸入要查找的內容</string>

<string name="logcat_options_copy">複制日志</string>
Expand Down
2 changes: 2 additions & 0 deletions library/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<resources>
<string name="logcat_launch_error">参数错误,无法启动 Logcat</string>

<string name="logcat_search_hint">请输入要查找的内容</string>

<string name="logcat_options_copy">复制日志</string>
Expand Down
Binary file modified picture/0.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c605246

Please sign in to comment.