Android Book Search App Search Results Layout Out Of Screen Occasionally - java

I was tasked to create a simple book searching app for Android as an internship project. I'm almost done with this, but I'm very bad at doing layouts. The published date and description will ALWAYS fly to the left and out of the screen if the ISBN number is 10 digits long, but it's perfectly fine when its just 13 digits long. Just for reference, I'm using the google books API. This would be much clearer if I could post pictures, but my rep is too low for that.
Here's my code:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
>
<ImageView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/img_cover"
android:layout_width="180dp"
android:layout_height="170dp"
android:src="#drawable/img_books_large"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:id="#+id/tvTitle"
android:text="Title"
android:layout_marginTop="20dp"
android:layout_alignParentTop="true"
android:layout_toRightOf="#+id/img_cover"
android:layout_toEndOf="#+id/img_cover" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Author"
android:id="#+id/tvAuthor"
android:layout_marginTop="25dp"
android:layout_below="#+id/tvTitle"
android:layout_toRightOf="#+id/img_cover"
android:layout_toEndOf="#+id/img_cover" />
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_below="#+id/img_cover"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="ISBN"
android:id="#+id/tvISBN"
android:layout_below="#+id/img_cover"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Publish Date"
android:id="#+id/tvPublishYear"
android:layout_below="#+id/tvISBN"
android:layout_marginTop="40dp"
android:layout_marginLeft="-220dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/tvDescription"
android:layout_marginTop="80dp"
android:layout_below="#+id/tvPublishYear"
android:layout_marginLeft="-270dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Description"
/>
</LinearLayout>
</ScrollView>
</RelativeLayout>
Thanks in advance

Nvm fixed it.
Just had to add
android:orientation="vertical"
to LinearLayout

Related

Layout larger than device screen causes app to crash

I am currently having an issue with a mobile app I am developing. The idea behind it being it displays the value of various variables from a passed object. As I have needed to add more and more objects to the layout xml file in order to display everything, the preview has since stopped displaying any objects besides the action bar and trying to start the activity using this layout crashes the app.
I have a feeling this may be due to the layout being larger than the virtual device screen, though there could be another cause i'm totally unaware of. Any help in this matter would be appreciated. This activity currently uses the Relative layout, would it resolve the issue to wrap the Relative layout in a Scrollview to make the activity scrollable?
<?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:paddingBottom="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="16dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Name"
android:id="#+id/RequestNameTextView"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<TextView
android:id="#+id/RequestNameDisplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/RequestNameTextView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_margin="10dp"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Student ID"
android:id="#+id/RequestStudentIDTextView"
android:layout_below="#+id/RequestNameDisplay"/>
<TextView
android:id="#+id/RequestStudentIDDisplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/RequestStudentIDTextView"
android:layout_margin="10dp"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/RequestLocationTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/RequestStudentIDDisplay"
android:text="Location"
android:textAppearance="?android:attr/textAppearanceMedium"
/>
<TextView
android:id="#+id/RequestLocationDisplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/RequestLocationTextView"
android:layout_margin="10dp"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/RequestProblemTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/RequestLocationDisplay"
android:text="Problem Description"
android:textAppearance="?android:attr/textAppearanceMedium"
/>
<TextView
android:id="#+id/RequestProblemDisplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/RequestProblemTextView"
android:layout_margin="10dp"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/RequestStatusTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/RequestProblemDisplay"
android:text="Current Status"
android:textAppearance="?android:attr/textAppearanceMedium"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/RequestStatusDisplay"
android:layout_below="#+id/RequestStatusTextView"
android:layout_margin="10dp"
android:textAppearance="?android:attr/textAppearanceMedium"/>
<TextView
android:id="#+id/RequestAssignmentTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/RequestStatusDropDown"
android:text="Assigned To"
android:textAppearance="?android:attr/textAppearanceMedium"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/RequestAssignmentDisplay"
android:layout_below="#+id/RequestAssignmentTextView"
android:layout_margin="10dp"
android:textAppearance="?android:attr/textAppearanceMedium"/>
<TextView
android:id="#+id/RequestStatusUpdateTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/RequestAssignmentDisplay"
android:text="Update Status to:"
android:textAppearance="?android:attr/textAppearanceMedium"
/>
<Spinner
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/RequestStatusDropDown"
android:layout_below="#+id/RequestStatusUpdateTextView"
android:layout_margin="10dp"
android:textAppearance="?android:attr/textAppearanceMedium"/>
<TextView
android:id="#+id/RequestAssignmentUpdateTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/RequestStatusDropDown"
android:text="Assign Request To:"
android:textAppearance="?android:attr/textAppearanceMedium"
/>
<Spinner
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/RequestAssignmentDropDown"
android:layout_below="#+id/RequestAssignmentUpdateTextView"
android:layout_margin="10dp"
android:textAppearance="?android:attr/textAppearanceMedium"/>
<Button
android:id="#+id/RequestSaveChangesButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:text="Save Changes" />
</RelativeLayout>
It is because your Relative Layout having Circular dependencies. From RequestAssignmentTextView to RequestStatusDropDown, your are having a circular dependency. Just change your 'below' element of RequestAssignmentTextView to avoid this error.

Android error: W/Ads: Not enough space to show ad. Needs 320x50 dp, but only has 384x0 dp

Others too have this issue, but mine is unique (I think) in that this error only occurs when I open the keyboard within the app like this. It does not happen when the keyboard is not opened.
Again, the error is:
W/Ads: Not enough space to show ad. Needs 320x50 dp, but only has 384x0 dp.
Here is the XML
<?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"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:orientation="vertical">
<EditText
android:id="#+id/input"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="Enter your Number"
android:textAlignment="center"
android:layout_gravity="center"
android:inputType="text"
android:ems="25"
android:textColor="#color/colorPrimary"
android:textSize="20sp"
android:maxLength="31"
android:layout_marginTop="30dp"
android:layout_marginBottom="45dp"/>
<TextView
android:id="#+id/from"
android:text="#string/from"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textColor="#color/colorPrimary"
android:textSize="16sp" />
<Spinner
android:id="#+id/spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:entries="#array/spinner_entries1"
android:background="#null"
android:layout_marginBottom="25dp"/>
<TextView
android:id="#+id/to"
android:text="#string/to"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textColor="#color/colorPrimary"
android:textSize="16sp" />
<Spinner
android:id="#+id/spinner2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="#null"
android:cursorVisible="false"
android:entries="#array/spinner_entries2"
android:layout_marginBottom="20dp"/>
<EditText
android:id="#+id/output"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAlignment="center"
android:layout_gravity="center"
android:inputType="text"
android:ems="25"
android:textColor="#color/colorPrimary"
android:textSize="20sp"
android:maxLength="31"
android:layout_marginBottom="30dp" />
<Button
android:id="#+id/button"
android:text="#string/button_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#color/colorPrimary"
android:textColor="#FFFFFF"
android:onClick="convert"
android:layout_gravity="center" />
<com.google.android.gms.ads.AdView
android:id="#+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
ads:adSize="BANNER"
ads:adUnitId="#string/admob_id"
android:layout_marginTop="50dp"
/>
</LinearLayout>
How do I go about fixing this?
EDIT: I wouldn't bother fixing this, because the ad returns back to normal when the keyboard goes away, BUT Views flicker when the keyboard 'touches' a view.
Fixed by adding
android:windowSoftInputMode="adjustPan"
to AndroidManifest.xml under <activity</>
Answer found here

not showing full text in textview in a fragment android

I developing an Android App in Eclipse and i'm using framelayout as a container to my fragment... and the fragment doesn't showing full text... half of the text is hiding...
Please help me out...!!!
Thanks in advance...
activty_main.xml `
<LinearLayout
android:layout_width="match_parent"
android:layout_height="200dp"
android:orientation="vertical">
<ScrollView
android:id="#+id/scrollView2"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<FrameLayout
android:id="#+id/fragment_place"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusable="true"/>
</ScrollView>
`
fragment_about.xml
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:padding="10dp">
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="About Us"
android:textColor="#F44336"
android:layout_gravity="center"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="30dp"/>
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#2196F3"
android:text=" Our vision is to interrelate the old and present students of college with each other and to develop a constant interaction among them.This also serves as a good opportunity to get the required career guidance to reach their future endeavours."
android:textAppearance="?android:attr/textAppearanceLarge" />
<View
android:id="#+id/view1"
android:layout_width="wrap_content"
android:layout_height="9dp"
/>
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#2196F3"
android:text=" We provide e-library to our students which compraises many number of e-books, projects and all fundamentals of electronics"
android:textAppearance="?android:attr/textAppearanceLarge" />
<View
android:id="#+id/view2"
android:layout_width="wrap_content"
android:layout_height="9dp"
/>
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#2196F3"
android:text=" We automized our students internal/external marks system so, every student can log on to his account and get his/her result at any time after the results are out"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
original fragment is Original
but the output coming is output
the remaining part is missing
Thanks in advance
Please try this once. Keep the activity_main.xml as it is. In case of the fragment_about.xml put the root view as a ScrollView and just add a view at the below i.e.
<ScrollView
android:id="#+id/scroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="10dp">
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="About Us"
android:textColor="#F44336"
android:layout_gravity="center"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="30dp"/>
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#2196F3"
android:text=" Our vision is to interrelate the old and present students of college with each other and to develop a constant interaction among them.This also serves as a good opportunity to get the required career guidance to reach their future endeavours."
android:textAppearance="?android:attr/textAppearanceLarge" />
<View
android:id="#+id/view1"
android:layout_width="wrap_content"
android:layout_height="9dp"
/>
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#2196F3"
android:text=" We provide e-library to our students which compraises many number of e-books, projects and all fundamentals of electronics"
android:textAppearance="?android:attr/textAppearanceLarge" />
<View
android:id="#+id/view2"
android:layout_width="wrap_content"
android:layout_height="9dp"
/>
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#2196F3"
android:text=" We automized our students internal/external marks system so, every student can log on to his account and get his/her result at any time after the results are out"
android:textAppearance="?android:attr/textAppearanceLarge" />
<View
android:layout_width="match_parent"
android:layout_height="25dp"/>
</LinearLayout>
</ScrollView>
Hope it will help.
Try like this
main_activity.xml()
<ScrollView
android:id="#+id/scrollView2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true" >
<FrameLayout
android:id="#+id/fragment_place"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusable="true"/>
</ScrollView>

How do i align both textviews on top of the drawable preventing them to pile up on eachother

Hello stackoverflow members. i am trying to achieve this:http://imgur.com/dqwOAOf
But for some reason the two texts cant take these positions like this http://imgur.com/lyYg8Ei
Could anyone explain what i am doing wrong?
and please forgive my artistic talents.
i have added the whole xml file.
The idea is that the two textviews timer and typegekookt are displayed in the center of backgroundtypegekookt evenly spaced out.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:orientation="vertical"
android:id="#+id/eggContainer"
android:layout_height="wrap_content"
android:padding="15dp">
<ImageView android:id="#+id/eggtimerimage"
android:src="#drawable/eiwit"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:gravity="center_vertical"
/>
<ImageView android:id="#+id/backgroundtypegekookt"
android:src="#drawable/timerwijzer"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerInParent="true"
/>
<TextView
android:id="#+id/typegekookt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="zacht"
android:textSize="20sp"
android:textStyle="bold"
android:textColor="#android:color/black"
android:layout_alignTop="#+id/divider2"
android:layout_centerHorizontal="true"/>
<TextView
android:id="#+id/timer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="10:00"
android:textSize="22sp"
android:textStyle="bold"
android:textColor="#android:color/black"
android:layout_centerHorizontal="true"
android:layout_alignBottom="#+id/divider2"
/>
<TextView
style="?android:listSeparatorTextViewStyle"
android:id="#+id/divider1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/eggtimerimage"
android:layout_marginBottom="-30dp"
/>
<TextView
style="?android:listSeparatorTextViewStyle"
android:id="#+id/divider2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignLeft="#+id/backgroundtypegekookt"
android:layout_alignStart="#+id/backgroundtypegekookt"
android:layout_alignRight="#+id/backgroundtypegekookt"
android:layout_alignEnd="#+id/backgroundtypegekookt" />
</RelativeLayout>
Instead of using the ImageView android:id="#+id/backgroundtypegekookt", use a RelativeLayout (or a LinearLayout) with that background (android:background="#drawable/timerwijzer"), and put your TextViews in it
This is what I mean:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:id="#+id/eggContainer"
android:layout_height="wrap_content"
android:padding="15dp"
>
<ImageView
android:id="#+id/eggtimerimage"
android:src="#drawable/eiwit"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:gravity="center_vertical"
/>
<LinearLayout
android:id="#+id/backgroundtypegekookt"
android:background="#drawable/timerwijzer"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerInParent="true"
android:orientation="vertical"
>
<TextView
android:id="#+id/typegekookt"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:text="zacht"
android:textSize="20sp"
android:textStyle="bold"
android:textColor="#android:color/black"
android:layout_centerHorizontal="true"
/>
<TextView
android:id="#+id/timer"
android:below="#id/typegekookt"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:text="10:00"
android:textSize="22sp"
android:textStyle="bold"
android:textColor="#android:color/black"
android:layout_centerHorizontal="true"
/>
</LinearLayout>
<!-- You can use 2 Views instead of 2 TextViews, more efficiently -->
<!-- Anyway, in your screenshots I only see 1 - I guess you'll have to fix that -->
<TextView
style="?android:listSeparatorTextViewStyle"
android:id="#+id/divider1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="-30dp"
/>
<TextView
style="?android:listSeparatorTextViewStyle"
android:id="#+id/divider2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignLeft="#id/backgroundtypegekookt"
android:layout_alignStart="#id/backgroundtypegekookt"
android:layout_alignRight="#id/backgroundtypegekookt"
android:layout_alignEnd="#id/backgroundtypegekookt"
/>
</RelativeLayout>
I also fixed the deprecated fill_parent to match_parent and #+id (anticipated reference) to #id (reference), where needed.
Also see my comments in the layout avout the 2 last views.

Issues with Android layout for normal sized screens

I am currently testing a recently finished app for Android and am struggling quite a bit with the layout for different screens. Basically I just can't figure out a "one size fits all" for each layout.
The normal layouts are being specially awful. On the Eclipse editor I see one thing, on the emulator I get another and on certain devices I get another. I really have no idea how to fix these screens specially because they don't appear to be wrong on the editor. Here are some examples of what I get:
What the editor looks like:
What the emulator looks like (mind you, it's the same phone on the editor):
What the screen looks like on a Motorola D3 device (the language is different, but it's the same layout!):
I don't know if it's relevant, but here is my xml code for that particular screen:
<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:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context=".EnterActivityActivity" >
<TextView
android:id="#+id/recommendationTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="29dp"
android:text="#string/recommendation_enter"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/timeTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/recommendationTextView"
android:layout_marginTop="48dp"
android:layout_toLeftOf="#+id/recommendationTextView"
android:text="#string/time_recommendation_enter" />
<EditText
android:id="#+id/changeRecommendationEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/changeRecommendationtextView"
android:layout_alignBottom="#+id/changeRecommendationtextView"
android:layout_alignParentRight="true"
android:layout_toRightOf="#+id/activityEnterButton"
android:ems="5"
android:inputType="number"
android:maxLength="5"
android:focusable="false"/>
<Button
android:id="#+id/activityEnterButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/pedometerButton"
android:layout_centerHorizontal="true"
android:text="#string/enter_button_recommendation_enter" />
<Button
android:id="#+id/pedometerButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:text="#string/open_pedometer_button_recommendation_enter" />
<TextView
android:id="#+id/changeRecommendationtextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/changeRecommendationButton"
android:layout_alignParentLeft="true"
android:layout_marginBottom="28dp"
android:text="#string/change_recommendation_enter" />
<Button
android:id="#+id/changeRecommendationButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/activityEnterButton"
android:layout_centerHorizontal="true"
android:layout_marginBottom="20dp"
android:text="#string/change_button_recommendation_enter" />
<EditText
android:id="#+id/timeEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/recommendationTextView"
android:layout_alignTop="#+id/timeTextView"
android:ems="3"
android:focusable="false"
android:inputType="number"
android:maxLength="3"/>
<TextView
android:id="#+id/distanceTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/timeTextView"
android:layout_marginTop="18dp"
android:layout_toLeftOf="#+id/changeRecommendationButton"
android:text="#string/distance_recommendation_enter" />
<EditText
android:id="#+id/distanceEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/changeRecommendationButton"
android:layout_below="#+id/timeTextView"
android:ems="5"
android:focusable="false"
android:inputType="number"
android:maxLength="5"/>
</RelativeLayout>
How exactly could I fix this so that is actually looks good and consistent with all the varieties of screens and devices?

Categories