Merge remote-tracking branch 'origin/dev_1.1.2' into dev_1.1.2

This commit is contained in:
董宏宇
2020-08-14 12:40:30 +08:00
8 changed files with 78 additions and 161 deletions

View File

@@ -2,11 +2,9 @@ apply plugin: 'com.android.application'
apply plugin: 'com.alibaba.arouter'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
import java.text.SimpleDateFormat
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
// buildToolsVersion rootProject.ext.android.buildToolsVersion
defaultConfig {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
@@ -66,13 +64,13 @@ android {
independent {
manifest.srcFile 'src/independent/AndroidManifest.xml'
}
e8xx{
e8xx {
manifest.srcFile 'src/e8xx/AndroidManifest.xml'
}
em4 {
manifest.srcFile 'src/em4/AndroidManifest.xml'
}
f8xxLauncherOnlineRelease{
f8xxLauncherOnlineRelease {
manifest.srcFile 'src/f8xxLauncherOnlineRelease/AndroidManifest.xml'
}
}
@@ -81,7 +79,7 @@ android {
productFlavors {
//独立app
independent{
independent {
dimension "basic"
// 是否启动位置服务
buildConfigField 'boolean', 'LAUNCH_LOCATION_SERVICE', 'false'
@@ -90,7 +88,7 @@ android {
buildConfigField 'String', 'SOCKET_APP_ID', '\"com.mogo.launcher\"'
}
// launcher app
launcher{
launcher {
dimension "basic"
// 是否启动位置服务
buildConfigField 'boolean', 'LAUNCH_LOCATION_SERVICE', 'true'
@@ -99,11 +97,11 @@ android {
buildConfigField 'String', 'SOCKET_APP_ID', '\"com.mogo.launcher\"'
}
// f系列-分体机全系列,未细分
f8xx{
f8xx {
applicationId rootProject.ext.android.fLauncherApplicationId
dimension "product"
// 使用思必驰语音
buildConfigField 'int', 'AIType','2'
buildConfigField 'int', 'AIType', '2'
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
// 车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
@@ -117,7 +115,7 @@ android {
applicationId rootProject.ext.android.launcherApplicationId
dimension "product"
// 使用思必驰语音
buildConfigField 'int', 'AIType','2'
buildConfigField 'int', 'AIType', '2'
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'true'
// 车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
@@ -131,7 +129,7 @@ android {
applicationId rootProject.ext.android.launcherApplicationId
dimension "product"
// 使用思必驰语音
buildConfigField 'int', 'AIType','2'
buildConfigField 'int', 'AIType', '2'
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'true'
// 车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
@@ -173,7 +171,7 @@ android {
applicationId rootProject.ext.android.independentApplicationId
dimension "product"
// 使用同行者语音
buildConfigField 'int', 'AIType','1'
buildConfigField 'int', 'AIType', '1'
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'true'
// 车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
@@ -183,11 +181,11 @@ android {
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
}
// d系列 1+16 版本
d82x{
d82x {
applicationId rootProject.ext.android.independentApplicationId
dimension "product"
// 使用同行者语音
buildConfigField 'int', 'AIType','1'
buildConfigField 'int', 'AIType', '1'
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'true'
// 车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
@@ -197,11 +195,11 @@ android {
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
}
// 比亚迪
bydauto{
bydauto {
applicationId rootProject.ext.android.bydautoIndependentApplicationId
dimension "product"
// 不使用语音
buildConfigField 'int', 'AIType','0'
buildConfigField 'int', 'AIType', '0'
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
// 车机类型主要用于区分自研车机还是别人家的车机其他车机比亚迪定为1
buildConfigField 'int', 'CAR_MACHINE_TYPE', '1'
@@ -229,42 +227,6 @@ android {
}
}
def generateVersionCode() {
String vn = rootProject.ext.android.versionName
String[] versions = vn.split("\\.")
if (versions.length == 3) {
int num1 = Integer.valueOf(versions[0])
int num2 = Integer.valueOf(versions[1])
int num3 = Integer.valueOf(versions[2])
if (num1 < 1 || num1 > 99){
throw new GradleException("版本号必须定义为 x.y.zx[1,99], y[0, 99], z[0, 99])")
}
if (num2 < 0 || num2 > 99){
throw new GradleException("版本号必须定义为 x.y.zx[1,99], y[0, 99], z[0, 99])")
}
if (num3 < 0 || num3 > 99){
throw new GradleException("版本号必须定义为 x.y.zx[1,99], y[0, 99], z[0, 99])")
}
StringBuilder builder = new StringBuilder()
builder.append(num1)
if( num2 > 9 ){
builder.append(num2)
} else {
builder.append("0").append(num2)
}
if( num3 > 9 ){
builder.append(num3)
} else {
builder.append("0").append(num3)
}
println("last versionCode ${builder}")
return Integer.valueOf(builder.toString())
} else {
throw new GradleException("版本号必须定义为 x.y.zx[1,99], y[0, 99], z[0, 99])")
}
}
repositories {
flatDir {
dirs 'libs'
@@ -332,13 +294,6 @@ dependencies {
apply from: "./functions/leftpanel.gradle"
}
//android.applicationVariants.all { variant ->
// variant.outputs.all { //这里修改apk文件名
// outputFileName = "Launcher2.0_V${android.defaultConfig.versionName}_${getCurrentDate()}_${variant.name}_${getGitCommit()}.apk"
// println outputFileName
// }
//}
android.applicationVariants.all { variant ->
def buildTime = new Date().format("yyyyMMdd", TimeZone.getTimeZone("GMT+08:00"))
def flavor = variant.productFlavors.collect { it.name }.join('-')
@@ -354,64 +309,4 @@ android.applicationVariants.all { variant ->
}
}
def getMonthAndDay() {
SimpleDateFormat sdf = new SimpleDateFormat("MMddHH")
return sdf.format(new Date())
}
def getCurrentDate() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss")
return sdf.format(new Date())
}
def getGitCommit() {
def gitDir = new File("${new File("${rootDir}")}/.git")
if (!gitDir.isDirectory()) {
return 'non_git_build'
}
def cmd = 'git log --pretty=format:%h -1'
def gitCommit = cmd.execute().text.trim()
print gitCommit
def cmd2 = 'git status -s'
def gitStatus = cmd2.execute().text.trim()
println '---------'
print gitStatus
if (gitStatus != null && !gitStatus.isEmpty()) {
return 'local-build'
}
assert !gitCommit.isEmpty()
gitCommit
}
afterEvaluate {
it.getTasks().iterator().forEachRemaining {
def nameLowCase = it.name
if (nameLowCase.startsWith("assemble")
&& nameLowCase.contains("Independent")
&& (nameLowCase.endsWith("Debug") || nameLowCase.endsWith("Release"))) {
it.group = "assembleIndependent"
} else if (nameLowCase.startsWith("assemble")
&& nameLowCase.contains("Launcher")
&& (nameLowCase.endsWith("Debug") || nameLowCase.endsWith("Release"))) {
it.group = "assembleLauncher"
} else if (nameLowCase.startsWith("install")
&& nameLowCase.contains("Independent")
&& (nameLowCase.endsWith("Debug") || nameLowCase.endsWith("Release"))) {
it.group = "installIndependent"
} else if (nameLowCase.startsWith("install")
&& nameLowCase.contains("Launcher")
&& (nameLowCase.endsWith("Debug") || nameLowCase.endsWith("Release"))) {
it.group = "installLauncher"
}
}
}
apply from: "./regroup.gradle"

45
app/regroup.gradle Normal file
View File

@@ -0,0 +1,45 @@
// 将 install 和 assemble 任务按功能分组
afterEvaluate {
def independent = ["em3", "em1", "d8xx", "d82x", "bydauto"]
def launcher = ["f8xx", "em4"]
it.getTasks().iterator().forEachRemaining {
def task = it
def taskName = task.name
if (taskName.startsWith("assemble")
&& taskName.contains("Independent")
&& (taskName.endsWith("Debug") || taskName.endsWith("Release"))) {
independent.forEach {
if( taskName.toLowerCase().contains(it) ){
task.group = "assembleIndependent"
}
}
} else if (taskName.startsWith("assemble")
&& taskName.contains("Launcher")
&& (taskName.endsWith("Debug") || taskName.endsWith("Release"))) {
launcher.forEach {
if( taskName.toLowerCase().contains(it) ){
task.group = "assembleLauncher"
}
}
} else if (taskName.startsWith("install")
&& taskName.contains("Independent")
&& (taskName.endsWith("Debug") || taskName.endsWith("Release"))) {
independent.forEach {
if( taskName.toLowerCase().contains(it) ){
task.group = "installIndependent"
}
}
} else if (taskName.startsWith("install")
&& taskName.contains("Launcher")
&& (taskName.endsWith("Debug") || taskName.endsWith("Release"))) {
launcher.forEach {
if( taskName.toLowerCase().contains(it) ){
task.group = "installLauncher"
}
}
}
}
}

View File

@@ -65,12 +65,13 @@ MOGO_BASE_SERVICES_SDK_VERSION = 1.2.1.22
# 探路
MOGO_MODULE_TANLU_VERSION=1.3.1.24
# 车聊聊
CARCHATTING_VERSION=1.4.9
CARCHATTING_VERSION=1.5.1
# 车聊聊接口
CARCHATTINGPROVIDER_VERSION=1.3.4
# 视频引导
MOGO_MODULE_GUIDESHOW_VERSION=1.0.2-SNAPSHOT
# 视频引导接口
MOGO_MODULE_GUIDESHOW_PROVIDER_VERSION=1.0.2-SNAPSHOT
# 在线车辆F
MOGO_MODULE_ONLINECAR_VERSION=1.0.3.2

View File

@@ -73,31 +73,6 @@ public class V2XShareEventAdapter extends RecyclerView.Adapter<RecyclerView.View
}
}
private float getEnthusuasmIndex(double score) {
if (score <= 0) {
return 0;
} else if (0 < score && score <= 5) {
return (float) 0.5;
} else if (5 < score && score <= 10) {
return 1;
} else if (10 < score && score <= 15) {
return (float) 1.5;
} else if (15 < score && score <= 20) {
return 2;
} else if (20 < score && score <= 25) {
return (float) 2.5;
} else if (25 < score && score <= 30) {
return 3;
} else if (30 < score && score <= 35) {
return (float) 3.5;
} else if (35 < score && score <= 40) {
return 4;
} else if (40 < score && score <= 45) {
return (float) 4.5;
}
return 5;
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
@@ -115,7 +90,7 @@ public class V2XShareEventAdapter extends RecyclerView.Adapter<RecyclerView.View
if (likeNum != null) {
((shareDescriptionViewHolder) holder).approveNumTextView.setText(likeNum);
}
((shareDescriptionViewHolder) holder).ratingBar.setRating(getEnthusuasmIndex(enthusiasmIndex));
((shareDescriptionViewHolder) holder).ratingBar.setRating((float) enthusiasmIndex);
}
}
} else if (holder instanceof shareItemViewHolder) {
@@ -223,7 +198,7 @@ public class V2XShareEventAdapter extends RecyclerView.Adapter<RecyclerView.View
refresh.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
callback.loadMoreShareEventList(false);
callback.getShareEventResponse();
}
});
}
@@ -242,7 +217,7 @@ public class V2XShareEventAdapter extends RecyclerView.Adapter<RecyclerView.View
@Override
public void onClick(View v) {
callback.loadMoreShareEventList(true);
callback.loadMoreShareEventList();
}
});
}

View File

@@ -32,7 +32,7 @@ public class V2XShareEventsFragment extends MvpFragment implements AdapterCallba
private static final String TAG = "ShareEventsFragment";
private RecyclerView recyclerView;
private V2XShareEventAdapter adapter;
private ArrayList dataArrayList = new ArrayList();
private ArrayList dataArrayList =new ArrayList();
;
private int pageNum = 1;
private V2XShareNetworkModel v2XShareNetworkModel;
@@ -77,7 +77,7 @@ public class V2XShareEventsFragment extends MvpFragment implements AdapterCallba
/*
* 获取热心指数,分享列表等分享内容
* */
private void getShareEventResponse() {
public void getShareEventResponse() {
animatioonAcction(View.VISIBLE);
v2XShareNetworkModel.getShareEventResponse(pageNum, 10, new V2XRefreshCallback() {
@Override
@@ -97,7 +97,7 @@ public class V2XShareEventsFragment extends MvpFragment implements AdapterCallba
@Override
public void onFail(String msg) {
loadingView.stopWithError(msg);
loadingView.stopWithError(msg,View.VISIBLE);
loadingView.refresButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@@ -106,6 +106,7 @@ public class V2XShareEventsFragment extends MvpFragment implements AdapterCallba
});
}
});
}
@@ -170,12 +171,10 @@ public class V2XShareEventsFragment extends MvpFragment implements AdapterCallba
}
@Override
public void loadMoreShareEventList(boolean moreOnePage) {
public void loadMoreShareEventList() {
Log.d(TAG, "page--" + pageNum);
animatioonAcction(View.VISIBLE);
if (moreOnePage == true){
pageNum += 1;
}
pageNum += 1;
v2XShareNetworkModel.getShareEventList(pageNum, 10, new V2XRefreshCallback() {
@Override
public void onSuccess(Object result) {
@@ -184,7 +183,7 @@ public class V2XShareEventsFragment extends MvpFragment implements AdapterCallba
@Override
public void onFail(String msg) {
loadingView.stopWithError(msg,View.INVISIBLE);
}
});
}

View File

@@ -5,5 +5,7 @@ package com.mogo.module.v2x.listener;
*/
public interface AdapterCallback {
//分享列表加载更多
void loadMoreShareEventList(boolean moreOnePage);
void loadMoreShareEventList();
//分享列表首次刷新
void getShareEventResponse();
}

View File

@@ -136,7 +136,7 @@ public class V2XShareNetworkModel {
public void onError(Throwable e) {
super.onError(e);
if (callback != null){
callback.onFail("当前服务不可以, 请稍后重试");
callback.onFail("网络异常,点击刷新重试");
}
}
});
@@ -180,7 +180,7 @@ public class V2XShareNetworkModel {
public void onError(Throwable e) {
super.onError(e);
if (callback != null){
callback.onFail("当前服务不可以, 请稍后重试");
callback.onFail("网络异常,点击刷新重试");
}
}
});

View File

@@ -76,7 +76,7 @@ public class V2XNetworkLoadingView extends RelativeLayout {
}
}
public void stopWithError(String errormsg) {
public void stopWithError(String errormsg, int showRefreshButton) {
if (v2XAnimationManager != null) {
v2XAnimationManager.soptWithError();
}
@@ -84,7 +84,7 @@ public class V2XNetworkLoadingView extends RelativeLayout {
textView.setText(errormsg);
}
if (refresButton != null) {
refresButton.setVisibility(VISIBLE);
refresButton.setVisibility(showRefreshButton);
}
}