My layout is based on what Android Studio creates - blank with an action bar. This is the default code to inflate my fragment_list.xml into activity_stats.xml (I only have one Java file)
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_list, container, false);
return rootView;
}
Activity_stats is unaltered, just like Android Studio generated it. This is fragment_list.xml
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.company.dummyname.stats$PlaceholderFragment" >
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clipToPadding="false"
android:paddingTop="#dimen/network_margin_vertical"
android:paddingLeft="#dimen/network_margin_horizontal"
android:paddingRight="#dimen/network_margin_vertical" >
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="#+id/networkContainer"/>
</ScrollView>
</RelativeLayout>
I want to add multiple children to networkContainer. The children should be layouts from network.xml, which looks like this:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.GridLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:grid="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.company.dummyname.stats$PlaceholderFragment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
grid:columnCount="2" >
<ImageView
android:layout_width="88dp"
android:layout_height="70dp"
android:background="#fff8cdac"
grid:layout_row="0"
grid:layout_column="0"
grid:layout_rowSpan="2"
android:src="#drawable/ic_launcher"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
grid:layout_row="0"
grid:layout_column="1"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="9999.99"
android:id="#+id/totalToday"
android:textSize="32sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" today"
android:textSize="32sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="46dp"
android:paddingLeft="8dp"
grid:layout_row="1"
grid:layout_column="1"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="9999.99"
android:id="#+id/totalYesterday"
android:textSize="24sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" yesterday"
android:textSize="24sp" />
</LinearLayout>
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
grid:layout_row="2"
grid:layout_columnSpan="2">
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
style="#style/StatsCell" />
<TextView
style="#style/StatsCell"
android:text="Hits" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
style="#style/StatsCell"
android:text="Today"
android:layout_height="match_parent" />
<TextView
style="#style/StatsCell"
android:id="#+id/todayHits"
android:text="9999" />
</TableRow>
</TableLayout>
</android.support.v7.widget.GridLayout>
There will be more data and one more row, but I removed them to simplify the question. The goal is to have many instances of network.xml with different data. How do I insert them and alter the data inside? I did research on Google, but without success. Please ignore the hardcoded strings and dimensions, I'll fix that.
EDIT: I need to add the children programmatically, not in XML, because the number of network.xml instances will vary depending on user settings.
IN XML
To Include multiple layouts you should use include element in the parent layout to referring to child layouts
IN CODE (PROGRAMATICALLY)
In the onCreateView function where you get the root View try to get the container layout like this
LinearLayout layout = (LinearLayout) rootView.findViewById(R.id.networkContainer);
and then in that linear layout create and add the instances of the other views you want to add like this
to get the View for the child Layout use LayoutInflator
layout.addView(newView);
and finally return the parent View
Related
I have two very similar Android layouts:
default_spinner.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:minHeight="#dimen/settings_line_min_height"
android:orientation="horizontal"
android:paddingLeft="#dimen/common_padding"
android:paddingRight="#dimen/common_padding">
<TextView
android:id="#id/label"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1" />
<ImageButton
android:id="#+id/down_spinner_btn"
style="#style/SpinnerDownButton"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
<EditText
android:id="#+id/edit_box"
style="#style/EditableSpinnerText"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:inputType="number"
android:imeOptions="actionDone"
android:longClickable="false" />
<ImageButton
android:id="#+id/up_spinner_btn"
style="#style/SpinnerUpButton"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
</LinearLayout>
and
custom_spinner.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="#dimen/common_padding"
android:paddingRight="#dimen/common_padding">
<TextView
android:id="#id/label"
style="#style/Subhead.Translucent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1" />
<ImageButton
android:id="#+id/down_spinner_btn"
style="#style/SpinnerDownButton"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
<com.company.CustomEditText
android:id="#+id/edit_box"
style="#style/EditableSpinnerText"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:inputType="text" />
<ImageButton
android:id="#+id/up_spinner_btn"
style="#style/SpinnerUpButton"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
</LinearLayout>
As you can see, the only difference between the two is that the second one has a custom implementation of the EditText class.
In some classes, I load the default spinner:
View view = inflater.inflate(R.layout.default_spinner, parent, false);
And in other classes, I load the custom spinner:
View view = inflater.inflate(R.layout.custom_spinner, parent, false);
This all works fine, but the inefficiency bothers me.
I know it's possible to reuse layout elements in Android using the <import /> command... however, I'm not sure if that would be applicable here. Since a majority of both of these layouts is the same, I'd like to consolidate the identical code and just have it use either the CustomEditText or EditText class, depending on the situation.
Does anyone have an idea of how I could reuse the outer elements of these layouts and eliminate all of that duplication?
Yes, there is. In this case, you can have a single layout file with a ViewStub in place of EditText/CustomEditText. Like this:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="#dimen/common_padding"
android:paddingRight="#dimen/common_padding">
<TextView
android:id="#id/label"
style="#style/Subhead.Translucent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1" />
<ImageButton
android:id="#+id/down_spinner_btn"
style="#style/SpinnerDownButton"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
<ViewStub
android:id="#+id/view_stub"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1" />
<ImageButton
android:id="#+id/up_spinner_btn"
style="#style/SpinnerUpButton"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
</LinearLayout>
Then, in your Java code, you will lazily inject the EditText of your choice:
ViewStub viewStub = (ViewStub) findViewById(R.id.view_stub);
viewStub.setLayoutResource(someCondition ? R.layout.custom_edit_text : R.layout.regular_edit_text);
viewStub.inflate();
As you can see, you'll have two more layout files for each EditText:
custom_edit_text.xml
<com.company.CustomEditText
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/edit_box"
style="#style/EditableSpinnerText"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:inputType="text" />
regular_edit_text.xml
<EditText
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/edit_box"
style="#style/EditableSpinnerText"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:inputType="text" />
I think, the best way is to use single layout adding different views programmatically. That's how it would be easier to support in future.
Sorry for the long question..
I have Relativelayout of elements I am adding dynamically into Linearlayout of Horizontalscrollview.
When I see the layout the preview seems great, but when I am adding it programmatically it ruins the view.. the Text moved to another locations on the layout, and the padding is ignored..
This is the Relativelayout element deal_layout.xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="310dp"
android:layout_height="wrap_content"
android:layout_marginEnd="15dp"
android:layout_marginRight="15dp"
android:id="#+id/deal_layout"
>
<ImageView
android:layout_width="310dp"
android:layout_height="130dp"
android:src="#drawable/deal_square"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:contentDescription="deals background" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:paddingTop="25dp"
android:id="#+id/from_to_deals_txt"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="from "
android:textAppearance="#style/from_to_deals"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Source"
android:textAppearance="#style/source_deals"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" to "
android:textAppearance="#style/from_to_deals"
/>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="destination"
android:textAppearance="#style/dst_deals"
android:layout_below="#id/from_to_deals_txt"
android:layout_alignRight="#id/from_to_deals_txt"
android:paddingTop="10dp"
android:id="#+id/dst_deals_txt"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1099 X"
android:textAppearance="#style/price_deals"
android:layout_below="#id/dst_deals_txt"
android:layout_alignRight="#id/from_to_deals_txt"
android:layout_alignEnd="#id/from_to_deals_txt"
android:paddingTop="10dp"
android:id="#+id/price_deal_txt"
/>
<ImageView
android:layout_width="150dp"
android:layout_height="150dp"
android:src="#drawable/ic_launcher"
android:background="#000000"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
/>
</RelativeLayout>
This is the Horizontal scroll view:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:background="#drawable/bg"
android:padding="10dp">
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/dealsView"
android:paddingTop="10dp"
>
</LinearLayout>
</HorizontalScrollView>
</LinearLayout>
I am adding the Relativelayout elements with this java function:
LinearLayout dealsView;
dealsView = (LinearLayout)findViewById(R.id.dealsView);
for(int i=0;i<5;i++)
{
LayoutInflater mInflater ;
mInflater = LayoutInflater.from(this);
View cur_deal = mInflater.inflate(R.layout.deal_layout, null);
dealsView.addView(cur_deal);
}
In the preview it looks like this:
On the application it looks like this:
Does anyone has idea what am I doing wrong?
When I am adding the elements with copy paste to the linearlayout it seems great, and the margin is works fine, only from the code it not works..
Thanks!
Instead of passing null to the inflater, pass the Views intended parent (dealsView) so that the LayoutParams from the root can be used to inflate.
View cur_deal = mInflater.inflate(R.layout.deal_layout, dealsView, false);
I believe the issue is caused by all of your Views using width="wrap_content" but without the inflater knowing the root it cannot properly inflate that value.
I have a relative layout with transparent background and a some views arranged in the middle, i inflate this layout and add it to the main layout with addView(), the inflated view just adds the middle elements in the corner to the parent layout, how can i make the added view occupy all the screen (tried fill_parent but it just gets ignored)
This is the view i inflate
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#android:color/transparent" >
<RelativeLayout
android:id="#+id/layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#color/info_bar_bg_color" >
<ImageView
android:id="#+id/channel_pic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true" />
<TextView
android:id="#+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toRightOf="#id/channel_pic"
android:ellipsize="end"
android:maxLines="2"
android:textColor="#color/title_color"
android:textSize="#dimen/title_text_size" />
<TextView
android:id="#+id/date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/title"
android:ellipsize="end"
android:maxLines="1"
android:textColor="#color/date_color"
android:textSize="#dimen/date_text_size" />
<TextView
android:id="#+id/hourStart"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/date"
android:textColor="#color/title_color"
android:textSize="#dimen/title_text_size" />
<TextView
android:id="#+id/hourEnd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="#id/hourStart"
android:textColor="#color/title_color"
android:textSize="#dimen/title_text_size" />
<ImageView
android:id="#+id/share_pic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:src="#drawable/epgshare_0" />
<ImageView
android:id="#+id/bell_pic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#id/share_pic"
android:src="#drawable/epgsharebell_0" />
</RelativeLayout>
</RelativeLayout>
and this is the main layout i add the view to
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/ic_launcher"
tools:context=".MainActivity" >
<Button
android:id="#+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:onClick="openInfoBar"
android:text="Open InfoBar" />
</RelativeLayout>
i inflate this layout and add it to the main layout with addView(),
the inflated view just adds the middle elements in the corner to the
parent layout,
That is happening(most likely) because you don't setup the proper LayoutParams for the inflated layout view. You probably use something like this:
View v = inflater.inflate(R.layout.to_fill_parent, null);
which combined with the simple addView(v) method will make the view behave like you see.
The correct way would be:
View v = inflater.inflate(R.layout.to_fill_parent, (ViewGroup)findViewById(R.id.layout), false);
//add the view with addView
Change the :
<RelativeLayout
android:id="#+id/layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#color/info_bar_bg_color" >
such as :
android:layout_width="500dp"
android:layout_height="600dp"
You must try another numbers not the 500 and 600 ,,,, when you have the best size save it ^_^
I am trying to add elements to my scrollview,
this scroll view has a vertical linear layout inside of it.
(i added another linear layout - horizontl, inside that will manage 2 textviews and an image according to the attributes i assigned them),
i am trying to add elements of this inner layout to my scroll view (id=insideLineLayout)
(each element added to scrollview will contain these 2 texts and an image)
because of the fact scrollview can only have 1 child i am unable to do this.
would appreciate some help, nothing seems to be working here.
Thanks.
my current xml code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/searchScreenOuterLinearLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<TextView
android:id="#+id/catagoryselectedText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="70dp"
android:text="selected catagory"
android:textSize="20dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="12dp"
android:orientation="horizontal" >
<EditText
android:id="#+id/searchText"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp" />
<ImageButton
android:id="#+id/searchButton"
android:layout_width="50dp"
android:layout_height="40dp"
android:background="#drawable/search_icon" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="10dp"
android:orientation="horizontal" >
<TextView
android:id="#+id/radiusText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:paddingTop="5dp"
android:text="Search Radius"
android:textAppearance="?android:attr/textAppearanceMedium" />
<SeekBar
android:id="#+id/radiusBar"
android:layout_width="140dp"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp" />
</LinearLayout>
<ScrollView
android:id="#+id/searchScrollView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:id="#+id/searchScrollViewLinear"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:paddingTop="10dp" >
<LinearLayout
android:id="#+id/insideLineLayout"
android:layout_width="fill_parent"
android:layout_height="30dp"
android:orientation="horizontal"
android:weightSum="100"
>
<TextView
android:id="#+id/linesPrice"
android:layout_weight="20"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="tmp1"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/linesInfo"
android:layout_weight="60"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:text="tmp2"
android:textAppearance="?android:attr/textAppearanceMedium" />
<ImageView
android:id="#+id/imageInfo"
android:layout_width="40dp"
android:layout_height="match_parent"
android:background="#drawable/tv_icon" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
Consider how long your list can get as ListView has been optimized in many ways which a regular scroll view is not. If you have too many elements you might start get out of memory exceptions.
In order to dynamically add views to a ScrollView you first need to get the container view inside the ScrollView (most likely a LinearLayout), then you simply do following for each view you add:
View view = inflater.inflate(R.layout.view_to_add, container, false); // this is used if you create from xml, if you make it in code you'd use the regular constructor.
// update the view content (view.findViewById(); etc.)
container.addView(view);
I'm trying to make a layout in Android with Fragments. I started to use Commonsware's MergeAdapter but I'm having a weird bit of trouble. The layout worked fine before, but now I get this:
http://img856.imageshack.us/img856/2796/layoutbug.png
There are a couple problems: The white strip should have text going all the way across its length. I set the TextView with a white background to make sure the width was being set correctly. The checkbox right below it should also say "Issue?" but it's trying to wrap the text for some reason.
Here is the layout code that is being added:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Instructions" />
<TextView android:id="#+id/tvInstructions" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Instructions go here" android:textSize="32dp" android:background="#FFFFFF"></TextView>
<LinearLayout android:layout_height="wrap_content" android:layout_width="match_parent" android:orientation="horizontal" android:paddingTop="24dp">
<CheckBox android:id="#+id/cbIssues" android:layout_height="wrap_content" android:layout_weight="1" android:layout_width="0dp" android:text="Issues?" />
<TextView android:id="#+id/tvStation" android:layout_height="wrap_content" android:layout_width="0dp" android:layout_weight=".5" android:text="Station:" />
<Spinner android:id="#+id/spStation" android:layout_height="wrap_content" android:layout_width="0dp" android:layout_weight=".5"/>
</LinearLayout>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Pending data" />
</LinearLayout>
and here's how I'm inflating it inside the Fragment's onActivityCreated:
LayoutInflater inflater = (LayoutInflater)getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
MergeAdapter _adapter = new MergeAdapter();
View observationHeaderView = inflater.inflate(R.layout.observationheader, getListView(), false);
_adapter.addView(observationHeaderView);
I get a feeling it has something to do with how I'm inflating the layout. Any help would be appreciated. Thanks.
Don't use match_parent for android:layout_height for something going into an AdapterView, such as your root LinearLayout.
You might also consider temporarily putting your header layout outside the ListView (e.g., in a vertical LinearLayout also holding the ListView) and get it debugged before adding the complication of having it in the ListView.
Beyond that, fire up Hierarchy View (Eclipse perspective or standalone edition) and try to figure out where your layout rules are going wrong.
Also, I am uncertain how well your Spinners will work inside of a ListView on Honeycomb.
It appears my problem was with layout_width being match_parent in certain places in my header, when it should have been wrap_content. The following worked:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Instructions" />
<TextView android:id="#+id/tvInstructions" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Instructions go here" android:textSize="32dp" android:background="#FFFFFF"></TextView>
<LinearLayout android:layout_height="wrap_content" android:layout_width="match_parent" android:orientation="horizontal" android:paddingTop="24dp">
<CheckBox android:id="#+id/cbIssues" android:layout_height="wrap_content" android:layout_weight="1" android:layout_width="wrap_content" android:text="Issues?" />
<TextView android:id="#+id/tvStation" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_weight=".5" android:text="Station:" />
<Spinner android:id="#+id/spStation" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_weight=".5"/>
</LinearLayout>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Pending data" />
</LinearLayout>