Skip to content

Commit

Permalink
更新了 Gradle 插件为 7.0.2,同时由于 Aliyun 还没更新对应的插件,暂时替换为 Google 仓库
Browse files Browse the repository at this point in the history
  • Loading branch information
ZCShou committed Sep 2, 2021
1 parent e8abd10 commit bf7ec5f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
6 changes: 3 additions & 3 deletions app/src/main/java/com/zcshou/gogogo/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -372,10 +372,10 @@ public boolean onQueryTextChange(String newText) {
}
});

// 搜索框的清除按钮
ImageView closeButton = (ImageView)searchView.findViewById(R.id.search_close_btn);
// 搜索框的清除按钮(该按钮属于安卓系统图标)
ImageView closeButton = (ImageView)searchView.findViewById(androidx.appcompat.R.id.search_close_btn);
closeButton.setOnClickListener(v -> {
EditText et = (EditText) findViewById(R.id.search_src_text);
EditText et = (EditText) findViewById(androidx.appcompat.R.id.search_src_text);
et.setText("");
searchView.setQuery("", false);
mSearchLayout.setVisibility(View.INVISIBLE);
Expand Down
37 changes: 21 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@
buildscript {

repositories {
maven {
url 'https://maven.aliyun.com/repository/jcenter'
}
maven {
url 'https://maven.aliyun.com/repository/google'
}
// maven {
// url 'https://maven.aliyun.com/repository/jcenter'
// }
// maven {
// url 'https://maven.aliyun.com/repository/google'
// }
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.1'
classpath 'com.android.tools.build:gradle:7.0.2'


// NOTE: Do not place your application dependencies here; they belong
Expand All @@ -21,15 +23,18 @@ buildscript {

allprojects {
repositories {
maven {
url 'https://maven.aliyun.com/repository/jcenter'
}
maven {
url 'https://maven.aliyun.com/repository/central'
}
maven {
url 'https://maven.aliyun.com/repository/google'
}
// maven {
// url 'https://maven.aliyun.com/repository/jcenter'
// }
// maven {
// url 'https://maven.aliyun.com/repository/central'
// }
// maven {
// url 'https://maven.aliyun.com/repository/google'
// }
google()
mavenCentral()

}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) { // 用于显示过时 API 的详细信息
Expand Down

0 comments on commit bf7ec5f

Please sign in to comment.