首页 星云 工具 资源 星选 资讯 热门工具
:

PDF转图片 完全免费 小红书视频下载 无水印 抖音视频下载 无水印 数字星空

优化后的ListView(自定义Adapter).zip

行业研究 381.37KB 3 需要积分: 1
立即下载

资源介绍:

优化后的ListView(自定义Adapter).zip
package com.example.myapplication; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.ListView; import android.widget.Toast; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class MainActivity extends AppCompatActivity implements AdapterView.OnItemClickListener, AdapterView.OnItemLongClickListener { List> data = new ArrayList>(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ListView listView = this.findViewById(R.id.listview); initData(); MyAdapter adapter = new MyAdapter(this,data);//创建自定义适配器 listView.setAdapter(adapter); listView.setOnItemClickListener(this); listView.setOnItemLongClickListener(this); } private void initData() { Map map = new HashMap(); map.put("icon",R.drawable.cat); map.put("title","小猫"); map.put("content","这是一只可爱的小猫。这是一只可爱的小猫。这是一只可爱的小猫。这是一只可爱的小猫。这是一只可爱的小猫。"); data.add(map); map = new HashMap(); map.put("icon",R.drawable.fawn); map.put("title","小鹿"); map.put("content","这是一只可爱的小鹿。这是一只可爱的小鹿。这是一只可爱的小鹿。这是一只可爱的小鹿。这是一只可爱的小鹿。"); data.add(map); map = new HashMap(); map.put("icon",R.drawable.tiger); map.put("title","老虎"); map.put("content","这是一只威猛的老虎。这是一只威猛的老虎。这是一只威猛的老虎。这是一只威猛的老虎。这是一只威猛的老虎。这是一只威猛的老虎。"); data.add(map); map = new HashMap(); map.put("icon",R.drawable.siberiankusky); map.put("title","哈士奇"); map.put("content","这是一只呆萌的哈士奇。这是一只呆萌的哈士奇。这是一只呆萌的哈士奇。这是一只呆萌的哈士奇。这是一只呆萌的哈士奇。这是一只呆萌的哈士奇。这是一只呆萌的哈士奇。"); data.add(map); map = new HashMap(); map.put("icon",R.drawable.fawn); map.put("title","小鹿"); map.put("content","这是一只可爱的小鹿。这是一只可爱的小鹿。这是一只可爱的小鹿。这是一只可爱的小鹿。这是一只可爱的小鹿。"); data.add(map); map = new HashMap(); map.put("icon",R.drawable.tiger); map.put("title","老虎"); map.put("content","这是一只威猛的老虎。这是一只威猛的老虎。这是一只威猛的老虎。这是一只威猛的老虎。这是一只威猛的老虎。这是一只威猛的老虎。"); data.add(map); map = new HashMap(); map.put("icon",R.drawable.siberiankusky); map.put("title","哈士奇"); map.put("content","这是一只呆萌的哈士奇。这是一只呆萌的哈士奇。这是一只呆萌的哈士奇。这是一只呆萌的哈士奇。这是一只呆萌的哈士奇。这是一只呆萌的哈士奇。这是一只呆萌的哈士奇。"); data.add(map); } @Override public void onItemClick(AdapterView adapterView, View view, int i, long l) { Toast.makeText(this,"短按+i:"+i+"l:"+l,Toast.LENGTH_SHORT).show(); } @Override public boolean onItemLongClick(AdapterView adapterView, View view, int i, long l) { Toast.makeText(this,"长按+i:"+i+"l:"+l,Toast.LENGTH_SHORT).show(); return false; } }

资源文件列表:

优化后的ListView(自定义Adapter).zip 大约有75个文件
  1. MyApplication2/.gitignore 225B
  2. MyApplication2/app/
  3. MyApplication2/app/.gitignore 6B
  4. MyApplication2/app/build.gradle 1.04KB
  5. MyApplication2/app/libs/
  6. MyApplication2/app/proguard-rules.pro 750B
  7. MyApplication2/app/src/
  8. MyApplication2/app/src/androidTest/
  9. MyApplication2/app/src/androidTest/java/
  10. MyApplication2/app/src/androidTest/java/com/
  11. MyApplication2/app/src/androidTest/java/com/example/
  12. MyApplication2/app/src/androidTest/java/com/example/myapplication/
  13. MyApplication2/app/src/androidTest/java/com/example/myapplication/ExampleInstrumentedTest.java 764B
  14. MyApplication2/app/src/main/
  15. MyApplication2/app/src/main/AndroidManifest.xml 962B
  16. MyApplication2/app/src/main/java/
  17. MyApplication2/app/src/main/java/com/
  18. MyApplication2/app/src/main/java/com/example/
  19. MyApplication2/app/src/main/java/com/example/myapplication/
  20. MyApplication2/app/src/main/java/com/example/myapplication/MainActivity.java 3.9KB
  21. MyApplication2/app/src/main/java/com/example/myapplication/MyAdapter.java 2.42KB
  22. MyApplication2/app/src/main/res/
  23. MyApplication2/app/src/main/res/drawable/
  24. MyApplication2/app/src/main/res/drawable/cat.png 50.07KB
  25. MyApplication2/app/src/main/res/drawable/fawn.png 45.53KB
  26. MyApplication2/app/src/main/res/drawable/ic_launcher_background.xml 5.47KB
  27. MyApplication2/app/src/main/res/drawable/ic_launcher_foreground.xml 1.66KB
  28. MyApplication2/app/src/main/res/drawable/siberiankusky.png 64.46KB
  29. MyApplication2/app/src/main/res/drawable/tiger.png 56.56KB
  30. MyApplication2/app/src/main/res/drawable/yellowduck.png 55.61KB
  31. MyApplication2/app/src/main/res/layout/
  32. MyApplication2/app/src/main/res/layout/activity_main.xml 1.33KB
  33. MyApplication2/app/src/main/res/layout/layout_item.xml 1.87KB
  34. MyApplication2/app/src/main/res/mipmap-anydpi-v26/
  35. MyApplication2/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml 343B
  36. MyApplication2/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml 343B
  37. MyApplication2/app/src/main/res/mipmap-hdpi/
  38. MyApplication2/app/src/main/res/mipmap-hdpi/ic_launcher.webp 1.37KB
  39. MyApplication2/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp 2.83KB
  40. MyApplication2/app/src/main/res/mipmap-mdpi/
  41. MyApplication2/app/src/main/res/mipmap-mdpi/ic_launcher.webp 982B
  42. MyApplication2/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp 1.73KB
  43. MyApplication2/app/src/main/res/mipmap-xhdpi/
  44. MyApplication2/app/src/main/res/mipmap-xhdpi/ic_launcher.webp 1.86KB
  45. MyApplication2/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp 3.83KB
  46. MyApplication2/app/src/main/res/mipmap-xxhdpi/
  47. MyApplication2/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp 2.82KB
  48. MyApplication2/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp 5.78KB
  49. MyApplication2/app/src/main/res/mipmap-xxxhdpi/
  50. MyApplication2/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp 3.75KB
  51. MyApplication2/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp 7.6KB
  52. MyApplication2/app/src/main/res/values/
  53. MyApplication2/app/src/main/res/values/colors.xml 147B
  54. MyApplication2/app/src/main/res/values/strings.xml 76B
  55. MyApplication2/app/src/main/res/values/themes.xml 411B
  56. MyApplication2/app/src/main/res/values-night/
  57. MyApplication2/app/src/main/res/values-night/themes.xml 333B
  58. MyApplication2/app/src/main/res/xml/
  59. MyApplication2/app/src/main/res/xml/backup_rules.xml 478B
  60. MyApplication2/app/src/main/res/xml/data_extraction_rules.xml 551B
  61. MyApplication2/app/src/test/
  62. MyApplication2/app/src/test/java/
  63. MyApplication2/app/src/test/java/com/
  64. MyApplication2/app/src/test/java/com/example/
  65. MyApplication2/app/src/test/java/com/example/myapplication/
  66. MyApplication2/app/src/test/java/com/example/myapplication/ExampleUnitTest.java 386B
  67. MyApplication2/build.gradle 168B
  68. MyApplication2/gradle/
  69. MyApplication2/gradle/wrapper/
  70. MyApplication2/gradle/wrapper/gradle-wrapper.jar 57.82KB
  71. MyApplication2/gradle/wrapper/gradle-wrapper.properties 236B
  72. MyApplication2/gradle.properties 1.24KB
  73. MyApplication2/gradlew 5.63KB
  74. MyApplication2/gradlew.bat 2.7KB
  75. MyApplication2/settings.gradle 332B
0评论
提交 加载更多评论
其他资源 Python校园学生一卡通管理
Python校园学生一卡通管理
vs2017+cmake 编译完成的libtiff+proj+sqlite3+libgeotiff 库文件和头文件
vs2017+cmake 编译完成的libtiff+proj+sqlite3+libgeotiff 库文件和头文件
masm5.0-dosbox0.74-MasmForWindows.zip
masm5.0 dosbox0.74 masm for windows.rar
masm5.0-dosbox0.74-MasmForWindows.zip masm5.0-dosbox0.74-MasmForWindows.zip
EXE一机一码打包加密大师1.5.0 (解压密码1234)
EXE一机一码打包加密大师最新版1.5.0, 支持网络验证, 给EXE添加卡密. EXE一机一码打包加密大师是一款功能强大的工具,用于保护和加密EXE文件。支持一机一码离线加密, 一机一码网络验证加密, 支持给EXE添加卡密, 添加授权信息等, 方便制作加密EXE文件. 1.5.0最新版本新增了网络验证功能, 并修复了一些问题, 使得加密EXE更加稳定, 保护效果更佳.
研旭DSP28335代码
研旭DSP28335代码
木头UI纹理按钮边框 背景图标 带PNG素材:Wooden UI 1.0
资源包包含以下元素:按钮、图标、框架、复选框等,提供分层的 PSD 文件。
attendanceManagement.zip
attendanceManagement.zip
125274266A455CC5F5FED1C2F6F25EDD.zip
125274266A455CC5F5FED1C2F6F25EDD.zip
125274266A455CC5F5FED1C2F6F25EDD.zip 125274266A455CC5F5FED1C2F6F25EDD.zip 125274266A455CC5F5FED1C2F6F25EDD.zip