Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
A
appzxhy
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
appzxhy
Commits
b0d1f423
Commit
b0d1f423
authored
Jun 10, 2025
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
fff01cf1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
86 additions
and
51 deletions
+86
-51
YuanAdapter2.kt
app/src/main/java/com/base/appzxhy/ui/main/YuanAdapter2.kt
+48
-48
bg_2dd29e_6ff2a2.xml
app/src/main/res/drawable/bg_2dd29e_6ff2a2.xml
+10
-0
fragment_home.xml
app/src/main/res/layout/fragment_home.xml
+27
-3
dimens.xml
app/src/main/res/values/dimens.xml
+1
-0
No files found.
app/src/main/java/com/base/appzxhy/ui/main/YuanAdapter2.kt
View file @
b0d1f423
package
com.base.appzxhy.ui.main
//package com.base.appzxhy.ui.main
//
import
android.annotation.SuppressLint
//import android.annotation.SuppressLint
import
android.content.Context
//import android.content.Context
import
android.view.View
//import android.view.View
import
android.view.ViewGroup
//import android.view.ViewGroup
import
androidx.recyclerview.widget.RecyclerView.ViewHolder
//import androidx.recyclerview.widget.RecyclerView.ViewHolder
import
com.base.appzxhy.BuildConfig
//import com.base.appzxhy.BuildConfig
import
com.base.appzxhy.R
//import com.base.appzxhy.R
import
com.base.appzxhy.databinding.ItemYuan2Binding
//import com.base.appzxhy.databinding.ItemYuan2Binding
import
com.base.appzxhy.utils.XmlEx.inflate
//import com.base.appzxhy.utils.XmlEx.inflate
import
com.chad.library.adapter4.BaseQuickAdapter
//import com.chad.library.adapter4.BaseQuickAdapter
import
kotlin.random.Random
//import kotlin.random.Random
//
class
YuanAdapter2
:
BaseQuickAdapter
<
Array
<
String
>,
YuanAdapter2
.
AAA
>()
{
//class YuanAdapter2 : BaseQuickAdapter<Array<String>, YuanAdapter2.AAA>() {
//
var
cleanClick
:
(()
->
Unit
)?
=
null
// var cleanClick: (() -> Unit)? = null
//
inner
class
AAA
(
view
:
View
)
:
ViewHolder
(
view
)
// inner class AAA(view: View) : ViewHolder(view)
//
@SuppressLint
(
"SetTextI18n"
)
// @SuppressLint("SetTextI18n")
override
fun
onBindViewHolder
(
holder
:
AAA
,
position
:
Int
,
item
:
Array
<
String
>?)
{
// override fun onBindViewHolder(holder: AAA, position: Int, item: Array<String>?) {
item
?:
return
// item ?: return
val
binding
=
ItemYuan2Binding
.
bind
(
holder
.
itemView
)
// val binding = ItemYuan2Binding.bind(holder.itemView)
//
if
(
BuildConfig
.
DEBUG
)
{
// if (BuildConfig.DEBUG) {
binding
.
tvCleanSize
.
text
=
"%.2f"
.
format
(
Random
.
nextFloat
()
*
Random
.
nextInt
(
1
,
10
))
// binding.tvCleanSize.text = "%.2f".format(Random.nextFloat() * Random.nextInt(1, 10))
binding
.
tvCleanSizeUnit
.
text
=
"GB Found"
// binding.tvCleanSizeUnit.text = "GB Found"
}
// }
//
binding
.
tvSize2
.
text
=
item
[
0
]
// binding.tvSize2.text = item[0]
binding
.
tvSize1
.
text
=
item
[
1
]
// binding.tvSize1.text = item[1]
//
//
binding
.
fl
.
setOnClickListener
{
// binding.fl.setOnClickListener {
cleanClick
?.
invoke
()
// cleanClick?.invoke()
}
// }
binding
.
tvClean
.
setOnClickListener
{
// binding.tvClean.setOnClickListener {
cleanClick
?.
invoke
()
// cleanClick?.invoke()
}
// }
}
// }
//
override
fun
onCreateViewHolder
(
context
:
Context
,
parent
:
ViewGroup
,
viewType
:
Int
):
AAA
{
// override fun onCreateViewHolder(context: Context, parent: ViewGroup, viewType: Int): AAA {
return
AAA
(
R
.
layout
.
item_yuan_2
.
inflate
(
parent
))
// return AAA(R.layout.item_yuan_2.inflate(parent))
}
// }
//
//
}
//}
\ No newline at end of file
\ No newline at end of file
app/src/main/res/drawable/bg_2dd29e_6ff2a2.xml
0 → 100644
View file @
b0d1f423
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<gradient
android:centerY=
"0.5"
android:centerX=
"0.5"
android:angle=
"270"
android:endColor=
"#6FF2A2"
android:startColor=
"#2DD29E"
/>
</shape>
\ No newline at end of file
app/src/main/res/layout/fragment_home.xml
View file @
b0d1f423
...
@@ -6,14 +6,38 @@
...
@@ -6,14 +6,38 @@
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/white"
>
android:background=
"@color/white"
>
<View
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp_450"
android:background=
"@drawable/bg_2dd29e_6ff2a2"
app:layout_constraintTop_toTopOf=
"parent"
/>
<FrameLayout
android:id=
"@+id/flTop"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:layout_constraintTop_toTopOf=
"parent"
>
<androidx.recyclerview.widget.RecyclerView
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginVertical=
"@dimen/dp_16"
android:layout_marginStart=
"@dimen/dp_16"
android:text=
"@string/app_name"
android:textColor=
"@color/white"
android:textSize=
"@dimen/sp_20"
/>
</FrameLayout>
<androidx.core.widget.NestedScrollView
android:id=
"@+id/rv"
android:id=
"@+id/rv"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_height=
"0dp"
android:overScrollMode=
"never"
android:overScrollMode=
"never"
android:paddingHorizontal=
"8dp"
android:paddingHorizontal=
"8dp"
app:layoutManager=
"androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
/>
app:layout_constraintTop_toBottomOf=
"@id/flTop"
>
</androidx.core.widget.NestedScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/values/dimens.xml
View file @
b0d1f423
...
@@ -47,4 +47,5 @@
...
@@ -47,4 +47,5 @@
<dimen
name=
"sp_13"
>
13sp
</dimen>
<dimen
name=
"sp_13"
>
13sp
</dimen>
<dimen
name=
"dp_260"
>
260dp
</dimen>
<dimen
name=
"dp_260"
>
260dp
</dimen>
<dimen
name=
"dp_26"
>
26dp
</dimen>
<dimen
name=
"dp_26"
>
26dp
</dimen>
<dimen
name=
"dp_450"
>
450dp
</dimen>
</resources>
</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