src/acr/browser/barebones/activities/BrowserActivity.java
public static int createTab(String theUrl, boolean display) {
		int id = -1;
		for (int n = 0; n < MAX_TABS; n++) {
			if (main[n] == null) {
				id = n;
				break;
			}
		}
		if (id != -1) {
			if (tabList.size() > 0) {
				if (display) {
					if (API < 16) {
						currentTabTitle.setBackgroundDrawable(inactive);
					} else {
						currentTabTitle.setBackground(inactive);
					}
					currentTabTitle.setPadding(leftPad, 0, rightPad, 0);
				}
			}
			final TextView title = new TextView(CONTEXT);
			title.setText("New Tab");
			if (display) {
				if (API < 16) {
					title.setBackgroundDrawable(active);
				} else {
					title.setBackground(active);
				}
			} else {
				if (API < 16) {
					title.setBackgroundDrawable(inactive);
				} else {
					title.setBackground(inactive);
				}
			}
			title.setSingleLine(true);
			title.setGravity(Gravity.CENTER_VERTICAL);
			title.setHeight(height32);
			title.setWidth(pixels);
			title.setPadding(leftPad, 0, rightPad, 0);
			title.setId(id);
			title.setGravity(Gravity.CENTER_VERTICAL);

			title.setCompoundDrawables(webpageOther, null, exitTab, null);

			Drawable[] drawables = title.getCompoundDrawables();
			bounds = drawables[2].getBounds();
			title.setOnTouchListener(ACTIVITY);
			Animation holo = AnimationUtils.loadAnimation(CONTEXT, R.anim.up);
			tabLayout.addView(title);
			title.setVisibility(View.INVISIBLE);
			holo.setAnimationListener(new AnimationListener() {

				@Override
				public void onAnimationEnd(Animation animation) {
				}

				@Override
				public void onAnimationRepeat(Animation animation) {
				}

				@Override
				public void onAnimationStart(Animation animation) {
					title.setVisibility(View.VISIBLE);
				}

			});
			title.startAnimation(holo);
			urlTitle[id] = title;

			urlTitle[id].setText("New Tab");

			if (theUrl != null) {
				main[id] = generateTab(id, theUrl, display);
			} else {
				main[id] = generateTab(id, homepage, display);
			}

		} else {
			Utils.showToast(CONTEXT, "Max number of tabs reached");
		}
		return id;
	}
// creates the tab and returns the ID of the view
creates the tab and returns the ID of the view
creates the tab and returns the ID of the view
public static int createTab(String theUrl, boolean display) {
		int id = -1;
		for (int n = 0; n < MAX_TABS; n++) {
			if (main[n] == null) {
				id = n;
				break;
			}
		}
		if (id != -1) {
			if (tabList.size() > 0) {
				if (display) {
					if (API < 16) {
						currentTabTitle.setBackgroundDrawable(inactive);
					} else {
						currentTabTitle.setBackground(inactive);
					}
					currentTabTitle.setPadding(leftPad, 0, rightPad, 0);
				}
			}
			final TextView title = new TextView(CONTEXT);
			title.setText("New Tab");
			if (display) {
				if (API < 16) {
					title.setBackgroundDrawable(active);
				} else {
					title.setBackground(active);
				}
			} else {
				if (API < 16) {
					title.setBackgroundDrawable(inactive);
				} else {
					title.setBackground(inactive);
				}
			}
			title.setSingleLine(true);
			title.setGravity(Gravity.CENTER_VERTICAL);
			title.setHeight(height32);
			title.setWidth(pixels);
			title.setPadding(leftPad, 0, rightPad, 0);
			title.setId(id);
			title.setGravity(Gravity.CENTER_VERTICAL);
			title.setCompoundDrawables(webpageOther, null, exitTab, null);
			Drawable[] drawables = title.getCompoundDrawables();
			bounds = drawables[2].getBounds();
			title.setOnTouchListener(ACTIVITY);
			Animation holo = AnimationUtils.loadAnimation(CONTEXT, R.anim.up);
			tabLayout.addView(title);
			title.setVisibility(View.INVISIBLE);
			holo.setAnimationListener(new AnimationListener() {
				@Override
				public void onAnimationEnd(Animation animation) {
				}
				@Override
				public void onAnimationRepeat(Animation animation) {
				}
				@Override
				public void onAnimationStart(Animation animation) {
					title.setVisibility(View.VISIBLE);
				}
			});
			title.startAnimation(holo);
			urlTitle[id] = title;
			urlTitle[id].setText("New Tab");
			if (theUrl != null) {
				main[id] = generateTab(id, theUrl, display);
			} else {
				main[id] = generateTab(id, homepage, display);
			}
		} else {
			Utils.showToast(CONTEXT, "Max number of tabs reached");
		}
		return id;
	}
public static int createTab ( String theUrl , boolean display ) { int id = - 1 ; for ( int n = 0 ; n < MAX_TABS ; n ++ ) { if ( main [ n ] == null ) { id = n ; break ; } } if ( id != - 1 ) { if ( tabList . size ( ) > 0 ) { if ( display ) { if ( API < 16 ) { currentTabTitle . setBackgroundDrawable ( inactive ) ; } else { currentTabTitle . setBackground ( inactive ) ; } currentTabTitle . setPadding ( leftPad , 0 , rightPad , 0 ) ; } } final TextView title = new TextView ( CONTEXT ) ; title . setText ( "New Tab" ) ; if ( display ) { if ( API < 16 ) { title . setBackgroundDrawable ( active ) ; } else { title . setBackground ( active ) ; } } else { if ( API < 16 ) { title . setBackgroundDrawable ( inactive ) ; } else { title . setBackground ( inactive ) ; } } title . setSingleLine ( true ) ; title . setGravity ( Gravity . CENTER_VERTICAL ) ; title . setHeight ( height32 ) ; title . setWidth ( pixels ) ; title . setPadding ( leftPad , 0 , rightPad , 0 ) ; title . setId ( id ) ; title . setGravity ( Gravity . CENTER_VERTICAL ) ; title . setCompoundDrawables ( webpageOther , null , exitTab , null ) ; Drawable [ ] drawables = title . getCompoundDrawables ( ) ; bounds = drawables [ 2 ] . getBounds ( ) ; title . setOnTouchListener ( ACTIVITY ) ; Animation holo = AnimationUtils . loadAnimation ( CONTEXT , R . anim . up ) ; tabLayout . addView ( title ) ; title . setVisibility ( View . INVISIBLE ) ; holo . setAnimationListener ( new AnimationListener ( ) { @ Override public void onAnimationEnd ( Animation animation ) { } @ Override public void onAnimationRepeat ( Animation animation ) { } @ Override public void onAnimationStart ( Animation animation ) { title . setVisibility ( View . VISIBLE ) ; } } ) ; title . startAnimation ( holo ) ; urlTitle [ id ] = title ; urlTitle [ id ] . setText ( "New Tab" ) ; if ( theUrl != null ) { main [ id ] = generateTab ( id , theUrl , display ) ; } else { main [ id ] = generateTab ( id , homepage , display ) ; } } else { Utils . showToast ( CONTEXT , "Max number of tabs reached" ) ; } return id ; }
creates the tab and returns the ID of the view
creates the tab and returns the ID of the view