Example usage for android.widget LinearLayout VERTICAL

List of usage examples for android.widget LinearLayout VERTICAL

Introduction

In this page you can find the example usage for android.widget LinearLayout VERTICAL.

Prototype

int VERTICAL

To view the source code for android.widget LinearLayout VERTICAL.

Click Source Link

Usage

From source file:com.sb.tododemo.widgets.SavedStateFragmentTabHost.java

private void initFragmentTabHost(final Context context, final AttributeSet attrs) {

    final TypedArray a = context.obtainStyledAttributes(attrs, new int[] { android.R.attr.inflatedId }, 0, 0);
    mContainerId = a.getResourceId(0, 0);
    a.recycle();/*from  www.  j  av  a  2  s  . c o  m*/

    super.setOnTabChangedListener(this);

    // If owner hasn't made its own view hierarchy, then as a convenience
    // we will construct a standard one here.
    if (findViewById(android.R.id.tabs) == null) {
        final LinearLayout ll = new LinearLayout(context);
        ll.setOrientation(LinearLayout.VERTICAL);
        addView(ll, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.MATCH_PARENT));

        final TabWidget tw = new TabWidget(context);
        tw.setId(android.R.id.tabs);
        tw.setOrientation(LinearLayout.HORIZONTAL);
        ll.addView(tw, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.WRAP_CONTENT, 0));

        FrameLayout fl = new FrameLayout(context);
        fl.setId(android.R.id.tabcontent);
        ll.addView(fl, new LinearLayout.LayoutParams(0, 0, 0));

        mRealTabContent = fl = new FrameLayout(context);
        mRealTabContent.setId(mContainerId);
        ll.addView(fl, new LinearLayout.LayoutParams(android.view.ViewGroup.LayoutParams.MATCH_PARENT, 0, 1));
    }
}

From source file:com.tinfoil.sms.settings.UserKeySettings.java

public void exportKey(View view) {
    if (SMSUtility.isMediaWritable()) {
        phoneBook = new AutoCompleteTextView(this);
        List<String> contact = null;
        if (tc == null) {
            //Do in thread.
            tc = dba.getAllRows(DBAccessor.ALL);
        }//w w  w.ja  va  2  s. c  o m

        if (tc != null) {
            if (contact == null) {
                contact = SMSUtility.contactDisplayMaker(tc);
            }
        } else {
            contact = null;
        }
        final ArrayAdapter<String> adapter = new ArrayAdapter<String>(this.getBaseContext(),
                R.layout.auto_complete_list_item, contact);

        phoneBook.setAdapter(adapter);

        final AlertDialog.Builder popup_builder = new AlertDialog.Builder(this);
        popup_builder.setTitle(R.string.import_contacts_title).setCancelable(true).setView(phoneBook)
                .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {

                    public void onClick(final DialogInterface dialog, final int which) {

                        String[] contactInfo = SMSUtility.parseAutoComplete(phoneBook.getText().toString());
                        //String number = null;

                        boolean invalid = false;
                        if (contactInfo != null) {
                            if (contactInfo[0] == null) {
                                contactInfo[0] = contactInfo[1];
                            }

                            final Number number = dba.getNumber(contactInfo[1]);

                            if (number != null) {
                                AlertDialog.Builder builder = new AlertDialog.Builder(UserKeySettings.this);
                                LinearLayout linearLayout = new LinearLayout(UserKeySettings.this);
                                linearLayout.setOrientation(LinearLayout.VERTICAL);

                                final EditText sharedSecret1 = new EditText(UserKeySettings.this);
                                sharedSecret1
                                        .setHint(UserKeySettings.this.getString(R.string.shared_secret_hint_1));
                                sharedSecret1.setMaxLines(EditNumber.SHARED_INFO_MAX);
                                sharedSecret1.setInputType(InputType.TYPE_CLASS_TEXT);
                                linearLayout.addView(sharedSecret1);

                                final EditText sharedSecret2 = new EditText(UserKeySettings.this);
                                sharedSecret2
                                        .setHint(UserKeySettings.this.getString(R.string.shared_secret_hint_2));
                                sharedSecret2.setMaxLines(EditNumber.SHARED_INFO_MAX);
                                sharedSecret2.setInputType(InputType.TYPE_CLASS_TEXT);
                                linearLayout.addView(sharedSecret2);

                                builder.setMessage(UserKeySettings.this.getString(R.string.set_shared_secrets)
                                        + " " + contactInfo[0] + ", " + number.getNumber())
                                        .setTitle(R.string.set_shared_secrets_title).setCancelable(true)
                                        .setPositiveButton(R.string.save,
                                                new DialogInterface.OnClickListener() {
                                                    @Override
                                                    public void onClick(DialogInterface dialog, int id) {
                                                        //Save the shared secrets

                                                        String s1 = sharedSecret1.getText().toString();
                                                        String s2 = sharedSecret2.getText().toString();
                                                        if (SMSUtility.checksharedSecret(s1)
                                                                && SMSUtility.checksharedSecret(s2)) {
                                                            number.setSharedInfo1(s1);
                                                            number.setSharedInfo2(s2);
                                                            dba.updateNumberRow(number, number.getNumber(),
                                                                    number.getId());

                                                            number.setInitiator(true);
                                                            dba.updateInitiator(number);

                                                            //TODO add check for shared secrets
                                                            String keyExchangeMessage = KeyExchange.sign(number,
                                                                    dba, SMSUtility.user);

                                                            writeToFile(number.getNumber(), keyExchangeMessage);

                                                            Toast.makeText(UserKeySettings.this,
                                                                    UserKeySettings.this
                                                                            .getString(R.string.written_path)
                                                                            + " " + path + "/"
                                                                            + number.getNumber() + "_" + file,
                                                                    Toast.LENGTH_SHORT).show();

                                                        } else {
                                                            Toast.makeText(UserKeySettings.this,
                                                                    R.string.invalid_secrets, Toast.LENGTH_LONG)
                                                                    .show();
                                                        }
                                                    }
                                                })
                                        .setNegativeButton(android.R.string.cancel,
                                                new DialogInterface.OnClickListener() {
                                                    @Override
                                                    public void onClick(DialogInterface arg0, int arg1) {
                                                        //Cancel the key exchange
                                                        Toast.makeText(UserKeySettings.this,
                                                                R.string.key_exchange_cancelled,
                                                                Toast.LENGTH_LONG).show();
                                                    }
                                                });
                                AlertDialog alert = builder.create();

                                alert.setView(linearLayout);
                                alert.show();
                            } else {
                                invalid = true;
                            }
                        } else {
                            invalid = true;
                        }

                        if (invalid) {
                            Toast.makeText(UserKeySettings.this, R.string.invalid_number_message,
                                    Toast.LENGTH_LONG).show();
                        }
                    }
                });

        popup_alert = popup_builder.create();
        popup_alert.show();

        //getExternalFilesDir(null);
    }
}

From source file:com.tinfoil.sms.sms.KeyExchangeManager.java

/**
 * Set the shared secrets for the contacts.
 * @param context The context of the setting.
 * @param number The Number of the contact.
 * @param name The name of the contact/*from  w  w w.j ava  2s . co  m*/
 * @param entry The key exchange message.
 */
private static void setAndSend(final Context context, final Number number, String name, final Entry entry) {
    final DBAccessor dba = new DBAccessor(context);
    AlertDialog.Builder builder = new AlertDialog.Builder(context);
    LinearLayout linearLayout = new LinearLayout(context);
    linearLayout.setOrientation(LinearLayout.VERTICAL);

    final EditText sharedSecret1 = new EditText(context);
    sharedSecret1.setHint(context.getString(R.string.shared_secret_hint_1));
    sharedSecret1.setMaxLines(EditNumber.SHARED_INFO_MAX);
    sharedSecret1.setInputType(InputType.TYPE_CLASS_TEXT);
    linearLayout.addView(sharedSecret1);

    final EditText sharedSecret2 = new EditText(context);
    sharedSecret2.setHint(context.getString(R.string.shared_secret_hint_2));
    sharedSecret2.setMaxLines(EditNumber.SHARED_INFO_MAX);
    sharedSecret2.setInputType(InputType.TYPE_CLASS_TEXT);
    linearLayout.addView(sharedSecret2);

    builder.setMessage(context.getString(R.string.set_shared_secrets) + " " + name + ", " + number.getNumber())
            .setTitle(R.string.set_shared_secrets_title).setCancelable(true)
            .setPositiveButton(R.string.save, new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int id) {
                    //Save the shared secrets
                    String s1 = sharedSecret1.getText().toString();
                    String s2 = sharedSecret2.getText().toString();
                    if (SMSUtility.checksharedSecret(s1) && SMSUtility.checksharedSecret(s2)) {
                        number.setSharedInfo1(s1);
                        number.setSharedInfo2(s2);
                        dba.updateNumberRow(number, number.getNumber(), number.getId());

                        respondKeyExchangeMessage(context, number, entry);
                    } else {
                        Toast.makeText(context, R.string.invalid_secrets, Toast.LENGTH_LONG).show();
                    }
                }
            }).setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface arg0, int arg1) {
                    //Cancel the key exchange
                    Toast.makeText(context, R.string.key_exchange_cancelled, Toast.LENGTH_LONG).show();
                }
            });
    AlertDialog alert = builder.create();

    alert.setView(linearLayout);
    alert.show();
}

From source file:com.uzmap.pkg.uzmodules.uzBMap.mode.Billboard.java

private LinearLayout titleLayout() {
    LinearLayout titleLayout = new LinearLayout(context);
    LayoutParams layoutParams = new LayoutParams(UZCoreUtil.dipToPix(width - iconSize - 30),
            UZCoreUtil.dipToPix(height));
    layoutParams.setMargins(UZCoreUtil.dipToPix(10), 0, UZCoreUtil.dipToPix(10), 0);
    titleLayout.setLayoutParams(layoutParams);
    titleLayout.setOrientation(LinearLayout.VERTICAL);

    LinearLayout titleLayout2 = new LinearLayout(context);
    LayoutParams layoutParams2 = new LayoutParams(UZCoreUtil.dipToPix(width - iconSize - 30),
            UZCoreUtil.dipToPix(height - 10));
    titleLayout2.setGravity(Gravity.CENTER_VERTICAL);
    titleLayout2.setOrientation(LinearLayout.VERTICAL);
    titleLayout2.setLayoutParams(layoutParams2);
    titleLayout.addView(titleLayout2);//from  w  ww.j ava2  s  .  c om
    titleLayout2.addView(title());
    titleLayout2.addView(subTitle());
    return titleLayout;
}

From source file:it.iziozi.iziozi.gui.IOBoardFragment.java

private View buildView(boolean editMode) {

    this.homeRows.clear();
    final List<IOSpeakableImageButton> mButtons = new ArrayList<IOSpeakableImageButton>();
    List<IOSpeakableImageButton> configButtons = this.mBoard.getButtons();

    ViewGroup mainView = (ViewGroup) getActivity().getLayoutInflater().inflate(R.layout.table_main_layout,
            null);//w w w  . java 2  s  . co m

    LinearLayout tableContainer = new LinearLayout(getActivity());
    LinearLayout.LayoutParams mainParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
            LinearLayout.LayoutParams.MATCH_PARENT);
    tableContainer.setLayoutParams(mainParams);
    tableContainer.setOrientation(LinearLayout.VERTICAL);

    for (int i = 0; i < this.mBoard.getRows(); i++) {

        LinearLayout rowLayout = new LinearLayout(getActivity());
        LinearLayout.LayoutParams rowParams = new LinearLayout.LayoutParams(
                LinearLayout.LayoutParams.MATCH_PARENT, 0, 1.f);
        rowLayout.setLayoutParams(rowParams);
        rowLayout.setOrientation(LinearLayout.HORIZONTAL);
        Random color = new Random();
        rowLayout.setBackgroundColor(Color.WHITE);
        tableContainer.addView(rowLayout);
        this.homeRows.add(rowLayout);
    }

    for (int j = 0; j < this.homeRows.size(); j++) {
        LinearLayout homeRow = this.homeRows.get(j);

        for (int i = 0; i < this.mBoard.getCols(); i++) {
            LinearLayout btnContainer = new LinearLayout(getActivity());
            LinearLayout.LayoutParams btnContainerParams = new LinearLayout.LayoutParams(0,
                    LinearLayout.LayoutParams.MATCH_PARENT, 1.f);
            btnContainer.setLayoutParams(btnContainerParams);
            btnContainer.setOrientation(LinearLayout.VERTICAL);
            btnContainer.setGravity(Gravity.CENTER);

            homeRow.addView(btnContainer);

            final IOSpeakableImageButton imgButton = (configButtons.size() > 0
                    && configButtons.size() > mButtons.size()) ? configButtons.get(mButtons.size())
                            : new IOSpeakableImageButton(getActivity());
            imgButton.setmContext(getActivity());
            imgButton.setShowBorder(IOConfiguration.getShowBorders());
            if (IOGlobalConfiguration.isEditing)
                imgButton.setImageDrawable(getResources().getDrawable(R.drawable.logo_org));
            else
                imgButton.setImageDrawable(null);
            imgButton.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
            imgButton.setBackgroundColor(Color.TRANSPARENT);

            if (imgButton.getmImageFile() != null && imgButton.getmImageFile().length() > 0) {

                if (!new File(imgButton.getmImageFile()).exists()) {
                    if (mAlertDialog == null || !mAlertDialog.isShowing()) {
                        mAlertDialog = new AlertDialog.Builder(getActivity()).setCancelable(true)
                                .setTitle(getString(R.string.image_missing))
                                .setMessage(getString(R.string.image_missing_text))
                                .setNegativeButton(getString(R.string.continue_string), null).create();
                        mAlertDialog.show();
                    }

                    //download image

                    if (isExternalStorageReadable()) {

                        File baseFolder = new File(Environment.getExternalStorageDirectory() + "/"
                                + IOApplication.APPLICATION_FOLDER + "/pictograms");
                        Character pictoChar = imgButton.getmImageFile()
                                .charAt(imgButton.getmImageFile().lastIndexOf("/") + 1);
                        File pictoFolder = new File(baseFolder + "/" + pictoChar + "/");

                        if (isExternalStorageWritable()) {

                            pictoFolder.mkdirs();

                            //download it

                            AsyncHttpClient client = new AsyncHttpClient();
                            client.get(imgButton.getmUrl(),
                                    new FileAsyncHttpResponseHandler(new File(imgButton.getmImageFile())) {
                                        @Override
                                        public void onFailure(int statusCode, Header[] headers,
                                                Throwable throwable, File file) {
                                            Toast.makeText(getActivity(),
                                                    getString(R.string.download_error) + file.toString(),
                                                    Toast.LENGTH_LONG).show();
                                        }

                                        @Override
                                        public void onSuccess(int statusCode, Header[] headers,
                                                File downloadedFile) {

                                            if (new File(imgButton.getmImageFile()).exists()) {
                                                imgButton.setImageBitmap(
                                                        BitmapFactory.decodeFile(imgButton.getmImageFile()));
                                            } else {
                                                Toast.makeText(getActivity(),
                                                        getString(R.string.image_save_error),
                                                        Toast.LENGTH_SHORT).show();
                                            }
                                        }
                                    });
                        } else {

                            Toast.makeText(getActivity(), getString(R.string.image_save_error),
                                    Toast.LENGTH_SHORT).show();
                        }
                    } else {
                        Toast.makeText(getActivity(), getString(R.string.image_save_error), Toast.LENGTH_SHORT)
                                .show();
                    }

                } else
                    imgButton.setImageBitmap(BitmapFactory.decodeFile(imgButton.getmImageFile()));
            }

            ViewGroup parent = (ViewGroup) imgButton.getParent();

            if (parent != null)
                parent.removeAllViews();

            btnContainer.addView(imgButton);

            mButtons.add(imgButton);

            imgButton.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    int index = mButtons.indexOf(v);
                    if (mListener != null)
                        mListener.tapOnSpeakableButton(mButtons.get(index), mBoardLevel);
                }
            });
        }
    }

    this.mBoard.setButtons(mButtons.size() > configButtons.size() ? mButtons : configButtons);

    return tableContainer;
}

From source file:com.google.android.gcm.demo.ui.InstanceIdFragment.java

@Override
public void refresh() {
    new AsyncTask<Void, Void, Void>() {
        @Override//w  w w .  j a v  a  2  s  . c om
        protected Void doInBackground(Void... params) {
            final String instanceId = mInstanceIdHelper.getInstanceId();
            final String creationTime = DateFormat.getDateTimeInstance()
                    .format(new Date(mInstanceIdHelper.getCreationTime()));
            final Activity activity = getActivity();
            if (activity != null) {
                Handler handler = new Handler(activity.getMainLooper());
                handler.post(new Runnable() {
                    public void run() {
                        setValue(activity.findViewById(R.id.iid_instance_id), instanceId);
                        setValue(activity.findViewById(R.id.iid_creation_time), creationTime);
                    }
                });
            }
            return null;
        }
    }.execute();
    float density = getActivity().getResources().getDisplayMetrics().density;
    SimpleArrayMap<String, Sender> addressBook = mSenders.getSenders();
    LinearLayout sendersList = new LinearLayout(getActivity());
    sendersList.setOrientation(LinearLayout.VERTICAL);
    for (int i = 0; i < addressBook.size(); i++) {
        Sender sender = addressBook.valueAt(i);
        if (sender.appTokens.size() > 0) {
            LinearLayout senderRow = (LinearLayout) getActivity().getLayoutInflater()
                    .inflate(R.layout.widget_icon_text_button_row, sendersList, false);
            ImageView senderIcon = (ImageView) senderRow.findViewById(R.id.widget_itbr_icon);
            TextView senderLabel = (TextView) senderRow.findViewById(R.id.widget_itbr_text);
            senderRow.findViewById(R.id.widget_itbr_button).setVisibility(View.GONE);
            senderIcon.setImageResource(R.drawable.cloud_googblue);
            senderIcon.setPadding(0, 0, (int) (8 * density), 0);
            senderLabel.setText(getString(R.string.topics_sender_id, sender.senderId));
            sendersList.addView(senderRow);
            for (Token token : sender.appTokens.values()) {
                LinearLayout row = (LinearLayout) getActivity().getLayoutInflater()
                        .inflate(R.layout.widget_icon_text_button_row, sendersList, false);
                ImageView icon = (ImageView) row.findViewById(R.id.widget_itbr_icon);
                TextView label = (TextView) row.findViewById(R.id.widget_itbr_text);
                Button button = (Button) row.findViewById(R.id.widget_itbr_button);
                icon.setImageResource(R.drawable.smartphone_grey600);
                label.setText(token.scope + " - " + AbstractFragment.truncateToMediumString(token.token));
                button.setText(R.string.iid_delete_token);
                button.setTag(R.id.tag_senderid, sender.senderId);
                button.setTag(R.id.tag_scope, token.scope);
                button.setOnClickListener(this);
                row.setPadding((int) (16 * density), 0, 0, 0);
                sendersList.addView(row);
            }
        }
    }
    if (sendersList.getChildCount() == 0) {
        TextView noTokens = new TextView(getActivity());
        noTokens.setText(getString(R.string.iid_no_tokens));
        noTokens.setTypeface(null, Typeface.ITALIC);
        sendersList.addView(noTokens);
    }
    FrameLayout tokensView = (FrameLayout) getActivity().findViewById(R.id.iid_tokens_wrapper);
    tokensView.removeAllViews();
    tokensView.addView(sendersList);
}

From source file:com.owncloud.android.ui.activity.FirstRunActivity.java

private void setSlideshowSize(boolean isLandscape) {
    boolean isProviderOrOwnInstallationVisible = getResources()
            .getBoolean(R.bool.show_provider_or_own_installation);
    LinearLayout buttonLayout = findViewById(R.id.buttonLayout);
    LinearLayout.LayoutParams layoutParams;

    buttonLayout.setOrientation(isLandscape ? LinearLayout.HORIZONTAL : LinearLayout.VERTICAL);

    LinearLayout bottomLayout = findViewById(R.id.bottomLayout);
    if (isProviderOrOwnInstallationVisible) {
        layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.WRAP_CONTENT);
    } else {//  ww  w  . j a  v  a2 s  .c  om
        layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
                DisplayUtils.convertDpToPixel(isLandscape ? 100f : 150f, this));
    }

    bottomLayout.setLayoutParams(layoutParams);
}

From source file:com.bangqu.eshow.view.sliding.ESSlidingTabView.java

/**
 * Inits the view.//from   ww  w  .j  a v a2 s  .  co  m
 */
public void initView() {
    this.setOrientation(LinearLayout.VERTICAL);
    this.setBackgroundColor(Color.rgb(255, 255, 255));

    mTabScrollView = new HorizontalScrollView(context);
    mTabScrollView.setHorizontalScrollBarEnabled(false);
    mTabScrollView.setSmoothScrollingEnabled(true);

    mTabLayout = new LinearLayout(context);
    mTabLayout.setOrientation(LinearLayout.HORIZONTAL);
    mTabLayout.setGravity(Gravity.CENTER);

    //mTabLayout
    mTabScrollView.addView(mTabLayout, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
            ViewGroup.LayoutParams.FILL_PARENT));

    this.addView(mTabScrollView, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,
            ViewGroup.LayoutParams.WRAP_CONTENT));

    //View?
    mViewPager = new ESViewPager(context);
    //ViewPager,setId()id
    mViewPager.setId(1985);
    pagerItemList = new ArrayList<Fragment>();
    //Tab?
    tabItemList = new ArrayList<TextView>();
    tabItemTextList = new ArrayList<String>();
    tabItemDrawableList = new ArrayList<Drawable>();

    //?FragmentActivity
    if (!(this.context instanceof FragmentActivity)) {
        ESLogUtil.e(ESSlidingTabView.class,
                "AbSlidingTabView?context,FragmentActivity");
    }
}

From source file:cn.org.eshow.framwork.view.sliding.AbSlidingTabView.java

/**
 * Inits the view./*from w  w w  .ja  v  a  2s. co  m*/
 */
public void initView() {
    this.setOrientation(LinearLayout.VERTICAL);
    this.setBackgroundColor(Color.rgb(255, 255, 255));

    mTabScrollView = new HorizontalScrollView(context);
    mTabScrollView.setHorizontalScrollBarEnabled(false);
    mTabScrollView.setSmoothScrollingEnabled(true);

    mTabLayout = new LinearLayout(context);
    mTabLayout.setOrientation(LinearLayout.HORIZONTAL);
    mTabLayout.setGravity(Gravity.CENTER);

    //mTabLayout
    mTabScrollView.addView(mTabLayout, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
            ViewGroup.LayoutParams.FILL_PARENT));

    this.addView(mTabScrollView, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,
            ViewGroup.LayoutParams.WRAP_CONTENT));

    //View?
    mViewPager = new AbViewPager(context);
    //ViewPager,setId()id
    mViewPager.setId(1985);
    pagerItemList = new ArrayList<Fragment>();
    //Tab?
    tabItemList = new ArrayList<TextView>();
    tabItemTextList = new ArrayList<String>();
    tabItemDrawableList = new ArrayList<Drawable>();

    //?FragmentActivity
    if (!(this.context instanceof FragmentActivity)) {
        AbLogUtil.e(AbSlidingTabView.class,
                "AbSlidingTabView?context,FragmentActivity");
    }
}

From source file:com.matthewtamlin.sliding_intro_screen_manual_testing.TestButtonConfig.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    initialiseDrawables(); // Needed before tests can run

    // Create a layout to display the control buttons over the ViewPager
    final LinearLayout controlButtonHolder = new LinearLayout(this);
    controlButtonHolder.setOrientation(LinearLayout.VERTICAL);
    getRootView().addView(controlButtonHolder);

    // Add the test buttons to the control layout
    controlButtonHolder.addView(createModifyAppearanceAndBehaviourButton());
    controlButtonHolder.addView(createToggleLeftButtonButton());
    controlButtonHolder.addView(createToggleRightButtonButton());
    controlButtonHolder.addView(createToggleFinalButtonButton());
    controlButtonHolder.addView(createShowLeftButtonOnLastPageButton());
}