package com.joshclemm.android.tabs;

import android.view.View;
import android.widget.TabHost;
import android.widget.TextView;

public class CustomTabActivity extends android.app.Activity
  {

    private TabHost mTabHost;

    @Override
    public void onCreate
      (
        android.os.Bundle savedInstanceState
      )
      {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        mTabHost = (TabHost)findViewById(R.id.mytabhost);
        mTabHost.setup();
        mTabHost.getTabWidget().setDividerDrawable(R.drawable.tab_divider);

        for (String TabName : new String[]{"Tab 1", "Tab 2", "Tab 3"})
          {
            final View contentview = new TextView(this); /* should really put something into this for show */
            View indicatorview =
                android.view.LayoutInflater.from(this).inflate(R.layout.tabs_bg, null);
            ((TextView)indicatorview.findViewById(R.id.tabsText)).setText(TabName);
            mTabHost.addTab
              (
                mTabHost.newTabSpec(TabName)
                    .setIndicator(indicatorview)
                    .setContent
                      (
                        new android.widget.TabHost.TabContentFactory()
                          {
                            public View createTabContent(String tag)
                              {
                                return contentview;
                              } /*createTabContent*/
                          } /*TabContentFactory*/
                      )
              );
          } /*for*/
      } /*onCreate*/
  } /*CustomTabActivity*/

@@ -28,16 +28,678 @@
 id.tabs;
+%0A/*%0A    Copyright (c) 2010 Josh Clemm%0A    Copyright 2012 Lawrence D'Oliveiro %3Cldo@geek-central.gen.nz%3E%0A%0A    Licensed under the Apache License, Version 2.0 (the %22License%22); you may not%0A    use this file except in compliance with the License. You may obtain a copy of%0A    the License at%0A%0A    http://www.apache.org/licenses/LICENSE-2.0%0A%0A    Unless required by applicable law or agreed to in writing, software%0A    distributed under the License is distributed on an %22AS IS%22 BASIS, WITHOUT%0A    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the%0A    License for the specific language governing permissions and limitations under%0A    the License.%0A*/
 %0A%0Aimport

add copyright notice