Preview Does Not Match with the Emulator - android-layout

I don't know why my Android layout does not match with the emulator. Does anyone have any idea why this might be happening?
Here is the layout code for the action sheet. The section that isn't displaying right is in the last linear layout
This is my activity_login.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:background="#fff"
android:orientation="vertical"
tools:context=".LoginActivity">
<ImageView
android:id="#+id/logo_image"
android:layout_width="150dp"
android:layout_height="150dp"
android:src="#drawable/logotitipdonk"
android:transitionName="logo_image" />
<TextView
android:id="#+id/logo_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="#font/bungee"
android:text="Hello there, Welcome Back"
android:textColor="#000"
android:textSize="40sp"
android:transitionName="logo_text" />
<TextView
android:id="#+id/slogan_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Sign In to continue"
android:textSize="18sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:orientation="vertical">
<com.google.android.material.textfield.TextInputLayout
android:id="#+id/username"
style="#style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Username">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="#+id/password"
style="#style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Password"
app:passwordToggleEnabled="true">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword" />
</com.google.android.material.textfield.TextInputLayout>
<Button
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_margin="5dp"
android:background="#00000000"
android:elevation="0dp"
android:text="Forget Password?" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:background="#000"
android:text="GO"
android:textColor="#fff" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_margin="5dp"
android:background="#00000000"
android:elevation="0dp"
android:text="New User? SIGN UP"
android:textColor="#000" />
</LinearLayout>
</LinearLayout>
This is my build gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.example.titipdonk"
minSdkVersion 26
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.google.android.material:material:1.1.0'
}
My Android emulator preview:
Edit: In addition to a fix for this specific problem does anyone know why the preview doesn't match the way it actually shows up on the phone?

Following are my suggestions for your code:
Your layout size in android studio preview should match to screen size of AVD.
Do not use absolute height and width for each component such as,
android:layout_width="30dp"
android:layout_height="40dp"
Instead use,
android:layout_width="match_parent/fill_parent/wrap_content"
android:layout_height="match_parent/fill_parent/wrap_content"
When you use absolute height and width such as 300dp or 400dp, components will be shown differently on each screen size and they may go outside of screen also
You can also use padding,margin and gravity for component position.
In your code use the layout_width="match_parent" and then use gravity="center/left/right"

Related

android studio: place recycleview on top of Edittext with transparent background

I'm trying to implement a chat activity where the background of the EditText is transparent, so on scrolling up the messages are visible behind the Edittext. But this is the result :
As you can see it is not perfect, I want to be able to scroll a little more to make messages above the edittext completely not behind it!
<androidx.recyclerview.widget.RecyclerView
android:layout_below="#+id/bar_layout"
android:id="#+id/recycle_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layoutManager="LinearLayoutManager"
android:stackFromBottom="true"
android:transcriptMode="alwaysScroll"
android:overScrollMode="never"
/>
<RelativeLayout
android:id="#+id/bottom"
android:layout_width="match_parent"
android:padding="5dp"
android:layout_margin="#dimen/_10sdp"
android:background="#android:color/transparent"
android:layout_alignParentBottom="true"
android:layout_height="wrap_content">
<EditText
android:id="#+id/text_send"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="#+id/btn_send"
android:background="#drawable/sendmessage"
android:hint="Type a message ... "
android:padding="8dp"
android:layout_centerVertical="true"
/>
<ImageButton
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_margin="5dp"
android:id="#+id/btn_send"
android:background="#drawable/ic_paper_plane"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"/>
</RelativeLayout>
Wrap it all in a LinearLayout with orientation="vertical"
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
tools:context=".MainActivity"
android:id="#+id/root">
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/recycle_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never"
android:stackFromBottom="true"
android:transcriptMode="alwaysScroll"
app:layoutManager="LinearLayoutManager" />
<RelativeLayout
android:id="#+id/bottom"
android:layout_width="match_parent"
android:padding="5dp"
android:background="#android:color/transparent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true">
<EditText
android:id="#+id/text_send"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toLeftOf="#+id/btn_send"
android:hint="Type a message ... "
android:padding="8dp" />
<ImageButton
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_margin="5dp"
android:id="#+id/btn_send"
android:background="#000000"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"/>
</RelativeLayout>
</RelativeLayout>

Tab indicator no longer at the bottom of AppBarLayout after migrating app to AndroidX. The tab is custom made tab

I migrated android app to AndroidX and then I noticed this
As you can see the tab indicator went up into the AppBarLayout. Here is the code
<com.google.android.material.appbar.AppBarLayout
android:id="#+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
android:paddingTop="#dimen/appbar_padding_top"
android:theme="#style/AppTheme.AppBarOverlay"
android:elevation="4dp">
<androidx.appcompat.widget.Toolbar
... // some code here relevant to toolbar
</androidx.appcompat.widget.Toolbar>
<com.google.android.material.tabs.TabLayout
android:id="#+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout="#layout/custom_tab" />
<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout="#layout/custom_tab" />
<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout="#layout/custom_tab"/>
</com.google.android.material.tabs.TabLayout>
</com.google.android.material.appbar.AppBarLayout>
The custom layout I created is below:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
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="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="#+id/tab_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="CONTRIBUTIONS"
style="#style/TextAppearance.Design.Tab"/>
<TextView
android:id="#+id/tv_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="#id/tab_title"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:text="1000"
android:layout_marginBottom="8dp"
style="#style/TextAppearance.Design.Tab"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginEnd="4dp"
android:layout_marginRight="4dp"
android:text="#string/open_bracket"
app:layout_constraintBottom_toBottomOf="#+id/tv_number"
app:layout_constraintEnd_toStartOf="#+id/tv_number"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="#+id/tv_number"
app:layout_constraintHorizontal_bias="1"
style="#style/TextAppearance.Design.Tab"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:text="#string/closing_bracket"
app:layout_constraintBottom_toBottomOf="#+id/tv_number"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#+id/tv_number"
app:layout_constraintTop_toTopOf="#+id/tv_number"
app:layout_constraintHorizontal_bias="0"
style="#style/TextAppearance.Design.Tab"/>
</androidx.constraintlayout.widget.ConstraintLayout>`
It looks fine in android 22 and below but not android 24 and above. However before this migration to androidx it was fine in all versions i.e the indicator was at bottom of appbarlayout not inside it.
You must set app:tabIndicatorColor="YOUR_COLOR" in TabLayout like this:
<com.google.android.material.tabs.TabLayout
android:id="#+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabIndicatorColor="#color/blue">
... // Your TabItems
</com.google.android.material.tabs.TabLayout>
if doesn't work, try to remove android:layout="#layout/custom_tab" from TabItems too.

ViewBinding - How to set visibility for include layout in ViewBinding?

I use an include layout and I need to change it's visibility:
<include
android:id="#+id/layout_provinces"
layout="#layout/layout_select_provinces"
/>
and layout_select_provinces is sth like this:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/select_province"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#color/white"
android:visibility="gone">
<LinearLayout
android:id="#+id/layout_top"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/background_color"
android:orientation="vertical">
<TextView
android:id="#+id/txt_state"
style="#style/FontIranBold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="#dimen/_8sdp"
android:layout_marginRight="#dimen/_4sdp"
android:layout_marginBottom="#dimen/_8sdp"
android:text="#string/txt_select_province"
android:textSize="#dimen/font_size_small" />
<View
android:layout_width="match_parent"
android:layout_height="#dimen/_1sdp"
android:background="#color/gray_special" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/recycler_estate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/layout_top"
android:layout_marginTop="#dimen/_8sdp" />
but when I set Id to RelativeLayout, my app crashes and I can't change the visibility:
binding.layoutProvinces.selectProvince.setVisibility(View.GONE);
is there anyone can help me with ViewBinding set id process?
When we give <include> an id it overrides the id of root layout that we included. In your case, layout_provinces is overriding <RelativeLayout's select_province. So when you access the relative layout it gives you an error because it is no longer there.
What you can do is remove the id of relative layout and only give id to include and access the root layout that you included through the getRoot() method like below.
Java
binding.selectProvince.getRoot().setVisibility(View.GONE)
Kotlin
binding.selectProvince.root.visibility = View.GONE
the getRoot() method in View Binding returns the topmost view of the given layout in your case it's the RelativeLayout.
For DataBinding to work, you need to have <layout> tag as your root tag. So wrap your xml code inside <layout> like this:
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<RelativeLayout
android:id="#+id/select_province"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#color/white"
android:visibility="gone">
<LinearLayout
android:id="#+id/layout_top"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/background_color"
android:orientation="vertical">
<TextView
android:id="#+id/txt_state"
style="#style/FontIranBold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="#dimen/_8sdp"
android:layout_marginRight="#dimen/_4sdp"
android:layout_marginBottom="#dimen/_8sdp"
android:text="#string/txt_select_province"
android:textSize="#dimen/font_size_small" />
<View
android:layout_width="match_parent"
android:layout_height="#dimen/_1sdp"
android:background="#color/gray_special" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/recycler_estate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/layout_top"
android:layout_marginTop="#dimen/_8sdp" />
</RelativeLayout>
</layout>

How can make the mRecyclerView control fill in the free space?

I use Code A to design UI with constraint layout, the top of the UI is google AD and the bottom of the UI is toolbar.
I hope the RecyclerView control named mRecyclerView fill in all other space, how can I do?
BTW, Code B is generated by Android Studio 3.01 automatically when I drag and drop RecyclerView control to UI. It's a hard code for layout_width and layout_height.
Code A
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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">
<com.google.android.gms.ads.AdView xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="#+id/adView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
ads:layout_constraintTop_toTopOf="parent"
ads:adSize="SMART_BANNER"
ads:adUnitId="#string/ad_unit_id"
/>
<LinearLayout
android:id="#+id/linearLayoutToolBar"
style="#style/myToolbar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:weightSum="4"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<Button
android:id="#+id/btnBackup"
style="#style/myTextMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="#string/BtnBackup" />
<Button
android:id="#+id/btnExit"
style="#style/myTextMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="#string/BtnExit" />
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:id="#+id/mRecyclerView"
android:layout_width="368dp"
android:layout_height="396dp"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="58dp" />
</android.support.constraint.ConstraintLayout>
Code B
<android.support.v7.widget.RecyclerView
android:id="#+id/mRecyclerView"
android:layout_width="368dp"
android:layout_height="396dp"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="58dp" />
Replace your RecyclerView code like below to fill the free space:
<android.support.v7.widget.RecyclerView
android:id="#+id/mRecyclerView"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintTop_toBottomOf="#id/adView"
app:layout_constraintBottom_toTopOf="#id/linearLayoutToolBar"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>

Error after updating gradle plugin version of Android Studio from 2.3.3 to 3.0.0

I've recently updated my Android Studio's Gradle plugin version from 2.3.3 to 3.0.0 and followed the instructions shown here
The updated build.gradle (app) looks like this:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "demo.myProject.projectdemoversion"
minSdkVersion 15
targetSdkVersion 23
versionCode 41
versionName "2.26"
aaptOptions.setProperty("cruncherEnabled", false)
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
zipAlignEnabled true
shrinkResources true
}
}
productFlavors {
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':volley')
implementation('com.github.worker8:tourguide:1.0.17-SNAPSHOT#aar') {
transitive = true
}
implementation 'com.android.support:multidex:1.0.1'
implementation 'com.android.support:cardview-v7:25.1.1'
implementation 'com.android.support:recyclerview-v7:25.1.1'
implementation 'ch.acra:acra:4.9.0'
implementation 'com.github.MKergall:osmbonuspack:6.2'
implementation 'com.android.support:appcompat-v7:25.0.1'
implementation 'com.google.android.gms:play-services-appindexing:8.4.0'
implementation 'com.google.android.gms:play-services-maps:8.4.0'
implementation 'com.google.android.gms:play-services-location:8.4.0'
implementation 'com.android.support:design:25.0.0'
implementation 'com.google.android.gms:play-services-analytics:8.4.0'
implementation 'org.osmdroid:osmdroid-android:5.6.4'
implementation 'org.slf4j:slf4j-android:1.7.12'
implementation 'com.android.support:support-v4:25.0.0'
implementation 'org.jetbrains:annotations-java5:15.0'
implementation 'com.facebook.android:account-kit-sdk:4.11.0'
implementation 'com.facebook.android:facebook-android-sdk:4.11.0'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'info.hoang8f:fbutton:1.0.5'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
}
And my build.gradle (project) is as follows:
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://jitpack.io"
}
maven(){
url "https://oss.sonatype.org/content/repositories/snapshots"
}
google()
}
}
But unfortunately it's still showing errors related to plugins. For example:
android.view.InflateException: Binary XML file line #0: Error inflating class info.hoang8f.widget.FButton
Here is the layout file which contains the FButton element:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:fbutton="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:layout_gravity="center_horizontal"
android:background="#color/colorPrimary"
android:orientation="vertical"
tools:context="demo.myProject.projectdemoversion.activity.PhoneRegActivity">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/white"
android:src="#drawable/menu_image_360" />
<LinearLayout
android:id="#+id/firstreg"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center_horizontal|center_vertical"
android:orientation="vertical"
android:padding="#dimen/regpadding">
<TextView
android:id="#+id/phoneheader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="15dp"
android:text="Register here"
android:textColor="#color/white"
android:textSize="#dimen/regtext"
android:textStyle="bold" />
<com.rengwuxian.materialedittext.MaterialEditText
android:id="#+id/userid"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="#drawable/user"
android:drawablePadding="10dp"
android:hint="Write your name"
app:met_baseColor="#color/white"
app:met_floatingLabel="highlight"
app:met_textColorHint="#color/white" />
<com.rengwuxian.materialedittext.MaterialEditText
android:id="#+id/phone_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="#drawable/phonereceiver"
android:drawablePadding="10dp"
android:hint="ফোন নাম্বার"
android:inputType="none"
android:padding="5dp"
app:met_baseColor="#color/white"
app:met_floatingLabel="normal"
app:met_textColorHint="#color/white" />
<info.hoang8f.widget.FButton
android:id="#+id/submittoserver"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="#dimen/regsubbtnsize"
android:paddingBottom="#dimen/regsubbtn"
android:paddingLeft="#dimen/regsubbtn"
android:paddingRight="#dimen/regsubbtn"
android:paddingTop="#dimen/regsubbtn"
android:text="Submit"
android:textColor="#color/colorSecondaryText"
android:textSize="#dimen/offercounterbtn"
fbutton:buttonColor="#color/colorAccent"
fbutton:shadowColor="#color/colorPrimaryDark"
fbutton:shadowEnabled="true"
fbutton:shadowHeight="5dp" />
</LinearLayout>
<LinearLayout
android:id="#+id/secondreg"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center_horizontal|center_vertical"
android:orientation="vertical"
android:padding="#dimen/regpadding"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center|top"
android:padding="15dp"
android:text="Welcome"
android:textColor="#color/white"
android:textSize="#dimen/regtext"
android:textStyle="bold" />
<TextView
android:id="#+id/hellonaame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center|top"
android:padding="15dp"
android:text="Register"
android:textColor="#color/white"
android:textSize="#dimen/regtext"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
Any help/suggestion would be appreciated. Thank you!

Resources