Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
S
Scan QR Code Barcode Reader
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
Scan QR Code Barcode Reader
Commits
73d13962
Commit
73d13962
authored
Dec 26, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...设置页面
parent
6ca214a1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
548 additions
and
16 deletions
+548
-16
GlobalConfig.kt
app/src/main/java/com/base/scanqr/GlobalConfig.kt
+56
-0
HistoryAdapter.kt
app/src/main/java/com/base/scanqr/ui/main/HistoryAdapter.kt
+7
-0
HistoryFragment.kt
app/src/main/java/com/base/scanqr/ui/main/HistoryFragment.kt
+7
-0
HistoryViewModel.kt
...src/main/java/com/base/scanqr/ui/main/HistoryViewModel.kt
+5
-0
SettingsFragment.kt
...src/main/java/com/base/scanqr/ui/main/SettingsFragment.kt
+41
-0
DateUtils.kt
app/src/main/java/com/base/scanqr/utils/DateUtils.kt
+18
-7
fragment_settings.xml
app/src/main/res/layout/fragment_settings.xml
+403
-9
check.png
app/src/main/res/mipmap-xxhdpi/check.png
+0
-0
feedback.png
app/src/main/res/mipmap-xxhdpi/feedback.png
+0
-0
h_product.png
app/src/main/res/mipmap-xxhdpi/h_product.png
+0
-0
language.png
app/src/main/res/mipmap-xxhdpi/language.png
+0
-0
manage.png
app/src/main/res/mipmap-xxhdpi/manage.png
+0
-0
privacy.png
app/src/main/res/mipmap-xxhdpi/privacy.png
+0
-0
rateapp.png
app/src/main/res/mipmap-xxhdpi/rateapp.png
+0
-0
set_logo.png
app/src/main/res/mipmap-xxhdpi/set_logo.png
+0
-0
shareg.png
app/src/main/res/mipmap-xxhdpi/shareg.png
+0
-0
strings.xml
app/src/main/res/values/strings.xml
+11
-0
No files found.
app/src/main/java/com/base/scanqr/GlobalConfig.kt
0 → 100644
View file @
73d13962
package
com.base.scanqr
/**
*Create by SleepDog on 2024-12-24
*/
object
GlobalConfig
{
//包名
const
val
PACKAGE_NAME
=
"com.loactation.alibabab.ccccaa"
// 域名
/**
* Url Event 上报接口
*/
const
val
URL_EVENT
=
"https://rp.gamexzonerk.xyz"
/**
* Url Api 业务接口
*/
const
val
URL_API
=
"https://api.gamexzonerk.xyz"
/**
* Url Privacy 隐私链接
*/
const
val
URL_PRIVACY
=
"https://sites.google.com/view/locationuses/location"
/**
* Url Use 使用条款
*/
const
val
URL_USE
=
""
/**
* Key Aes 加密key
*/
const
val
KEY_AES
=
"pex50vwzuhpim3yh"
/**
* Key solar 归因key
*/
const
val
KEY_SOLAR
=
""
// admob广告位id
inline
val
ID_ADMOB_INTER
get
()
=
if
(
BuildConfig
.
DEBUG
)
"ca-app-pub-3940256099942544/1033173712"
else
"ca-app-pub-3940256099942544/1033173712"
inline
val
ID_ADMOB_NATIVE
get
()
=
if
(
BuildConfig
.
DEBUG
)
"ca-app-pub-3940256099942544/2247696110"
else
"ca-app-pub-3940256099942544/2247696110"
inline
val
ID_ADMOB_OPEN
get
()
=
if
(
BuildConfig
.
DEBUG
)
"ca-app-pub-3940256099942544/9257395921"
else
"ca-app-pub-3940256099942544/9257395921"
inline
val
ID_ADMOB_BANNER
get
()
=
if
(
BuildConfig
.
DEBUG
)
"ca-app-pub-3940256099942544/9214589741"
else
"ca-app-pub-3940256099942544/9214589741"
inline
val
ID_ADMOB_REWARD
get
()
=
if
(
BuildConfig
.
DEBUG
)
"ca-app-pub-3940256099942544/5224354917"
else
"ca-app-pub-3940256099942544/5224354917"
// max广告位id
inline
val
KEY_MAX
get
()
=
if
(
BuildConfig
.
DEBUG
)
"GGPreND6SRmCt1zJgn5faiLGD8c2PVGPLgPpSg7cHanVTud1DhtuI9MmteTqlEviaJ57WnxW68kQDaATJ5z3cW"
else
"GGPreND6SRmCt1zJgn5faiLGD8c2PVGPLgPpSg7cHanVTud1DhtuI9MmteTqlEviaJ57WnxW68kQDaATJ5z3cW"
inline
val
ID_MAX_INTER
get
()
=
if
(
BuildConfig
.
DEBUG
)
"3a9efc39d536ffe6"
else
"3a9efc39d536ffe6"
inline
val
ID_MAX_NATIVE
get
()
=
if
(
BuildConfig
.
DEBUG
)
"cc0cc5b36a2608ca"
else
"cc0cc5b36a2608ca"
inline
val
ID_MAX_OPEN
get
()
=
if
(
BuildConfig
.
DEBUG
)
"ad4efa4a0bc2a585"
else
"ad4efa4a0bc2a585"
inline
val
ID_MAX_BANNER
get
()
=
if
(
BuildConfig
.
DEBUG
)
""
else
""
inline
val
ID_MAX_REWARD
get
()
=
if
(
BuildConfig
.
DEBUG
)
""
else
""
}
\ No newline at end of file
app/src/main/java/com/base/scanqr/ui/main/HistoryAdapter.kt
View file @
73d13962
...
...
@@ -10,10 +10,12 @@ import com.base.scanqr.bean.FunctionUIBean.Companion.KEY_EMAIL
import
com.base.scanqr.bean.FunctionUIBean.Companion.KEY_EVENT
import
com.base.scanqr.bean.FunctionUIBean.Companion.KEY_LOCATION
import
com.base.scanqr.bean.FunctionUIBean.Companion.KEY_MESSAGE
import
com.base.scanqr.bean.FunctionUIBean.Companion.KEY_PRODUCT
import
com.base.scanqr.bean.FunctionUIBean.Companion.KEY_TELEPHONE
import
com.base.scanqr.bean.FunctionUIBean.Companion.KEY_TEXT
import
com.base.scanqr.bean.FunctionUIBean.Companion.KEY_WEBSITE
import
com.base.scanqr.bean.FunctionUIBean.Companion.KEY_WIFI
import
com.base.scanqr.bean.ProductUIBean
import
com.base.scanqr.bean.ScanBean
import
com.base.scanqr.bean.TextUIBean
import
com.base.scanqr.bean.WebsiteUIBean
...
...
@@ -77,6 +79,11 @@ class HistoryAdapter : BaseQuickAdapter<ScanBean, CommonViewHolder>() {
}
KEY_MESSAGE
->
{}
KEY_PRODUCT
->
{
if
(
item
is
ProductUIBean
)
{
binding
.
ivIcon
.
setImageResource
(
R
.
mipmap
.
h_product
)
}
}
}
...
...
app/src/main/java/com/base/scanqr/ui/main/HistoryFragment.kt
View file @
73d13962
...
...
@@ -12,6 +12,7 @@ import com.base.scanqr.bean.FunctionUIBean
import
com.base.scanqr.bean.ScanBean
import
com.base.scanqr.databinding.FragmentHistoryBinding
import
com.base.scanqr.ui.email.EmailCodeActivity
import
com.base.scanqr.ui.product.ProductCodeActivity
import
com.base.scanqr.ui.text.TextCodeActivity
import
com.base.scanqr.ui.website.WebsiteCodeActivity
import
com.base.scanqr.ui.widget.DeleteQRDialog.showDeleteQRDialog
...
...
@@ -86,6 +87,12 @@ class HistoryFragment : BaseFragment<FragmentHistoryBinding>(FragmentHistoryBind
putExtra
(
"data"
,
Gson
().
toJson
(
item
))
})
}
FunctionUIBean
.
KEY_PRODUCT
->
{
activity
?.
startActivity
(
Intent
(
activity
,
ProductCodeActivity
::
class
.
java
).
apply
{
putExtra
(
"data"
,
Gson
().
toJson
(
item
))
})
}
}
}
...
...
app/src/main/java/com/base/scanqr/ui/main/HistoryViewModel.kt
View file @
73d13962
...
...
@@ -4,6 +4,7 @@ import androidx.lifecycle.ViewModel
import
androidx.lifecycle.viewModelScope
import
com.base.scanqr.bean.EmailUIBean
import
com.base.scanqr.bean.FunctionUIBean
import
com.base.scanqr.bean.ProductUIBean
import
com.base.scanqr.bean.ScanBean
import
com.base.scanqr.bean.TextUIBean
import
com.base.scanqr.bean.WebsiteUIBean
...
...
@@ -33,11 +34,15 @@ class HistoryViewModel() : ViewModel() {
emailList
.
forEach
{
it
.
listContent
=
it
.
address
}
val
websiteList
=
SpJsonUtils
.
getSpJsonList
<
WebsiteUIBean
>(
FunctionUIBean
.
KEY_WEBSITE
)
websiteList
.
forEach
{
it
.
listContent
=
it
.
http
}
val
productList
=
SpJsonUtils
.
getSpJsonList
<
ProductUIBean
>(
FunctionUIBean
.
KEY_PRODUCT
)
productList
.
forEach
{
it
.
listContent
=
it
.
content
}
historyList
.
addAll
(
wifiList
)
historyList
.
addAll
(
textList
)
historyList
.
addAll
(
emailList
)
historyList
.
addAll
(
websiteList
)
historyList
.
addAll
(
productList
)
historyList
.
forEach
{
LogEx
.
logDebug
(
TAG
,
"${it.scanType} ${it.createTime} ${it.createType} ${it.listContent}"
)
}
...
...
app/src/main/java/com/base/scanqr/ui/main/SettingsFragment.kt
View file @
73d13962
package
com.base.scanqr.ui.main
import
android.content.Intent
import
android.net.Uri
import
androidx.core.view.updatePadding
import
com.base.scanqr.BuildConfig
import
com.base.scanqr.GlobalConfig
import
com.base.scanqr.R
import
com.base.scanqr.base.BaseFragment
import
com.base.scanqr.bean.EmailUIBean
import
com.base.scanqr.databinding.FragmentSettingsBinding
import
com.base.scanqr.utils.BarUtils
import
com.base.scanqr.utils.IntentUtils.intentSendEmail
import
com.base.scanqr.utils.ToastUtils.toast
class
SettingsFragment
:
BaseFragment
<
FragmentSettingsBinding
>(
FragmentSettingsBinding
::
inflate
)
{
override
fun
initView
()
{
super
.
initView
()
binding
.
flTop
.
updatePadding
(
top
=
BarUtils
.
getStatusBarHeight
())
binding
.
tvVersion
.
text
=
getString
(
R
.
string
.
version
)
+
BuildConfig
.
VERSION_NAME
}
override
fun
initListener
()
{
super
.
initListener
()
binding
.
llFeedback
.
setOnClickListener
{
val
address
=
"gamexzone.rk@gmail.com"
val
email
=
EmailUIBean
()
email
.
address
=
address
val
intent
=
intentSendEmail
(
email
)
try
{
startActivity
(
intent
)
}
catch
(
e
:
Exception
)
{
requireContext
().
toast
(
"No application was found to handle the email request"
,
true
)
}
}
binding
.
llPrivacy
.
setOnClickListener
{
runCatching
{
val
intent
=
Intent
(
Intent
.
ACTION_VIEW
,
Uri
.
parse
(
GlobalConfig
.
URL_PRIVACY
)
)
requireContext
().
startActivity
(
intent
)
}
}
}
}
\ No newline at end of file
app/src/main/java/com/base/scanqr/utils/DateUtils.kt
View file @
73d13962
...
...
@@ -151,17 +151,28 @@ object DateUtils {
val
diff
=
now
.
time
-
then
.
time
if
(
diff
<
1000
*
60
)
{
// less than a minute
return
(
diff
/
1000
).
toString
()
+
" s ago"
}
else
if
(
diff
<
1000
*
60
*
60
)
{
// less than an hour
return
(
diff
/
(
1000
*
60
)).
toString
()
+
" minute ago"
val
minute
=
(
diff
/
(
1000
*
60
))
var
string
=
" minute ago"
if
(
minute
>
1L
)
{
string
=
" minutes ago"
}
return
minute
.
toString
()
+
string
}
else
if
(
diff
<
1000
*
60
*
60
*
24
)
{
// less than a day
return
(
diff
/
(
1000
*
60
*
60
)).
toString
()
+
" hour ago"
val
hour
=
(
diff
/
(
1000
*
60
*
60
))
var
string
=
" hour ago"
if
(
hour
>
1
)
{
string
=
" hours ago"
}
return
hour
.
toString
()
+
string
}
else
{
// more than a day
return
(
diff
/
(
1000
*
60
*
60
*
24
)).
toString
()
+
" day ago"
val
day
=
(
diff
/
(
1000
*
60
*
60
*
24
))
var
string
=
" day ago"
if
(
day
>
1
)
{
string
=
" days ago"
}
return
day
.
toString
()
+
string
}
}
...
...
app/src/main/res/layout/fragment_settings.xml
View file @
73d13962
This diff is collapsed.
Click to expand it.
app/src/main/res/mipmap-xxhdpi/check.png
0 → 100644
View file @
73d13962
7.76 KB
app/src/main/res/mipmap-xxhdpi/feedback.png
0 → 100644
View file @
73d13962
8.61 KB
app/src/main/res/mipmap-xxhdpi/h_product.png
0 → 100644
View file @
73d13962
8.47 KB
app/src/main/res/mipmap-xxhdpi/language.png
0 → 100644
View file @
73d13962
10.1 KB
app/src/main/res/mipmap-xxhdpi/manage.png
0 → 100644
View file @
73d13962
8.55 KB
app/src/main/res/mipmap-xxhdpi/privacy.png
0 → 100644
View file @
73d13962
9.21 KB
app/src/main/res/mipmap-xxhdpi/rateapp.png
0 → 100644
View file @
73d13962
9.15 KB
app/src/main/res/mipmap-xxhdpi/set_logo.png
0 → 100644
View file @
73d13962
6.26 KB
app/src/main/res/mipmap-xxhdpi/shareg.png
0 → 100644
View file @
73d13962
9.87 KB
app/src/main/res/values/strings.xml
View file @
73d13962
...
...
@@ -50,4 +50,15 @@
<string
name=
"do_you_want_delete_item"
>
Do you want delete item?
</string>
<string
name=
"loading"
>
Loading
</string>
<string
name=
"product"
>
Product
</string>
<string
name=
"daily_new_product_report"
>
Daily new product report
</string>
<string
name=
"information_product_notification"
>
Information product notification
</string>
<string
name=
"other"
>
Other
</string>
<string
name=
"change_language"
>
Change language
</string>
<string
name=
"rate_this_app"
>
Rate this app
</string>
<string
name=
"send_feedback"
>
Send Feedback
</string>
<string
name=
"manage_subscriptions"
>
Manage Subscriptions
</string>
<string
name=
"share_app"
>
Share app
</string>
<string
name=
"privacy_policy"
>
Privacy Policy
</string>
<string
name=
"check_app_update"
>
Check app update
</string>
<string
name=
"version"
>
"Version "
</string>
</resources>
\ 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