Back to project page caddisfly-app-camera.
The source code is released under:
GNU General Public License
If you think the Android project caddisfly-app-camera listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/* * Copyright (C) TernUp Research Labs/* w ww . j av a 2s. c o m*/ * * This file is part of Caddisfly * * Caddisfly is free software: you can redistribute it and modify it under the terms of * the GNU Affero General Public License (AGPL) as published by the Free Software Foundation, * either version 3 of the License or any later version. * * Caddisfly is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License included below for more details. * * The full license text can also be seen at <http://www.gnu.org/licenses/agpl.html>. */ package org.akvo.mobile.caddisfly.fragment; import android.app.ListFragment; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.view.View; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.TextView; import com.ternup.caddisfly.R; import org.akvo.mobile.caddisfly.fragment.dummy.DummyContent; public class ItemFragment extends ListFragment { /** * Mandatory empty constructor for the fragment manager to instantiate the * fragment (e.g. upon screen orientation changes). */ public ItemFragment() { } public static ItemFragment newInstance() { ItemFragment fragment = new ItemFragment(); return fragment; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Override public void onViewCreated(View view, Bundle savedInstanceState) { TextView padding = new TextView(getActivity()); padding.setHeight(20); // Can only specify in pixels unfortunately. No DIP :-( ListView myListView = getListView(); myListView.addHeaderView(padding); myListView.addFooterView(padding); myListView.setSelector(new ColorDrawable(Color.TRANSPARENT)); setListAdapter(new ArrayAdapter<DummyContent.DummyItem>(getActivity(), R.layout.row_item, R.id.resultText, DummyContent.ITEMS)); super.onViewCreated(view, savedInstanceState); } @Override public void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); } }