日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

java公告栏源码_公告栏view

發布時間:2023/12/16 编程问答 45 豆豆
生活随笔 收集整理的這篇文章主要介紹了 java公告栏源码_公告栏view 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

INoticeBoardView

INoticeBoardView 公告信息自定義,最多僅切兩個view來回切換,不復用view!!! 動畫方式(水平|豎直)兩種

效果預覽

INoticeBoardView.gif

特性

直播界面或者懸浮窗中使用

使用適配器模式,繼承 INoticeAdapt 來自定義業務邏輯

不復用 View ,只操作2個view,最多2個view

無限輪詢

使用

在XML或者代碼中添加INoticeBoardView

app:INoticeBoardView_AnimTime="6000"

app:INoticeBoardView_Direction="vertical"

app:INoticeBoardView_Vertical_Duration_Step="10"

app:INoticeBoardView_Vertical_OffsetX="100"

android:layout_width="match_parent"

android:layout_height="match_parent"/>

使用方式

java

List list1 = new ArrayList<>();

list1.add("吃飯時,和朋友提到高血壓,我就順勢科普起來: 高血壓的預防很重要11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111");

list1.add("左宗棠很喜歡下圍棋,而且,還是個高手,其屬僚皆非其對手。");

list1.add("往日的歡樂已是往日的快樂,再怎么留戀也無法放在今天;過去的痛苦再一次回顧");

list1.add("別人家孩子不好嗎");

list1.add("就知道玩");

list1.add("別人家孩子周末都在家學習");

mINoticeView22.setAdapter(new INoticeBoardView.INoticeAdapt(list1) {

@Override

public void onBindViewHolder(View itemView, String itemData) {

TextView tvs = itemView.findViewById(R.id.tv_line);

tvs.setText(mCurrentIndex + "|" + itemData);

tvs.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

Log.e("INoticeView2", ":------------點擊事件---------------------------------");

}

});

}

@Override

protected View onCreateViewHolder(LayoutInflater inflater, ViewGroup parent, int viewType) {

// return inflater.inflate(R.layout.lines, parent,false);

return inflater.inflate(R.layout.lines, null);

}

});

建議直接復制源碼吧

attrs.xml

如有需要

許可證

Copyright 2019 majunm

Licensed under the Apache License, Version 2.0 (the "License");

you may not use this file except in compliance with the License.

You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software

distributed under the License is distributed on an "AS IS" BASIS,

WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and

limitations under the License.

總結

以上是生活随笔為你收集整理的java公告栏源码_公告栏view的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。