SwitchViewGroup - Android中一個垂直運動的廣告條
SwitchViewGroup
Android中一個垂直運動的廣告條,運用動畫層來達到不會卡頓的效果,僅供參考原理,實際運用還請使用Android原生控件ViewAnimator
Usage
<!--在這里加上廣告小喇叭--> <com.github.switchviewgroup.views.SwitchViewGroup android:id="@+id/switchViewGroup" android:layout_width="@dimen/vertical_view_group_width" android:layout_height="@dimen/vertical_view_group_height" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:paddingLeft="10dp" android:visibility="visible" />
for (int i = 0; i < 3; i++) { datas.add("trumpet____" + i); } mSwitchViewGroup.addData(datas); mSwitchViewGroup.startScroll(); mSwitchViewGroup.setOnClickTabListener(new SwitchViewGroup.OnClickTabListener() { @Override public void onClickTab(int index) { Snackbar.make(mSwitchViewGroup, datas.get(index), Snackbar.LENGTH_SHORT).show(); } });
效果圖
License
Copyright xuyunqiang 1539140295@qq.com 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.
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!