Text is showing through into new fragment android
up vote
0
down vote
favorite
I'm new to Android and I'm making an alarm clock for practice. I have my MainActivity
which shows a digital clock like this -
The add sign in the top right corner opens a new fragment to be able to set a new alarm but the problem is that the white digital clock text (shown in the first image) is peaking through into my fragment. I have tried to follow other suggestions that I've found on here such as setting the background to white on the fragment and also setting statelistanimator
to @null
but nothing has changed it. Here is the image(the overlap is on the text)-
Here is the XML for the fragment. (I have included only the parts that I believe are relevant, but i could be wrong).
<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="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:clickable="true"
android:focusable="true"
tools:context=".SetAlarmFragment">
<TextView
android:id="@+id/textView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="8dp"
android:text="Choose a time"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.501"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView2" />
and here is the activity XML.
<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="match_parent"
android:layout_height="match_parent"
app:layout_constraintEnd_toEndOf="parent"
android:background="@color/colorPrimary"
tools:context=".MainActivity">
<FrameLayout
android:id="@+id/fragmentLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
</FrameLayout>
<TextClock
android:id="@+id/textClock"
android:layout_width="wrap_content"
android:layout_height="56dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:fontFamily="@font/digital"
android:textAlignment="center"
android:textColor="@color/design_default_color_background"
android:textSize="50sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.502"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/completeAlarmSetUp"
tools:text="12:30:01" />
Any help would be appreciated as well as any documentation that I can follow.
Thanks
android xml android-fragments
add a comment |
up vote
0
down vote
favorite
I'm new to Android and I'm making an alarm clock for practice. I have my MainActivity
which shows a digital clock like this -
The add sign in the top right corner opens a new fragment to be able to set a new alarm but the problem is that the white digital clock text (shown in the first image) is peaking through into my fragment. I have tried to follow other suggestions that I've found on here such as setting the background to white on the fragment and also setting statelistanimator
to @null
but nothing has changed it. Here is the image(the overlap is on the text)-
Here is the XML for the fragment. (I have included only the parts that I believe are relevant, but i could be wrong).
<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="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:clickable="true"
android:focusable="true"
tools:context=".SetAlarmFragment">
<TextView
android:id="@+id/textView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="8dp"
android:text="Choose a time"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.501"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView2" />
and here is the activity XML.
<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="match_parent"
android:layout_height="match_parent"
app:layout_constraintEnd_toEndOf="parent"
android:background="@color/colorPrimary"
tools:context=".MainActivity">
<FrameLayout
android:id="@+id/fragmentLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
</FrameLayout>
<TextClock
android:id="@+id/textClock"
android:layout_width="wrap_content"
android:layout_height="56dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:fontFamily="@font/digital"
android:textAlignment="center"
android:textColor="@color/design_default_color_background"
android:textSize="50sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.502"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/completeAlarmSetUp"
tools:text="12:30:01" />
Any help would be appreciated as well as any documentation that I can follow.
Thanks
android xml android-fragments
Try to move your<TextClock>
declaration in youractivity.xml
aboveFrameLayout
. So Hierarchy will be [ConstraintLayout
{TextClock
,FrameLayout
}], You dont have to change constraints, just moveFrameLayout
at the end.
– Aaditya Brahmbhatt
Nov 21 at 4:30
@AadityaBrahmbhatt Hit the nail on the head, i feel so stupid!! please answer the question and ill mark it correct. thanks again!
– john seymour
Nov 21 at 4:38
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm new to Android and I'm making an alarm clock for practice. I have my MainActivity
which shows a digital clock like this -
The add sign in the top right corner opens a new fragment to be able to set a new alarm but the problem is that the white digital clock text (shown in the first image) is peaking through into my fragment. I have tried to follow other suggestions that I've found on here such as setting the background to white on the fragment and also setting statelistanimator
to @null
but nothing has changed it. Here is the image(the overlap is on the text)-
Here is the XML for the fragment. (I have included only the parts that I believe are relevant, but i could be wrong).
<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="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:clickable="true"
android:focusable="true"
tools:context=".SetAlarmFragment">
<TextView
android:id="@+id/textView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="8dp"
android:text="Choose a time"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.501"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView2" />
and here is the activity XML.
<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="match_parent"
android:layout_height="match_parent"
app:layout_constraintEnd_toEndOf="parent"
android:background="@color/colorPrimary"
tools:context=".MainActivity">
<FrameLayout
android:id="@+id/fragmentLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
</FrameLayout>
<TextClock
android:id="@+id/textClock"
android:layout_width="wrap_content"
android:layout_height="56dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:fontFamily="@font/digital"
android:textAlignment="center"
android:textColor="@color/design_default_color_background"
android:textSize="50sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.502"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/completeAlarmSetUp"
tools:text="12:30:01" />
Any help would be appreciated as well as any documentation that I can follow.
Thanks
android xml android-fragments
I'm new to Android and I'm making an alarm clock for practice. I have my MainActivity
which shows a digital clock like this -
The add sign in the top right corner opens a new fragment to be able to set a new alarm but the problem is that the white digital clock text (shown in the first image) is peaking through into my fragment. I have tried to follow other suggestions that I've found on here such as setting the background to white on the fragment and also setting statelistanimator
to @null
but nothing has changed it. Here is the image(the overlap is on the text)-
Here is the XML for the fragment. (I have included only the parts that I believe are relevant, but i could be wrong).
<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="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:clickable="true"
android:focusable="true"
tools:context=".SetAlarmFragment">
<TextView
android:id="@+id/textView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="8dp"
android:text="Choose a time"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.501"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView2" />
and here is the activity XML.
<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="match_parent"
android:layout_height="match_parent"
app:layout_constraintEnd_toEndOf="parent"
android:background="@color/colorPrimary"
tools:context=".MainActivity">
<FrameLayout
android:id="@+id/fragmentLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
</FrameLayout>
<TextClock
android:id="@+id/textClock"
android:layout_width="wrap_content"
android:layout_height="56dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:fontFamily="@font/digital"
android:textAlignment="center"
android:textColor="@color/design_default_color_background"
android:textSize="50sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.502"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/completeAlarmSetUp"
tools:text="12:30:01" />
Any help would be appreciated as well as any documentation that I can follow.
Thanks
android xml android-fragments
android xml android-fragments
edited Nov 21 at 4:28
Ishaan
514116
514116
asked Nov 21 at 4:02
john seymour
1089
1089
Try to move your<TextClock>
declaration in youractivity.xml
aboveFrameLayout
. So Hierarchy will be [ConstraintLayout
{TextClock
,FrameLayout
}], You dont have to change constraints, just moveFrameLayout
at the end.
– Aaditya Brahmbhatt
Nov 21 at 4:30
@AadityaBrahmbhatt Hit the nail on the head, i feel so stupid!! please answer the question and ill mark it correct. thanks again!
– john seymour
Nov 21 at 4:38
add a comment |
Try to move your<TextClock>
declaration in youractivity.xml
aboveFrameLayout
. So Hierarchy will be [ConstraintLayout
{TextClock
,FrameLayout
}], You dont have to change constraints, just moveFrameLayout
at the end.
– Aaditya Brahmbhatt
Nov 21 at 4:30
@AadityaBrahmbhatt Hit the nail on the head, i feel so stupid!! please answer the question and ill mark it correct. thanks again!
– john seymour
Nov 21 at 4:38
Try to move your
<TextClock>
declaration in your activity.xml
above FrameLayout
. So Hierarchy will be [ConstraintLayout
{TextClock
, FrameLayout
}], You dont have to change constraints, just move FrameLayout
at the end.– Aaditya Brahmbhatt
Nov 21 at 4:30
Try to move your
<TextClock>
declaration in your activity.xml
above FrameLayout
. So Hierarchy will be [ConstraintLayout
{TextClock
, FrameLayout
}], You dont have to change constraints, just move FrameLayout
at the end.– Aaditya Brahmbhatt
Nov 21 at 4:30
@AadityaBrahmbhatt Hit the nail on the head, i feel so stupid!! please answer the question and ill mark it correct. thanks again!
– john seymour
Nov 21 at 4:38
@AadityaBrahmbhatt Hit the nail on the head, i feel so stupid!! please answer the question and ill mark it correct. thanks again!
– john seymour
Nov 21 at 4:38
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
Try to move your <TextClock>
declaration in your activity.xml
above FrameLayout
. So Hierarchy will be [ConstraintLayout
{TextClock
, FrameLayout
}], You don't have to change constraints, just move FrameLayout
at the end.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Try to move your <TextClock>
declaration in your activity.xml
above FrameLayout
. So Hierarchy will be [ConstraintLayout
{TextClock
, FrameLayout
}], You don't have to change constraints, just move FrameLayout
at the end.
add a comment |
up vote
1
down vote
accepted
Try to move your <TextClock>
declaration in your activity.xml
above FrameLayout
. So Hierarchy will be [ConstraintLayout
{TextClock
, FrameLayout
}], You don't have to change constraints, just move FrameLayout
at the end.
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Try to move your <TextClock>
declaration in your activity.xml
above FrameLayout
. So Hierarchy will be [ConstraintLayout
{TextClock
, FrameLayout
}], You don't have to change constraints, just move FrameLayout
at the end.
Try to move your <TextClock>
declaration in your activity.xml
above FrameLayout
. So Hierarchy will be [ConstraintLayout
{TextClock
, FrameLayout
}], You don't have to change constraints, just move FrameLayout
at the end.
answered Nov 21 at 4:40
Aaditya Brahmbhatt
2568
2568
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53405097%2ftext-is-showing-through-into-new-fragment-android%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Try to move your
<TextClock>
declaration in youractivity.xml
aboveFrameLayout
. So Hierarchy will be [ConstraintLayout
{TextClock
,FrameLayout
}], You dont have to change constraints, just moveFrameLayout
at the end.– Aaditya Brahmbhatt
Nov 21 at 4:30
@AadityaBrahmbhatt Hit the nail on the head, i feel so stupid!! please answer the question and ill mark it correct. thanks again!
– john seymour
Nov 21 at 4:38