/*
 * =================================================================================================
 *                             Copyright (C) 2014 Martin Albedinsky
 * =================================================================================================
 *         Licensed under the Apache License, Version 2.0 or later (further "License" only).
 * -------------------------------------------------------------------------------------------------
 * You may use this file only in compliance with the License. More details and copy of this License 
 * you may obtain at
 * 
 * 		http://www.apache.org/licenses/LICENSE-2.0
 * 
 * You can redistribute, modify or publish any part of the code written within this file but as it 
 * is described in the License, the software distributed under the License is distributed on an 
 * "AS IS" BASIS, WITHOUT WARRANTIES or CONDITIONS OF ANY KIND.
 * 
 * See the License for the specific language governing permissions and limitations under the License.
 * =================================================================================================
 */
package com.albedinsky.android.ui.examples.fragment.components.collection;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.albedinsky.android.support.fragment.annotation.ActionBarOptions;
import com.albedinsky.android.ui.examples.R;
import com.albedinsky.android.ui.examples.fragment.CapitalsListFragment;

/**
 * @author Martin Albedinsky
 */
@ActionBarOptions(title = R.string.components_navigation_lists_pullable)
public final class PullableListFragment extends CapitalsListFragment {

	@SuppressWarnings("unused")
	private static final String TAG = "PullableListFragment";

	@Override
	@SuppressWarnings("ConstantConditions")
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		final ViewGroup view = (ViewGroup) super.onCreateView(inflater, container, savedInstanceState);
		view.removeView(view.findViewById(android.R.id.list));
		view.addView(inflater.inflate(R.layout.list_view_pullable, container, false));
		return view;
	}
}
