Search in sources :

Example 6 with Space

use of android.widget.Space in project android_packages_apps_DUI by DirtyUnicorns.

the class SmartBarHelper method makeSeparator.

static View makeSeparator(Context ctx) {
    View v;
    if (BaseNavigationBar.sIsTablet) {
        v = new Space(ctx);
    } else {
        v = new View(ctx);
    }
    v.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT, 1.0f));
    v.setVisibility(View.INVISIBLE);
    return v;
}
Also used : Space(android.widget.Space) LayoutParams(android.widget.LinearLayout.LayoutParams) ImageView(android.widget.ImageView) SmartBarView(com.android.systemui.navigation.smartbar.SmartBarView) View(android.view.View) SmartButtonView(com.android.systemui.navigation.smartbar.SmartButtonView) LinearLayout(android.widget.LinearLayout)

Example 7 with Space

use of android.widget.Space in project android_frameworks_base by ResurrectionRemix.

the class BiDiTestGridLayoutCodeRtl method create.

public static View create(Context context) {
    GridLayout layout = new GridLayout(context);
    layout.setUseDefaultMargins(true);
    layout.setAlignmentMode(ALIGN_BOUNDS);
    layout.setRowOrderPreserved(false);
    layout.setLayoutDirection(View.LAYOUT_DIRECTION_RTL);
    Spec row1 = spec(0);
    Spec row2 = spec(1);
    Spec row3 = spec(2, BASELINE);
    Spec row4 = spec(3, BASELINE);
    // allow the last two rows to overlap the middle two
    Spec row5 = spec(2, 3, FILL);
    Spec row6 = spec(5);
    Spec row7 = spec(6);
    Spec col1a = spec(0, 4, CENTER);
    Spec col1b = spec(0, 4, LEFT);
    Spec col1c = spec(0, RIGHT);
    Spec col2 = spec(1, START);
    Spec col3 = spec(2, FILL);
    Spec col4a = spec(3);
    Spec col4b = spec(3, FILL);
    {
        TextView c = new TextView(context);
        c.setTextSize(32);
        c.setText("Email setup");
        layout.addView(c, new GridLayout.LayoutParams(row1, col1a));
    }
    {
        TextView c = new TextView(context);
        c.setTextSize(16);
        c.setText("You can configure email in just a few steps:");
        layout.addView(c, new GridLayout.LayoutParams(row2, col1b));
    }
    {
        TextView c = new TextView(context);
        c.setText("Email address:");
        layout.addView(c, new GridLayout.LayoutParams(row3, col1c));
    }
    {
        EditText c = new EditText(context);
        c.setEms(10);
        c.setInputType(TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_EMAIL_ADDRESS);
        layout.addView(c, new GridLayout.LayoutParams(row3, col2));
    }
    {
        TextView c = new TextView(context);
        c.setText("Password:");
        layout.addView(c, new GridLayout.LayoutParams(row4, col1c));
    }
    {
        TextView c = new EditText(context);
        c.setEms(8);
        c.setInputType(TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_PASSWORD);
        layout.addView(c, new GridLayout.LayoutParams(row4, col2));
    }
    {
        Space c = new Space(context);
        layout.addView(c, new GridLayout.LayoutParams(row5, col3));
    }
    {
        Button c = new Button(context);
        c.setText("Manual setup");
        layout.addView(c, new GridLayout.LayoutParams(row6, col4a));
    }
    {
        Button c = new Button(context);
        c.setText("Next");
        layout.addView(c, new GridLayout.LayoutParams(row7, col4b));
    }
    return layout;
}
Also used : EditText(android.widget.EditText) Space(android.widget.Space) GridLayout(android.widget.GridLayout) Button(android.widget.Button) TextView(android.widget.TextView) Spec(android.widget.GridLayout.Spec)

Example 8 with Space

use of android.widget.Space in project android_frameworks_base by crdroidandroid.

the class BiDiTestGridLayoutCodeLtr method create.

public static View create(Context context) {
    GridLayout layout = new GridLayout(context);
    layout.setUseDefaultMargins(true);
    layout.setAlignmentMode(ALIGN_BOUNDS);
    layout.setRowOrderPreserved(false);
    layout.setLayoutDirection(View.LAYOUT_DIRECTION_LTR);
    Spec row1 = spec(0);
    Spec row2 = spec(1);
    Spec row3 = spec(2, BASELINE);
    Spec row4 = spec(3, BASELINE);
    // allow the last two rows to overlap the middle two
    Spec row5 = spec(2, 3, FILL);
    Spec row6 = spec(5);
    Spec row7 = spec(6);
    Spec col1a = spec(0, 4, CENTER);
    Spec col1b = spec(0, 4, LEFT);
    Spec col1c = spec(0, RIGHT);
    Spec col2 = spec(1, START);
    Spec col3 = spec(2, FILL);
    Spec col4a = spec(3);
    Spec col4b = spec(3, FILL);
    {
        TextView c = new TextView(context);
        c.setTextSize(32);
        c.setText("Email setup");
        layout.addView(c, new GridLayout.LayoutParams(row1, col1a));
    }
    {
        TextView c = new TextView(context);
        c.setTextSize(16);
        c.setText("You can configure email in just a few steps:");
        layout.addView(c, new GridLayout.LayoutParams(row2, col1b));
    }
    {
        TextView c = new TextView(context);
        c.setText("Email address:");
        layout.addView(c, new GridLayout.LayoutParams(row3, col1c));
    }
    {
        EditText c = new EditText(context);
        c.setEms(10);
        c.setInputType(TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_EMAIL_ADDRESS);
        layout.addView(c, new GridLayout.LayoutParams(row3, col2));
    }
    {
        TextView c = new TextView(context);
        c.setText("Password:");
        layout.addView(c, new GridLayout.LayoutParams(row4, col1c));
    }
    {
        TextView c = new EditText(context);
        c.setEms(8);
        c.setInputType(TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_PASSWORD);
        layout.addView(c, new GridLayout.LayoutParams(row4, col2));
    }
    {
        Space c = new Space(context);
        layout.addView(c, new GridLayout.LayoutParams(row5, col3));
    }
    {
        Button c = new Button(context);
        c.setText("Manual setup");
        layout.addView(c, new GridLayout.LayoutParams(row6, col4a));
    }
    {
        Button c = new Button(context);
        c.setText("Next");
        layout.addView(c, new GridLayout.LayoutParams(row7, col4b));
    }
    return layout;
}
Also used : EditText(android.widget.EditText) Space(android.widget.Space) GridLayout(android.widget.GridLayout) Button(android.widget.Button) TextView(android.widget.TextView) Spec(android.widget.GridLayout.Spec)

Example 9 with Space

use of android.widget.Space in project android_frameworks_base by crdroidandroid.

the class BiDiTestGridLayoutCodeRtl method create.

public static View create(Context context) {
    GridLayout layout = new GridLayout(context);
    layout.setUseDefaultMargins(true);
    layout.setAlignmentMode(ALIGN_BOUNDS);
    layout.setRowOrderPreserved(false);
    layout.setLayoutDirection(View.LAYOUT_DIRECTION_RTL);
    Spec row1 = spec(0);
    Spec row2 = spec(1);
    Spec row3 = spec(2, BASELINE);
    Spec row4 = spec(3, BASELINE);
    // allow the last two rows to overlap the middle two
    Spec row5 = spec(2, 3, FILL);
    Spec row6 = spec(5);
    Spec row7 = spec(6);
    Spec col1a = spec(0, 4, CENTER);
    Spec col1b = spec(0, 4, LEFT);
    Spec col1c = spec(0, RIGHT);
    Spec col2 = spec(1, START);
    Spec col3 = spec(2, FILL);
    Spec col4a = spec(3);
    Spec col4b = spec(3, FILL);
    {
        TextView c = new TextView(context);
        c.setTextSize(32);
        c.setText("Email setup");
        layout.addView(c, new GridLayout.LayoutParams(row1, col1a));
    }
    {
        TextView c = new TextView(context);
        c.setTextSize(16);
        c.setText("You can configure email in just a few steps:");
        layout.addView(c, new GridLayout.LayoutParams(row2, col1b));
    }
    {
        TextView c = new TextView(context);
        c.setText("Email address:");
        layout.addView(c, new GridLayout.LayoutParams(row3, col1c));
    }
    {
        EditText c = new EditText(context);
        c.setEms(10);
        c.setInputType(TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_EMAIL_ADDRESS);
        layout.addView(c, new GridLayout.LayoutParams(row3, col2));
    }
    {
        TextView c = new TextView(context);
        c.setText("Password:");
        layout.addView(c, new GridLayout.LayoutParams(row4, col1c));
    }
    {
        TextView c = new EditText(context);
        c.setEms(8);
        c.setInputType(TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_PASSWORD);
        layout.addView(c, new GridLayout.LayoutParams(row4, col2));
    }
    {
        Space c = new Space(context);
        layout.addView(c, new GridLayout.LayoutParams(row5, col3));
    }
    {
        Button c = new Button(context);
        c.setText("Manual setup");
        layout.addView(c, new GridLayout.LayoutParams(row6, col4a));
    }
    {
        Button c = new Button(context);
        c.setText("Next");
        layout.addView(c, new GridLayout.LayoutParams(row7, col4b));
    }
    return layout;
}
Also used : EditText(android.widget.EditText) Space(android.widget.Space) GridLayout(android.widget.GridLayout) Button(android.widget.Button) TextView(android.widget.TextView) Spec(android.widget.GridLayout.Spec)

Example 10 with Space

use of android.widget.Space in project android_frameworks_base by DirtyUnicorns.

the class BiDiTestGridLayoutCodeRtl method create.

public static View create(Context context) {
    GridLayout layout = new GridLayout(context);
    layout.setUseDefaultMargins(true);
    layout.setAlignmentMode(ALIGN_BOUNDS);
    layout.setRowOrderPreserved(false);
    layout.setLayoutDirection(View.LAYOUT_DIRECTION_RTL);
    Spec row1 = spec(0);
    Spec row2 = spec(1);
    Spec row3 = spec(2, BASELINE);
    Spec row4 = spec(3, BASELINE);
    // allow the last two rows to overlap the middle two
    Spec row5 = spec(2, 3, FILL);
    Spec row6 = spec(5);
    Spec row7 = spec(6);
    Spec col1a = spec(0, 4, CENTER);
    Spec col1b = spec(0, 4, LEFT);
    Spec col1c = spec(0, RIGHT);
    Spec col2 = spec(1, START);
    Spec col3 = spec(2, FILL);
    Spec col4a = spec(3);
    Spec col4b = spec(3, FILL);
    {
        TextView c = new TextView(context);
        c.setTextSize(32);
        c.setText("Email setup");
        layout.addView(c, new GridLayout.LayoutParams(row1, col1a));
    }
    {
        TextView c = new TextView(context);
        c.setTextSize(16);
        c.setText("You can configure email in just a few steps:");
        layout.addView(c, new GridLayout.LayoutParams(row2, col1b));
    }
    {
        TextView c = new TextView(context);
        c.setText("Email address:");
        layout.addView(c, new GridLayout.LayoutParams(row3, col1c));
    }
    {
        EditText c = new EditText(context);
        c.setEms(10);
        c.setInputType(TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_EMAIL_ADDRESS);
        layout.addView(c, new GridLayout.LayoutParams(row3, col2));
    }
    {
        TextView c = new TextView(context);
        c.setText("Password:");
        layout.addView(c, new GridLayout.LayoutParams(row4, col1c));
    }
    {
        TextView c = new EditText(context);
        c.setEms(8);
        c.setInputType(TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_PASSWORD);
        layout.addView(c, new GridLayout.LayoutParams(row4, col2));
    }
    {
        Space c = new Space(context);
        layout.addView(c, new GridLayout.LayoutParams(row5, col3));
    }
    {
        Button c = new Button(context);
        c.setText("Manual setup");
        layout.addView(c, new GridLayout.LayoutParams(row6, col4a));
    }
    {
        Button c = new Button(context);
        c.setText("Next");
        layout.addView(c, new GridLayout.LayoutParams(row7, col4b));
    }
    return layout;
}
Also used : EditText(android.widget.EditText) Space(android.widget.Space) GridLayout(android.widget.GridLayout) Button(android.widget.Button) TextView(android.widget.TextView) Spec(android.widget.GridLayout.Spec)

Aggregations

Space (android.widget.Space)12 TextView (android.widget.TextView)9 Button (android.widget.Button)8 EditText (android.widget.EditText)8 GridLayout (android.widget.GridLayout)8 Spec (android.widget.GridLayout.Spec)8 LinearLayout (android.widget.LinearLayout)3 View (android.view.View)2 ImageView (android.widget.ImageView)2 SuppressLint (android.annotation.SuppressLint)1 AbsListView (android.widget.AbsListView)1 LayoutParams (android.widget.LinearLayout.LayoutParams)1 ListView (android.widget.ListView)1 TableRow (android.widget.TableRow)1 SmartBarView (com.android.systemui.navigation.smartbar.SmartBarView)1 SmartButtonView (com.android.systemui.navigation.smartbar.SmartButtonView)1 StackAdapter (com.fima.cardsui.StackAdapter)1