diff --git a/app/build.gradle b/app/build.gradle index 63d9410d9..ba03faba9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -4,10 +4,8 @@ apply plugin: 'com.google.gms.google-services' apply plugin: 'com.google.firebase.crashlytics' apply plugin: 'com.alibaba.arouter' apply from: "../package_config.gradle" + android { - dexOptions { - jumboMode = true - } project.tasks.getByName("tasks").doFirst { } @@ -92,10 +90,11 @@ android { println "清空build文件夹"; for (final def project in rootProject.getAllprojects()) { def name = variant.name.replace('Debug', '').replace('Release', '').toLowerCase() - delete project.buildDir - delete 'app' + File.separator + name - println project.buildDir + //delete project.buildDir + delete project.rootDir.absolutePath+File.separator+"app"+File.separator+name + //println project.buildDir } + //delete project.rootDir.absolutePath + File.separator + "outputs" String variantName = variant.name.capitalize() def processManifestTask = project.tasks.getByName("process${variantName}Manifest") processManifestTask.doLast { pm -> @@ -160,29 +159,39 @@ android { } } } - variant.outputs.all { vt -> - println("输出文件名:${vt}") + variant.assemble.doLast { vt -> def channel = '' - def server='' - if (variant.name.startsWith('huawei')) { + def server = '' + if (variant.name.contains('huawei')) { channel = "华为" - } else if (variant.name.startsWith('samsung')) { + } else if (variant.name.contains('samsung')) { channel = "三星" - } else if (variant.name.startsWith('google')) { + } else if (variant.name.contains('google')) { channel = "谷歌" } else { channel = "链接" } - if(variant.name.contains('online')){ - server='正式服' - }else{ - server='测试服' + if (variant.name.contains('online')) { + server = '正式服' + } else { + server = '测试服' } - // outputFileName = "[${new Date().format("yyyy-MM-dd HHmmss", TimeZone.getTimeZone("GMT+8"))}]PDLive-${defaultConfig.versionName}-${channel}-${server}-${variant.buildType.name}.apk" + def fileName = "[${new Date().format("yyyy-MM-dd HHmmss", TimeZone.getTimeZone("GMT+8"))}]PDLive-${defaultConfig.versionName}-${defaultConfig.versionCode}-${channel}-${server}-${variant.buildType.name}.apk" + variant.outputs.forEach { fe -> + copy { + from fe.outputFile + into file("${project.rootDir}\\outputs\\apk\\") + rename { fn -> + fileName + } + } + } + } tasks.named("sign${variant.name.capitalize()}Bundle", com.android.build.gradle.internal.tasks.FinalizeBundleTask) { File file = finalBundleFile.asFile.get() def channel = '' + def server = '' if (variant.name.startsWith('huawei')) { channel = "华为" } else if (variant.name.startsWith('samsung')) { @@ -192,43 +201,14 @@ android { } else { channel = "链接" } - File finalFile = new File(file.parentFile, "[${new Date().format("yyyy-MM-dd HHmmss", TimeZone.getTimeZone("GMT+8"))}]PDLive-${defaultConfig.versionName}-${channel}-${variant.buildType.name}.aab") - finalBundleFile.set(finalFile) - } - project.afterEvaluate { project -> - project.tasks.each { - if (it.name.startsWith('assemble') && it.name.endsWith('Release')) { - it.doLast { - def dir = it.name.replace('assemble', '').replace('Release', '').toLowerCase() - println("处理assembleRelease ${project.rootDir}\\app\\$dir\\release\\ | " + new File("${project.rootDir}\\app\\$dir\\release\\").exists()) - if (new File("${project.rootDir}\\app\\$dir\\release\\").exists()) { - println("准备拷贝apk文件") - copy { - from file("${project.rootDir}\\app\\$dir\\release\\") - into file("${project.rootDir}\\outputs\\apk\\") - include '**/*.apk' - } - - } - println("打包apk结束") - } - } else if (it.name.startsWith('sign') && it.name.endsWith('ReleaseBundle')) { - it.doLast { - def dir = it.name.replace('sign', '').replace('ReleaseBundle', '').toLowerCase() - println("处理signReleaseBundle ${project.rootDir}\\app\\$dir\\release\\ | " + new File("${project.rootDir}\\app\\$dir\\release\\").exists()) - if (new File("${project.rootDir}\\app\\$dir\\release\\").exists()) { - println("准备拷贝aab文件") - copy { - from file("${project.rootDir}\\app\\$dir\\release\\") - into file("${project.rootDir}\\outputs\\aab\\") - include '**/*.aab' - } - - } - println("打包aab结束") - } - } + if (variant.name.contains('online')) { + server = '正式服' + } else { + server = '测试服' } + def fileName = "[${new Date().format("yyyy-MM-dd HHmmss", TimeZone.getTimeZone("GMT+8"))}]PDLive-${defaultConfig.versionName}-${defaultConfig.versionCode}-${channel}-${server}-${variant.buildType.name}.aab" + File finalFile = new File("${project.rootDir}\\outputs\\aab", fileName) + finalBundleFile.set(finalFile) } } signingConfigs { @@ -269,9 +249,17 @@ android { manifestPlaceholders = rootProject.ext.manifestPlaceholders multiDexEnabled true ndk { - // TODO: 谷歌商城需要兼容两个平台 - //abiFilters "armeabi-v7a", "arm64-v8a" - abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64" + Gradle gradle = getGradle() + String tskReqStr = gradle.getStartParameter().getTaskRequests().args.toString() + println("处理ndk 版本 = " + tskReqStr) + def isLink = tskReqStr.contains("Link") + if (isLink) { + abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64" + println("打包ndk 链接") + } else { + abiFilters "armeabi-v7a", "arm64-v8a" + println("打包ndk其他") + } } javaCompileOptions { annotationProcessorOptions { @@ -326,18 +314,4 @@ dependencies { //debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.10' -} -// 链接包需要注释掉 否正无法更新 谷歌包需要打开 -/* -project.afterEvaluate { - android.applicationVariants.all { variant -> - variant.outputs.each { output -> - output.processResources.doFirst { pm-> - String manifestPath = output.processResources.manifestFile; - def manifestContent = file(manifestPath).getText() - manifestContent = manifestContent.replace('android.permission.REQUEST_INSTALL_PACKAGES', '') - file(manifestPath).write(manifestContent) - } - } - } -}*/ +} \ No newline at end of file diff --git a/common/src/main/java/com/yunbao/common/views/SudGameUserListViewHolder.java b/common/src/main/java/com/yunbao/common/views/SudGameUserListViewHolder.java index 0ba2aa016..478dc447b 100644 --- a/common/src/main/java/com/yunbao/common/views/SudGameUserListViewHolder.java +++ b/common/src/main/java/com/yunbao/common/views/SudGameUserListViewHolder.java @@ -4,6 +4,7 @@ import android.view.View; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.LinearLayout; +import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; @@ -25,15 +26,19 @@ public class SudGameUserListViewHolder extends RecyclerView.ViewHolder { private FrameLayout user_layout; private RoundedImageView sud_game_user; private LinearLayout layout; + private TextView userName; + private FrameLayout vacancy_sud_gameLayout; public SudGameUserListViewHolder(@NonNull View itemView) { super(itemView); vacancy_sud_game = itemView.findViewById(R.id.vacancy_sud_game); + vacancy_sud_gameLayout = itemView.findViewById(R.id.vacancy_sud_gameLayout); sud_game_user = itemView.findViewById(R.id.sud_game_user); user_layout = itemView.findViewById(R.id.user_layout); mic_status = itemView.findViewById(R.id.mic_status); layout = itemView.findViewById(R.id.layout); game_status = itemView.findViewById(R.id.game_status); + userName= itemView.findViewById(R.id.userName); } public void upData(SudGameUserModel sudGameUserModel, SudGameUserListAdapter.SudGameSmallCallBack sudGameSmallCallBack, int position) { @@ -46,7 +51,7 @@ public class SudGameUserListViewHolder extends RecyclerView.ViewHolder { // } // }); if (sudGameUserModel.isNullUser()) { - vacancy_sud_game.setVisibility(View.VISIBLE); + vacancy_sud_gameLayout.setVisibility(View.VISIBLE); user_layout.setVisibility(View.GONE); ViewClicksAntiShake.clicksAntiShake(vacancy_sud_game, new ViewClicksAntiShake.ViewClicksCallBack() { @Override @@ -55,7 +60,7 @@ public class SudGameUserListViewHolder extends RecyclerView.ViewHolder { } }); } else { - vacancy_sud_game.setVisibility(View.GONE); + vacancy_sud_gameLayout.setVisibility(View.GONE); user_layout.setVisibility(View.VISIBLE); ImgLoader.display2(itemView.getContext(), sudGameUserModel.getAvatar(), sud_game_user); if (sudGameUserModel.getMicStatus() == 2) { @@ -71,6 +76,7 @@ public class SudGameUserListViewHolder extends RecyclerView.ViewHolder { } else { game_status.setVisibility(View.GONE); } + userName.setText(sudGameUserModel.getUserNicename()); ViewClicksAntiShake.clicksAntiShake(user_layout, new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { diff --git a/common/src/main/res/drawable/bg_live_sud_game_top_new.xml b/common/src/main/res/drawable/bg_live_sud_game_top_new.xml index dc541bd75..784608b98 100644 --- a/common/src/main/res/drawable/bg_live_sud_game_top_new.xml +++ b/common/src/main/res/drawable/bg_live_sud_game_top_new.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/common/src/main/res/drawable/bg_live_sud_list.xml b/common/src/main/res/drawable/bg_live_sud_list.xml index 4216aa85c..ccace1e40 100644 --- a/common/src/main/res/drawable/bg_live_sud_list.xml +++ b/common/src/main/res/drawable/bg_live_sud_list.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/common/src/main/res/drawable/dialog_live_sud_game_name_bg.xml b/common/src/main/res/drawable/dialog_live_sud_game_name_bg.xml index 904801aa2..1c10e92bb 100644 --- a/common/src/main/res/drawable/dialog_live_sud_game_name_bg.xml +++ b/common/src/main/res/drawable/dialog_live_sud_game_name_bg.xml @@ -1,9 +1,5 @@ - - - - - - - - \ No newline at end of file + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/activity_sud_game.xml b/common/src/main/res/layout/activity_sud_game.xml index 698d0617c..06a8c86b6 100644 --- a/common/src/main/res/layout/activity_sud_game.xml +++ b/common/src/main/res/layout/activity_sud_game.xml @@ -19,8 +19,8 @@ - - + android:textSize="8sp" /> - + android:layout_height="50dp" + android:layout_marginTop="93dp"> diff --git a/common/src/main/res/layout/dialog_live_sud_game.xml b/common/src/main/res/layout/dialog_live_sud_game.xml index 7e2e04347..1b54f1c8a 100644 --- a/common/src/main/res/layout/dialog_live_sud_game.xml +++ b/common/src/main/res/layout/dialog_live_sud_game.xml @@ -26,8 +26,8 @@ @@ -44,7 +44,7 @@ app:riv_oval="true" /> @@ -52,11 +52,13 @@ + android:layout_marginTop="1dp"> @@ -75,7 +77,7 @@ + android:layout_marginTop="2dp"> diff --git a/common/src/main/res/layout/view_sud_game_user_list_holder.xml b/common/src/main/res/layout/view_sud_game_user_list_holder.xml index 42c914407..46fe981f7 100644 --- a/common/src/main/res/layout/view_sud_game_user_list_holder.xml +++ b/common/src/main/res/layout/view_sud_game_user_list_holder.xml @@ -3,50 +3,72 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/layout" android:layout_width="wrap_content" - android:layout_height="match_parent" + android:layout_height="wrap_content" android:gravity="center_vertical" android:orientation="vertical"> - + + + + + - + + + \ No newline at end of file diff --git a/common/src/main/res/values-en-rUS/string.xml b/common/src/main/res/values-en-rUS/string.xml index f7b69bd82..8397d6839 100644 --- a/common/src/main/res/values-en-rUS/string.xml +++ b/common/src/main/res/values-en-rUS/string.xml @@ -1332,7 +1332,7 @@ Limited ride And limited avatar frame All Game Create a room "Room Name: " - Room ID: + ID: Please enter a room name Game type: Game threshold: diff --git a/common/src/main/res/values-zh-rHK/strings.xml b/common/src/main/res/values-zh-rHK/strings.xml index 0ca615a3c..dfe78a92b 100644 --- a/common/src/main/res/values-zh-rHK/strings.xml +++ b/common/src/main/res/values-zh-rHK/strings.xml @@ -1329,7 +1329,7 @@ 所有遊戲 創建房間 房間名稱: - 房間號: + ID: 請輸入房間名 游戲類型: 游戲門檻: diff --git a/common/src/main/res/values-zh-rTW/strings.xml b/common/src/main/res/values-zh-rTW/strings.xml index d2ff10baf..da8b9c5ed 100644 --- a/common/src/main/res/values-zh-rTW/strings.xml +++ b/common/src/main/res/values-zh-rTW/strings.xml @@ -1328,7 +1328,7 @@ 所有遊戲 創建房間 房間名稱: - 房間號: + ID: 請輸入房間名 游戲類型: 游戲門檻: diff --git a/common/src/main/res/values-zh/strings.xml b/common/src/main/res/values-zh/strings.xml index f118df88a..2b6a58bed 100644 --- a/common/src/main/res/values-zh/strings.xml +++ b/common/src/main/res/values-zh/strings.xml @@ -1327,7 +1327,7 @@ 所有遊戲 創建房間 房間名稱: - 房間號: + ID: 請輸入房間名 游戲類型: 游戲門檻: diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 136420081..4ea97c177 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1335,7 +1335,7 @@ Limited ride And limited avatar frame All Game Create a room "Room Name: " - Room ID: + ID: Please enter a room name Game type: Game threshold: