Commit 81acdb06 authored by 赵鹏翔's avatar 赵鹏翔

功能中心添加,关于系统功能添加,待完善

parent 649c539a
......@@ -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
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
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
......@@ -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)
}
}
......
<?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
This diff is collapsed.
<?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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment