Seekbar too little - java

I'm following an example in my book, but I can't get the seekbar in the said example to be large enough as the book shows and even the example code from the book site shows.
this is the layout declaration and the concerned row. Do you know what is the difference related to?
Expected Result and given result (yes the book was made for 2.3):
http://i.stack.imgur.com/9QT9j.png
http://i.stack.imgur.com/J7Cpr.png
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/tableLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFF"
android:padding="5dp"
android:stretchColumns="1,2,3" >
<TableRow
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:id="#+id/tableRow0">
<TextView
android:id="#+id/billTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/billTotal"
android:textColor="#000"
android:gravity="right"
android:paddingRight="5dp" />
<EditText
android:id="#+id/billEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_span="3"
android:inputType="numberDecimal"
android:layout_weight="1">
</EditText>
</TableRow>
<TableRow
android:id="#+id/tableRow1"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/tenTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:textColor="#000"
android:gravity="center"
android:layout_weight="1"
android:text="10%" />
<TextView
android:id="#+id/fifteenTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="15%"
android:textColor="#000"
android:gravity="center"
android:layout_weight="1"/>
<TextView
android:id="#+id/twentyTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="20%"
android:textColor="#000"
android:gravity="center"
android:layout_weight="1"/>
</TableRow>
<TableRow
android:id="#+id/tableRow2"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/tipTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:paddingRight="5dp"
android:text="#string/tip" />
<EditText
android:id="#+id/tip10EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:longClickable="false"
android:text="#string/zero" />
<EditText
android:id="#+id/tip15EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:focusable="false"
android:longClickable="false"
android:text="#string/zero" />
<EditText
android:id="#+id/tip20EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:focusable="false"
android:longClickable="false"
android:text="#string/zero" />
</TableRow>
<TableRow
android:id="#+id/tableRow3"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/totalTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:paddingRight="5dp"
android:text="#string/total" />
<EditText
android:id="#+id/total10EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:focusable="false"
android:longClickable="false"
android:text="#string/zero" />
<EditText
android:id="#+id/total15EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:focusable="false"
android:longClickable="false"
android:text="#string/zero" />
<EditText
android:id="#+id/total20EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:focusable="false"
android:longClickable="false"
android:text="#string/zero" />
</TableRow>
<TableRow
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:id="#+id/tableRow4">
<TextView
android:id="#+id/customTextView"
android:layout_width="wrap_content"
android:text="#string/custom"
android:textColor="#000"
android:paddingRight="5dp"
android:gravity="right|center_vertical"
android:layout_height="match_parent"
android:paddingBottom="5dp"
android:focusable="false"/>
<SeekBar
android:id="#+id/customSeekBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_span="2"
android:layout_weight="1"
android:paddingBottom="5dp"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:progress="18" />
<TextView
android:id="#+id/customTipTextView"
android:layout_width="wrap_content"
android:text="18%"
android:textColor="#000"
android:gravity="center_vertical"
android:layout_height="match_parent"
android:paddingLeft="5dp"
android:paddingBottom="5dp"
android:focusable="false"
android:layout_weight="1"
/>
</TableRow>
<TableRow
android:id="#+id/tableRow5"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/tipCustomTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:paddingRight="5dp"
android:text="#string/tip" />
<EditText
android:id="#+id/tipCustomEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:focusable="false"
android:longClickable="false"
android:text="#string/zero" />
<TextView
android:id="#+id/totalCustomTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:layout_weight="1"
android:paddingRight="5dp"
android:text="#string/total" />
<EditText
android:id="#+id/totalCustomEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:focusable="false"
android:longClickable="false"
android:text="#string/zero" />
</TableRow>
</TableLayout>

Related

How to create Sticky Header in a ScrollingActivity

I used ScrollActivity that comes in android studio to create a cool animation while scrolling. The ScrollActivity came with two xml files which are content_scrolling.xml and activity_scrolling.xml. I would like to create sticky headers inside the content_scrolling.xml. I created sticky headers before but the problem I am having is that the header does not "stick" right under the image where I'd like it to instead it sticks on top of the screen which is blocked by the image. I have provided an image of what I am trying to accomplish and I hope it helps understand what I am trying to do. Thank you!
activity_scrolling.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.myapplication.foodapp.ScrollingActivity">
<android.support.design.widget.AppBarLayout
android:id="#+id/app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:theme="#style/AppTheme.PopupOverlay">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/toolbar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<ImageView
android:id="#+id/imageView2"
android:layout_width="match_parent"
android:layout_height="545dp"
android:layout_alignParentTop="true"
android:scaleType="fitXY"
android:src="#mipmap/food1"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Chipotle Chicken Fajitas"
android:textSize="27sp"
android:layout_gravity="bottom"
android:layout_marginBottom="40dp"
android:layout_marginLeft="5dp"
android:textColor="#fff"
android:id="#+id/first_food_title"/>
<me.grantland.widget.AutofitTextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="16 ingredients | 284 Calories | 1 hour"
android:singleLine="true"
android:textAlignment="center"
android:textColor="#fff"
android:layout_gravity="bottom"
android:textSize="20sp"
android:id="#+id/spec_text"/>
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="200dp"
app:layout_collapseMode="pin"
/>
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:src="#mipmap/arrow"
android:id="#id/back_Arrow"
android:layout_marginTop="5dp"
android:layout_marginLeft="5dp"
/>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
</android.support.design.widget.CoordinatorLayout>
content_scrolling.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView
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"
xmlns:app="http://schemas.android.com/apk/res-auto"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
tools:context="com.myapplication.foodapp.ScrollingActivity"
android:id="#+id/nested_scroll_view">
<RelativeLayout
android:id="#+id/relative_layout1"
android:layout_width="match_parent"
android:layout_height="2000dp"
android:background="#fff">
<me.grantland.widget.AutofitTextView
android:id="#+id/spec_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="16 ingredients | 284 Calories | 1 hour"
android:textAlignment="center"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#fff"
android:textSize="20sp"
android:layout_alignBottom="#+id/imageView2"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
app:sizeToFit="true"/>
<View
android:layout_width="wrap_content"
android:layout_height="55dp"
android:background="#2C7873"
android:layout_below="#+id/imageView2"
android:layout_alignRight="#+id/imageView3"
android:layout_alignEnd="#+id/imageView3"
android:id="#+id/ingredient_view"
/>
<ImageView
android:layout_width="70dp"
android:layout_height="50dp"
android:id="#+id/imageView3"
android:src="#drawable/servings"
android:layout_alignBottom="#+id/relativeLayout"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Ingredients"
android:textColor="#fff"
android:textSize="24sp"
android:textStyle="bold"
android:paddingLeft="5dp"
android:paddingTop="15dp"
android:layout_below="#+id/imageView2"
android:layout_alignRight="#+id/imageView3"
android:layout_alignEnd="#+id/imageView3"
/>
<TextView
android:id="#+id/bullet_one"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:paddingTop="5px"
android:text="#string/_1_lb_boneless_skinless_chicken_breasts_cut_into_thin_strips"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_below="#+id/imageView3"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<TextView
android:id="#+id/bullet_two"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/bullet_one"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="#string/_1_tsp_ground_cumin"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/bullet_three"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/bullet_two"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="#string/_1_tsp_chili_powder"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/bullet_four"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/bullet_three"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="#string/kosher_salt"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/bullet_five"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/bullet_four"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="#string/freshly_ground_black_pepper"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/bullet_six"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/bullet_five"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="#string/_1_tbsp_canola_oil"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/bullet_seven"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/bullet_six"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="#string/_1_red_bell_pepper_sliced"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/bullet_eight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/bullet_seven"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="#string/_1_small_onion_sliced"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/bullet_nine"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/bullet_eight"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="#string/_1_c_sliced_mushrooms"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/bullet_ten"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/bullet_nine"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="#string/_3_garlic_cloves_chopped"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/bullet_elven"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/bullet_ten"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="#string/_1_tbsp_chopped_chipotles_in_adobo"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/bullet_twelve"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/bullet_ten"
android:layout_marginTop="29dp"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="#string/_1_1_2_tbsp_fresh_lime_juice"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/bullet_thirteen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/bullet_twelve"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="#string/_8_warm_flour_tortillas"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/bullet_fithteen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/bullet_thirteen"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="#string/cilantro_for_serving"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/bullet_sixteen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/bullet_fithteen"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="#string/lime_wedges_for_serving"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/bullet_fourteen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/bullet_sixteen"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="#string/grated_cheddar_cheese_for_serving"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textView23"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="5dp"
android:paddingLeft="5dp"
android:paddingTop="10dp"
android:text="View Directions"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="15sp"
android:layout_below="#+id/bullet_fourteen"
/>
<View
android:layout_width="wrap_content"
android:layout_height="55dp"
android:background="#2C7873"
android:layout_below="#+id/textView23"
android:layout_alignRight="#+id/imageView3"
android:layout_alignEnd="#+id/imageView3"
android:id="#+id/view2"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:tag="sticky"/>
<TextView
android:id="#+id/textView15"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:paddingTop="10dp"
android:text="Nutrition Facts"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#fff"
android:textSize="24sp"
android:textStyle="bold"
android:layout_alignTop="#+id/view2"
android:layout_alignLeft="#+id/textView23"
android:layout_alignStart="#+id/textView23" />
<TextView
android:id="#+id/textView16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:text="View More"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#fff"
android:textSize="15sp"
android:layout_alignBottom="#+id/textView15"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_marginBottom="5dp"
android:layout_marginRight="5dp" />
<RelativeLayout
android:id="#+id/relativeLayout4"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#fff"
android:paddingEnd="15dp"
android:paddingStart="30dp"
android:layout_below="#+id/view2"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<ImageView
android:id="#+id/imageView18"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/protein" />
<ImageView
android:id="#+id/imageView19"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toEndOf="#+id/imageView18"
android:layout_toRightOf="#+id/imageView18"
android:src="#drawable/sodium" />
<ImageView
android:id="#+id/imageView20"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toEndOf="#+id/imageView19"
android:layout_toRightOf="#+id/imageView19"
android:src="#drawable/fats" />
<ImageView
android:id="#+id/imageView21"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_toEndOf="#+id/imageView20"
android:layout_toRightOf="#+id/imageView20"
android:src="#drawable/sugars" />
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="#2C7873"
android:layout_below="#+id/relativeLayout4"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:id="#+id/view3"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:tag="sticky"/>
<TextView
android:id="#+id/textView19"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:text="Reviews"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#fff"
android:textSize="24sp"
android:textStyle="bold"
android:layout_alignBottom="#+id/view3"
android:layout_alignLeft="#+id/textView15"
android:layout_alignStart="#+id/textView15" />
<RatingBar
android:id="#+id/ratingBar"
android:layout_width="230dp"
android:layout_height="35dp"
android:clickable="false"
android:numStars="5"
android:scaleX=".5"
android:scaleY=".5"
android:layout_alignTop="#+id/textView19"
android:layout_alignRight="#+id/textView16"
android:layout_alignEnd="#+id/textView16"
android:layout_marginTop="-5dp" />
<TextView
android:id="#+id/display_review"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#f1fcf0"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="20sp"
android:layout_below="#+id/view3"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
</RelativeLayout>
</android.support.v4.widget.NestedScrollView>

Android Studio. Align multiple text boxes under multiple check boxes and equal spacing to fit screen

This is what i am trying to achieve
But
this is what i get when uploaded on phone.
It seems ok in android studio fragment design preview but when uploaded on phone
checkboxes are not displayed :(.
Any better solutions?
Below is full xml code.
<?xml version="1.0" encoding="utf-8"?>
<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"
android:fitsSystemWindows="false"
tools:context=".MainFragment">
<TextView
android:id="#+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:autoText="false"
android:text="#string/getnotif"
android:layout_below="#+id/linearLayout5"
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp" />
<CheckBox
android:id="#+id/checkBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView"
android:layout_alignStart="#+id/textView"
android:layout_below="#+id/textView"
android:text="#string/mcall"
android:textSize="12sp" />
<CheckBox
android:id="#+id/checkBox2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textView"
android:layout_toEndOf="#+id/checkBox"
android:layout_toRightOf="#+id/checkBox"
android:text="#string/msms"
android:textSize="12sp" />
<Button
android:id="#+id/timePicker"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="00:00"
android:background="#3f51b5"
android:layout_alignTop="#+id/timePicker2"
android:layout_marginLeft="25dp"
android:layout_alignParentStart="true"
android:textColor="#ffffff" />
<Button
android:id="#+id/timePicker2"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="23:59"
android:background="#3f51b5"
android:layout_below="#+id/linearLayout4"
android:layout_alignParentLeft="false"
android:layout_alignParentStart="false"
android:layout_alignParentEnd="false"
android:layout_marginRight="25dp"
android:layout_alignParentRight="true"
android:textColor="#ffffff" />
<LinearLayout
android:id="#+id/linearLayout"
android:layout_width="wrap_content"
android:layout_height="20dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/timePicker"
android:layout_marginTop="20dp"
android:orientation="horizontal"
android:layout_alignParentEnd="true">
<TextView
android:id="#+id/textView8"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="0dp"
android:text="Days"
android:gravity="center" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/linearLayout"
android:orientation="horizontal"
android:layout_alignRight="#+id/linearLayout"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentEnd="true"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp">
<CheckBox
android:id="#+id/checkBox3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="false"
android:checked="false"
android:layout_weight="1"
android:text="#string/monday"
android:paddingLeft="-27dp"
android:paddingTop="40dp"
android:textSize="10dp" />
<CheckBox
android:id="#+id/checkBox4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="false"
android:layout_weight="1"
android:text="#string/tuesday"
android:paddingLeft="-26dp"
android:paddingTop="40dp"
android:textSize="10dp" />
<CheckBox
android:id="#+id/checkBox5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="false"
android:layout_weight="1"
android:text="#string/wednesday"
android:paddingLeft="-27dp"
android:paddingTop="40dp"
android:textSize="10dp" />
<CheckBox
android:id="#+id/checkBox6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="false"
android:layout_weight="1"
android:text="#string/thursday"
android:paddingLeft="-27dp"
android:paddingTop="40dp"
android:textSize="10dp" />
<CheckBox
android:id="#+id/checkBox7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="false"
android:layout_weight="1"
android:text="#string/friday"
android:paddingLeft="-24dp"
android:paddingTop="40dp"
android:textSize="10dp" />
<CheckBox
android:id="#+id/checkBox8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="false"
android:checked="false"
android:layout_weight="1"
android:text="#string/saturday"
android:paddingLeft="-25dp"
android:paddingTop="40dp"
android:textSize="10dp" />
<CheckBox
android:id="#+id/checkBox9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="false"
android:checked="false"
android:text="#string/sunday"
android:paddingLeft="-27dp"
android:paddingTop="40dp"
android:textSize="10dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:orientation="horizontal">
<Button
android:id="#+id/exitButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="#drawable/button_state"
android:text="Exit"
android:layout_weight="0.5"
android:layout_marginRight="16dp"
android:textColor="#ffffff" />
<Button
android:id="#+id/saveButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="#drawable/button_state"
android:text="Save"
android:layout_weight="0.5"
android:layout_marginLeft="16dp"
android:textColor="#ffffff" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="false"
android:layout_marginTop="20dp"
android:id="#+id/linearLayout4"
android:layout_alignParentEnd="false">
<TextView
android:id="#+id/textView7"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="#string/from"
android:layout_below="#+id/textView5"
android:layout_alignParentLeft="false"
android:layout_alignParentStart="false"
android:gravity="center"
android:layout_marginTop="20dp"
android:layout_marginLeft="25dp" />
<TextView
android:id="#+id/textView23"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="0dp"
android:text="Time"
android:gravity="center"
android:layout_weight="1" />
<TextView
android:id="#+id/textView6"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="#string/to"
android:layout_below="#+id/textView5"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:gravity="center"
android:layout_marginTop="20dp"
android:layout_marginRight="25dp" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout5"
android:layout_width="fill_parent"
android:layout_height="60dp"
android:orientation="horizontal"
android:layout_below="#+id/linearLayout2"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
</LinearLayout>
</RelativeLayout>
Set all your checkboxes with layout_weight=1 inside a LinearLayout. Set the Linear Layout's orientation to vertical.
<?xml version="1.0" encoding="utf-8"?>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Mon"
android:layout_weight="1"
android:id="#+id/checkBox"/>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Tue"
android:layout_weight="1"
android:id="#+id/checkBox2"/>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Wed"
android:layout_weight="1"
android:id="#+id/checkBox3"/>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Thu"
android:layout_weight="1"
android:id="#+id/checkBox4"/>
I have tested your design in an activity , it's displaying fine in full screen.
[![like this][1]][1]
[1]: http://i.stack.imgur.com/0B1hz.png
Make sure you have given Fragment width and height to match parent.
<Fragment
android:width="match_parent"
android:height="match_parent"
/>
New androidtudio preview
And
the result on phone
Bellow is code modified as you suggested.
<?xml version="1.0" encoding="utf-8"?>
<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"
android:fitsSystemWindows="false"
tools:context=".MainFragment">
<TextView
android:id="#+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:autoText="false"
android:text="#string/getnotif"
android:layout_below="#+id/linearLayout2"
android:layout_centerHorizontal="true" />
<CheckBox
android:id="#+id/checkBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView"
android:layout_alignStart="#+id/textView"
android:layout_below="#+id/textView"
android:text="#string/mcall"
android:textSize="12sp" />
<CheckBox
android:id="#+id/checkBox2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textView"
android:layout_toEndOf="#+id/checkBox"
android:layout_toRightOf="#+id/checkBox"
android:text="#string/msms"
android:textSize="12sp" />
<Button
android:id="#+id/timePicker"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="00:00"
android:background="#3f51b5"
android:layout_alignTop="#+id/timePicker2"
android:layout_marginLeft="25dp"
android:layout_alignParentStart="true"
android:textColor="#ffffff" />
<Button
android:id="#+id/timePicker2"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="23:59"
android:background="#3f51b5"
android:layout_below="#+id/linearLayout4"
android:layout_alignParentLeft="false"
android:layout_alignParentStart="false"
android:layout_alignParentEnd="false"
android:layout_marginRight="25dp"
android:layout_alignParentRight="true"
android:textColor="#ffffff" />
<LinearLayout
android:id="#+id/linearLayout"
android:layout_width="wrap_content"
android:layout_height="20dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/timePicker"
android:layout_marginTop="20dp"
android:orientation="horizontal"
android:layout_alignParentEnd="true">
<TextView
android:id="#+id/textView8"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="0dp"
android:text="Days"
android:gravity="center" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/linearLayout"
android:orientation="vertical"
android:layout_alignRight="#+id/linearLayout"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentEnd="true"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp">
<CheckBox
android:id="#+id/checkBox3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="MON"
android:layout_weight="1" />
<CheckBox
android:id="#+id/checkBox4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TUE"
android:layout_weight="1"/>
<CheckBox
android:id="#+id/checkBox5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="WED"
android:layout_weight="1" />
<CheckBox
android:id="#+id/checkBox6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="THU"
android:layout_weight="1" />
<CheckBox
android:id="#+id/checkBox7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="FRI"
android:layout_weight="1" />
<CheckBox
android:id="#+id/checkBox8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="SAT"
android:layout_weight="1"/>
<CheckBox
android:id="#+id/checkBox9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="SUN"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:orientation="horizontal">
<Button
android:id="#+id/exitButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="#drawable/button_state"
android:text="Exit"
android:layout_weight="0.5"
android:layout_marginRight="16dp"
android:textColor="#ffffff" />
<Button
android:id="#+id/saveButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="#drawable/button_state"
android:text="Save"
android:layout_weight="0.5"
android:layout_marginLeft="16dp"
android:textColor="#ffffff" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="false"
android:layout_marginTop="20dp"
android:id="#+id/linearLayout4"
android:layout_alignParentEnd="false">
<TextView
android:id="#+id/textView7"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="#string/from"
android:layout_below="#+id/textView5"
android:layout_alignParentLeft="false"
android:layout_alignParentStart="false"
android:gravity="center"
android:layout_marginTop="20dp"
android:layout_marginLeft="25dp" />
<TextView
android:id="#+id/textView23"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="0dp"
android:text="Time"
android:gravity="center"
android:layout_weight="1" />
<TextView
android:id="#+id/textView6"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="#string/to"
android:layout_below="#+id/textView5"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:gravity="center"
android:layout_marginTop="20dp"
android:layout_marginRight="25dp" />
</LinearLayout>
</RelativeLayout>
I didn't managed to align properly the text boxes under the check boxes.
I have inserted the layout into a scroll view and i can properly see all of them know.
It is good enough for me.

Android Scroll View last view not showing inside linear layout

I have created a Scroll view and it contains some Linear layouts that contains some views but issue is that the last view is not showing inside scroll view My Linear layout is not expending and android:fillViewport="true" is not working, i will post screen shot
MY Output is
MY XML CODE IS
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar_filters"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#2f3f9f"
android:minHeight="?attr/actionBarSize"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light"
app:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar" >
<TextView
android:id="#+id/toolbar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="FILTERS"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#color/white" />
</android.support.v7.widget.Toolbar>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true"
android:layout_below="#+id/toolbar_filters"
android:background="#202231" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#202231"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:background="#2a2d41"
android:orientation="horizontal"
android:weightSum="2" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical" >
<TextView
android:id="#+id/open_now"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingLeft="20dp"
android:paddingTop="5dp"
android:text="Opne Now"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<View
android:id="#+id/view_open_now"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#2a2d41" />
<TextView
android:id="#+id/smoking_inside"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingLeft="20dp"
android:paddingTop="10dp"
android:text="Smoking Inside"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<View
android:id="#+id/view_smoking_inside"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#2a2d41" />
<TextView
android:id="#+id/shots"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingLeft="20dp"
android:paddingTop="10dp"
android:text="Shots"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<View
android:id="#+id/view_shots"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#2a2d41" />
<TextView
android:id="#+id/vvip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingLeft="20dp"
android:paddingTop="10dp"
android:text="VVIP"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<View
android:id="#+id/view_vvip"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#2a2d41" />
<TextView
android:id="#+id/terrace"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingLeft="20dp"
android:paddingTop="10dp"
android:text="Terrace"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<View
android:id="#+id/view_terrace"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#2a2d41" />
</LinearLayout>
<View
android:id="#+id/view_vertical"
android:layout_width="2dp"
android:layout_height="match_parent"
android:background="#2a2d41" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical" >
<TextView
android:id="#+id/karoake"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingLeft="20dp"
android:paddingTop="5dp"
android:text="Karaoke"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<View
android:id="#+id/view_karoake"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#2a2d41" />
<TextView
android:id="#+id/cigar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingLeft="20dp"
android:paddingTop="10dp"
android:text="Cigar"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<View
android:id="#+id/view_cigar"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#2a2d41" />
<TextView
android:id="#+id/vip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingLeft="20dp"
android:paddingTop="10dp"
android:text="VIP"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<View
android:id="#+id/view_vip"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#2a2d41" />
<TextView
android:id="#+id/sea_side"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingLeft="20dp"
android:paddingTop="10dp"
android:text="Sea Side"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<View
android:id="#+id/view_sea_side"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#2a2d41" />
<TextView
android:id="#+id/swimming_pool"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingLeft="20dp"
android:paddingTop="10dp"
android:text="Swimming Pool"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<View
android:id="#+id/view_swimming_pool"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#2a2d41" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/music_selection_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:background="#2a2d41"
android:orientation="horizontal" >
<TextView
android:id="#+id/filter_music"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:gravity="left"
android:text="Music"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<TextView
android:id="#+id/filter_music_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:gravity="right"
android:paddingRight="8dp"
android:text="(0)"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#color/white" />
<TextView
android:id="#+id/filter_music_fonts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:gravity="right"
android:paddingRight="8dp"
android:text=">"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#color/white" />
</LinearLayout>
<LinearLayout
android:id="#+id/cuisine_layouts"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:background="#2a2d41"
android:orientation="horizontal" >
<TextView
android:id="#+id/filter_cuisines"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:gravity="left"
android:text="Cuisines"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<TextView
android:id="#+id/filter_cuisines_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:gravity="right"
android:paddingRight="8dp"
android:text="(0)"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#color/white" />
<TextView
android:id="#+id/filter_cuisines_fonts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:gravity="right"
android:paddingRight="8dp"
android:text=">"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#color/white" />
</LinearLayout>
<LinearLayout
android:id="#+id/outlet_type_layouts"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:background="#2a2d41"
android:orientation="horizontal" >
<TextView
android:id="#+id/filter_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:gravity="left"
android:text="Type"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<TextView
android:id="#+id/filter_type_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:gravity="right"
android:paddingRight="8dp"
android:text="(0)"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#color/white" />
<TextView
android:id="#+id/filter_type_fonts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:gravity="right"
android:paddingRight="8dp"
android:text=">"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#color/white" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:background="#2a2d41"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="#+id/filter_cover_charges_upto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:gravity="left"
android:text="COVER CHARGES UPTO"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<View
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1" />
<TextView
android:id="#+id/filter_cover_charges_upto_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:background="#drawable/back"
android:gravity="left"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:text="50"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="#+id/seekBar_value_min"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginTop="5dp"
android:gravity="top"
android:text="0"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#color/white" />
<SeekBar
android:id="#+id/seekBar1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:max="999" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:gravity="top"
android:text="999"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#color/white" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:background="#2a2d41"
android:orientation="horizontal" >
<TextView
android:id="#+id/filter_guest_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:gravity="left"
android:text="GUESTLIST UPTO"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:gravity="right"
android:paddingRight="2dp"
android:text="23:30"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<TextView
android:id="#+id/filter_arrow_fonts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:gravity="right"
android:paddingRight="8dp"
android:text=">"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#color/white" />
</LinearLayout>
</LinearLayout>
</ScrollView>
<LinearLayout
android:id="#+id/wrapper_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:orientation="horizontal" >
<Button
android:id="#+id/activate_plans_btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#2f3f9f"
android:text="SUBMIT"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#ffffff" />
</LinearLayout>
</RelativeLayout>
Change height of ScrollView to wrap content or you can also put your ScrollView and the last LinearLayout into another LinearLayout having vertical orientation with fill_parent dimensions and add the weight property to both of them.
Try this for your last Linear Layout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginBottom="20dp"
android:background="#2a2d41"
android:orientation="horizontal" >
<TextView
android:id="#+id/filter_guest_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:gravity="left"
android:text="GUESTLIST UPTO"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:gravity="right"
android:paddingRight="2dp"
android:text="23:30"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<TextView
android:id="#+id/filter_arrow_fonts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:gravity="right"
android:paddingRight="8dp"
android:text=">"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#color/white" />
</LinearLayout>

I want to set my spinner in this layout with dropdown triangle icon

This is my spinner layout and I'm setting the spinner inside the table layout in second row. I'm wrapping the spinner and giving manually height and width to it. When i set its weight and height to wrap content it's layout make a issues.
so i want to set the spinner in this layout with drop-down arrow also.
<TableLayout
android:id="#+id/details"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#color/list_divider"
android:orientation="vertical"
android:stretchColumns="*" >
<TableRow
android:id="#+id/row1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="2dp"
android:layout_weight="1"
android:background="#ffffff"
android:gravity="center"
android:padding="5dp"
android:text="Lot Qty."
android:textSize="18sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="2dp"
android:layout_weight="1"
android:background="#ffffff"
android:gravity="center"
android:padding="5dp"
android:text="Lot Size"
android:textSize="18sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#ffffff"
android:gravity="center"
android:padding="5dp"
android:text="Unit Price"
android:textSize="18sp" />
</TableRow>
<TableRow
android:id="#+id/row2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Spinner
android:id="#+id/lot_qty_spinner"
android:layout_width="70dp"
android:layout_height="39dp"
android:layout_marginRight="2dp"
android:background="#ffffff"
android:popupBackground="#DFFFFFFF" />
<TextView
android:id="#+id/size"
android:layout_width="wrap_content"
android:layout_height="39dp"
android:layout_marginRight="2dp"
android:background="#ffffff"
android:gravity="center"
android:text="size"
android:textColor="#000000"
android:textSize="20sp" />
<TextView
android:id="#+id/unit_price"
android:layout_width="wrap_content"
android:layout_height="39dp"
android:layout_weight="1"
android:background="#ffffff"
android:gravity="center"
android:textColor="#000000"
android:textSize="20sp" />
</TableRow>
</TableLayout>
You need to remove background color from background.
Remove android:background="#ffffff"
Try with this.
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/details"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#ffffff"
android:orientation="vertical"
android:background="#color/list_divider"
android:stretchColumns="*" >
<TableRow
android:id="#+id/row1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="2dp"
android:layout_weight="1"
android:gravity="center"
android:padding="5dp"
android:text="Lot Qty."
android:textSize="18sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="2dp"
android:layout_weight="1"
android:gravity="center"
android:padding="5dp"
android:text="Lot Size"
android:textSize="18sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:padding="5dp"
android:text="Unit Price"
android:textSize="18sp" />
</TableRow>
<TableRow
android:id="#+id/row2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Spinner
android:id="#+id/lot_qty_spinner"
android:layout_width="70dp"
android:layout_height="39dp"
android:layout_marginRight="2dp"
android:popupBackground="#DFFFFFFF" />
<TextView
android:id="#+id/size"
android:layout_width="wrap_content"
android:layout_height="39dp"
android:layout_marginRight="2dp"
android:gravity="center"
android:text="size"
android:textColor="#000000"
android:textSize="20sp" />
<TextView
android:id="#+id/unit_price"
android:layout_width="wrap_content"
android:layout_height="39dp"
android:layout_weight="1"
android:gravity="center"
android:textColor="#000000"
android:textSize="20sp" />
</TableRow>
</TableLayout>

Admob integration in my app

I'm trying to add admob into my android app, but I keep having this error in eclipse:
Element type "com.admob.android.ads.AdView" must be followed by either attribute specifications,
">" or "/>".
The code is:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:myapp="http://schemas.android.com/apk/res/com.example.SampleApp"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.admob.android.ads.AdView android:id="#+id/ad"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
myapp:backgroundColor="#000000"
myapp:primaryTextColor="#FFFFFF"
myapp:secondaryTextColor="#CCCCCC"</com.admob.android.ads.AdView>
</LinearLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/RelativeLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#00BFFF"
android:orientation="vertical"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<TextView
android:id="#+id/txt_stupnjevi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/txt_grad"
android:layout_below="#+id/txt_grad"
android:layout_marginTop="5dp"
android:textColor="#FFF"
android:textSize="40sp" />
<ImageView
android:id="#+id/img_glavna"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/linearLayout1"
android:layout_below="#+id/txt_stupnjevi"
android:layout_centerHorizontal="true"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:adjustViewBounds="true"
android:src="#drawable/img01d" />
<TextView
android:id="#+id/txt_grad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/img_glavna"
android:layout_alignParentTop="true"
android:textColor="#FFF"
android:textSize="35sp" />
<ProgressBar
android:id="#+id/progressBar1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:indeterminate="true"
android:visibility="gone" />
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:baselineAligned="false"
android:weightSum="3" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical" >
<TextView
android:id="#+id/txt_dan1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:maxLength="3"
android:paddingTop="10dp"
android:textColor="#FFF"
android:textSize="20sp" />
<ImageView
android:id="#+id/img_dan1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="#drawable/img01n" />
<TextView
android:id="#+id/txt_stupnjevi1"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:paddingBottom="10dp"
android:textColor="#FFF"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical" >
<TextView
android:id="#+id/txt_dan2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:maxLength="3"
android:paddingTop="10dp"
android:textColor="#FFF"
android:textSize="20sp" />
<ImageView
android:id="#+id/img_dan2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="#drawable/img11d" />
<TextView
android:id="#+id/txt_stupnjevi2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:textColor="#FFF"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical" >
<TextView
android:id="#+id/txt_dan3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:maxLength="3"
android:paddingTop="10dp"
android:textColor="#FFF"
android:textSize="20sp" />
<ImageView
android:id="#+id/img_dan3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="#drawable/img13n" />
<TextView
android:id="#+id/txt_stupnjevi3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:textColor="#FFF"
android:textSize="18sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/txt_stupnjevi"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/txt_grad"
android:layout_marginRight="16dp"
android:orientation="vertical"
android:weightSum="3" >
<TextView
android:id="#+id/txt_tlak"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_weight="1"
android:drawablePadding="10dip"
android:drawableRight="#drawable/e2"
android:gravity="center_vertical|center_horizontal"
android:textColor="#FFF"
android:textSize="18sp" />
<TextView
android:id="#+id/txt_vlaznost"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_weight="1"
android:drawablePadding="10dip"
android:drawableRight="#drawable/d1"
android:gravity="center_vertical|center_horizontal"
android:textColor="#FFF"
android:textSize="18sp" />
<TextView
android:id="#+id/txt_brzina"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_weight="1"
android:drawablePadding="10dip"
android:drawableRight="#drawable/wind"
android:gravity="center_vertical|center_horizontal"
android:textColor="#FFF"
android:textSize="18sp" />
</LinearLayout>
<TextView
android:id="#+id/txt_stanje"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/linearLayout1"
android:layout_centerHorizontal="true"
android:layout_marginBottom="10dp"
android:textColor="#FFF"
android:textSize="18sp" />
</RelativeLayout>
What I should do to solve this?
i got this error too:
The markup in the document following the root element must be well-formed.
Just replace
<com.admob.android.ads.AdView android:id="#+id/ad"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
myapp:backgroundColor="#000000"
myapp:primaryTextColor="#FFFFFF"
myapp:secondaryTextColor="#CCCCCC"></com.admob.android.ads.AdView>

Categories