1、游戏房间界面需美化

This commit is contained in:
Martin 2024-07-02 14:40:36 +08:00
parent f14fb4612b
commit 833b58d311
14 changed files with 133 additions and 135 deletions

View File

@ -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)
}
}
}
}*/
}

View File

@ -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() {

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="8dp" />
<corners android:radius="10dp" />
<solid android:color="#B3414141" />
</shape>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:topLeftRadius="12dp" android:topRightRadius="12dp" />
<solid android:color="#201E1A" />
<solid android:color="#292929" />
</shape>

View File

@ -1,9 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="7dp" />
<solid android:color="#3D3D3D" />
</shape>
</item>
</selector>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="7dp" />
<solid android:color="#B3414141" />
</shape>

View File

@ -19,8 +19,8 @@
</RelativeLayout>
<LinearLayout
android:layout_width="150dp"
android:layout_height="50dp"
android:layout_width="138dp"
android:layout_height="38dp"
android:layout_marginStart="23dp"
android:layout_marginTop="48dp"
android:background="@drawable/bg_live_sud_game_top_new"
@ -79,30 +79,27 @@
</LinearLayout>
<LinearLayout
android:layout_width="98dp"
android:layout_width="88dp"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginTop="49dp"
android:layout_marginEnd="20dp"
android:layout_marginTop="55dp"
android:gravity="center_vertical">
<ImageView
android:id="@+id/sud_history"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginEnd="14dp"
android:src="@mipmap/icon_sud_history_live_new" />
<TextView
<ImageView
android:id="@+id/exit"
android:layout_width="40dp"
android:layout_height="40dp"
android:background="@drawable/bg_live_sud_game_back_new"
android:layout_width="30dp"
android:layout_height="30dp"
android:background="@mipmap/bg_live_sud_game_back_new2"
android:gravity="center"
android:text="@string/video_exit"
android:textColor="#FFFFFF"
android:textSize="12sp" />
android:textSize="8sp" />
</LinearLayout>
<LinearLayout
@ -141,10 +138,8 @@
android:id="@+id/game_seat"
android:layout_width="34dp"
android:layout_height="34dp"
android:src="@mipmap/icon_game_seat" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
@ -156,13 +151,13 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_marginTop="98dp">
android:layout_height="50dp"
android:layout_marginTop="93dp">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/user_list"
android:layout_marginStart="11dp"
android:layout_marginEnd="20dp"
android:layout_marginEnd="12dp"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
</LinearLayout>

View File

@ -26,8 +26,8 @@
<LinearLayout
android:layout_marginLeft="10dp"
android:layout_width="175dp"
android:layout_height="50dp"
android:layout_width="121dp"
android:layout_height="39dp"
android:padding="2dp"
android:background="@drawable/dialog_live_sud_game_name_bg"
android:gravity="center_vertical">
@ -44,7 +44,7 @@
app:riv_oval="true" />
<LinearLayout
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginStart="10dp"
android:orientation="vertical">
@ -52,11 +52,13 @@
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp">
android:layout_marginTop="1dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:ellipsize="end"
android:text="@string/interactive_game_create_room_name"
android:textColor="@color/white"
android:textSize="12sp" />
@ -75,7 +77,7 @@
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp">
android:layout_marginTop="2dp">
<TextView
android:layout_width="wrap_content"
@ -118,6 +120,7 @@
<ImageView
android:id="@+id/exit"
android:layout_width="30dp"
android:layout_marginEnd="12dp"
android:layout_height="30dp"
android:background="@mipmap/bg_live_sud_game_back_new2"
android:gravity="center"

View File

@ -38,7 +38,9 @@
<ImageView
android:id="@+id/btn_close"
android:layout_width="50dp"
android:layout_marginLeft="-35dp"
android:layout_height="50dp"
android:layout_toRightOf="@+id/layout"
android:paddingBottom="30dp"
android:src="@mipmap/icon_live_close_3" />

View File

@ -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">
<ImageView
android:id="@+id/vacancy_sud_game"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_marginStart="12dp"
android:src="@mipmap/icon_vacancy_sud_game"
android:visibility="visible" />
<FrameLayout
android:id="@+id/vacancy_sud_gameLayout"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:visibility="visible">
<ImageView
android:id="@+id/vacancy_sud_game"
android:layout_width="34dp"
android:layout_height="50dp"
android:paddingBottom="5dp"
android:layout_marginStart="15dp"
android:src="@mipmap/icon_vacancy_sud_game" />
</FrameLayout>
<FrameLayout
android:id="@+id/user_layout"
android:layout_width="wrap_content"
android:layout_height="60dp"
android:layout_height="50dp"
android:visibility="visible">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/sud_game_user"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_gravity="center_vertical"
android:layout_marginStart="12dp"
android:layout_width="34dp"
android:layout_height="34dp"
android:layout_marginTop="5dp"
android:layout_marginStart="15dp"
android:scaleType="centerCrop"
android:src="@mipmap/icon_vacancy_sud_game"
app:riv_oval="true" />
<ImageView
android:id="@+id/mic_status"
android:layout_width="15dp"
android:layout_height="15dp"
android:layout_marginStart="5dp"
android:layout_marginTop="5dp"
android:layout_width="9dp"
android:layout_height="9dp"
android:layout_marginTop="3dp"
android:layout_marginStart="15dp"
android:src="@mipmap/icon_game_close_wheat_mute" />
<ImageView
android:id="@+id/game_status"
android:layout_width="18dp"
android:layout_height="14dp"
android:layout_marginStart="5dp"
android:layout_gravity="bottom|center_horizontal"
android:layout_width="17dp"
android:layout_height="11dp"
android:layout_marginTop="31dp"
android:layout_marginStart="8dp"
android:layout_gravity="center_horizontal"
android:src="@mipmap/icon_game_status" />
<TextView
android:id="@+id/userName"
android:text="用户名"
android:layout_marginTop="40dp"
android:ellipsize="end"
android:maxLines="1"
android:gravity="center"
android:textColor="#333333"
android:layout_marginStart="8dp"
android:textSize="8dp"
android:layout_gravity="center_horizontal"
android:layout_width="34dp"
android:layout_height="wrap_content"/>
</FrameLayout>
</LinearLayout>

View File

@ -1332,7 +1332,7 @@ Limited ride And limited avatar frame</string>
<string name="interactive_game_room_all">All Game</string>
<string name="interactive_game_create_room">Create a room</string>
<string name="interactive_game_create_room_name">"Room Name: "</string>
<string name="interactive_game_create_room_number">Room ID:</string>
<string name="interactive_game_create_room_number">ID:</string>
<string name="interactive_game_create_room_name_input">Please enter a room name</string>
<string name="interactive_game_create_game_type">Game type:</string>
<string name="interactive_game_create_game_sill">Game threshold:</string>

View File

@ -1329,7 +1329,7 @@
<string name="interactive_game_room_all">所有遊戲</string>
<string name="interactive_game_create_room">創建房間</string>
<string name="interactive_game_create_room_name">房間名稱:</string>
<string name="interactive_game_create_room_number">房間號</string>
<string name="interactive_game_create_room_number">ID</string>
<string name="interactive_game_create_room_name_input">請輸入房間名</string>
<string name="interactive_game_create_game_type">游戲類型:</string>
<string name="interactive_game_create_game_sill">游戲門檻:</string>

View File

@ -1328,7 +1328,7 @@
<string name="interactive_game_room_all">所有遊戲</string>
<string name="interactive_game_create_room">創建房間</string>
<string name="interactive_game_create_room_name">房間名稱:</string>
<string name="interactive_game_create_room_number">房間號</string>
<string name="interactive_game_create_room_number">ID</string>
<string name="interactive_game_create_room_name_input">請輸入房間名</string>
<string name="interactive_game_create_game_type">游戲類型:</string>
<string name="interactive_game_create_game_sill">游戲門檻:</string>

View File

@ -1327,7 +1327,7 @@
<string name="interactive_game_room_all">所有遊戲</string>
<string name="interactive_game_create_room">創建房間</string>
<string name="interactive_game_create_room_name">房間名稱:</string>
<string name="interactive_game_create_room_number">房間號</string>
<string name="interactive_game_create_room_number">ID</string>
<string name="interactive_game_create_room_name_input">請輸入房間名</string>
<string name="interactive_game_create_game_type">游戲類型:</string>
<string name="interactive_game_create_game_sill">游戲門檻:</string>

View File

@ -1335,7 +1335,7 @@ Limited ride And limited avatar frame</string>
<string name="interactive_game_room_all">All Game</string>
<string name="interactive_game_create_room">Create a room</string>
<string name="interactive_game_create_room_name">"Room Name: "</string>
<string name="interactive_game_create_room_number">Room ID:</string>
<string name="interactive_game_create_room_number">ID:</string>
<string name="interactive_game_create_room_name_input">Please enter a room name</string>
<string name="interactive_game_create_game_type">Game type:</string>
<string name="interactive_game_create_game_sill">Game threshold:</string>