{"id":13645114,"url":"https://github.com/andjdk/HVScrollListView","last_synced_at":"2025-04-21T13:31:46.133Z","repository":{"id":12243140,"uuid":"70549525","full_name":"andjdk/HVScrollListView","owner":"andjdk","description":"HVScrollListView是一个可以实现横纵滑动的列表控件。如股票列表","archived":false,"fork":false,"pushed_at":"2017-07-17T06:14:29.000Z","size":2952,"stargazers_count":46,"open_issues_count":1,"forks_count":17,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-09T18:41:35.444Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andjdk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-11T02:50:01.000Z","updated_at":"2024-02-19T02:21:20.000Z","dependencies_parsed_at":"2022-08-07T06:16:50.286Z","dependency_job_id":null,"html_url":"https://github.com/andjdk/HVScrollListView","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andjdk%2FHVScrollListView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andjdk%2FHVScrollListView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andjdk%2FHVScrollListView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andjdk%2FHVScrollListView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andjdk","download_url":"https://codeload.github.com/andjdk/HVScrollListView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250064682,"owners_count":21368948,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T01:02:27.609Z","updated_at":"2025-04-21T13:31:45.804Z","avatar_url":"https://github.com/andjdk.png","language":"Java","readme":"# HVScrollListView\n---\nHVScrollListView是一个可以实现横纵滑动的列表控件。如股票列表。以下为使用此控件实现的效果图：\n![](https://github.com/andjdk/HVScrollListView/blob/master/index.gif)\n\n##版本升级\nhvscrollviewlibrary-1.0\n\nhvscrollviewlibrary-1.0.1 :增加了上拉加载更多\n\n##使用方式\n\n###step 1：\n a、把hvscrollviewlibrary-1.0.aar粘贴到lib目录下。b、在build.gradle中增加`repositories {\n    flatDir {\n        dirs 'libs'\n    }\n}` 和dependencies中增加`compile(name: 'hvscrollviewlibrary-1.0', ext: 'aar')`这句，然后sync。这样就可以在项目中使用了\n\n\n\n\n\n    \u003ccom.andjdk.hvscrollviewlibrary.HVScrollView\n        android:id=\"@+id/hv_scrollview\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\u003e\n    \u003c/com.andjdk.hvscrollviewlibrary.HVScrollView\u003e\n\n###step 2\n    HVScrollView hvScrollView= (HVScrollView) findViewById(R.id.hv_scrollview);\n        List\u003cStockDataInfo\u003e stockDataInfoList=new ArrayList\u003c\u003e();\n        for (int i = 0; i \u003c 30; i++) {\n            StockDataInfo stockDataInfo=new StockDataInfo();\n            stockDataInfo.setStockName(\"浦发银行\");\n            stockDataInfo.setStockCode(\"600000\");\n            stockDataInfo.setPriceLastest(\"13.08\");\n            stockDataInfo.setPriceOffsetRate(\"0.10\");\n            stockDataInfo.setPriceHigh(\"13.10\");\n            stockDataInfo.setPriceLow(\"12.80\");\n            stockDataInfo.setPriceOpen(\"12.90\");\n            stockDataInfo.setPricePreClose(\"12.90\");\n            stockDataInfo.setTradVulumes(\"12.90\");\n            stockDataInfo.setTotalMarketValue(\"12.90\");\n            stockDataInfoList.add(stockDataInfo);\n        }\n        //定义顶部栏\n        hvScrollView.setHeaderListData(new String[]{\"最新价\", \"涨跌幅\", \"最高价\", \"最低价\", \"开盘价\", \"收盘价\",\"成交量\",\"总市值\"});\n\t\t//初始化adapter\n        StockListAdapter mAdapter=new StockListAdapter(this,stockDataInfoList,R.layout.item_layout);\t\t\n        hvScrollView.setAdapter(mAdapter);\n\n        \n\n注意：\n\n- 1、StockListAdapter必须继承CommonAdapter\n- 2、R.layout.item_layout布局中实现滑动部分的layout必须是**LinearLayout**包裹且定义的id必须定义为 **android:id=\"@+id/move\\_layout\"**\n如下\n\n   \n        \u003cLinearLayout\n        \tandroid:id=\"@+id/move_layout\"\n        \tandroid:layout_width=\"wrap_content\"\n        \tandroid:layout_height=\"wrap_content\"\n        \tandroid:orientation=\"horizontal\"\u003e\n\t        \u003cTextView\n\t            android:id=\"@+id/text2\"\n\t            android:layout_width=\"70dp\"\n\t            android:layout_height=\"50dp\"\n\t            android:gravity=\"center\"\n\t            android:text=\"2\"/\u003e\n\t        \u003cTextView\n\t            android:id=\"@+id/text3\"\n\t            android:layout_width=\"70dp\"\n\t            android:gravity=\"center\"\n\t            android:layout_height=\"50dp\"\n\t            android:text=\"3\"/\u003e\n\t        \u003cTextView\n\t            android:id=\"@+id/text4\"\n\t            android:layout_width=\"70dp\"\n\t            android:gravity=\"center\"\n\t            android:layout_height=\"50dp\"\n\t            android:text=\"4\"/\u003e\n\t        \u003cTextView\n\t            android:id=\"@+id/text5\"\n\t            android:gravity=\"center\"\n\t            android:layout_width=\"70dp\"\n\t            android:layout_height=\"50dp\"\n\t            android:text=\"5\"/\u003e\n\t        \u003cTextView\n\t            android:id=\"@+id/text6\"\n\t            android:gravity=\"center\"\n\t            android:layout_width=\"70dp\"\n\t            android:layout_height=\"50dp\"\n\t            android:text=\"6\"/\u003e\n\t        \u003cTextView\n\t            android:id=\"@+id/text7\"\n\t            android:gravity=\"center\"\n\t            android:layout_width=\"70dp\"\n\t            android:layout_height=\"50dp\"\n\t            android:text=\"7\"/\u003e\n\t        \u003cTextView\n\t            android:id=\"@+id/text8\"\n\t            android:gravity=\"center\"\n\t            android:layout_width=\"70dp\"\n\t            android:layout_height=\"50dp\"\n\t            android:text=\"8\"/\u003e\n\t        \u003cTextView\n\t            android:id=\"@+id/text9\"\n\t            android:gravity=\"center\"\n\t            android:layout_width=\"70dp\"\n\t            android:layout_height=\"50dp\"\n\t            android:text=\"9\"/\u003e\n    \u003c/LinearLayout\u003e\n    \n\n\n###step 3：在adapter中初始化数据\n\n\t\n    public class StockListAdapter extends CommonAdapter\u003cStockDataInfo\u003e {\n\n\n    public StockListAdapter(Context mContext, List\u003cStockDataInfo\u003e mDatas, int layoutId) {\n        super(mContext, mDatas, layoutId);\n    }\n\n    @Override\n    public void convert(ViewHolder holder, StockDataInfo stockDataInfo, int position, ArrayList\u003cView\u003e movableViewList) {\n        holder.setText(R.id.text1,stockDataInfo.getStockName());\n        holder.setText(R.id.text2,stockDataInfo.getPriceLastest());\n        holder.setText(R.id.text3,stockDataInfo.getPriceOffsetRate());\n        holder.setText(R.id.text4,stockDataInfo.getPriceHigh());\n        holder.setText(R.id.text5,stockDataInfo.getPriceLow());\n        holder.setText(R.id.text6,stockDataInfo.getPriceOpen());\n        holder.setText(R.id.text7,stockDataInfo.getPricePreClose());\n        holder.setText(R.id.text8,stockDataInfo.getTradVulumes());\n        holder.setText(R.id.text9,stockDataInfo.getTotalMarketValue());\n    }}\n\n\n###实现点击列表\n\n    \t//点击列表item\n        hvScrollView.setOnItemClick(new HVScrollView.OnItemClickedListener() {\n            @Override\n            public void onItemClick(AdapterView\u003c?\u003e parent, View view, int position, long id) {\n                Toast.makeText(MainActivity.this,position+\"\",Toast.LENGTH_SHORT).show();\n            }\n        });\n        //点击头部按钮\n        hvScrollView.setOnHeaderClickedListener(new HVScrollView.OnHeaderClickedListener() {\n            @Override\n            public void onHeadViewClick(String string) {\n                Toast.makeText(MainActivity.this,string,Toast.LENGTH_SHORT).show();\n            }\n        });\n\n###1.0.1上拉加载更多\n\n    hvScrollView.setOnLoadMoreListener(new HVScrollView.OnLoadMoreListener() {\n            @Override\n            public void onLoadingMore() {\n                //TODO \n\n            }\n        });\n\t//加载成功之后调用此方法\n    hvScrollView.onLoadingComplete();\n\n\n\n到这里就可以是实现想要的功能了，是不是很简单。当然目前还没有增加上拉刷新向下加载更多的功能，这功能还在完善中，敬请期待。如在使用中遇到有什么问题也可以直接联系我。加群：462723796 欢迎大家star或者fork","funding_links":[],"categories":["表格(Table)"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandjdk%2FHVScrollListView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandjdk%2FHVScrollListView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandjdk%2FHVScrollListView/lists"}