Commit 42aa632f by 韩倩倩

9820E 4.4适配

1 parent a246829f
...@@ -12,7 +12,7 @@ android { ...@@ -12,7 +12,7 @@ android {
compileSdkVersion 28 compileSdkVersion 28
defaultConfig { defaultConfig {
applicationId "com.toscl.location.hengfeng" applicationId "com.toscl.location.hengfeng"
minSdkVersion 23 minSdkVersion 19
targetSdkVersion 28 targetSdkVersion 28
versionCode 14 versionCode 14
versionName "0.7.8" versionName "0.7.8"
...@@ -50,7 +50,7 @@ dependencies { ...@@ -50,7 +50,7 @@ dependencies {
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.amap.api:location:4.5.1' implementation 'com.amap.api:location:4.5.1'
implementation 'com.amap.api:map2d:5.2.0' implementation 'com.amap.api:map2d:5.2.0'
implementation("com.squareup.okhttp3:okhttp:3.14.1") implementation("com.squareup.okhttp3:okhttp:3.12.0")
implementation 'com.google.code.gson:gson:2.8.2' implementation 'com.google.code.gson:gson:2.8.2'
......
...@@ -12,6 +12,7 @@ import android.graphics.Color; ...@@ -12,6 +12,7 @@ import android.graphics.Color;
import android.location.Location; import android.location.Location;
import android.location.LocationListener; import android.location.LocationListener;
import android.location.LocationManager; import android.location.LocationManager;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.IBinder; import android.os.IBinder;
import android.os.SystemClock; import android.os.SystemClock;
...@@ -96,7 +97,7 @@ public class LocationService extends Service { ...@@ -96,7 +97,7 @@ public class LocationService extends Service {
/* /*
* has sim card ? * has sim card ?
* */ * */
if (PhoneUtils.getSubId(this, PreferencesUtil.HENG_FENG_DEFAULT_SLOT) == SubscriptionManager.INVALID_SUBSCRIPTION_ID){ if (PhoneUtils.getSubId(this, PreferencesUtil.HENG_FENG_DEFAULT_SLOT) == -1){
Toast.makeText(this, getResources().getString(R.string.location_service_failed_tips), Toast.LENGTH_SHORT).show(); Toast.makeText(this, getResources().getString(R.string.location_service_failed_tips), Toast.LENGTH_SHORT).show();
}else{ }else{
if (req != null){ if (req != null){
...@@ -201,15 +202,18 @@ public class LocationService extends Service { ...@@ -201,15 +202,18 @@ public class LocationService extends Service {
NotificationManager manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); NotificationManager manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
NotificationChannel notificationChannel = new NotificationChannel(CHANNEL_ONE_ID, if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
CHANNEL_ONE_NAME, NotificationManager.IMPORTANCE_HIGH);
notificationChannel.enableLights(true);
notificationChannel.setLightColor(Color.RED);
notificationChannel.setShowBadge(true);
notificationChannel.setLockscreenVisibility(Notification.VISIBILITY_PUBLIC);
if (manager != null){ NotificationChannel notificationChannel = new NotificationChannel(CHANNEL_ONE_ID,
manager.createNotificationChannel(notificationChannel); CHANNEL_ONE_NAME, NotificationManager.IMPORTANCE_HIGH);
notificationChannel.enableLights(true);
notificationChannel.setLightColor(Color.RED);
notificationChannel.setShowBadge(true);
notificationChannel.setLockscreenVisibility(Notification.VISIBILITY_PUBLIC);
if (manager != null) {
manager.createNotificationChannel(notificationChannel);
}
} }
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, new Intent(), 0); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, new Intent(), 0);
......
...@@ -35,7 +35,7 @@ public class NavActivity extends Activity implements View.OnClickListener { ...@@ -35,7 +35,7 @@ public class NavActivity extends Activity implements View.OnClickListener {
startActivity(new Intent(this, ServiceInfoActivity.class)); startActivity(new Intent(this, ServiceInfoActivity.class));
break; break;
case R.id.service_setting: case R.id.service_setting:
if (PhoneUtils.getSubId(this, PreferencesUtil.HENG_FENG_DEFAULT_SLOT) == SubscriptionManager.INVALID_SUBSCRIPTION_ID){ if (PhoneUtils.getSubId(this, PreferencesUtil.HENG_FENG_DEFAULT_SLOT) == -1){
Toast.makeText(this, getResources().getString(R.string.location_service_failed_tips), Toast.LENGTH_SHORT).show(); Toast.makeText(this, getResources().getString(R.string.location_service_failed_tips), Toast.LENGTH_SHORT).show();
}else{ }else{
startActivity(new Intent(this, ServiceSettingActivity.class)); startActivity(new Intent(this, ServiceSettingActivity.class));
...@@ -43,7 +43,7 @@ public class NavActivity extends Activity implements View.OnClickListener { ...@@ -43,7 +43,7 @@ public class NavActivity extends Activity implements View.OnClickListener {
break; break;
case R.id.service_stop: case R.id.service_stop:
if (PhoneUtils.getSubId(this, PreferencesUtil.HENG_FENG_DEFAULT_SLOT) == SubscriptionManager.INVALID_SUBSCRIPTION_ID){ if (PhoneUtils.getSubId(this, PreferencesUtil.HENG_FENG_DEFAULT_SLOT) == -1){
Toast.makeText(this, getResources().getString(R.string.location_service_failed_tips), Toast.LENGTH_SHORT).show(); Toast.makeText(this, getResources().getString(R.string.location_service_failed_tips), Toast.LENGTH_SHORT).show();
}else if (PreferencesUtil.getInstance(this).getBoolean(PreferencesUtil.HENG_FENG_IS_OEPN, false) }else if (PreferencesUtil.getInstance(this).getBoolean(PreferencesUtil.HENG_FENG_IS_OEPN, false)
&& PhoneUtils.hengdaServiceAvailable(this)) { && PhoneUtils.hengdaServiceAvailable(this)) {
...@@ -53,7 +53,7 @@ public class NavActivity extends Activity implements View.OnClickListener { ...@@ -53,7 +53,7 @@ public class NavActivity extends Activity implements View.OnClickListener {
} }
break; break;
case R.id.service_apply: case R.id.service_apply:
if (PhoneUtils.getSubId(this, PreferencesUtil.HENG_FENG_DEFAULT_SLOT) == SubscriptionManager.INVALID_SUBSCRIPTION_ID){ if (PhoneUtils.getSubId(this, PreferencesUtil.HENG_FENG_DEFAULT_SLOT) == -1){
Toast.makeText(this, getResources().getString(R.string.location_service_failed_tips), Toast.LENGTH_SHORT).show(); Toast.makeText(this, getResources().getString(R.string.location_service_failed_tips), Toast.LENGTH_SHORT).show();
}else{ }else{
startActivity(new Intent(this, ServiceApplyActivity.class)); startActivity(new Intent(this, ServiceApplyActivity.class));
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/color_purple"/>
<corners android:radius="5dp"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:drawable="@drawable/button_focused"/>
<item android:state_focused="false" android:drawable="@drawable/button_unfocused"/>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/color_white"/>
<corners android:radius="5dp"/>
</shape>
\ No newline at end of file
...@@ -20,7 +20,8 @@ ...@@ -20,7 +20,8 @@
android:focusable="true" android:focusable="true"
android:text="@string/title_apply" android:text="@string/title_apply"
android:textColor="#000000" android:textColor="#000000"
android:textSize="25px" /> android:textSize="25px"
android:background="@drawable/button_selector"/>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
...@@ -38,6 +39,7 @@ ...@@ -38,6 +39,7 @@
android:text="@string/title_server_stop" android:text="@string/title_server_stop"
android:textColor="#000000" android:textColor="#000000"
android:textSize="25px" android:textSize="25px"
android:background="@drawable/button_selector"
android:visibility="gone"/> android:visibility="gone"/>
</LinearLayout> </LinearLayout>
...@@ -56,6 +58,7 @@ ...@@ -56,6 +58,7 @@
android:text="@string/title_service_setting" android:text="@string/title_service_setting"
android:textColor="#000000" android:textColor="#000000"
android:textSize="25px" android:textSize="25px"
android:background="@drawable/button_selector"
android:visibility="gone"/> android:visibility="gone"/>
</LinearLayout> </LinearLayout>
...@@ -72,7 +75,8 @@ ...@@ -72,7 +75,8 @@
android:focusable="true" android:focusable="true"
android:text="@string/title_server_info" android:text="@string/title_server_info"
android:textColor="#000000" android:textColor="#000000"
android:textSize="25px" /> android:textSize="25px"
android:background="@drawable/button_selector"/>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -3,4 +3,6 @@ ...@@ -3,4 +3,6 @@
<color name="colorPrimary">#008577</color> <color name="colorPrimary">#008577</color>
<color name="colorPrimaryDark">#00574B</color> <color name="colorPrimaryDark">#00574B</color>
<color name="colorAccent">#D81B60</color> <color name="colorAccent">#D81B60</color>
<color name="color_purple">#FF80FF</color>
<color name="color_white">#ffffff</color>
</resources> </resources>
...@@ -5,8 +5,17 @@ ...@@ -5,8 +5,17 @@
<item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item> <item name="colorAccent">@color/colorAccent</item>
<item name="android:textColor">#000000</item> <item name="android:textColor">#000000</item>
<item name="android:actionBarStyle">@style/Customize_Holo_ActionBar</item>
<item name="android:actionBarSize">62dp</item>
</style>
<style name="Customize_Holo_ActionBar" parent="@android:style/Widget.Holo.Light.ActionBar">
<item name="android:background">#008577</item>
<item name="android:titleTextStyle">@style/Customize_AcBar_titleStyle</item>
</style>
<style name="Customize_AcBar_titleStyle" parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title">
<item name="android:textSize">25sp</item>
<item name="android:textColor">#ffffff</item>
</style> </style>
<style name="InputBoxStyle"> <style name="InputBoxStyle">
<item name="android:layout_centerHorizontal">true</item> <item name="android:layout_centerHorizontal">true</item>
<item name="android:layout_marginLeft">18dp</item> <item name="android:layout_marginLeft">18dp</item>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!