Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
L
location share white
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wanglei
location share white
Commits
e441a352
Commit
e441a352
authored
Oct 22, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
d672f7a6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
82 additions
and
11 deletions
+82
-11
build.gradle.kts
app/build.gradle.kts
+3
-0
ConstObject.kt
...main/java/com/base/locationsharewhite/bean/ConstObject.kt
+9
-0
MyApplication.kt
.../java/com/base/locationsharewhite/helper/MyApplication.kt
+14
-11
KotlinExt.kt
.../main/java/com/base/locationsharewhite/utils/KotlinExt.kt
+56
-0
No files found.
app/build.gradle.kts
View file @
e441a352
...
@@ -69,4 +69,7 @@ dependencies {
...
@@ -69,4 +69,7 @@ dependencies {
implementation
(
"com.google.firebase:firebase-messaging"
)
implementation
(
"com.google.firebase:firebase-messaging"
)
implementation
(
"com.google.firebase:firebase-analytics-ktx"
)
implementation
(
"com.google.firebase:firebase-analytics-ktx"
)
implementation
(
"com.google.firebase:firebase-crashlytics"
)
implementation
(
"com.google.firebase:firebase-crashlytics"
)
//facebook
implementation
(
"com.facebook.android:facebook-android-sdk:[8,9)"
)
}
}
\ No newline at end of file
app/src/main/java/com/base/locationsharewhite/bean/ConstObject.kt
View file @
e441a352
...
@@ -49,4 +49,13 @@ object ConstObject {
...
@@ -49,4 +49,13 @@ object ConstObject {
AppPreferences
.
getInstance
().
put
(
"changeLanguageSp"
,
value
,
true
)
AppPreferences
.
getInstance
().
put
(
"changeLanguageSp"
,
value
,
true
)
}
}
var
topic_number
=
""
get
()
{
return
AppPreferences
.
getInstance
().
getString
(
"topic_number"
,
field
)
}
set
(
value
)
{
field
=
value
AppPreferences
.
getInstance
().
put
(
"topic_number"
,
value
,
true
)
}
}
}
\ No newline at end of file
app/src/main/java/com/base/locationsharewhite/helper/MyApplication.kt
View file @
e441a352
...
@@ -5,9 +5,12 @@ import android.app.Application
...
@@ -5,9 +5,12 @@ import android.app.Application
import
android.content.Intent
import
android.content.Intent
import
android.os.Bundle
import
android.os.Bundle
import
android.text.TextUtils
import
android.text.TextUtils
import
com.base.locationsharewhite.bean.ConstObject.topic_number
import
com.base.locationsharewhite.ui.splash.SplashActivity
import
com.base.locationsharewhite.ui.splash.SplashActivity
import
com.base.locationsharewhite.utils.AppPreferences
import
com.base.locationsharewhite.utils.AppPreferences
import
com.base.locationsharewhite.utils.KotlinExt.toFormatMinute
import
com.base.locationsharewhite.utils.LogEx
import
com.base.locationsharewhite.utils.LogEx
import
com.facebook.FacebookSdk
import
java.util.Locale
import
java.util.Locale
import
java.util.UUID
import
java.util.UUID
...
@@ -50,20 +53,20 @@ class MyApplication : Application() {
...
@@ -50,20 +53,20 @@ class MyApplication : Application() {
}
}
fun
initApp
()
{
fun
initApp
()
{
//
FacebookSdk.sdkInitialize(applicationContext)
FacebookSdk
.
sdkInitialize
(
applicationContext
)
//
var topicNumber = System.currentTimeMillis().toFormatMinute()
var
topicNumber
=
System
.
currentTimeMillis
().
toFormatMinute
()
//
LogEx.logDebug(TAG, "topicNumber=$topicNumber")
LogEx
.
logDebug
(
TAG
,
"topicNumber=$topicNumber"
)
//
if (topic_number.isNotEmpty()) {
if
(
topic_number
.
isNotEmpty
())
{
//
topicNumber = topic_number
topicNumber
=
topic_number
//
} else {
}
else
{
//
topic_number = topicNumber
topic_number
=
topicNumber
//
}
}
//
val topic = ConfigHelper.packageName + "_push_$topicNumber"
val
topic
=
ConfigHelper
.
packageName
+
"_push_$topicNumber"
//
LogEx.logDebug(TAG, "topic=${topic}")
LogEx
.
logDebug
(
TAG
,
"topic=${topic}"
)
// FCMManager.initFirebase(this)
// FCMManager.initFirebase(this)
// FCMManager.subscribeToTopic(topic)
// FCMManager.subscribeToTopic(topic)
// InstallHelps.init()
// InstallHelps.init()
//
initLifeListener()
initLifeListener
()
// ScreenStatusReceiver.setupScreenStatusListener(this)
// ScreenStatusReceiver.setupScreenStatusListener(this)
}
}
...
...
app/src/main/java/com/base/locationsharewhite/utils/KotlinExt.kt
0 → 100644
View file @
e441a352
package
com.base.locationsharewhite.utils
import
java.text.SimpleDateFormat
import
java.util.Locale
object
KotlinExt
{
fun
Number
.
toFormatSize
(
count
:
Int
=
1
):
String
{
var
suffix
=
"B"
var
fSize
=
this
.
toDouble
()
if
(
fSize
>
1024
)
{
suffix
=
"KB"
fSize
/=
1024.0
}
if
(
fSize
>
1024
)
{
suffix
=
"MB"
fSize
/=
1024.0
}
if
(
fSize
>
1024
)
{
suffix
=
"GB"
fSize
/=
1024.0
}
return
String
.
format
(
"%.${count}f %s"
,
fSize
,
suffix
)
}
fun
Long
.
toFormatTime
():
String
{
return
SimpleDateFormat
(
"MMM dd,yyyy"
,
Locale
.
ENGLISH
).
format
(
this
)
}
fun
Long
.
toFormatTime2
():
String
{
return
SimpleDateFormat
(
"yyyyMMdd_HHmmss"
,
Locale
.
ENGLISH
).
format
(
this
)
}
fun
Long
.
toFormatTime3
():
String
{
return
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
,
Locale
.
ENGLISH
).
format
(
this
)
}
fun
Long
.
toFormatTime4
():
String
{
return
SimpleDateFormat
(
"yyyy-MM-dd"
,
Locale
.
ENGLISH
).
format
(
this
)
}
fun
Long
.
toFormatMinute
():
String
{
return
SimpleDateFormat
(
"mm"
,
Locale
.
ENGLISH
).
format
(
this
)
}
fun
Array
<
String
>.
array2String
():
String
{
val
stringBuilder
=
StringBuilder
()
forEach
{
stringBuilder
.
append
(
it
)
}
return
stringBuilder
.
toString
()
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment