/**
 * Provides the view for the More section
 */
package com.sharefaith.churchapp.views;

import java.util.HashMap;

import com.codename1.ui.Container;
import com.codename1.ui.TextArea;
import com.codename1.ui.layouts.BoxLayout;
import com.sharefaith.churchapp.model.*;

public class MoreView extends TabViews
{
	/**
	 * A tag to identify this section in the UI
	 */
	public static final String TAG = new String( "more" );
	
	/**
	 * An instance of the data getter
	 */
	public ChurchAppData cad;
	
	/**
	 * Configuration options
	 */
	public HashMap<String,String> config;
	
	/**
	 * Class constructor.
	 * 
	 * @since 20140312
	 * @author costmo
	 */
	public MoreView()
	{
		this.cad = new ChurchAppData( false );
	}
	
	/**
	 * Provides content for the view.
	 * 
	 * This should be the only thing that is called to get the overall view and may enveloper other components
	 * 
	 * @since 20140312
	 * @author costmo
	 */
	public Container contentComponent()
	{
		Container returnContainer = new Container( new BoxLayout( BoxLayout.Y_AXIS ) );

		TextArea ta = new TextArea( "Some " + this.configValues().get( "display_label" ) + " text" );
		returnContainer.addComponent( ta );
		
		return returnContainer;
	}
	
	/**
	 * Provides icon file locations for this tab item
	 * 
	 * @since 20140312
	 * @author costmo
	 */
	public HashMap<String,String> tabIconFiles()
	{
		return this.tabIconFilesByTag( MoreView.TAG );
	}
	
	/**
	 * Refresh this item's config options
	 * 
	 * @since 20140312
	 * @author costmo
	 */
	public HashMap<String,String> configValues()
	{
		if( this.config == null )
		{
			this.config = this.configValuesByTag( MoreView.TAG );
		}
		return this.config;
	}
	
	/**
	 * Handle device rotation
	 * 
	 * @since 20140312
	 * @author costmo
	 */
	public void rotate()
	{
		
	}
}
