From wiki.ginstr.com
Jump to: navigation, search

Container horizontal two

This widget is used as a container for other widgets. In this case two widgets can be added to container.

Widget id, ${gbamID}:

containerHorizontalTwo

Back to GBAM widgets table

Predefined user data

Properties panel

User will configure this data in properties panels of selected widget:

GENERAL
  • ${screenLabel}
  • "border", ${border} checkbox which when selected wraps entire container in a border. By default disabled. When enabled following xml at ${border} should be added:

if label option is checked:

gn:style="@style/containerHorizontalTwo_inputNoLabel"

if label option is not checked:

gn:style="@style/containerHorizontalTwo_input"

at each cell ${cellStyle} should be added following:

gn:style="@style/containerHorizontalTwo_internalContainer"
  • "label", ${label} checkbox which when selected shows label widget above the container. By default disabled:
<com.ginstr.widgets.GnTextView
    android:id="@+id/${widgetID}_label"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="@string/${widgetID}"
    gn:style="@style/containerHorizontalTwo_label"/>
  • "center child labels", ${centerChildLabel}, checkbox when selected all labels over containers are centered. By default disabled. When enabled to each child that is added to container, to it's label widget should be added following attribute:
gn:s_gravity="CENTER_HORIZONTAL"
VALIDATIONS
  • -
ACTION
  • -
ACTION MESSAGES
  • -

Widgets groups that can not be put into container

  • Screens
  • Containers
  • Complex
  • Menu bars

Code snippets

GBAM Code Variables

Variables which are used in code snippet below but not defined in user modifiable inputs.

  • ${weight} - defines a value between 5 and 95. Width is bigger on the widget where the number is smaller. All weight numbers combined have to sum up to 100

Common widget code

${label}

<LinearLayout
	android:layout_height="wrap_content"
	android:layout_width="match_parent"
	android:orientation="horizontal"
	android:weightSum="100"
        ${border} >
	
	<LinearLayout
		android:layout_height="match_parent"
		android:layout_width="0dp"
		android:orientation="vertical"
		android:layout_marginRight="5dp"
		android:layout_weight="${weight}"
                ${cellStyle}>
	
		... content ... 
			
	</LinearLayout>
	
	<LinearLayout
		android:layout_height="match_parent"
		android:layout_width="0dp"
		android:orientation="vertical"
		android:layout_marginLeft="5dp"
		android:layout_weight="${weight}"
                ${cellStyle}>
					
		... content ... 

	</LinearLayout>
</LinearLayout>