Skip to content

orhanobut/simplelistview

Repository files navigation

Android Arsenal API

simplelistview

Android simple listview by using linearlayout.

The problem

  • You need to add a few items and you don't want the scroll feature
  • You have a scrollview and you want to show a few items in the list as fully expanded

###Gradle

compile 'com.orhanobut:simplelistview:1.3@aar'

###Usage Either define in xml or dynamically. xml sample

<com.orhanobut.simplelistview.SimpleListView
    android:id="@+id/list"                     
    android:layout_width="match_parent"        
    android:layout_height="wrap_content"/>
Set header
listView.setHeaderView(R.layout.header);

or

listView.setHeaderView(view);
Set footer
listView.setFooterView(R.layout.footer);

or

listView.setFooterView(view);
Set divider
listView.setDividerView(R.layout.divider);
Set item click Listener
listView.setOnItemClickListener(new SimpleListView.OnItemClickListener() { 
    @Override                                                              
    public void onItemClick(Object item, View view, int position) {        
        //This special listener will return object for you                                                            
    }                                                                      
});
Set adapter
listView.setAdapter(adapter);
Refresh the listview
adapter.notifyDataSetChanged();

You might also like

  • Logger Simple,pretty and advanced logger
  • Hawk Secure simple key-value storage
  • Wasp All-in-one network solution
  • Bee QA/Debug tool
  • DialogPlus Easy,simple dialog solution

###License

Copyright 2014 Orhan Obut

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.

About

Android simple listview by using linearlayout

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages