Commit 023bc895 authored by gaodapeng's avatar gaodapeng

增加部分代码,修改屏幕适配方式

parent 88987323
...@@ -18,7 +18,7 @@ android { ...@@ -18,7 +18,7 @@ android {
defaultConfig { defaultConfig {
applicationId "com.miya.fastcashier" applicationId "com.miya.fastcashier"
minSdkVersion 16 minSdkVersion 19
targetSdkVersion 31 targetSdkVersion 31
versionCode 2 versionCode 2
versionName "2.0" versionName "2.0"
...@@ -63,6 +63,8 @@ dependencies { ...@@ -63,6 +63,8 @@ dependencies {
implementation 'androidx.annotation:annotation:1.1.0' implementation 'androidx.annotation:annotation:1.1.0'
implementation 'com.rengwuxian.materialedittext:library:2.1.4' implementation 'com.rengwuxian.materialedittext:library:2.1.4'
implementation 'com.github.GrenderG:Toasty:1.5.2' implementation 'com.github.GrenderG:Toasty:1.5.2'
annotationProcessor 'androidx.room:room-compiler:2.4.0'
implementation 'androidx.room:room-runtime:2.4.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation files('libs/Pay-Platform.jar') implementation files('libs/Pay-Platform.jar')
testImplementation 'junit:junit:4.+' testImplementation 'junit:junit:4.+'
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
<application <application
android:name=".BaseApplication" android:name=".BaseApplication"
android:allowBackup="false" android:allowBackup="false"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"> android:supportsRtl="true">
<activity <activity
...@@ -49,6 +49,9 @@ ...@@ -49,6 +49,9 @@
<activity <activity
android:name=".ui.PayActivity" android:name=".ui.PayActivity"
android:theme="@style/Theme.MiYaFastCashier.Dark" /> android:theme="@style/Theme.MiYaFastCashier.Dark" />
<activity
android:name=".ui.SearchOrderActivity"
android:theme="@style/Theme.MiYaFastCashier.Dark" />
</application> </application>
</manifest> </manifest>
\ No newline at end of file
...@@ -16,6 +16,7 @@ import com.elvishew.xlog.printer.file.FilePrinter ...@@ -16,6 +16,7 @@ import com.elvishew.xlog.printer.file.FilePrinter
import com.elvishew.xlog.printer.file.backup.NeverBackupStrategy import com.elvishew.xlog.printer.file.backup.NeverBackupStrategy
import com.elvishew.xlog.printer.file.naming.DateFileNameGenerator import com.elvishew.xlog.printer.file.naming.DateFileNameGenerator
import com.miya.fastcashier.utils.DateUtils import com.miya.fastcashier.utils.DateUtils
import com.miya.fastcashier.utils.DensityUtils
import com.miya.print.PrinterManager import com.miya.print.PrinterManager
import com.sdy.miya.moblie.component.pay.core.utils.PayLogFileUtils import com.sdy.miya.moblie.component.pay.core.utils.PayLogFileUtils
import com.tencent.mmkv.MMKV import com.tencent.mmkv.MMKV
...@@ -35,7 +36,7 @@ class BaseApplication : MultiDexApplication() { ...@@ -35,7 +36,7 @@ class BaseApplication : MultiDexApplication() {
logConfig() logConfig()
} }
private fun logConfig(){ private fun logConfig() {
XLog.init(LogLevel.ALL); XLog.init(LogLevel.ALL);
...@@ -69,48 +70,44 @@ class BaseApplication : MultiDexApplication() { ...@@ -69,48 +70,44 @@ class BaseApplication : MultiDexApplication() {
//支付日志文件夹 //支付日志文件夹
PayLogFileUtils.initLogPath(applicationContext.getExternalFilesDir(null)!! PayLogFileUtils.initLogPath(
applicationContext.getExternalFilesDir(null)!!
.absolutePath .absolutePath
+ File.separator + "payLog") + File.separator + "payLog"
)
} }
private fun screenAdapt() { private fun screenAdapt() {
registerActivityLifecycleCallbacks(object : ActivityLifecycleCallbacks { registerActivityLifecycleCallbacks(object : ActivityLifecycleCallbacks {
override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) { override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {
setDensity(activity, this@BaseApplication) DensityUtils.setDensity(activity, this@BaseApplication)
XLog.d(DateUtils.format18(Date())+" onActivityCreated") XLog.d(DateUtils.format18(Date()) + " onActivityCreated")
} }
override fun onActivityStarted(activity: Activity) { override fun onActivityStarted(activity: Activity) {
XLog.d(DateUtils.format18(Date())+" onActivityStarted") XLog.d(DateUtils.format18(Date()) + " onActivityStarted")
} }
override fun onActivityResumed(activity: Activity) { override fun onActivityResumed(activity: Activity) {
XLog.d(DateUtils.format18(Date())+" onActivityResumed") XLog.d(DateUtils.format18(Date()) + " onActivityResumed")
} }
override fun onActivityPaused(activity: Activity) { override fun onActivityPaused(activity: Activity) {
XLog.d(DateUtils.format18(Date())+" onActivityPaused") XLog.d(DateUtils.format18(Date()) + " onActivityPaused")
} }
override fun onActivityStopped(activity: Activity) { override fun onActivityStopped(activity: Activity) {
XLog.d(DateUtils.format18(Date())+" onActivityStopped") XLog.d(DateUtils.format18(Date()) + " onActivityStopped")
} }
override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) { override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {
XLog.d(DateUtils.format18(Date())+" onActivitySaveInstanceState") XLog.d(DateUtils.format18(Date()) + " onActivitySaveInstanceState")
} }
override fun onActivityDestroyed(activity: Activity) { override fun onActivityDestroyed(activity: Activity) {
XLog.d(DateUtils.format18(Date())+" onActivityDestroyed") XLog.d(DateUtils.format18(Date()) + " onActivityDestroyed")
} }
}) })
} }
fun setDensity(context: Context, application: Application) {
val appDiaplayMetrics = application.resources.displayMetrics
val targetDensity = (appDiaplayMetrics.widthPixels / 540).toFloat()
val targetDensityDpi = (160 * targetDensity).toInt()
appDiaplayMetrics.scaledDensity = targetDensity
appDiaplayMetrics.density = appDiaplayMetrics.scaledDensity
appDiaplayMetrics.densityDpi = targetDensityDpi
val activityDisplayMetrics = context.resources.displayMetrics
activityDisplayMetrics.scaledDensity = targetDensity
activityDisplayMetrics.density = activityDisplayMetrics.scaledDensity
activityDisplayMetrics.densityDpi = targetDensityDpi
}
} }
\ No newline at end of file
...@@ -41,26 +41,29 @@ class MainActivity : BaseActivity() { ...@@ -41,26 +41,29 @@ class MainActivity : BaseActivity() {
tvStoreName.text = AccountService.getAccountInfo()?.shopInfo?.storeName tvStoreName.text = AccountService.getAccountInfo()?.shopInfo?.storeName
tvSlog.text = AccountService.getUserName() tvSlog.text = AccountService.getUserName()
llPay.clickWithTrigger{ llPay.clickWithTrigger {
val intent = Intent() val intent = Intent()
intent.setClass(this@MainActivity, PriceInputActivity::class.java) intent.setClass(this@MainActivity, PriceInputActivity::class.java)
startActivity(intent) startActivity(intent)
} }
llRefund.clickWithTrigger{ llRefund.clickWithTrigger {
val intent = Intent() val intent = Intent()
intent.setClass(this@MainActivity, RefundActivity::class.java) intent.setClass(this@MainActivity, RefundActivity::class.java)
startActivity(intent) startActivity(intent)
} }
tvPrintLast.clickWithTrigger{ tvPrintLast.clickWithTrigger {
try { try {
PrintService.printLastOrderInfo() PrintService.printLastOrderInfo()
}catch (e:Exception){ } catch (e: Exception) {
e.message?.let { it1 -> CenterToasty.error(this, it1,Toast.LENGTH_SHORT).show() }; e.message?.let { it1 -> CenterToasty.error(this, it1, Toast.LENGTH_SHORT).show() };
} }
} }
binding.llSearchOrder.clickWithTrigger {
val intent = Intent(this@MainActivity, SearchOrderActivity::class.java)
startActivity(intent)
}
ivLoginOut.clickWithTrigger {
ivLoginOut.clickWithTrigger{
loginOut() loginOut()
} }
} }
......
package com.miya.fastcashier.ui
import android.content.Context
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.google.android.material.tabs.TabLayoutMediator
import com.miya.fastcashier.R
import com.miya.fastcashier.databinding.ActivitySearchOrderBinding
import com.miya.fastcashier.databinding.FragmentSearchOrderBinding
import com.miya.fastcashier.databinding.ItemSearchOrderListBinding
import com.miya.fastcashier.utils.MiYaPayPlantformPayWayEnum
import com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse
/**
* 查单列表
*/
class SearchOrderActivity : BaseActivity() {
private lateinit var binding: ActivitySearchOrderBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivitySearchOrderBinding.inflate(LayoutInflater.from(this))
setContentView(binding.root)
TabLayoutMediator(
binding.tlIndicator,
binding.vpPage
) { tab, position ->
when (position) {
0 -> tab.text = "微信"
1 -> tab.text = "支付宝"
else -> tab.text = ""
}
}.attach()
binding.vpPage.adapter = object : FragmentStateAdapter(this) {
override fun getItemCount(): Int {
return 2
}
override fun createFragment(position: Int): Fragment {
return when (position) {
0 -> SearchOrderFragment(MiYaPayPlantformPayWayEnum.MiyaPayType.WEIXIN)
else -> SearchOrderFragment(MiYaPayPlantformPayWayEnum.MiyaPayType.ALIPAY)
}
}
}
}
}
class SearchOrderFragment(payType: MiYaPayPlantformPayWayEnum.MiyaPayType) : Fragment() {
private var binding: FragmentSearchOrderBinding? = null
private lateinit var adapter: SearchOrderListAdapter
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View {
binding = FragmentSearchOrderBinding.inflate(inflater, container, false)
return binding!!.root
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
if (activity == null) {
return
}
val act = requireActivity()
binding?.run {
adapter = SearchOrderListAdapter(act, arrayListOf())
rvContent.layoutManager = LinearLayoutManager(act, LinearLayoutManager.VERTICAL, false)
rvContent.adapter = adapter
rvContent.addOnScrollListener(object : RecyclerView.OnScrollListener() {
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
super.onScrolled(recyclerView, dx, dy)
}
override fun onScrollStateChanged(recyclerView: RecyclerView, newState: Int) {
super.onScrollStateChanged(recyclerView, newState)
}
})
}
}
override fun onDestroyView() {
binding = null
super.onDestroyView()
}
}
class SearchOrderListAdapter(val context: Context, private val list: MutableList<PayServiceResponse>) :
RecyclerView.Adapter<SearchOrderViewHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): SearchOrderViewHolder {
return SearchOrderViewHolder(
LayoutInflater.from(parent.context)
.inflate(R.layout.item_search_order_list, parent, false)
)
}
override fun onBindViewHolder(holder: SearchOrderViewHolder, position: Int) {
holder.setData(list[position])
}
override fun getItemCount(): Int {
return list.size
}
}
class SearchOrderViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
private val binding: ItemSearchOrderListBinding = ItemSearchOrderListBinding.bind(itemView)
fun setData(data: PayServiceResponse) {
binding.tvDate.text = data.chanelOrderTradeTime
}
}
\ No newline at end of file
package com.miya.fastcashier.utils
import android.app.Application
import android.content.ComponentCallbacks
import android.content.Context
import android.content.res.Configuration
class DensityUtils {
companion object {
var sNonCompatDensity: Float = 0f
var sNonCompatScaledDensity: Float = 0f
fun setDensity(context: Context, application: Application) {
val appDisplayMetrics = application.resources.displayMetrics
if (sNonCompatDensity == 0f) {
sNonCompatDensity = appDisplayMetrics.density
sNonCompatScaledDensity = appDisplayMetrics.scaledDensity
application.registerComponentCallbacks(object : ComponentCallbacks {
override fun onConfigurationChanged(newConfig: Configuration) {
if (newConfig != null && newConfig.fontScale > 0) {
sNonCompatScaledDensity =
application.resources.displayMetrics.scaledDensity
}
}
override fun onLowMemory() {
}
})
}
val targetDensity = (appDisplayMetrics.widthPixels / 720).toFloat()
val targetScaledDensity = targetDensity * (sNonCompatScaledDensity / sNonCompatDensity)
val targetDensityDpi = (160 * targetDensity).toInt()
appDisplayMetrics.density = targetDensity
appDisplayMetrics.scaledDensity = targetScaledDensity
appDisplayMetrics.densityDpi = targetDensityDpi
val activityDisplayMetrics = context.resources.displayMetrics
activityDisplayMetrics.density = targetDensity
activityDisplayMetrics.scaledDensity = targetScaledDensity
activityDisplayMetrics.densityDpi = targetDensityDpi
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<stroke
android:width="2dp"
android:color="#89889A" />
<solid android:color="#20FFFFFF" />
<corners android:radius="10dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/res/android">
<stroke android:color="@color/white" <stroke
android:width="2dp"/> android:width="2dp"
android:color="#89889A" />
<solid android:color="#20FFFFFF" />
<corners android:radius="8dp" /> <corners android:radius="8dp" />
</shape> </shape>
\ No newline at end of file
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
android:layout_height="120dp" android:layout_height="120dp"
android:layout_marginStart="39dp" android:layout_marginStart="39dp"
android:layout_marginLeft="39dp" android:layout_marginLeft="39dp"
android:layout_marginTop="259dp" android:layout_marginTop="87dp"
android:background="@mipmap/app_store_round_logo" android:background="@mipmap/app_store_round_logo"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
...@@ -52,11 +52,11 @@ ...@@ -52,11 +52,11 @@
android:id="@+id/tvStoreName" android:id="@+id/tvStoreName"
android:layout_width="360dp" android:layout_width="360dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:ellipsize="end"
android:layout_marginStart="23dp" android:layout_marginStart="23dp"
android:layout_marginLeft="26dp" android:layout_marginLeft="26dp"
android:text="匡威-杭州滨江店!" android:ellipsize="end"
android:maxLines="1" android:maxLines="1"
android:text="匡威-杭州滨江店!"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="48sp" android:textSize="48sp"
app:layout_constraintStart_toEndOf="@+id/ivLogo" app:layout_constraintStart_toEndOf="@+id/ivLogo"
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
android:id="@+id/llPay" android:id="@+id/llPay"
android:layout_width="292dp" android:layout_width="292dp"
android:layout_height="292dp" android:layout_height="292dp"
android:layout_marginTop="471dp" android:layout_marginTop="279dp"
android:background="@drawable/app_home_function_bg" android:background="@drawable/app_home_function_bg"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:orientation="vertical" android:orientation="vertical"
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
android:id="@+id/llRefund" android:id="@+id/llRefund"
android:layout_width="292dp" android:layout_width="292dp"
android:layout_height="292dp" android:layout_height="292dp"
android:layout_marginTop="471dp" android:layout_marginTop="279dp"
android:background="@drawable/app_home_function_bg" android:background="@drawable/app_home_function_bg"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:orientation="vertical" android:orientation="vertical"
...@@ -131,40 +131,133 @@ ...@@ -131,40 +131,133 @@
</androidx.appcompat.widget.LinearLayoutCompat> </androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/llSearchOrder"
android:layout_width="180dp"
android:layout_height="180dp"
android:layout_marginTop="32dp"
android:background="@drawable/app_home_function_btn_bg"
android:descendantFocusability="blocksDescendants"
android:gravity="center"
android:orientation="vertical"
app:layout_constraintEnd_toStartOf="@id/llStatistic"
app:layout_constraintHorizontal_chainStyle="spread"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/llPay">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/ivSearchOrder"
android:layout_width="80dp"
android:layout_height="80dp"
android:scaleType="fitCenter"
android:src="@mipmap/ic_home_search" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tvSearchOrder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/search"
android:textColor="@color/white"
android:textSize="22sp" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/llStatistic"
android:layout_width="180dp"
android:layout_height="180dp"
android:background="@drawable/app_home_function_btn_bg"
android:descendantFocusability="blocksDescendants"
android:gravity="center"
android:orientation="vertical"
app:layout_constraintEnd_toStartOf="@id/llBalance"
app:layout_constraintStart_toEndOf="@id/llSearchOrder"
app:layout_constraintTop_toTopOf="@id/llSearchOrder">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/ivStatistic"
android:layout_width="80dp"
android:layout_height="80dp"
android:scaleType="fitCenter"
android:src="@mipmap/ic_home_statistic" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tvStatistic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/statistic"
android:textColor="@color/white"
android:textSize="22sp" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/llBalance"
android:layout_width="180dp"
android:layout_height="180dp"
android:background="@drawable/app_home_function_btn_bg"
android:descendantFocusability="blocksDescendants"
android:gravity="center"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/llStatistic"
app:layout_constraintTop_toTopOf="@id/llStatistic">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/ivBalance"
android:layout_width="80dp"
android:layout_height="80dp"
android:scaleType="fitCenter"
android:src="@mipmap/ic_home_balance" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tvBalance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/balance"
android:textColor="@color/white"
android:textSize="22sp" />
</androidx.appcompat.widget.LinearLayoutCompat>
<TextView <TextView
android:id="@+id/tvPrintLast" android:id="@+id/tvPrintLast"
android:layout_width="624dp" android:layout_width="624dp"
android:layout_height="100dp" android:layout_height="100dp"
android:layout_marginTop="60dp"
android:background="@drawable/app_home_print_last_bg"
android:gravity="center" android:gravity="center"
android:text="打印上一单" android:text="打印上一单"
android:textSize="32sp"
android:layout_marginTop="80dp"
android:textColor="@color/white" android:textColor="@color/white"
android:background="@drawable/app_home_print_last_bg" android:textSize="32sp"
app:layout_constraintTop_toBottomOf="@+id/llPay"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/llSearchOrder"
app:layout_constraintVertical_bias="0.2" /> app:layout_constraintVertical_bias="0.2" />
<ImageView <ImageView
android:layout_width="220dp" android:layout_width="220dp"
android:layout_height="40dp" android:layout_height="40dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginBottom="24dp" android:layout_marginBottom="24dp"
android:background="@mipmap/app_home_bottom_store_logo" /> android:background="@mipmap/app_home_bottom_store_logo"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<ImageView <ImageView
android:id="@+id/ivLoginOut" android:id="@+id/ivLoginOut"
app:layout_constraintTop_toTopOf="@+id/tvStoreName"
app:layout_constraintBottom_toBottomOf="@+id/tvStoreName"
app:layout_constraintStart_toEndOf="@+id/tvStoreName"
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="50dp" android:layout_height="50dp"
android:padding="7dp"
android:layout_marginStart="12dp" android:layout_marginStart="12dp"
android:layout_marginLeft="12dp"
android:padding="7dp"
android:src="@mipmap/app_main_login_out" android:src="@mipmap/app_main_login_out"
android:layout_marginLeft="12dp" /> app:layout_constraintBottom_toBottomOf="@+id/tvStoreName"
app:layout_constraintStart_toEndOf="@+id/tvStoreName"
app:layout_constraintTop_toTopOf="@+id/tvStoreName" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...@@ -4,45 +4,11 @@ ...@@ -4,45 +4,11 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/colorPrimary"
android:focusable="true" android:focusable="true"
android:focusableInTouchMode="true" android:focusableInTouchMode="true"
tools:context=".ui.PriceInputActivity"> tools:context=".ui.PriceInputActivity">
<TextView <include layout="@layout/title" />
android:id="@+id/tvBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="60dp"
android:layout_marginLeft="60dp"
android:layout_marginTop="32dp"
android:text="@string/back"
android:textColor="@color/white"
android:textSize="24sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/ivBack"
android:layout_width="24dp"
android:layout_height="48dp"
android:contentDescription="@string/back"
android:padding="6dp"
android:src="@mipmap/ic_left_arrow"
app:layout_constraintBottom_toBottomOf="@+id/tvBack"
app:layout_constraintEnd_toStartOf="@+id/tvBack"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/tvBack" />
<ImageView
android:layout_width="195dp"
android:layout_height="20dp"
android:layout_marginEnd="32dp"
android:layout_marginRight="32dp"
android:src="@mipmap/ic_logo_white"
app:layout_constraintBottom_toBottomOf="@+id/tvBack"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/tvBack" />
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -69,27 +35,27 @@ ...@@ -69,27 +35,27 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="281dp" android:layout_marginTop="281dp"
android:layout_marginEnd="5dp"
android:layout_marginRight="5dp"
android:text="收款金额" android:text="收款金额"
android:textColor="#141C30" android:textColor="#141C30"
android:layout_marginEnd="5dp"
android:textSize="32sp" android:textSize="32sp"
app:layout_constraintEnd_toStartOf="@+id/guideline" app:layout_constraintEnd_toStartOf="@+id/guideline"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent" />
android:layout_marginRight="5dp" />
<TextView <TextView
android:id="@+id/tvPayPrice" android:id="@+id/tvPayPrice"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_marginLeft="5dp"
android:layout_marginTop="273dp" android:layout_marginTop="273dp"
android:text="¥98.5" android:text="¥98.5"
android:textColor="#141C30" android:textColor="#141C30"
android:layout_marginStart="5dp"
android:textSize="48sp" android:textSize="48sp"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintStart_toEndOf="@id/guideline" app:layout_constraintStart_toEndOf="@id/guideline"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent" />
android:layout_marginLeft="5dp" />
<ImageView <ImageView
android:layout_width="541dp" android:layout_width="541dp"
......
<?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">
<include layout="@layout/title" />
<com.google.android.material.tabs.TabLayout
android:id="@+id/tlIndicator"
android:layout_width="match_parent"
android:layout_height="85dp"
android:layout_marginTop="87dp"
app:layout_constraintTop_toTopOf="parent" />
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/vpPage"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/tlIndicator" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvContent"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/tvOrderNo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="40dp"
android:layout_marginTop="24dp"
android:textColor="@color/color_333333"
android:textSize="28sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="流水号1" />
<TextView
android:id="@+id/tvDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<View
android:id="@+id/vBg"
android:layout_width="match_parent"
android:layout_height="87dp"
android:background="@color/colorPrimary"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tvBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="60dp"
android:layout_marginTop="32dp"
android:text="@string/back"
android:textColor="@color/white"
android:textSize="24sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/ivBack"
android:layout_width="24dp"
android:layout_height="48dp"
android:contentDescription="@string/back"
android:padding="6dp"
android:src="@mipmap/ic_left_arrow"
app:layout_constraintBottom_toBottomOf="@+id/tvBack"
app:layout_constraintEnd_toStartOf="@+id/tvBack"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/tvBack" />
<ImageView
android:layout_width="195dp"
android:layout_height="20dp"
android:layout_marginEnd="32dp"
android:src="@mipmap/ic_logo_white"
app:layout_constraintBottom_toBottomOf="@+id/tvBack"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/tvBack" />
</merge>
\ No newline at end of file
...@@ -9,4 +9,5 @@ ...@@ -9,4 +9,5 @@
<color name="transparent">#00000000</color> <color name="transparent">#00000000</color>
<color name="green">#06C261</color> <color name="green">#06C261</color>
<color name="blue">#2E6CFB</color> <color name="blue">#2E6CFB</color>
<color name="color_333333">#333333</color>
</resources> </resources>
\ No newline at end of file
...@@ -15,5 +15,8 @@ ...@@ -15,5 +15,8 @@
<string name="username_not_empty">用户名不能为空</string> <string name="username_not_empty">用户名不能为空</string>
<string name="password_not_empty">密码不能为空</string> <string name="password_not_empty">密码不能为空</string>
<string name="invalid_password">密码位数必须得是6位以上</string> <string name="invalid_password">密码位数必须得是6位以上</string>
<string name="search">查询</string>
<string name="statistic">统计</string>
<string name="balance">结算</string>
</resources> </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