zoukankan      html  css  js  c++  java
  • 实现IOS圆角风格的列表ListView

    适用于android1.6以上,不依赖其他jar包 


    使用时不需要继承这里的RoundListAdapter。只需要在你实现了ListAdapter的类中,传入一个RoundParams的对象,并在getView方法返回前调用这里RoundListAdapter类提供的静态方法。 
    RoundListAdapter.setItemBackground(position, switcherView, mParams, 
    getCount());  
    代码:
     * @(#)LocalAdapter.java Project:RTKSETTINGS




    *
    * Copyright (c) 2013 Geek_Soledad.
    * All rights reserved.
    *
    * 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.http://www.huiyi8.com/jiaoben/
    */
    package com.realtek.msdx.rtksettings.view;


    import java.util.ArrayList;
    import java.util.List;


    import android.app.TvManager;
    import android.content.Context;
    import android.view.View;
    import android.view.ViewGroup;
    import android.widget.BaseAdapter;


    import com.lurencun.cfuture09.androidkit.widget.roundlist.RoundListAdapter;
    import com.lurencun.cfuture09.androidkit.widget.roundlist.RoundListAdapter.RoundParams;
    import com.realtek.msdx.rtksettings.activity.MainActivity;
    import com.realtek.msdx.rtksettings.bean.LocalSettingsBean;


    /**
    * @author Geek_Soledad (msdx.android@tom.com)
    */
    public class LocalAdapter extends BaseAdapter {


    private RoundParams mParams;
    private Context mContext;


    public LocalAdapter(Context context, RoundParams params) {
    super();
    mContext = context;
    mParams = params;
    }


    @Override
    public int getCount() {
    return 5;
    }


    @Override
    public Object getItem(int position) {
    return position;
    }


    @Override
    public long getItemId(int position) {
    return position;
    }


    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
    // 在这里创建view,jQuery特效
    //SwitcherTextView view = new SwitcherTextView(mContext);
    // 然后在返回view前进行调用
    RoundListAdapter.setItemBackground(position, view, mParams,
    getCount());
    return view;
    }
    }

  • 相关阅读:
    yii2.0缓存的使用
    yii2.0框架where条件的使用
    yii2.0自带验证码使用
    spring中MessageSource的配置使用方法1[转]
    DOM、JDOM、DOM4J的区别
    探秘Java虚拟机——内存管理与垃圾回收
    MySQL开发规范和原则大全
    Java Classloader机制解析
    Junit之测试顺序---FixMethodOrder
    MySQL的btree索引和hash索引的区别
  • 原文地址:https://www.cnblogs.com/xkzy/p/3801155.html
Copyright © 2011-2022 走看看