version:1.2
fix: update:更新app name,增加快捷控制
@@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
|
||||
apply plugin: "com.tencent.android.tpns"
|
||||
|
||||
def appName() {
|
||||
return "关怀系统OS"
|
||||
return "AIOS系统"
|
||||
}
|
||||
|
||||
def releaseTime() {
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
android:sharedUserId="android.uid.system">
|
||||
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
|
||||
<!-- 清单文件中, 申明监听通话精确状态权限,该权限需要android:sharedUserId="android.uid.system" -->
|
||||
<uses-permission android:name="android.permission.READ_PRECISE_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.DELETE_PACKAGES" />
|
||||
@@ -13,6 +12,8 @@
|
||||
<uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<uses-permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
|
||||
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
|
||||
@@ -61,7 +62,7 @@
|
||||
<uses-permission android:name="android.permission.GET_TASKS" />
|
||||
|
||||
<application
|
||||
android:name="com.uiuios.aios.base.BaseApplication"
|
||||
android:name=".base.BaseApplication"
|
||||
android:allowBackup="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
@@ -71,8 +72,9 @@
|
||||
android:restoreAnyVersion="true"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
<activity android:name=".activity.ControlActivity"></activity>
|
||||
<activity
|
||||
android:name="com.uiuios.aios.activity.main.MainActivity"
|
||||
android:name=".activity.main.MainActivity"
|
||||
android:clearTaskOnLaunch="true"
|
||||
android:enabled="true"
|
||||
android:excludeFromRecents="true"
|
||||
@@ -92,30 +94,30 @@
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name="com.uiuios.aios.activity.contact.ContactActivity" />
|
||||
<activity android:name=".activity.contact.ContactActivity" />
|
||||
<activity
|
||||
android:name="com.uiuios.aios.activity.code.HealthCodeActivity"
|
||||
android:name=".activity.code.HealthCodeActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="sensorPortrait" />
|
||||
<activity
|
||||
android:name="com.uiuios.aios.activity.weather.WeatherActivity"
|
||||
android:name=".activity.weather.WeatherActivity"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name="com.uiuios.aios.activity.EmergencyActivity"
|
||||
android:name=".activity.EmergencyActivity"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name="com.uiuios.aios.activity.NoticeActivity"
|
||||
android:name=".activity.NoticeActivity"
|
||||
android:excludeFromRecents="true"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/activity_styles" />
|
||||
<activity android:name="com.uiuios.aios.activity.APPListActivity" />
|
||||
<activity android:name=".activity.APPListActivity" />
|
||||
<activity
|
||||
android:name="com.uiuios.aios.activity.alarm.AlarmClockActivity"
|
||||
android:name=".activity.alarm.AlarmClockActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppWhiteTheme" />
|
||||
|
||||
<receiver
|
||||
android:name="com.uiuios.aios.receiver.BootReceiver"
|
||||
android:name=".receiver.BootReceiver"
|
||||
android:enabled="true"
|
||||
android:exported="true">
|
||||
<intent-filter android:priority="1000">
|
||||
@@ -133,16 +135,16 @@
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
<receiver
|
||||
android:name="com.uiuios.aios.receiver.InstallResultReceiver"
|
||||
android:name=".receiver.InstallResultReceiver"
|
||||
android:enabled="true"
|
||||
android:exported="true" />
|
||||
|
||||
<service
|
||||
android:name="com.uiuios.aios.alarm.AlarmService"
|
||||
android:name=".alarm.AlarmService"
|
||||
android:enabled="true"
|
||||
android:exported="true" />
|
||||
<service
|
||||
android:name="com.uiuios.aios.service.main.MainService"
|
||||
android:name=".service.main.MainService"
|
||||
android:enabled="true"
|
||||
android:exported="true">
|
||||
<intent-filter android:priority="1000">
|
||||
@@ -154,19 +156,16 @@
|
||||
</intent-filter>
|
||||
</service>
|
||||
<service
|
||||
android:name="com.uiuios.aios.service.NotificationService"
|
||||
android:name=".service.NotificationService"
|
||||
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
|
||||
<intent-filter>
|
||||
<action android:name="android.service.notification.NotificationListenerService" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<!-- 声明service组件 -->
|
||||
</service> <!-- 声明service组件 -->
|
||||
<service
|
||||
android:name="com.baidu.location.f"
|
||||
android:enabled="true"
|
||||
android:process=":remote" />
|
||||
<!-- 应用的其它配置 -->
|
||||
android:process=":remote" /> <!-- 应用的其它配置 -->
|
||||
<uses-library
|
||||
android:name="org.apache.http.legacy"
|
||||
android:required="false" />
|
||||
@@ -233,6 +232,7 @@
|
||||
<action android:name="com.tencent.android.xg.vip.action.ACTION_SDK_KEEPALIVE" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<!-- 【必须】移动推送 TPNS service -->
|
||||
<service
|
||||
android:name="com.tencent.android.tpush.service.XGVipPushService"
|
||||
@@ -263,8 +263,9 @@
|
||||
android:exported="true"
|
||||
tools:replace="android:exported" />
|
||||
<!-- 【可选】APP实现的Receiver,用于接收消息透传和操作结果的回调,请根据需要添加 -->
|
||||
|
||||
<!-- YOUR_PACKAGE_PATH.CustomPushReceiver需要改为自己的Receiver: -->
|
||||
<receiver android:name="com.uiuios.aios.tpush.MessageReceiver">
|
||||
<receiver android:name=".tpush.MessageReceiver">
|
||||
<intent-filter>
|
||||
|
||||
<!-- 接收消息透传 -->
|
||||
@@ -294,8 +295,10 @@
|
||||
<meta-data
|
||||
android:name="XG_V2_ACCESS_KEY"
|
||||
android:value="A0PFUHEPEKKM" />
|
||||
|
||||
<meta-data
|
||||
android:name="com.baidu.lbsapi.API_KEY"
|
||||
android:value="QQnVGVe6EcQeHo7epbnxk2EGhGkkj7hM" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
483
app/src/main/java/com/uiuios/aios/activity/ControlActivity.java
Normal file
@@ -0,0 +1,483 @@
|
||||
package com.uiuios.aios.activity;
|
||||
|
||||
import android.bluetooth.BluetoothAdapter;
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.hardware.camera2.CameraAccessException;
|
||||
import android.hardware.camera2.CameraCharacteristics;
|
||||
import android.hardware.camera2.CameraManager;
|
||||
import android.media.AudioManager;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.net.wifi.WifiInfo;
|
||||
import android.net.wifi.WifiManager;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.SeekBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.baidu.location.BDAbstractLocationListener;
|
||||
import com.baidu.location.BDLocation;
|
||||
import com.baidu.location.LocationClient;
|
||||
import com.uiuios.aios.R;
|
||||
import com.uiuios.aios.manager.AmapManager;
|
||||
import com.uiuios.aios.utils.BrightnessUtils;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
|
||||
public class ControlActivity extends AppCompatActivity {
|
||||
private static final String TAG = ControlActivity.class.getSimpleName();
|
||||
|
||||
@BindView(R.id.tv_wifi)
|
||||
TextView tv_wifi;
|
||||
@BindView(R.id.tv_wifi_ssid)
|
||||
TextView tv_wifi_ssid;
|
||||
@BindView(R.id.tv_bt)
|
||||
TextView tv_bt;
|
||||
@BindView(R.id.tv_bt_ssid)
|
||||
TextView tv_bt_ssid;
|
||||
|
||||
@BindView(R.id.tv_font_size)
|
||||
TextView tv_font_size;
|
||||
@BindView(R.id.seekBar)
|
||||
SeekBar seekBar;
|
||||
@BindView(R.id.seekbar_brightness)
|
||||
SeekBar seekbar_brightness;
|
||||
@BindView(R.id.seekbar_sound)
|
||||
SeekBar seekbar_sound;
|
||||
|
||||
@BindView(R.id.tv_sound)
|
||||
TextView tv_sound;
|
||||
|
||||
@BindView(R.id.tv_battery)
|
||||
TextView tv_battery;
|
||||
@BindView(R.id.tv_electricity)
|
||||
TextView tv_electricity;
|
||||
@BindView(R.id.tv_flashlight)
|
||||
TextView tv_flashlight;
|
||||
@BindView(R.id.tv_flashlight_switch)
|
||||
TextView tv_flashlight_switch;
|
||||
|
||||
@BindView(R.id.tv_brightness)
|
||||
TextView tv_brightness;
|
||||
@BindView(R.id.tv_location)
|
||||
TextView tv_location;
|
||||
|
||||
@BindView(R.id.cl_wifi)
|
||||
ConstraintLayout cl_wifi;
|
||||
@BindView(R.id.cl_bt)
|
||||
ConstraintLayout cl_bt;
|
||||
@BindView(R.id.cl_battery)
|
||||
ConstraintLayout cl_battery;
|
||||
@BindView(R.id.cl_flashlight)
|
||||
ConstraintLayout cl_flashlight;
|
||||
|
||||
|
||||
private ContentResolver crv;
|
||||
private static final String ACTION_FLASHLIGHT_CHANGED =
|
||||
"com.android.settings.flashlight.action.FLASHLIGHT_CHANGED";
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_control);
|
||||
ButterKnife.bind(this);
|
||||
crv = getContentResolver();
|
||||
initView();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
getWifi();
|
||||
registerReceivers();
|
||||
getBluetooth();
|
||||
registerBluetoothReceiver();
|
||||
getFlashlight();
|
||||
getFontSize();
|
||||
getLocation();
|
||||
getBrightness();
|
||||
getSound();
|
||||
}
|
||||
|
||||
private void getWifi() {
|
||||
cl_wifi.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
startActivity(new Intent(android.provider.Settings.ACTION_WIFI_SETTINGS));
|
||||
}
|
||||
});
|
||||
if (isWifiEnabled()) {
|
||||
tv_wifi_ssid.setText(getSSID());
|
||||
cl_wifi.setBackground(getDrawable(R.drawable.control_background_item));
|
||||
} else {
|
||||
tv_wifi_ssid.setText("未连接");
|
||||
cl_wifi.setBackground(getDrawable(R.drawable.control_background_item_dis));
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isWifiEnabled() {
|
||||
WifiManager wifiMgr = (WifiManager) getSystemService(Context.WIFI_SERVICE);
|
||||
if (wifiMgr.getWifiState() == WifiManager.WIFI_STATE_ENABLED) {
|
||||
ConnectivityManager connManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
NetworkInfo wifiInfo = connManager
|
||||
.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
|
||||
return wifiInfo.isConnected();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private WifiReceiver mWifiReceiver;
|
||||
|
||||
private void registerReceivers() {
|
||||
registerWiFiReceiver();
|
||||
}
|
||||
|
||||
private void registerWiFiReceiver() {
|
||||
if (mWifiReceiver == null) {
|
||||
mWifiReceiver = new WifiReceiver();
|
||||
}
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);
|
||||
filter.addAction(WifiManager.WIFI_STATE_CHANGED_ACTION);
|
||||
filter.addAction(WifiManager.RSSI_CHANGED_ACTION);
|
||||
filter.addAction(WifiManager.NETWORK_IDS_CHANGED_ACTION);
|
||||
filter.addAction(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION);
|
||||
filter.addAction(WifiManager.CONFIGURED_NETWORKS_CHANGED_ACTION);
|
||||
filter.addAction(WifiManager.LINK_CONFIGURATION_CHANGED_ACTION);
|
||||
filter.addAction(WifiManager.SUPPLICANT_STATE_CHANGED_ACTION);
|
||||
filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
|
||||
registerReceiver(mWifiReceiver, filter);
|
||||
}
|
||||
|
||||
public class WifiReceiver extends BroadcastReceiver {
|
||||
private static final String TAG = "wifiReceiver";
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
switch (intent.getAction()) {
|
||||
case WifiManager.RSSI_CHANGED_ACTION:
|
||||
Log.e(TAG, "wifi信号强度变化");
|
||||
break;
|
||||
//wifi连接上与否
|
||||
case WifiManager.NETWORK_STATE_CHANGED_ACTION:
|
||||
NetworkInfo info = intent.getParcelableExtra(WifiManager.EXTRA_NETWORK_INFO);
|
||||
if (info.getState().equals(NetworkInfo.State.DISCONNECTED)) {
|
||||
Log.e(TAG, "wifi断开");
|
||||
tv_wifi_ssid.setText("未连接");
|
||||
cl_wifi.setBackground(getDrawable(R.drawable.control_background_item_dis));
|
||||
} else if (info.getState().equals(NetworkInfo.State.CONNECTED)) {
|
||||
WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
|
||||
WifiInfo wifiInfo = wifiManager.getConnectionInfo();
|
||||
//获取当前wifi名称
|
||||
String newSSID = wifiInfo.getSSID();
|
||||
tv_wifi_ssid.setText(newSSID);
|
||||
cl_wifi.setBackground(getDrawable(R.drawable.control_background_item));
|
||||
}
|
||||
break;
|
||||
//wifi打开与否
|
||||
case WifiManager.WIFI_STATE_CHANGED_ACTION:
|
||||
int wifistate = intent.getIntExtra(WifiManager.EXTRA_WIFI_STATE, WifiManager.WIFI_STATE_DISABLED);
|
||||
if (wifistate == WifiManager.WIFI_STATE_DISABLED) {
|
||||
Log.e(TAG, "系统关闭wifi");
|
||||
tv_wifi_ssid.setText("关");
|
||||
cl_wifi.setBackground(getDrawable(R.drawable.control_background_item_dis));
|
||||
} else if (wifistate == WifiManager.WIFI_STATE_ENABLED) {
|
||||
Log.e(TAG, "系统开启wifi");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前连接WIFI的SSID
|
||||
*/
|
||||
public String getSSID() {
|
||||
WifiManager wm = (WifiManager) getSystemService(WIFI_SERVICE);
|
||||
if (wm != null) {
|
||||
WifiInfo winfo = wm.getConnectionInfo();
|
||||
if (winfo != null) {
|
||||
String s = winfo.getSSID();
|
||||
if (s.length() > 2 && s.charAt(0) == '"' && s.charAt(s.length() - 1) == '"') {
|
||||
return s.substring(1, s.length() - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
private void getBluetooth() {
|
||||
cl_bt.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
startActivity(new Intent(Settings.ACTION_BLUETOOTH_SETTINGS));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private BluetoothMonitorReceiver bleListenerReceiver;
|
||||
|
||||
private void registerBluetoothReceiver() {
|
||||
bleListenerReceiver = new BluetoothMonitorReceiver();
|
||||
IntentFilter intentFilter = new IntentFilter();
|
||||
// 监视蓝牙关闭和打开的状态
|
||||
intentFilter.addAction(BluetoothAdapter.ACTION_STATE_CHANGED);
|
||||
// 监视蓝牙设备与APP连接的状态
|
||||
intentFilter.addAction(BluetoothDevice.ACTION_ACL_DISCONNECTED);
|
||||
intentFilter.addAction(BluetoothDevice.ACTION_ACL_CONNECTED);
|
||||
// 注册广播
|
||||
registerReceiver(this.bleListenerReceiver, intentFilter);
|
||||
}
|
||||
|
||||
public class BluetoothMonitorReceiver extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
String action = intent.getAction();
|
||||
if (action != null) {
|
||||
switch (action) {
|
||||
case BluetoothAdapter.ACTION_STATE_CHANGED:
|
||||
int blueState = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, 0);
|
||||
switch (blueState) {
|
||||
case BluetoothAdapter.STATE_TURNING_ON:
|
||||
tv_bt_ssid.setText("蓝牙正在打开");
|
||||
cl_bt.setBackground(getDrawable(R.drawable.control_background_item));
|
||||
break;
|
||||
case BluetoothAdapter.STATE_ON:
|
||||
tv_bt_ssid.setText("蓝牙已经打开");
|
||||
cl_bt.setBackground(getDrawable(R.drawable.control_background_item));
|
||||
break;
|
||||
case BluetoothAdapter.STATE_TURNING_OFF:
|
||||
tv_bt_ssid.setText("蓝牙正在关闭");
|
||||
cl_bt.setBackground(getDrawable(R.drawable.control_background_item));
|
||||
break;
|
||||
case BluetoothAdapter.STATE_OFF:
|
||||
tv_bt_ssid.setText("关");
|
||||
cl_bt.setBackground(getDrawable(R.drawable.control_background_item_dis));
|
||||
break;
|
||||
default:
|
||||
}
|
||||
break;
|
||||
case BluetoothDevice.ACTION_ACL_CONNECTED:
|
||||
tv_bt_ssid.setText("蓝牙设备已连接");
|
||||
cl_bt.setBackground(getDrawable(R.drawable.control_background_item));
|
||||
break;
|
||||
case BluetoothDevice.ACTION_ACL_DISCONNECTED:
|
||||
tv_bt_ssid.setText("蓝牙设备已断开");
|
||||
cl_bt.setBackground(getDrawable(R.drawable.control_background_item_dis));
|
||||
break;
|
||||
default:
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void getFlashlight() {
|
||||
if (isFlashlightEnabled()) {
|
||||
tv_flashlight_switch.setText("开");
|
||||
} else {
|
||||
tv_flashlight_switch.setText("关");
|
||||
}
|
||||
cl_flashlight.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (isFlashlightEnabled()) {
|
||||
Settings.Secure.putInt(crv, Settings.Secure.FLASHLIGHT_ENABLED, 0);
|
||||
sendBroadcast(new Intent(ACTION_FLASHLIGHT_CHANGED));
|
||||
tv_flashlight_switch.setText("关");
|
||||
} else {
|
||||
Settings.Secure.putInt(crv, Settings.Secure.FLASHLIGHT_ENABLED, 1);
|
||||
sendBroadcast(new Intent(ACTION_FLASHLIGHT_CHANGED));
|
||||
tv_flashlight_switch.setText("开");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private boolean isFlashlightAvailable() {
|
||||
int defaultAvailability = 0;
|
||||
try {
|
||||
// check if there is a flash unit
|
||||
if (getCameraId(this) != null) {
|
||||
defaultAvailability = 1;
|
||||
}
|
||||
} catch (CameraAccessException e) {
|
||||
Log.e(TAG, "Error getting camera id.", e);
|
||||
}
|
||||
return Settings.Secure.getInt(crv, Settings.Secure.FLASHLIGHT_AVAILABLE, defaultAvailability) == 1;
|
||||
}
|
||||
|
||||
private static String getCameraId(Context context) throws CameraAccessException {
|
||||
final CameraManager cameraManager = context.getSystemService(CameraManager.class);
|
||||
final String[] ids = cameraManager.getCameraIdList();
|
||||
for (String id : ids) {
|
||||
CameraCharacteristics c = cameraManager.getCameraCharacteristics(id);
|
||||
Boolean flashAvailable = c.get(CameraCharacteristics.FLASH_INFO_AVAILABLE);
|
||||
Integer lensFacing = c.get(CameraCharacteristics.LENS_FACING);
|
||||
if (flashAvailable != null && flashAvailable
|
||||
&& lensFacing != null && lensFacing == CameraCharacteristics.LENS_FACING_BACK) {
|
||||
return id;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private boolean isFlashlightEnabled() {
|
||||
return Settings.Secure.getInt(crv, Settings.Secure.FLASHLIGHT_ENABLED, 0) == 1;
|
||||
}
|
||||
|
||||
private void getFontSize() {
|
||||
float fontScale = Settings.System.getFloat(crv, Settings.System.FONT_SCALE, 0.0f);
|
||||
Log.e(TAG, "getHardware: fontScale = " + fontScale);
|
||||
List<String> mEntries = Arrays.asList(getResources().getStringArray(R.array.entries_font_size));
|
||||
List<String> strEntryValues = Arrays.asList(getResources().getStringArray(R.array.entryvalues_font_size));
|
||||
String font_size;
|
||||
int index = strEntryValues.indexOf(String.valueOf(fontScale));
|
||||
if (index == -1) {
|
||||
font_size = "默认";
|
||||
} else {
|
||||
font_size = mEntries.get(index);
|
||||
}
|
||||
tv_font_size.setText(font_size);
|
||||
seekBar.setProgress(index);
|
||||
seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
||||
@Override
|
||||
public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
|
||||
Settings.System.putFloat(crv, Settings.System.FONT_SCALE, Float.parseFloat(strEntryValues.get(i)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartTrackingTouch(SeekBar seekBar) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStopTrackingTouch(SeekBar seekBar) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void getLocation() {
|
||||
BDLocation bdLocation = AmapManager.getInstance().getNowMapLocation();
|
||||
if (bdLocation != null) {
|
||||
if (bdLocation.getLocType() == BDLocation.TypeGpsLocation // GPS定位结果
|
||||
|| bdLocation.getLocType() == BDLocation.TypeNetWorkLocation // 网络定位结果
|
||||
|| bdLocation.getLocType() == BDLocation.TypeOffLineLocation) {// 离线定位结果
|
||||
tv_location.setText(bdLocation.getAddrStr());
|
||||
} else {
|
||||
tv_location.setText("未知");
|
||||
}
|
||||
} else {
|
||||
tv_location.setText("定位失败");
|
||||
}
|
||||
LocationClient locationClient = AmapManager.getInstance().getLocationClient();
|
||||
locationClient.stop();
|
||||
locationClient.start();
|
||||
locationClient.registerLocationListener(new BDAbstractLocationListener() {
|
||||
@Override
|
||||
public void onReceiveLocation(BDLocation bdLocation) {
|
||||
switch (bdLocation.getLocType()) {
|
||||
case BDLocation.TypeGpsLocation:// GPS定位结果
|
||||
case BDLocation.TypeNetWorkLocation:// 网络定位结果
|
||||
case BDLocation.TypeOffLineLocation:// 离线定位结果
|
||||
tv_location.setText(bdLocation.getAddrStr());
|
||||
break;
|
||||
default:
|
||||
tv_location.setText("定位失败");
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void getBrightness() {
|
||||
seekbar_brightness.setMin(1);
|
||||
seekbar_brightness.setMax(255);
|
||||
//亮度
|
||||
int brightness = Settings.System.getInt(crv, Settings.System.SCREEN_BRIGHTNESS, 1);
|
||||
seekbar_brightness.setProgress(brightness);
|
||||
Log.e(TAG, "getHardware: brightness = " + brightness);
|
||||
int gamma = BrightnessUtils.convertLinearToGamma(brightness, 1, 255);
|
||||
Log.e(TAG, "getHardware: gamma = " + gamma);
|
||||
long percentage = Math.round((((double) gamma / 65535) * 100f));
|
||||
tv_brightness.setText(percentage + "%");
|
||||
Log.e(TAG, "getHardware: percentage = " + percentage);
|
||||
seekbar_brightness.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
||||
@Override
|
||||
public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
|
||||
Settings.System.putInt(crv, Settings.System.SCREEN_BRIGHTNESS, i);
|
||||
int gamma = BrightnessUtils.convertLinearToGamma(i, 1, 255);
|
||||
long percentage = Math.round((((double) gamma / 65535) * 100f));
|
||||
tv_brightness.setText(percentage + "%");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartTrackingTouch(SeekBar seekBar) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStopTrackingTouch(SeekBar seekBar) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private AudioManager mAudioManager;
|
||||
|
||||
private void getSound() {
|
||||
mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
|
||||
//最大音量
|
||||
int maxVolume = mAudioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
|
||||
seekbar_sound.setMax(maxVolume);
|
||||
Log.e(TAG, "getHardware: maxVolume = " + maxVolume);
|
||||
//音量
|
||||
int streamVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
|
||||
seekbar_sound.setProgress(streamVolume);
|
||||
Log.e(TAG, "getHardware: streamVolume = " + streamVolume);
|
||||
int currentVolume = (int) (((double) streamVolume / (double) maxVolume) * 100f);
|
||||
Log.e(TAG, "getHardware: currentVolume = " + currentVolume);
|
||||
tv_sound.setText(currentVolume + "%");
|
||||
seekbar_sound.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
||||
@Override
|
||||
public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
|
||||
int volume = (int) (((double) i / (double) maxVolume) * 100f);
|
||||
tv_sound.setText(volume + "%");
|
||||
mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, i, 0);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartTrackingTouch(SeekBar seekBar) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStopTrackingTouch(SeekBar seekBar) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (mWifiReceiver != null) unregisterReceiver(mWifiReceiver);
|
||||
}
|
||||
}
|
||||
@@ -47,6 +47,7 @@ import com.qweather.sdk.view.QWeather;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.uiuios.aios.BuildConfig;
|
||||
import com.uiuios.aios.R;
|
||||
import com.uiuios.aios.activity.ControlActivity;
|
||||
import com.uiuios.aios.activity.EmergencyActivity;
|
||||
import com.uiuios.aios.activity.alarm.AlarmClockActivity;
|
||||
import com.uiuios.aios.activity.code.HealthCodeActivity;
|
||||
@@ -113,9 +114,10 @@ public class CustomFragment extends Fragment implements NetworkUtils.OnNetworkSt
|
||||
ConstraintLayout cl_ai;
|
||||
@BindView(R.id.cl_appstore)
|
||||
ConstraintLayout cl_appstore;
|
||||
// @BindView(R.id.cl_exit)
|
||||
// @BindView(R.id.cl_exit)
|
||||
// ConstraintLayout cl_exit;
|
||||
|
||||
@BindView(R.id.cl_control)
|
||||
ConstraintLayout cl_control;
|
||||
|
||||
// @BindView(R.id.cl_battery)
|
||||
// ConstraintLayout cl_battery;
|
||||
@@ -464,6 +466,13 @@ public class CustomFragment extends Fragment implements NetworkUtils.OnNetworkSt
|
||||
// showPassword();
|
||||
// }
|
||||
// });
|
||||
cl_control.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
startActivity(new Intent(mContext, ControlActivity.class));
|
||||
}
|
||||
});
|
||||
|
||||
refreshMemory();
|
||||
}
|
||||
|
||||
|
||||
@@ -74,8 +74,13 @@ public class AmapManager {
|
||||
String aMapLocationjson = mMMKV.decodeString(AMAPLOCATION_JSON_KEY, "");
|
||||
Type type = new TypeToken<BDLocation>() {
|
||||
}.getType();
|
||||
BDLocation bdLocation = new Gson().fromJson(aMapLocationjson, type);
|
||||
return bdLocation;
|
||||
try {
|
||||
BDLocation bdLocation = new Gson().fromJson(aMapLocationjson, type);
|
||||
return bdLocation;
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "getNowMapLocation: " + e.getMessage());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return this.mLocation;
|
||||
}
|
||||
@@ -123,7 +128,7 @@ public class AmapManager {
|
||||
* 定位结果回调,重写onReceiveLocation方法,可以直接拷贝如下代码到自己工程中修改
|
||||
*
|
||||
*/
|
||||
private BDAbstractLocationListener mListener = new BDAbstractLocationListener() {
|
||||
private BDAbstractLocationListener mListener = new BDAbstractLocationListener() {
|
||||
|
||||
/**
|
||||
* 定位请求回调函数
|
||||
|
||||
142
app/src/main/java/com/uiuios/aios/utils/BrightnessUtils.java
Normal file
@@ -0,0 +1,142 @@
|
||||
|
||||
/*
|
||||
* Copyright (C) 2018 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.uiuios.aios.utils;
|
||||
|
||||
import android.util.MathUtils;
|
||||
|
||||
public class BrightnessUtils {
|
||||
|
||||
public static final int GAMMA_SPACE_MIN = 0;
|
||||
public static final int GAMMA_SPACE_MAX = 65535;
|
||||
|
||||
// Hybrid Log Gamma constant values
|
||||
private static final float R = 0.5f;
|
||||
private static final float A = 0.17883277f;
|
||||
private static final float B = 0.28466892f;
|
||||
private static final float C = 0.55991073f;
|
||||
|
||||
/**
|
||||
* A function for converting from the gamma space that the slider works in to the
|
||||
* linear space that the setting works in.
|
||||
* <p>
|
||||
* The gamma space effectively provides us a way to make linear changes to the slider that
|
||||
* result in linear changes in perception. If we made changes to the slider in the linear space
|
||||
* then we'd see an approximately logarithmic change in perception (c.f. Fechner's Law).
|
||||
* <p>
|
||||
* Internally, this implements the Hybrid Log Gamma electro-optical transfer function, which is
|
||||
* a slight improvement to the typical gamma transfer function for displays whose max
|
||||
* brightness exceeds the 120 nit reference point, but doesn't set a specific reference
|
||||
* brightness like the PQ function does.
|
||||
* <p>
|
||||
* Note that this transfer function is only valid if the display's backlight value is a linear
|
||||
* control. If it's calibrated to be something non-linear, then a different transfer function
|
||||
* should be used.
|
||||
*
|
||||
* @param val The slider value.
|
||||
* @param min The minimum acceptable value for the setting.
|
||||
* @param max The maximum acceptable value for the setting.
|
||||
* @return The corresponding setting value.
|
||||
*/
|
||||
public static final int convertGammaToLinear(int val, int min, int max) {
|
||||
final float normalizedVal = MathUtils.norm(GAMMA_SPACE_MIN, GAMMA_SPACE_MAX, val);
|
||||
final float ret;
|
||||
if (normalizedVal <= R) {
|
||||
ret = MathUtils.sq(normalizedVal / R);
|
||||
} else {
|
||||
ret = MathUtils.exp((normalizedVal - C) / A) + B;
|
||||
}
|
||||
|
||||
// HLG is normalized to the range [0, 12], so we need to re-normalize to the range [0, 1]
|
||||
// in order to derive the correct setting value.
|
||||
return Math.round(MathUtils.lerp(min, max, ret / 12));
|
||||
}
|
||||
|
||||
/**
|
||||
* Version of {@link #convertGammaToLinear} that takes and returns float values.
|
||||
* TODO(flc): refactor Android Auto to use float version
|
||||
*
|
||||
* @param val The slider value.
|
||||
* @param min The minimum acceptable value for the setting.
|
||||
* @param max The maximum acceptable value for the setting.
|
||||
* @return The corresponding setting value.
|
||||
*/
|
||||
public static final float convertGammaToLinearFloat(int val, float min, float max) {
|
||||
final float normalizedVal = MathUtils.norm(GAMMA_SPACE_MIN, GAMMA_SPACE_MAX, val);
|
||||
final float ret;
|
||||
if (normalizedVal <= R) {
|
||||
ret = MathUtils.sq(normalizedVal / R);
|
||||
} else {
|
||||
ret = MathUtils.exp((normalizedVal - C) / A) + B;
|
||||
}
|
||||
|
||||
// HLG is normalized to the range [0, 12], ensure that value is within that range,
|
||||
// it shouldn't be out of bounds.
|
||||
final float normalizedRet = MathUtils.constrain(ret, 0, 12);
|
||||
|
||||
// Re-normalize to the range [0, 1]
|
||||
// in order to derive the correct setting value.
|
||||
return MathUtils.lerp(min, max, normalizedRet / 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* A function for converting from the linear space that the setting works in to the
|
||||
* gamma space that the slider works in.
|
||||
* <p>
|
||||
* The gamma space effectively provides us a way to make linear changes to the slider that
|
||||
* result in linear changes in perception. If we made changes to the slider in the linear space
|
||||
* then we'd see an approximately logarithmic change in perception (c.f. Fechner's Law).
|
||||
* <p>
|
||||
* Internally, this implements the Hybrid Log Gamma opto-electronic transfer function, which is
|
||||
* a slight improvement to the typical gamma transfer function for displays whose max
|
||||
* brightness exceeds the 120 nit reference point, but doesn't set a specific reference
|
||||
* brightness like the PQ function does.
|
||||
* <p>
|
||||
* Note that this transfer function is only valid if the display's backlight value is a linear
|
||||
* control. If it's calibrated to be something non-linear, then a different transfer function
|
||||
* should be used.
|
||||
*
|
||||
* @param val The brightness setting value.
|
||||
* @param min The minimum acceptable value for the setting.
|
||||
* @param max The maximum acceptable value for the setting.
|
||||
* @return The corresponding slider value
|
||||
*/
|
||||
public static final int convertLinearToGamma(int val, int min, int max) {
|
||||
return convertLinearToGammaFloat((float) val, (float) min, (float) max);
|
||||
}
|
||||
|
||||
/**
|
||||
* Version of {@link #convertLinearToGamma} that takes float values.
|
||||
* TODO: brightnessfloat merge with above method(?)
|
||||
*
|
||||
* @param val The brightness setting value.
|
||||
* @param min The minimum acceptable value for the setting.
|
||||
* @param max The maximum acceptable value for the setting.
|
||||
* @return The corresponding slider value
|
||||
*/
|
||||
public static final int convertLinearToGammaFloat(float val, float min, float max) {
|
||||
// For some reason, HLG normalizes to the range [0, 12] rather than [0, 1]
|
||||
final float normalizedVal = MathUtils.norm(min, max, val) * 12;
|
||||
final float ret;
|
||||
if (normalizedVal <= 1f) {
|
||||
ret = MathUtils.sqrt(normalizedVal) * R;
|
||||
} else {
|
||||
ret = A * MathUtils.log(normalizedVal - B) + C;
|
||||
}
|
||||
|
||||
return Math.round(MathUtils.lerp(GAMMA_SPACE_MIN, GAMMA_SPACE_MAX, ret));
|
||||
}
|
||||
}
|
||||
BIN
app/src/main/res/drawable-hdpi/battery1.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
app/src/main/res/drawable-hdpi/battery2.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
app/src/main/res/drawable-hdpi/bluetooth1.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
app/src/main/res/drawable-hdpi/bluetooth2.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
app/src/main/res/drawable-hdpi/brightness1.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
app/src/main/res/drawable-hdpi/brightness2.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
app/src/main/res/drawable-hdpi/control_background.png
Normal file
|
After Width: | Height: | Size: 2.5 MiB |
BIN
app/src/main/res/drawable-hdpi/flashlight1.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
app/src/main/res/drawable-hdpi/flashlight2.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
app/src/main/res/drawable-hdpi/position.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
app/src/main/res/drawable-hdpi/sound1.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
app/src/main/res/drawable-hdpi/sound2.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
app/src/main/res/drawable-hdpi/wifi1.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
app/src/main/res/drawable-hdpi/wifi2.png
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
18
app/src/main/res/drawable/control_background_item.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<!-- 内部颜色 -->
|
||||
<solid android:color="#CC0480FF" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners
|
||||
android:bottomLeftRadius="@dimen/dp_8"
|
||||
android:bottomRightRadius="@dimen/dp_8"
|
||||
android:topLeftRadius="@dimen/dp_8"
|
||||
android:topRightRadius="@dimen/dp_8" />
|
||||
|
||||
<!-- <padding-->
|
||||
<!-- android:bottom="4dp"-->
|
||||
<!-- android:left="20dp"-->
|
||||
<!-- android:right="20dp"-->
|
||||
<!-- android:top="4dp" />-->
|
||||
</shape>
|
||||
18
app/src/main/res/drawable/control_background_item_dis.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<!-- 内部颜色 -->
|
||||
<solid android:color="#535353" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners
|
||||
android:bottomLeftRadius="@dimen/dp_8"
|
||||
android:bottomRightRadius="@dimen/dp_8"
|
||||
android:topLeftRadius="@dimen/dp_8"
|
||||
android:topRightRadius="@dimen/dp_8" />
|
||||
|
||||
<!-- <padding-->
|
||||
<!-- android:bottom="4dp"-->
|
||||
<!-- android:left="20dp"-->
|
||||
<!-- android:right="20dp"-->
|
||||
<!-- android:top="4dp" />-->
|
||||
</shape>
|
||||
@@ -462,6 +462,43 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_control"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="@dimen/dp_2"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:layout_marginEnd="@dimen/dp_4"
|
||||
android:layout_marginBottom="@dimen/dp_4"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/custom_bg_health">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView6"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:text="快捷设置"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_17"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_68"
|
||||
android:layout_height="@dimen/dp_68"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/home_clinical_hand"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<!-- <androidx.constraintlayout.widget.ConstraintLayout-->
|
||||
<!-- android:id="@+id/cl_exit"-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
|
||||
@@ -74,8 +74,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:text="位置"
|
||||
android:textSize="@dimen/sp_18"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_18"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_temp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_temp" />
|
||||
@@ -130,8 +130,8 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="绿码同行更畅快"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:text="绿码同行更畅快"
|
||||
android:textColor="@color/white"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="@+id/textView"
|
||||
@@ -152,15 +152,15 @@
|
||||
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/tv_name"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginTop="@dimen/dp_2"-->
|
||||
<!-- android:textColor="@color/black"-->
|
||||
<!-- android:textStyle="bold"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="@+id/iv_health"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="@+id/iv_health"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@+id/iv_health" />-->
|
||||
<!-- android:id="@+id/tv_name"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginTop="@dimen/dp_2"-->
|
||||
<!-- android:textColor="@color/black"-->
|
||||
<!-- android:textStyle="bold"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="@+id/iv_health"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="@+id/iv_health"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@+id/iv_health" />-->
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -198,12 +198,12 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="危险请按我"
|
||||
android:visibility="gone"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:textColor="@color/lightGray"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="@+id/textView7"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView7" />
|
||||
|
||||
@@ -257,10 +257,10 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:text="一键加速"
|
||||
android:visibility="gone"
|
||||
android:textColor="@color/lightGray"
|
||||
android:textSize="@dimen/sp_17"
|
||||
android:textStyle="bold"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
@@ -269,26 +269,26 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="卡顿就按我"
|
||||
android:visibility="gone"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:textColor="@color/lightGray"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="@+id/textView5"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView5" />
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:id="@+id/iv_head"-->
|
||||
<!-- android:layout_width="@dimen/dp_52"-->
|
||||
<!-- android:layout_height="@dimen/dp_52"-->
|
||||
<!-- android:layout_marginEnd="24dp"-->
|
||||
<!-- android:adjustViewBounds="true"-->
|
||||
<!-- android:scaleType="fitCenter"-->
|
||||
<!-- android:src="@drawable/home_clean_icon"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent" />-->
|
||||
<!-- <ImageView-->
|
||||
<!-- android:id="@+id/iv_head"-->
|
||||
<!-- android:layout_width="@dimen/dp_52"-->
|
||||
<!-- android:layout_height="@dimen/dp_52"-->
|
||||
<!-- android:layout_marginEnd="24dp"-->
|
||||
<!-- android:adjustViewBounds="true"-->
|
||||
<!-- android:scaleType="fitCenter"-->
|
||||
<!-- android:src="@drawable/home_clean_icon"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent" />-->
|
||||
|
||||
<com.king.view.circleprogressview.CircleProgressView
|
||||
android:id="@+id/cpv"
|
||||
@@ -296,10 +296,10 @@
|
||||
android:layout_height="@dimen/dp_68"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
app:cpvDuration="1000"
|
||||
app:cpvLabelTextSize="26sp"
|
||||
app:cpvProgressColor="#ff9300"
|
||||
app:cpvLabelTextColor="@color/black"
|
||||
app:cpvLabelTextSize="26sp"
|
||||
app:cpvNormalColor="#FFD3D3D3"
|
||||
app:cpvProgressColor="#ff9300"
|
||||
app:cpvShowTick="false"
|
||||
app:cpvStrokeWidth="@dimen/dp_8"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@@ -428,7 +428,6 @@
|
||||
android:id="@+id/textView2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:layout_marginBottom="@dimen/dp_16"
|
||||
android:text="通讯录"
|
||||
@@ -489,81 +488,125 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_ai"
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="@dimen/dp_2"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:layout_marginEnd="@dimen/dp_4"
|
||||
android:layout_marginBottom="@dimen/dp_4"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/custom_bg_health">
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:layout_marginBottom="@dimen/dp_16"
|
||||
android:text="AI问诊"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_17"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_ai"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="@dimen/dp_2"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:layout_marginEnd="@dimen/dp_4"
|
||||
android:layout_marginBottom="@dimen/dp_4"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/custom_bg_health">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_52"
|
||||
android:layout_height="@dimen/dp_52"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/home_clinical_hand"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
<TextView
|
||||
android:id="@+id/textView8"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_16"
|
||||
android:text="AI问诊"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_17"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_52"
|
||||
android:layout_height="@dimen/dp_52"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/home_clinical_hand"
|
||||
app:layout_constraintBottom_toTopOf="@+id/textView8"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!-- <androidx.constraintlayout.widget.ConstraintLayout-->
|
||||
<!-- android:id="@+id/cl_exit"-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_marginStart="@dimen/dp_2"-->
|
||||
<!-- android:layout_marginTop="@dimen/dp_2"-->
|
||||
<!-- android:layout_marginEnd="@dimen/dp_4"-->
|
||||
<!-- android:layout_marginBottom="@dimen/dp_4"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:background="@drawable/custom_bg_health">-->
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginStart="@dimen/dp_8"-->
|
||||
<!-- android:layout_marginTop="@dimen/dp_8"-->
|
||||
<!-- android:layout_marginBottom="@dimen/dp_16"-->
|
||||
<!-- android:text="切换系统"-->
|
||||
<!-- android:textColor="@color/white"-->
|
||||
<!-- android:textSize="@dimen/sp_17"-->
|
||||
<!-- android:textStyle="bold"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent" />-->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_control"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="@dimen/dp_2"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:layout_marginEnd="@dimen/dp_4"
|
||||
android:layout_marginBottom="@dimen/dp_4"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/custom_bg_health">
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:layout_width="@dimen/dp_52"-->
|
||||
<!-- android:layout_height="@dimen/dp_52"-->
|
||||
<!-- android:adjustViewBounds="true"-->
|
||||
<!-- android:scaleType="fitCenter"-->
|
||||
<!-- android:src="@drawable/app_exit"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent" />-->
|
||||
<TextView
|
||||
android:id="@+id/textView6"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_16"
|
||||
android:text="快捷设置"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_17"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<!-- </androidx.constraintlayout.widget.ConstraintLayout>-->
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_52"
|
||||
android:layout_height="@dimen/dp_52"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/home_clinical_hand"
|
||||
app:layout_constraintBottom_toTopOf="@+id/textView6"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
<!-- <androidx.constraintlayout.widget.ConstraintLayout-->
|
||||
<!-- android:id="@+id/cl_exit"-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_marginStart="@dimen/dp_2"-->
|
||||
<!-- android:layout_marginTop="@dimen/dp_2"-->
|
||||
<!-- android:layout_marginEnd="@dimen/dp_4"-->
|
||||
<!-- android:layout_marginBottom="@dimen/dp_4"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:background="@drawable/custom_bg_health">-->
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginStart="@dimen/dp_8"-->
|
||||
<!-- android:layout_marginTop="@dimen/dp_8"-->
|
||||
<!-- android:layout_marginBottom="@dimen/dp_16"-->
|
||||
<!-- android:text="切换系统"-->
|
||||
<!-- android:textColor="@color/white"-->
|
||||
<!-- android:textSize="@dimen/sp_17"-->
|
||||
<!-- android:textStyle="bold"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent" />-->
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:layout_width="@dimen/dp_52"-->
|
||||
<!-- android:layout_height="@dimen/dp_52"-->
|
||||
<!-- android:adjustViewBounds="true"-->
|
||||
<!-- android:scaleType="fitCenter"-->
|
||||
<!-- android:src="@drawable/app_exit"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent" />-->
|
||||
|
||||
<!-- </androidx.constraintlayout.widget.ConstraintLayout>-->
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
365
app/src/main/res/layout/activity_control.xml
Normal file
@@ -0,0 +1,365 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/control_background"
|
||||
tools:context=".activity.ControlActivity">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_wifi"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="@dimen/dp_8"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/control_background_item">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_wifi"
|
||||
android:layout_width="@dimen/dp_48"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/wifi1"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_wifi"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:text="WIFI"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_18"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_wifi"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_wifi" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_wifi_ssid"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:text="ssid"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_18"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_wifi"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_wifi"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_wifi" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_bt"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="@dimen/dp_8"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/control_background_item">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_bt"
|
||||
android:layout_width="@dimen/dp_48"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/bluetooth1"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bt"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:text="蓝牙"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_18"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_bt"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_bt" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bt_ssid"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="ssid"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_18"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_bt"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_bt"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_bt" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="@dimen/dp_8"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/control_background_item">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView21"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:text="字体大小"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_18"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_font_size"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="标准"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_18"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView21" />
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/seekBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:max="3"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_font_size" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="@dimen/dp_8"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/control_background_item">
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/seekbar_sound"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_sound"
|
||||
android:layout_width="@dimen/dp_48"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/sound1"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_sound"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="100%"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_28"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_sound"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_sound"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_sound" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_battery"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="@dimen/dp_8"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/control_background_item">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_battery"
|
||||
android:layout_width="@dimen/dp_48"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/battery1"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_battery"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:text="电量"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_18"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_battery"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_battery" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_electricity"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:text="100%"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_18"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_battery"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_battery"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_battery" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_flashlight"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="@dimen/dp_8"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/control_background_item">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_flashlight"
|
||||
android:layout_width="@dimen/dp_48"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/flashlight1"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_flashlight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:text="手电筒"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_18"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_flashlight"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_flashlight" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_flashlight_switch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="关"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_18"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_flashlight"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_flashlight"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_flashlight" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="@dimen/dp_8"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/control_background_item">
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/seekbar_brightness"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_brightness"
|
||||
android:layout_width="@dimen/dp_48"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/brightness1"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_brightness"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="100%"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_28"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_brightness"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_brightness"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_brightness" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="@dimen/dp_8"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/control_background_item">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_location"
|
||||
android:layout_width="@dimen/dp_48"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/position"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_location"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:text="未知"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_16"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_location"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -16,4 +16,16 @@
|
||||
<attr name="left_bottom_radius" format="dimension" />
|
||||
</declare-styleable>
|
||||
|
||||
<string-array name="entryvalues_font_size" translatable="false">
|
||||
<item>0.85</item>
|
||||
<item>1.0</item>
|
||||
<item>1.15</item>
|
||||
<item>1.30</item>
|
||||
</string-array>
|
||||
<string-array name="entries_font_size">
|
||||
<item msgid="4649244712522775149">"小"</item>
|
||||
<item msgid="4350318459725129464">"默认"</item>
|
||||
<item msgid="722959474722634030">"大"</item>
|
||||
<item msgid="5468692832610514379">"最大"</item>
|
||||
</string-array>
|
||||
</resources>
|
||||
@@ -1,2 +1,2 @@
|
||||
include ':app', ':niceimageview'
|
||||
rootProject.name='UIUIOS关怀系统'
|
||||
rootProject.name='AIOS系统'
|
||||