Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
MiYaFastCashier
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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jiangjiantao
MiYaFastCashier
Commits
81acdb06
Commit
81acdb06
authored
May 10, 2022
by
赵鹏翔
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
功能中心添加,关于系统功能添加,待完善
parent
649c539a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
638 additions
and
7 deletions
+638
-7
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+18
-6
FunctionCenterActivity.kt
...n/java/com/miya/fastcashier/log/FunctionCenterActivity.kt
+56
-0
SystemParameterDialog.java
.../java/com/miya/fastcashier/log/SystemParameterDialog.java
+93
-0
SettingActivity.kt
app/src/main/java/com/miya/fastcashier/ui/SettingActivity.kt
+2
-1
activity_function_center.xml
app/src/main/res/layout/activity_function_center.xml
+111
-0
dialog_system_parameter.xml
app/src/main/res/layout/dialog_system_parameter.xml
+349
-0
icon_function_center_about_system.png
...in/res/mipmap-xhdpi/icon_function_center_about_system.png
+0
-0
icon_function_center_close.png
app/src/main/res/mipmap-xhdpi/icon_function_center_close.png
+0
-0
icon_function_center_log.png
app/src/main/res/mipmap-xhdpi/icon_function_center_log.png
+0
-0
colors.xml
app/src/main/res/values/colors.xml
+9
-0
No files found.
app/src/main/AndroidManifest.xml
View file @
81acdb06
...
...
@@ -2,18 +2,16 @@
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"com.miya.fastcashier"
>
<uses-permission
android:name=
"android.permission.WRITE_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.READ_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.ACCESS_NETWORK_STATE"
/>
<application
android:name=
".BaseApplication"
android:allowBackup=
"false"
android:icon=
"@mipmap/ic_launcher"
android:label=
"@string/app_name"
android:roundIcon=
"@mipmap/ic_launcher_round"
android:theme=
"@style/Theme.MiYaFastCashier.Dark"
android:supportsRtl=
"true"
>
android:supportsRtl=
"true"
android:theme=
"@style/Theme.MiYaFastCashier.Dark"
>
<activity
android:name=
".ui.LoginActivity"
android:exported=
"true"
...
...
@@ -21,6 +19,7 @@
android:theme=
"@style/Theme.MiYaFastCashier.Light"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
...
...
@@ -58,6 +57,19 @@
<activity
android:name=
".ui.ResetAuthorizePasswordActivity"
android:exported=
"true"
/>
<activity
android:name=
".log.FunctionCenterActivity"
android:exported=
"true"
/>
<!-- <activity-->
<!-- android:name=".log.LFilePickerActivity"-->
<!-- android:exported="true" />-->
</application>
<uses-permission
android:name=
"android.permission.READ_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.WRITE_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.ACCESS_NETWORK_STATE"
/>
<uses-permission
android:name=
"android.permission.ACCESS_WIFI_STATE"
/>
</manifest>
\ No newline at end of file
app/src/main/java/com/miya/fastcashier/log/FunctionCenterActivity.kt
0 → 100644
View file @
81acdb06
package
com.miya.fastcashier.log
import
android.content.Intent
import
android.os.Bundle
import
android.widget.Toast
import
com.miya.fastcashier.databinding.ActivityFunctionCenterBinding
import
com.miya.fastcashier.ui.BaseActivity
import
com.miya.fastcashier.utils.CenterToasty
import
com.miya.fastcashier.utils.LogFileUtils
import
com.miya.fastcashier.utils.clickWithTrigger
/**
* 功能中心
* @author zpxiang
*/
class
FunctionCenterActivity
:
BaseActivity
()
{
private
lateinit
var
viewBinding
:
ActivityFunctionCenterBinding
private
var
systemDialog
:
SystemParameterDialog
?
=
null
companion
object
{
fun
start
(
context
:
BaseActivity
)
{
var
intent
=
Intent
()
intent
.
setClass
(
context
,
FunctionCenterActivity
::
class
.
java
)
context
.
startActivity
(
intent
)
}
}
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
viewBinding
=
ActivityFunctionCenterBinding
.
inflate
(
layoutInflater
)
setContentView
(
viewBinding
.
root
)
viewBinding
.
moreOpExit
.
clickWithTrigger
{
finish
()
}
viewBinding
.
vLog
.
clickWithTrigger
{
toUploadLog
()
}
viewBinding
.
vSystem
.
clickWithTrigger
{
showSystemParamterDialog
()
}
}
fun
toUploadLog
()
{
// LFilePicker()
// .withActivity(this)
// .withStartPath(LogFileUtils.CACHE_FILE_PATH) //指定初始显示路径
// .withIsGreater(true) //过滤文件大小 小于指定大小的文件
// .withFileSize(0) //指定文件大小为500K
// .withMutilyMode(false)
// .start()
}
fun
showSystemParamterDialog
()
{
if
(
null
==
systemDialog
)
{
systemDialog
=
SystemParameterDialog
(
this
@FunctionCenterActivity
)
}
systemDialog
!!
.
show
()
}
}
\ No newline at end of file
app/src/main/java/com/miya/fastcashier/log/SystemParameterDialog.java
0 → 100644
View file @
81acdb06
package
com
.
miya
.
fastcashier
.
log
;
import
android.app.Dialog
;
import
android.content.Context
;
import
android.view.Gravity
;
import
android.view.View
;
import
android.view.WindowManager
;
import
android.widget.TextView
;
import
com.miya.fastcashier.R
;
import
com.miya.fastcashier.beans.SelfCashierAccountInfo
;
import
com.miya.fastcashier.databinding.DialogSystemParameterBinding
;
import
com.miya.fastcashier.service.AccountService
;
import
androidx.annotation.NonNull
;
public
class
SystemParameterDialog
extends
Dialog
{
private
DialogSystemParameterBinding
viewBinding
;
public
SystemParameterDialog
(
@NonNull
Context
context
)
{
super
(
context
,
R
.
style
.
CommonDialog
);
viewBinding
=
DialogSystemParameterBinding
.
inflate
(
getLayoutInflater
());
setContentView
(
viewBinding
.
getRoot
());
setCanceledOnTouchOutside
(
false
);
setCancelable
(
true
);
init
();
}
private
void
init
()
{
SelfCashierAccountInfo
accountInfo
=
AccountService
.
INSTANCE
.
getAccountInfo
();
// setInfo(viewBinding.tvVersion, BaseFunctionKt.getVersion(getContext()));
setInfo
(
viewBinding
.
tvStoreName
,
accountInfo
.
getShopInfo
().
getStoreName
());
setInfo
(
viewBinding
.
tvStoreNum
,
accountInfo
.
getShopInfo
().
getStoreId
());
setInfo
(
viewBinding
.
tvMerchantNum
,
accountInfo
.
getShopInfo
().
getHhMerchant
());
setInfo
(
viewBinding
.
tvPos
,
accountInfo
.
getShopInfo
().
getPosId
());
setInfo
(
viewBinding
.
tvCashier
,
accountInfo
.
getShopInfo
().
getOperatorId
());
// setInfo(viewBinding.tvVersionType, "fastCashier_" + BuildConfig.appType);
setInfo
(
viewBinding
.
tvEquipment
,
"sunmi_v2pro"
);
// setInfo(viewBinding.tvServerUrl, LoginService.Companion.getBaseUrl());
// setInfo(viewBinding.tvWifiName, BaseFunctionKt.getWifyName(getContext()));
// setInfo(viewBinding.tvNetIp, BaseFunctionKt.getNetIp(getContext()) == null ? "未知" : BaseFunctionKt.getNetIp(getContext()));
// setInfo(viewBinding.tvPrintType, PrinterManager.getInstance().getPrinter() == null ?
// getContext().getResources().getString(R.string.app_unkown) :
// PrinterManager.getInstance().getPrinter().getPrinterName());
// setInfo(viewBinding.tvChannel, BuildConfig.CHANNEL);
viewBinding
.
ivClose
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
dismiss
();
}
});
resize
();
}
private
void
setInfo
(
View
view
,
String
info
)
{
((
TextView
)
view
).
setText
(
info
);
}
/**
* 设置对话框大小
*
* @param width 宽度,传0表示走默认宽度
* @param height 高度,传0表示走默认高度
*/
public
SystemParameterDialog
setSize
(
int
width
,
int
height
)
{
if
(
width
<
0
||
height
<
0
)
{
return
this
;
}
WindowManager
.
LayoutParams
layoutParams
=
getWindow
().
getAttributes
();
if
(
width
!=
0
&&
height
!=
0
)
{
layoutParams
.
width
=
width
;
layoutParams
.
height
=
height
;
}
else
if
(
width
==
0
&&
height
!=
0
)
{
layoutParams
.
height
=
height
;
}
else
if
(
width
!=
0
&&
height
==
0
)
{
layoutParams
.
width
=
width
;
}
getWindow
().
setGravity
(
Gravity
.
CENTER
);
getWindow
().
setAttributes
(
layoutParams
);
return
this
;
}
private
void
resize
()
{
this
.
getWindow
().
setLayout
(
WindowManager
.
LayoutParams
.
MATCH_PARENT
,
WindowManager
.
LayoutParams
.
MATCH_PARENT
);
}
}
\ No newline at end of file
app/src/main/java/com/miya/fastcashier/ui/SettingActivity.kt
View file @
81acdb06
...
...
@@ -9,6 +9,7 @@ import androidx.fragment.app.FragmentManager
import
com.miya.fastcashier.BaseApplication
import
com.miya.fastcashier.R
import
com.miya.fastcashier.databinding.ActivitySettingBinding
import
com.miya.fastcashier.log.FunctionCenterActivity
import
com.miya.fastcashier.ui.dialog.AuthorizePasswordInputDialog
import
com.miya.fastcashier.ui.dialog.CommonDialog
import
com.miya.fastcashier.utils.click
...
...
@@ -90,7 +91,7 @@ class SettingActivity : BaseActivity() {
AuthorizePasswordInputDialog
.
newInstance
().
show
(
fm
,
FRAGMENT_TAG
,
object
:
AuthorizePasswordInputDialog
.
OnAuthorizedFinishListener
{
override
fun
onAuthorizedFinished
(
isSucceed
:
Boolean
)
{
if
(
isSucceed
){
//
FunctionCenterActivity.start(this@SettingActivity)
FunctionCenterActivity
.
start
(
this
@SettingActivity
)
}
}
...
...
app/src/main/res/layout/activity_function_center.xml
0 → 100644
View file @
81acdb06
<?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"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
android:background=
"@color/commonColorPrimary"
>
<TextView
android:id=
"@+id/tv_title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"功能中心"
android:textColor=
"@color/white"
android:textSize=
"40sp"
android:textStyle=
"bold"
android:layout_marginStart=
"30dp"
android:layout_marginTop=
"40dp"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<ImageView
android:id=
"@+id/moreOpExit"
android:layout_width=
"48dp"
android:layout_height=
"48dp"
android:layout_gravity=
"end"
android:scaleType=
"centerInside"
android:layout_marginEnd=
"30dp"
android:layout_marginTop=
"40dp"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
android:src=
"@mipmap/icon_function_center_close"
/>
<View
android:id=
"@+id/v_content"
android:layout_width=
"0dp"
android:layout_height=
"0dp"
app:layout_constraintTop_toBottomOf=
"@id/tv_title"
app:layout_constraintStart_toStartOf=
"parent"
android:layout_margin=
"30dp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
android:background=
"@drawable/shape_border_d1d1dc_solid_white_radius16"
/>
<View
android:id=
"@+id/v_log"
android:layout_width=
"140dp"
android:layout_height=
"0dp"
android:layout_marginTop=
"40dp"
android:layout_marginStart=
"40dp"
app:layout_constraintStart_toStartOf=
"@id/v_content"
app:layout_constraintBottom_toBottomOf=
"@id/tv_upload_log"
app:layout_constraintTop_toTopOf=
"@id/v_content"
android:src=
"@mipmap/icon_function_center_log"
/>
<ImageView
android:id=
"@+id/iv_log"
android:layout_width=
"100dp"
android:layout_height=
"100dp"
app:layout_constraintStart_toStartOf=
"@id/v_log"
app:layout_constraintEnd_toEndOf=
"@id/v_log"
app:layout_constraintTop_toTopOf=
"@id/v_log"
android:src=
"@mipmap/icon_function_center_log"
/>
<TextView
android:id=
"@+id/tv_upload_log"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
app:layout_constraintStart_toStartOf=
"@id/v_log"
app:layout_constraintEnd_toEndOf=
"@id/v_log"
android:layout_marginTop=
"8dp"
app:layout_constraintTop_toBottomOf=
"@id/iv_log"
android:text=
"查看日志"
android:textColor=
"@color/color_333333"
android:textStyle=
"bold"
android:textSize=
"26sp"
/>
<View
android:id=
"@+id/v_system"
android:layout_width=
"140dp"
android:layout_height=
"0dp"
android:layout_marginTop=
"40dp"
android:layout_marginStart=
"40dp"
app:layout_constraintStart_toEndOf=
"@+id/v_log"
app:layout_constraintBottom_toBottomOf=
"@id/tv_system"
app:layout_constraintTop_toTopOf=
"@id/v_content"
android:src=
"@mipmap/icon_function_center_log"
/>
<ImageView
android:id=
"@+id/iv_system"
android:layout_width=
"100dp"
android:layout_height=
"100dp"
app:layout_constraintStart_toStartOf=
"@id/v_system"
app:layout_constraintEnd_toEndOf=
"@id/v_system"
app:layout_constraintTop_toTopOf=
"@id/v_system"
android:src=
"@mipmap/icon_function_center_about_system"
/>
<TextView
android:id=
"@+id/tv_system"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
app:layout_constraintStart_toStartOf=
"@id/v_system"
app:layout_constraintEnd_toEndOf=
"@id/v_system"
android:layout_marginTop=
"8dp"
app:layout_constraintTop_toBottomOf=
"@id/iv_system"
android:text=
"关于系统"
android:textColor=
"@color/color_333333"
android:textStyle=
"bold"
android:textSize=
"26sp"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/dialog_system_parameter.xml
0 → 100644
View file @
81acdb06
This diff is collapsed.
Click to expand it.
app/src/main/res/mipmap-xhdpi/icon_function_center_about_system.png
0 → 100755
View file @
81acdb06
39.2 KB
app/src/main/res/mipmap-xhdpi/icon_function_center_close.png
0 → 100644
View file @
81acdb06
1018 Bytes
app/src/main/res/mipmap-xhdpi/icon_function_center_log.png
0 → 100755
View file @
81acdb06
31.9 KB
app/src/main/res/values/colors.xml
View file @
81acdb06
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color
name=
"commonColorPrimary"
>
#FF8000
</color>
<color
name=
"colorPrimary"
>
#111235
</color>
<color
name=
"black"
>
#FF000000
</color>
<color
name=
"white"
>
#FFFFFFFF
</color>
...
...
@@ -24,4 +25,12 @@
<color
name=
"color_141C30"
>
#141C30
</color>
<color
name=
"color_D1D1DC"
>
#D1D1DC
</color>
<color
name=
"color_323233"
>
#323233
</color>
<color
name=
"lfile_colorAccent"
>
#418CE2
</color>
<color
name=
"lfile_colorPrimary"
>
#418CE2
</color>
<color
name=
"lfile_colorPrimaryDark"
>
#418CE2
</color>
<color
name=
"lfile_defaultColor"
>
#418CE2
</color>
<color
name=
"lfile_gray"
>
#cccccc
</color>
<color
name=
"lfile_lightgray"
>
#dddddd
</color>
<color
name=
"lfile_white"
>
#ffffff
</color>
</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