Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
石璀亮
/
agenew_a16_sos
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 42aa632f
authored
Jan 04, 2020
by
韩倩倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
9820E 4.4适配
1 parent
a246829f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
57 additions
and
17 deletions
app/build.gradle
app/src/main/java/com/toscl/location/hengfeng/LocationService.java
app/src/main/java/com/toscl/location/hengfeng/activity/NavActivity.java
app/src/main/java/com/toscl/location/hengfeng/util/PhoneUtils.java
app/src/main/res/drawable/button_focused.xml
app/src/main/res/drawable/button_selector.xml
app/src/main/res/drawable/button_unfocused.xml
app/src/main/res/layout/location_nav.xml
app/src/main/res/values/colors.xml
app/src/main/res/values/styles.xml
app/build.gradle
View file @
42aa632
...
@@ -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.1
4.1
"
)
implementation
(
"com.squareup.okhttp3:okhttp:3.1
2.0
"
)
implementation
'com.google.code.gson:gson:2.8.2'
implementation
'com.google.code.gson:gson:2.8.2'
...
...
app/src/main/java/com/toscl/location/hengfeng/LocationService.java
View file @
42aa632
...
@@ -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
);
...
...
app/src/main/java/com/toscl/location/hengfeng/activity/NavActivity.java
View file @
42aa632
...
@@ -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
));
...
...
app/src/main/java/com/toscl/location/hengfeng/util/PhoneUtils.java
View file @
42aa632
This diff is collapsed.
Click to expand it.
app/src/main/res/drawable/button_focused.xml
0 → 100644
View file @
42aa632
<?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
app/src/main/res/drawable/button_selector.xml
0 → 100644
View file @
42aa632
<?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
app/src/main/res/drawable/button_unfocused.xml
0 → 100644
View file @
42aa632
<?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
app/src/main/res/layout/location_nav.xml
View file @
42aa632
...
@@ -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
app/src/main/res/values/colors.xml
View file @
42aa632
...
@@ -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>
app/src/main/res/values/styles.xml
View file @
42aa632
...
@@ -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>
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment