Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
Hello UTS
提交
dc477afe
H
Hello UTS
项目概览
DCloud
/
Hello UTS
通知
1598
Star
27
Fork
9
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
2
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
Hello UTS
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
2
Issue
2
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
dc477afe
编写于
1月 05, 2023
作者:
DCloud-yyl
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "native page 增加了 recycleview 示例"
This reverts commit
dc15293a
.
上级
4a17faeb
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
0 addition
and
76 deletion
+0
-76
uni_modules/uts-nativepage/utssdk/app-android/config.json
uni_modules/uts-nativepage/utssdk/app-android/config.json
+0
-6
uni_modules/uts-nativepage/utssdk/app-android/index.uts
uni_modules/uts-nativepage/utssdk/app-android/index.uts
+0
-51
uni_modules/uts-nativepage/utssdk/app-android/res/layout/demo_activity.xml
...ativepage/utssdk/app-android/res/layout/demo_activity.xml
+0
-8
uni_modules/uts-nativepage/utssdk/app-android/res/layout/fruit_item.xml
...s-nativepage/utssdk/app-android/res/layout/fruit_item.xml
+0
-11
未找到文件。
uni_modules/uts-nativepage/utssdk/app-android/config.json
已删除
100644 → 0
浏览文件 @
4a17faeb
{
"dependencies"
:
[
"androidx.recyclerview:recyclerview:1.0.0"
]
}
uni_modules/uts-nativepage/utssdk/app-android/index.uts
浏览文件 @
dc477afe
...
...
@@ -28,11 +28,6 @@ import Class from 'java.lang.Class';
import Exception from 'java.lang.Exception';
import PackageManager from 'android.content.pm.PackageManager';
import ResolveInfo from 'android.content.pm.ResolveInfo';
import RecyclerView from 'androidx.recyclerview.widget.RecyclerView';
import TextView from 'android.widget.TextView';
import ViewGroup from 'android.view.ViewGroup';
import LayoutInflater from 'android.view.LayoutInflater';
import LinearLayoutManager from 'androidx.recyclerview.widget.LinearLayoutManager';
...
...
@@ -176,46 +171,6 @@ class CustomThread extends Thread{
}
}
class FruitAdapter extends RecyclerView.Adapter<FruitAdapter.ViewHolder>{
mFruitList: Array<String>
constructor(param:Array<String>){
mFruitList = param
}
ViewHolder = class extends RecyclerView.ViewHolder {
fruitName:TextView;
constructor(view:View) {
super(view);
fruitName = view.findViewById(R.id.fruit_name) as TextView;
}
}
override onCreateViewHolder(
parent: ViewGroup,
viewType: Int
): ViewHolder {
let view: View =
LayoutInflater.from(parent.context).inflate(R.layout.fruit_item, parent, false)
return ViewHolder(view)
}
override onBindViewHolder(holder: ViewHolder, position: Int) {
let fruit: String = mFruitList[position]
holder.fruitName.setText(fruit)
}
override getItemCount(): Int {
return mFruitList.size
}
}
class DemoActivity extends Activity{
constructor (){
...
...
@@ -235,12 +190,6 @@ class DemoActivity extends Activity{
let btn_start_thread = findViewById<Button>(R.id.btn_start_thread);
btn_start_thread.setOnClickListener(new StartThreadListener());
let recyclerView = findViewById<RecyclerView>(R.id.recycler_view)
let layoutManager = LinearLayoutManager(this);
recyclerView.setLayoutManager(layoutManager);
let fruitAdapter = FruitAdapter(arrayListOf("香蕉","苹果","大鸭梨"));
recyclerView.setAdapter(fruitAdapter);
}
}
...
...
uni_modules/uts-nativepage/utssdk/app-android/res/layout/demo_activity.xml
浏览文件 @
dc477afe
...
...
@@ -8,12 +8,4 @@
<Button
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"开启前台服务(应用包活)"
android:id=
"@+id/btn_start_service_front"
/>
<Button
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"注册屏幕状态广播监听"
android:id=
"@+id/btn_start_screen_listen"
/>
<Button
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"开启异步任务"
android:id=
"@+id/btn_start_thread"
/>
<androidx.recyclerview.widget.RecyclerView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:id=
"@+id/recycler_view"
>
</androidx.recyclerview.widget.RecyclerView>
</LinearLayout>
\ No newline at end of file
uni_modules/uts-nativepage/utssdk/app-android/res/layout/fruit_item.xml
已删除
100644 → 0
浏览文件 @
4a17faeb
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:orientation=
"horizontal"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:id=
"@+id/fruit_name"
/>
</LinearLayout>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录