Example usage for android.widget LinearLayout SHOW_DIVIDER_BEGINNING

List of usage examples for android.widget LinearLayout SHOW_DIVIDER_BEGINNING

Introduction

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

Prototype

int SHOW_DIVIDER_BEGINNING

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

Click Source Link

Document

Show a divider at the beginning of the group.

Usage

From source file:com.passwordboss.android.widget.sliding_tab.SlidingTabLayout.java

public SlidingTabLayout(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);

    // Disable the Scroll Bar
    setHorizontalScrollBarEnabled(false);
    // Make sure that the Tab Strips fills this View
    setFillViewport(true);/*  w  w  w. j a  v a  2s.c om*/

    mTitleOffset = (int) (TITLE_OFFSET_DIPS * getResources().getDisplayMetrics().density);

    mTabStrip = new SlidingTabStrip(context);
    mTabStrip.setShowDividers(LinearLayout.SHOW_DIVIDER_BEGINNING);
    mTabStrip.setDividerDrawable(
            new ColorDrawable(ContextCompat.getColor(context, R.color.vertical_divider_grey)));
    mTabStrip.setDividerPadding(4);
    addView(mTabStrip, LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
}

From source file:net.momodalo.app.vimtouch.VimTouch.java

public void showCmdHistory() {

    final Dialog dialog = new Dialog(this, R.style.DialogSlideAnim);

    // Setting dialogview
    Window window = dialog.getWindow();
    window.setGravity(Gravity.BOTTOM);//from w w w .  j  a v  a2  s. c  o m

    window.setLayout(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
    dialog.setTitle(null);
    dialog.setContentView(R.layout.hist_list);
    dialog.setCancelable(true);

    LinearLayout layout = (LinearLayout) dialog.findViewById(R.id.hist_layout);
    if (AndroidCompat.SDK >= 11) {
        layout.setShowDividers(LinearLayout.SHOW_DIVIDER_BEGINNING | LinearLayout.SHOW_DIVIDER_MIDDLE
                | LinearLayout.SHOW_DIVIDER_END);
    }
    LayoutParams params = layout.getLayoutParams();
    params.width = mScreenWidth;
    layout.setLayoutParams(params);

    LayoutInflater inflater = LayoutInflater.from(this);
    boolean exists = false;

    for (int i = 1; i <= 10; i++) {
        TextView button = (TextView) inflater.inflate(R.layout.histbutton, layout, false);
        String cmd = Exec.getCmdHistory(i);
        if (cmd.length() == 0)
            break;
        exists = true;
        button.setText(":" + cmd);
        button.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                TextView text = (TextView) v;
                CharSequence cmd = text.getText();
                Exec.doCommand(cmd.subSequence(1, cmd.length()).toString());
                dialog.dismiss();
            }
        });
        layout.addView((View) button);
    }

    if (exists)
        dialog.show();
}