..
@@ -24,7 +24,7 @@ if (!isAndroidTestBuild()) {
|
||||
|
||||
if (!isAndroidTestBuild()) {
|
||||
apply plugin: 'chain.log.hook'
|
||||
hooklog{
|
||||
hooklog {
|
||||
enableTraceToServer false
|
||||
enableLoggerToLocal true
|
||||
}
|
||||
@@ -264,7 +264,7 @@ dependencies {
|
||||
} else {
|
||||
implementation project(':tts:tts-pad')
|
||||
implementation project(':core:function-impl:mogo-core-function-hmi')
|
||||
|
||||
|
||||
androidTestImplementation project(':core:mogo-core-function-call')
|
||||
androidTestImplementation project(':core:mogo-core-res')
|
||||
androidTestImplementation project(':core:function-impl:mogo-core-function-notice')
|
||||
@@ -353,7 +353,7 @@ def getWorkingBranchHash() {
|
||||
}
|
||||
|
||||
static def getBuildTime() {
|
||||
def buildTimeFormat = "yyyy-MM-dd HH:mm:ss"
|
||||
def buildTimeFormat = "yyyy-MM-dd HH:mm:ss"
|
||||
//设置时间格式
|
||||
SimpleDateFormat formatter = new SimpleDateFormat(buildTimeFormat, Locale.getDefault())
|
||||
//获取当前时间
|
||||
|
||||
@@ -7,8 +7,6 @@ import androidx.annotation.NonNull;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.LogLevel;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.launcher.crash.CrashSystem;
|
||||
import com.mogo.thread.ext.core.ThreadManager;
|
||||
import com.mogo.thread.ext.core.config.ThreadConfig;
|
||||
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
@@ -23,40 +21,40 @@ public class MogoApplication extends MainMoGoApplication {
|
||||
@Override
|
||||
protected void attachBaseContext(Context base) {
|
||||
super.attachBaseContext(base);
|
||||
ThreadConfig.Builder builder = new ThreadConfig.Builder().listener(new ThreadConfig.TaskExecuteListener() {
|
||||
@Override
|
||||
public boolean isEnabled() {
|
||||
return true; // 如果返回true,会有后续的回调;如果返回false, 不会有后续的回调
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onExecutorBefore(@NonNull Runnable runnable, @NonNull ThreadConfig.TaskType type) {
|
||||
//每个任务执行前回调
|
||||
// if (type == ThreadConfig.TaskType.HandlerThread) {
|
||||
// ThreadConfig.Builder builder = new ThreadConfig.Builder().listener(new ThreadConfig.TaskExecuteListener() {
|
||||
// @Override
|
||||
// public boolean isEnabled() {
|
||||
// return true; // 如果返回true,会有后续的回调;如果返回false, 不会有后续的回调
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onExecutorBefore(@NonNull Runnable runnable, @NonNull ThreadConfig.TaskType type) {
|
||||
// //每个任务执行前回调
|
||||
//// if (type == ThreadConfig.TaskType.HandlerThread) {
|
||||
////
|
||||
////
|
||||
//// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onExecutorAfter(@NonNull Runnable runnable, @NonNull ThreadConfig.TaskType type) {
|
||||
//每个任务执行后回调
|
||||
}
|
||||
|
||||
/**
|
||||
* @param core 线程池的核心数
|
||||
* @param max 线程池的最大线程数
|
||||
* @param active 线程池正在活跃的任务数
|
||||
* @param completed 线程池已完成的任务数
|
||||
*/
|
||||
@Override
|
||||
public void onExecutorStateChanged(@NonNull ThreadPoolExecutor pool, int core, int max, int active, long completed) {
|
||||
//线程池在执行过程,状态变化回调
|
||||
//Log.d("POOL", "core:" + core + ";max:" + max + ";active:" + active + ";completed:" + completed);
|
||||
}
|
||||
});
|
||||
builder.loggable(false);
|
||||
ThreadManager.INSTANCE.init(builder);
|
||||
// @Override
|
||||
// public void onExecutorAfter(@NonNull Runnable runnable, @NonNull ThreadConfig.TaskType type) {
|
||||
// //每个任务执行后回调
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @param core 线程池的核心数
|
||||
// * @param max 线程池的最大线程数
|
||||
// * @param active 线程池正在活跃的任务数
|
||||
// * @param completed 线程池已完成的任务数
|
||||
// */
|
||||
// @Override
|
||||
// public void onExecutorStateChanged(@NonNull ThreadPoolExecutor pool, int core, int max, int active, long completed) {
|
||||
// //线程池在执行过程,状态变化回调
|
||||
// //Log.d("POOL", "core:" + core + ";max:" + max + ";active:" + active + ";completed:" + completed);
|
||||
// }
|
||||
// });
|
||||
// builder.loggable(false);
|
||||
// ThreadManager.INSTANCE.init(builder);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,9 +34,13 @@ class FuncConfigNetWorkModel {
|
||||
if (error == null) {
|
||||
error = onError
|
||||
}
|
||||
//todo test
|
||||
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
|
||||
// map["sn"] = "20220118J1V4G9W"
|
||||
map["mac"] = DeviceUtils.getMacAddress()
|
||||
// map["mac"] = "48:b0:2d:3a:9d:34"
|
||||
map["channelVersion"] = FuncConfigConst.getChannelCode()
|
||||
// map["channelVersion"] = 2
|
||||
}
|
||||
loader {
|
||||
apiCall {
|
||||
|
||||
@@ -12,10 +12,12 @@ import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
|
||||
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import java.lang.ref.WeakReference
|
||||
|
||||
class BatteryGroupView : LinearLayout {
|
||||
class BatteryGroupView : LinearLayout, IMoGoSkinModeChangeListener {
|
||||
|
||||
constructor(
|
||||
context: Context,
|
||||
@@ -29,6 +31,7 @@ class BatteryGroupView : LinearLayout {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_battery_group, this, true)
|
||||
private var batteryView: BatteryView = (view as BatteryGroupView).findViewById(R.id.viewBattery)
|
||||
private var ivBatteryCharge: ImageView = (view as BatteryGroupView).findViewById(R.id.ivBatteryCharge)
|
||||
private var mSkinMode = 0
|
||||
|
||||
private val batteryStateReceiver: BroadcastReceiver = object : BroadcastReceiver() {
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
@@ -49,6 +52,9 @@ class BatteryGroupView : LinearLayout {
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
const val TAG = "BatteryGroupView"
|
||||
|
||||
class BatteryHandler(batteryGroupView: BatteryGroupView) : Handler() {
|
||||
|
||||
//虚引用
|
||||
@@ -69,6 +75,10 @@ class BatteryGroupView : LinearLayout {
|
||||
it.batteryView.setCharging(isCharging)
|
||||
if (isCharging) {
|
||||
it.ivBatteryCharge.visibility = View.VISIBLE
|
||||
when(it.mSkinMode){
|
||||
0 -> it.ivBatteryCharge.setImageResource(R.drawable.battery_charge_light)
|
||||
1 -> it.ivBatteryCharge.setImageResource(R.drawable.battery_charge_dark)
|
||||
}
|
||||
} else {
|
||||
it.ivBatteryCharge.visibility = View.GONE
|
||||
}
|
||||
@@ -83,10 +93,17 @@ class BatteryGroupView : LinearLayout {
|
||||
val intentFilter = IntentFilter()
|
||||
intentFilter.addAction(Intent.ACTION_BATTERY_CHANGED)
|
||||
context.registerReceiver(batteryStateReceiver, intentFilter)
|
||||
// 添加换肤监听
|
||||
CallerSkinModeListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
context.unregisterReceiver(batteryStateReceiver)
|
||||
CallerSkinModeListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
override fun onSkinModeChange(skinMode: Int) {
|
||||
mSkinMode = skinMode
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,8 @@ import android.os.Handler
|
||||
import android.os.Message
|
||||
import android.util.AttributeSet
|
||||
import androidx.appcompat.widget.AppCompatImageView
|
||||
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
|
||||
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import java.lang.ref.WeakReference
|
||||
|
||||
@@ -17,7 +19,7 @@ class WifiStateView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : AppCompatImageView(context, attrs, defStyleAttr) {
|
||||
) : AppCompatImageView(context, attrs, defStyleAttr), IMoGoSkinModeChangeListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "WifiStateView"
|
||||
@@ -34,15 +36,8 @@ class WifiStateView @JvmOverloads constructor(
|
||||
override fun handleMessage(msg: Message) {
|
||||
super.handleMessage(msg)
|
||||
val wifiStateView = stateViewWeakReference?.get()
|
||||
wifiStateView?.let {
|
||||
when (msg.what) {
|
||||
-1 -> wifiStateView.setImageResource(R.drawable.wifi_light_state_close)
|
||||
0 -> wifiStateView.setImageResource(R.drawable.wifi_light_state_one)
|
||||
1 -> wifiStateView.setImageResource(R.drawable.wifi_light_state_two)
|
||||
2 -> wifiStateView.setImageResource(R.drawable.wifi_light_state_three)
|
||||
3 -> wifiStateView.setImageResource(R.drawable.wifi_light_state_four)
|
||||
4 -> wifiStateView.setImageResource(R.drawable.wifi_light_state_five)
|
||||
}
|
||||
wifiStateView?.updateView(msg.what) {
|
||||
wifiStateView.setImageResource(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -51,6 +46,12 @@ class WifiStateView @JvmOverloads constructor(
|
||||
private var wifiManager: WifiManager? = null
|
||||
private var wifiHandler: WifiHandler? = null
|
||||
|
||||
@Volatile
|
||||
private var mSkinMode: Int = 0
|
||||
|
||||
@Volatile
|
||||
private var level: Int = 0
|
||||
|
||||
init {
|
||||
wifiManager =
|
||||
context.applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager?
|
||||
@@ -62,12 +63,13 @@ class WifiStateView @JvmOverloads constructor(
|
||||
when (intent.action) {
|
||||
WifiManager.WIFI_STATE_CHANGED_ACTION, WifiManager.RSSI_CHANGED_ACTION -> {
|
||||
if (wifiManager!!.wifiState == WifiManager.WIFI_STATE_DISABLED
|
||||
|| wifiManager!!.wifiState ==WifiManager.WIFI_STATE_DISABLING) {
|
||||
|| wifiManager!!.wifiState == WifiManager.WIFI_STATE_DISABLING
|
||||
) {
|
||||
wifiHandler?.sendEmptyMessage(-1)
|
||||
return
|
||||
}
|
||||
val wifiInfo = wifiManager!!.connectionInfo
|
||||
val level = WifiManager.calculateSignalLevel(wifiInfo.rssi, 5)
|
||||
level = WifiManager.calculateSignalLevel(wifiInfo.rssi, 5)
|
||||
wifiHandler?.sendEmptyMessage(level)
|
||||
}
|
||||
}
|
||||
@@ -82,11 +84,44 @@ class WifiStateView @JvmOverloads constructor(
|
||||
//Wifi信号强度变化
|
||||
intentFilter.addAction(WifiManager.RSSI_CHANGED_ACTION)
|
||||
context.registerReceiver(wifiStateReceiver, intentFilter)
|
||||
// 添加换肤监听
|
||||
CallerSkinModeListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
wifiHandler?.removeCallbacksAndMessages(null)
|
||||
context.unregisterReceiver(wifiStateReceiver)
|
||||
CallerSkinModeListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
override fun onSkinModeChange(skinMode: Int) {
|
||||
mSkinMode = skinMode
|
||||
wifiHandler?.sendEmptyMessage(level)
|
||||
}
|
||||
|
||||
fun updateView(wifiState: Int, resId: ((Int) -> Unit)) {
|
||||
when (mSkinMode) {
|
||||
0 -> {
|
||||
when (wifiState) {
|
||||
-1 -> resId.invoke(R.drawable.wifi_light_state_close)
|
||||
0 -> resId.invoke(R.drawable.wifi_light_state_one)
|
||||
1 -> resId.invoke(R.drawable.wifi_light_state_two)
|
||||
2 -> resId.invoke(R.drawable.wifi_light_state_three)
|
||||
3 -> resId.invoke(R.drawable.wifi_light_state_four)
|
||||
4 -> resId.invoke(R.drawable.wifi_light_state_five)
|
||||
}
|
||||
}
|
||||
1 -> {
|
||||
when (wifiState) {
|
||||
-1 -> resId.invoke(R.drawable.wifi_light_state_close)
|
||||
0 -> resId.invoke(R.drawable.wifi_dark_state_one)
|
||||
1 -> resId.invoke(R.drawable.wifi_dark_state_two)
|
||||
2 -> resId.invoke(R.drawable.wifi_dark_state_three)
|
||||
3 -> resId.invoke(R.drawable.wifi_dark_state_four)
|
||||
4 -> resId.invoke(R.drawable.wifi_dark_state_five)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 640 B |
|
Before Width: | Height: | Size: 467 B After Width: | Height: | Size: 467 B |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
@@ -17,6 +17,6 @@
|
||||
android:layout_height="@dimen/dp_22"
|
||||
android:layout_marginStart="@dimen/dp_6"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/battery_charge"
|
||||
android:src="@drawable/battery_charge_light"
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
@@ -59,8 +59,8 @@ bytex.ASM_API=ASM7
|
||||
HOOK_LOG_VERSION=1.6.1
|
||||
SERVICE_CHAIN_VERSION=1.1.0
|
||||
|
||||
BIZCONFIG_VERSION=1.3.1
|
||||
SERVICE_BIZ_VERSION=1.2.3
|
||||
BIZCONFIG_VERSION=1.3.2
|
||||
SERVICE_BIZ_VERSION=1.2.4
|
||||
################ 外部依赖引用 ################
|
||||
# loglib
|
||||
LOGLIB_VERSION=1.3.38
|
||||
|
||||