Progress bar show under Button
up vote
0
down vote
favorite
Android studio 3.1
minSdkVersion 21
Here my layout xml:
<?xml version="1.0" encoding="utf-8"?>
<layout 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">
<data>
<variable
name="handler"
type="md.dotfinance.tm.android.ui.activity.AddTraderActivity" />
</data>
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/common_gray_color_bg">
<include
android:id="@+id/jsonViewToolBar"
layout="@layout/tool_bar"
android:title='@{@string/add_trader}'
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/baseTextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
android:layout_marginEnd="8dp"
android:text="@string/base"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/jsonViewToolBar" />
<EditText
android:id="@+id/baseEditText"
style="@style/textViewOneLine"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/baseTextView" />
<TextView
android:id="@+id/quoteTextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/default_margin"
android:text="@string/quote"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/baseEditText" />
<EditText
android:id="@+id/quoteEditText"
style="@style/textViewOneLine"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/quoteTextView" />
<Button
android:id="@+id/startButton"
android:layout_width="0dp"
android:layout_height="@dimen/min_height"
android:layout_marginTop="@dimen/default_margin"
android:layout_marginBottom="@dimen/default_margin"
android:background="@color/button_gray"
android:text="@string/start"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/quoteEditText" />
<include
layout="@layout/progress_bar_layout"
android:visibility="gone" />
</android.support.constraint.ConstraintLayout>
</layout>
Here my progress_bar_layout.xml
<?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"
android:id="@+id/containerProgressBarLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#4777"
android:clickable="true"
android:focusable="true">
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyle"
android:layout_width="48dp"
android:layout_height="48dp"
android:indeterminateTint="@color/colorPrimary"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
But when I start app the progress bar is UNDER button.
But I need over button.
How I can do this?
android
add a comment |
up vote
0
down vote
favorite
Android studio 3.1
minSdkVersion 21
Here my layout xml:
<?xml version="1.0" encoding="utf-8"?>
<layout 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">
<data>
<variable
name="handler"
type="md.dotfinance.tm.android.ui.activity.AddTraderActivity" />
</data>
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/common_gray_color_bg">
<include
android:id="@+id/jsonViewToolBar"
layout="@layout/tool_bar"
android:title='@{@string/add_trader}'
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/baseTextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
android:layout_marginEnd="8dp"
android:text="@string/base"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/jsonViewToolBar" />
<EditText
android:id="@+id/baseEditText"
style="@style/textViewOneLine"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/baseTextView" />
<TextView
android:id="@+id/quoteTextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/default_margin"
android:text="@string/quote"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/baseEditText" />
<EditText
android:id="@+id/quoteEditText"
style="@style/textViewOneLine"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/quoteTextView" />
<Button
android:id="@+id/startButton"
android:layout_width="0dp"
android:layout_height="@dimen/min_height"
android:layout_marginTop="@dimen/default_margin"
android:layout_marginBottom="@dimen/default_margin"
android:background="@color/button_gray"
android:text="@string/start"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/quoteEditText" />
<include
layout="@layout/progress_bar_layout"
android:visibility="gone" />
</android.support.constraint.ConstraintLayout>
</layout>
Here my progress_bar_layout.xml
<?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"
android:id="@+id/containerProgressBarLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#4777"
android:clickable="true"
android:focusable="true">
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyle"
android:layout_width="48dp"
android:layout_height="48dp"
android:indeterminateTint="@color/colorPrimary"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
But when I start app the progress bar is UNDER button.
But I need over button.
How I can do this?
android
put your progressbar in a linearlayout and then inclue the file and also define this tag on your include element in xml => app:layout_constraintTop_toBottomOf="@+id/startButton" then you are good to go :)
– Har Kal
Nov 19 at 15:29
Not help. Same result.
– Alexei
Nov 19 at 15:40
Button
s haveelevation
by default, which will make them appear on top of other views. You can addelevation
to the ProgressBar or you can change your layout in order to have the button and progressbar not overlap.
– Ben P.
Nov 19 at 17:09
set to button the next attirbutte - android:elevation="2dp" - not help. Same result.
– Alexei
Nov 20 at 8:16
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Android studio 3.1
minSdkVersion 21
Here my layout xml:
<?xml version="1.0" encoding="utf-8"?>
<layout 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">
<data>
<variable
name="handler"
type="md.dotfinance.tm.android.ui.activity.AddTraderActivity" />
</data>
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/common_gray_color_bg">
<include
android:id="@+id/jsonViewToolBar"
layout="@layout/tool_bar"
android:title='@{@string/add_trader}'
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/baseTextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
android:layout_marginEnd="8dp"
android:text="@string/base"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/jsonViewToolBar" />
<EditText
android:id="@+id/baseEditText"
style="@style/textViewOneLine"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/baseTextView" />
<TextView
android:id="@+id/quoteTextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/default_margin"
android:text="@string/quote"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/baseEditText" />
<EditText
android:id="@+id/quoteEditText"
style="@style/textViewOneLine"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/quoteTextView" />
<Button
android:id="@+id/startButton"
android:layout_width="0dp"
android:layout_height="@dimen/min_height"
android:layout_marginTop="@dimen/default_margin"
android:layout_marginBottom="@dimen/default_margin"
android:background="@color/button_gray"
android:text="@string/start"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/quoteEditText" />
<include
layout="@layout/progress_bar_layout"
android:visibility="gone" />
</android.support.constraint.ConstraintLayout>
</layout>
Here my progress_bar_layout.xml
<?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"
android:id="@+id/containerProgressBarLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#4777"
android:clickable="true"
android:focusable="true">
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyle"
android:layout_width="48dp"
android:layout_height="48dp"
android:indeterminateTint="@color/colorPrimary"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
But when I start app the progress bar is UNDER button.
But I need over button.
How I can do this?
android
Android studio 3.1
minSdkVersion 21
Here my layout xml:
<?xml version="1.0" encoding="utf-8"?>
<layout 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">
<data>
<variable
name="handler"
type="md.dotfinance.tm.android.ui.activity.AddTraderActivity" />
</data>
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/common_gray_color_bg">
<include
android:id="@+id/jsonViewToolBar"
layout="@layout/tool_bar"
android:title='@{@string/add_trader}'
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/baseTextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
android:layout_marginEnd="8dp"
android:text="@string/base"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/jsonViewToolBar" />
<EditText
android:id="@+id/baseEditText"
style="@style/textViewOneLine"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/baseTextView" />
<TextView
android:id="@+id/quoteTextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/default_margin"
android:text="@string/quote"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/baseEditText" />
<EditText
android:id="@+id/quoteEditText"
style="@style/textViewOneLine"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/quoteTextView" />
<Button
android:id="@+id/startButton"
android:layout_width="0dp"
android:layout_height="@dimen/min_height"
android:layout_marginTop="@dimen/default_margin"
android:layout_marginBottom="@dimen/default_margin"
android:background="@color/button_gray"
android:text="@string/start"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/quoteEditText" />
<include
layout="@layout/progress_bar_layout"
android:visibility="gone" />
</android.support.constraint.ConstraintLayout>
</layout>
Here my progress_bar_layout.xml
<?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"
android:id="@+id/containerProgressBarLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#4777"
android:clickable="true"
android:focusable="true">
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyle"
android:layout_width="48dp"
android:layout_height="48dp"
android:indeterminateTint="@color/colorPrimary"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
But when I start app the progress bar is UNDER button.
But I need over button.
How I can do this?
android
android
asked Nov 19 at 15:18
Alexei
1,06511024
1,06511024
put your progressbar in a linearlayout and then inclue the file and also define this tag on your include element in xml => app:layout_constraintTop_toBottomOf="@+id/startButton" then you are good to go :)
– Har Kal
Nov 19 at 15:29
Not help. Same result.
– Alexei
Nov 19 at 15:40
Button
s haveelevation
by default, which will make them appear on top of other views. You can addelevation
to the ProgressBar or you can change your layout in order to have the button and progressbar not overlap.
– Ben P.
Nov 19 at 17:09
set to button the next attirbutte - android:elevation="2dp" - not help. Same result.
– Alexei
Nov 20 at 8:16
add a comment |
put your progressbar in a linearlayout and then inclue the file and also define this tag on your include element in xml => app:layout_constraintTop_toBottomOf="@+id/startButton" then you are good to go :)
– Har Kal
Nov 19 at 15:29
Not help. Same result.
– Alexei
Nov 19 at 15:40
Button
s haveelevation
by default, which will make them appear on top of other views. You can addelevation
to the ProgressBar or you can change your layout in order to have the button and progressbar not overlap.
– Ben P.
Nov 19 at 17:09
set to button the next attirbutte - android:elevation="2dp" - not help. Same result.
– Alexei
Nov 20 at 8:16
put your progressbar in a linearlayout and then inclue the file and also define this tag on your include element in xml => app:layout_constraintTop_toBottomOf="@+id/startButton" then you are good to go :)
– Har Kal
Nov 19 at 15:29
put your progressbar in a linearlayout and then inclue the file and also define this tag on your include element in xml => app:layout_constraintTop_toBottomOf="@+id/startButton" then you are good to go :)
– Har Kal
Nov 19 at 15:29
Not help. Same result.
– Alexei
Nov 19 at 15:40
Not help. Same result.
– Alexei
Nov 19 at 15:40
Button
s have elevation
by default, which will make them appear on top of other views. You can add elevation
to the ProgressBar or you can change your layout in order to have the button and progressbar not overlap.– Ben P.
Nov 19 at 17:09
Button
s have elevation
by default, which will make them appear on top of other views. You can add elevation
to the ProgressBar or you can change your layout in order to have the button and progressbar not overlap.– Ben P.
Nov 19 at 17:09
set to button the next attirbutte - android:elevation="2dp" - not help. Same result.
– Alexei
Nov 20 at 8:16
set to button the next attirbutte - android:elevation="2dp" - not help. Same result.
– Alexei
Nov 20 at 8:16
add a comment |
4 Answers
4
active
oldest
votes
up vote
0
down vote
The best way to do this is to hide the progress bar or make it's visibility="gone"
. Make sure you give it an ID so you can invoke it and hide the other layout with buttons and text views. Then show the progress bar when you process a certain request. Make it invisible!!!
add a comment |
up vote
0
down vote
Try to use
of
android.support.constraint.ConstraintLayout
and add
android:elevation="30dp"
to the RelativeLayout tag
Try to use "RelativeLayout" )
– egorkovv3
Nov 20 at 13:49
add a comment |
up vote
-1
down vote
Try that
<?xml version="1.0" encoding="utf-8"?>
<layout 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">
<data>
<variable
name="handler"
type="md.dotfinance.tm.android.ui.activity.AddTraderActivity" />
</data>
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
layout="@layout/progress_bar_layout"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/common_gray_color_bg">
<include
android:id="@+id/jsonViewToolBar"
layout="@layout/tool_bar"
android:title='@{@string/add_trader}'
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/baseTextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
android:layout_marginEnd="8dp"
android:text="@string/base"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/jsonViewToolBar" />
<EditText
android:id="@+id/baseEditText"
style="@style/textViewOneLine"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/baseTextView" />
<TextView
android:id="@+id/quoteTextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/default_margin"
android:text="@string/quote"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/baseEditText" />
<EditText
android:id="@+id/quoteEditText"
style="@style/textViewOneLine"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/quoteTextView" />
<Button
android:id="@+id/startButton"
android:layout_width="0dp"
android:layout_height="@dimen/min_height"
android:layout_marginTop="@dimen/default_margin"
android:layout_marginBottom="@dimen/default_margin"
android:background="@color/button_gray"
android:text="@string/start"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/quoteEditText" />
</android.support.constraint.ConstraintLayout>
</layout>
compile error: ***Only one layout element and one data element are allowed
– Alexei
Nov 19 at 15:37
add a comment |
up vote
-2
down vote
You need to add contraint to your include tag.
<Button
android:id="@+id/startButton"
android:layout_width="0dp"
android:layout_height="@dimen/min_height"
android:layout_marginTop="@dimen/default_margin"
android:layout_marginBottom="@dimen/default_margin"
android:background="@color/button_gray"
android:text="@string/start"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/quoteEditText" />
<include
layout="@layout/progress_bar_layout"
android:visibility="gone"
app:layout_constraintTop_toBottomOf="@+id/startButton" />
Or any other constraint.
add a comment |
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
The best way to do this is to hide the progress bar or make it's visibility="gone"
. Make sure you give it an ID so you can invoke it and hide the other layout with buttons and text views. Then show the progress bar when you process a certain request. Make it invisible!!!
add a comment |
up vote
0
down vote
The best way to do this is to hide the progress bar or make it's visibility="gone"
. Make sure you give it an ID so you can invoke it and hide the other layout with buttons and text views. Then show the progress bar when you process a certain request. Make it invisible!!!
add a comment |
up vote
0
down vote
up vote
0
down vote
The best way to do this is to hide the progress bar or make it's visibility="gone"
. Make sure you give it an ID so you can invoke it and hide the other layout with buttons and text views. Then show the progress bar when you process a certain request. Make it invisible!!!
The best way to do this is to hide the progress bar or make it's visibility="gone"
. Make sure you give it an ID so you can invoke it and hide the other layout with buttons and text views. Then show the progress bar when you process a certain request. Make it invisible!!!
answered Nov 19 at 15:24
ElectronSz
346
346
add a comment |
add a comment |
up vote
0
down vote
Try to use
of
android.support.constraint.ConstraintLayout
and add
android:elevation="30dp"
to the RelativeLayout tag
Try to use "RelativeLayout" )
– egorkovv3
Nov 20 at 13:49
add a comment |
up vote
0
down vote
Try to use
of
android.support.constraint.ConstraintLayout
and add
android:elevation="30dp"
to the RelativeLayout tag
Try to use "RelativeLayout" )
– egorkovv3
Nov 20 at 13:49
add a comment |
up vote
0
down vote
up vote
0
down vote
Try to use
of
android.support.constraint.ConstraintLayout
and add
android:elevation="30dp"
to the RelativeLayout tag
Try to use
of
android.support.constraint.ConstraintLayout
and add
android:elevation="30dp"
to the RelativeLayout tag
answered Nov 20 at 13:48
egorkovv3
61
61
Try to use "RelativeLayout" )
– egorkovv3
Nov 20 at 13:49
add a comment |
Try to use "RelativeLayout" )
– egorkovv3
Nov 20 at 13:49
Try to use "RelativeLayout" )
– egorkovv3
Nov 20 at 13:49
Try to use "RelativeLayout" )
– egorkovv3
Nov 20 at 13:49
add a comment |
up vote
-1
down vote
Try that
<?xml version="1.0" encoding="utf-8"?>
<layout 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">
<data>
<variable
name="handler"
type="md.dotfinance.tm.android.ui.activity.AddTraderActivity" />
</data>
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
layout="@layout/progress_bar_layout"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/common_gray_color_bg">
<include
android:id="@+id/jsonViewToolBar"
layout="@layout/tool_bar"
android:title='@{@string/add_trader}'
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/baseTextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
android:layout_marginEnd="8dp"
android:text="@string/base"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/jsonViewToolBar" />
<EditText
android:id="@+id/baseEditText"
style="@style/textViewOneLine"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/baseTextView" />
<TextView
android:id="@+id/quoteTextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/default_margin"
android:text="@string/quote"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/baseEditText" />
<EditText
android:id="@+id/quoteEditText"
style="@style/textViewOneLine"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/quoteTextView" />
<Button
android:id="@+id/startButton"
android:layout_width="0dp"
android:layout_height="@dimen/min_height"
android:layout_marginTop="@dimen/default_margin"
android:layout_marginBottom="@dimen/default_margin"
android:background="@color/button_gray"
android:text="@string/start"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/quoteEditText" />
</android.support.constraint.ConstraintLayout>
</layout>
compile error: ***Only one layout element and one data element are allowed
– Alexei
Nov 19 at 15:37
add a comment |
up vote
-1
down vote
Try that
<?xml version="1.0" encoding="utf-8"?>
<layout 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">
<data>
<variable
name="handler"
type="md.dotfinance.tm.android.ui.activity.AddTraderActivity" />
</data>
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
layout="@layout/progress_bar_layout"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/common_gray_color_bg">
<include
android:id="@+id/jsonViewToolBar"
layout="@layout/tool_bar"
android:title='@{@string/add_trader}'
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/baseTextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
android:layout_marginEnd="8dp"
android:text="@string/base"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/jsonViewToolBar" />
<EditText
android:id="@+id/baseEditText"
style="@style/textViewOneLine"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/baseTextView" />
<TextView
android:id="@+id/quoteTextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/default_margin"
android:text="@string/quote"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/baseEditText" />
<EditText
android:id="@+id/quoteEditText"
style="@style/textViewOneLine"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/quoteTextView" />
<Button
android:id="@+id/startButton"
android:layout_width="0dp"
android:layout_height="@dimen/min_height"
android:layout_marginTop="@dimen/default_margin"
android:layout_marginBottom="@dimen/default_margin"
android:background="@color/button_gray"
android:text="@string/start"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/quoteEditText" />
</android.support.constraint.ConstraintLayout>
</layout>
compile error: ***Only one layout element and one data element are allowed
– Alexei
Nov 19 at 15:37
add a comment |
up vote
-1
down vote
up vote
-1
down vote
Try that
<?xml version="1.0" encoding="utf-8"?>
<layout 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">
<data>
<variable
name="handler"
type="md.dotfinance.tm.android.ui.activity.AddTraderActivity" />
</data>
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
layout="@layout/progress_bar_layout"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/common_gray_color_bg">
<include
android:id="@+id/jsonViewToolBar"
layout="@layout/tool_bar"
android:title='@{@string/add_trader}'
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/baseTextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
android:layout_marginEnd="8dp"
android:text="@string/base"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/jsonViewToolBar" />
<EditText
android:id="@+id/baseEditText"
style="@style/textViewOneLine"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/baseTextView" />
<TextView
android:id="@+id/quoteTextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/default_margin"
android:text="@string/quote"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/baseEditText" />
<EditText
android:id="@+id/quoteEditText"
style="@style/textViewOneLine"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/quoteTextView" />
<Button
android:id="@+id/startButton"
android:layout_width="0dp"
android:layout_height="@dimen/min_height"
android:layout_marginTop="@dimen/default_margin"
android:layout_marginBottom="@dimen/default_margin"
android:background="@color/button_gray"
android:text="@string/start"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/quoteEditText" />
</android.support.constraint.ConstraintLayout>
</layout>
Try that
<?xml version="1.0" encoding="utf-8"?>
<layout 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">
<data>
<variable
name="handler"
type="md.dotfinance.tm.android.ui.activity.AddTraderActivity" />
</data>
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
layout="@layout/progress_bar_layout"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/common_gray_color_bg">
<include
android:id="@+id/jsonViewToolBar"
layout="@layout/tool_bar"
android:title='@{@string/add_trader}'
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/baseTextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
android:layout_marginEnd="8dp"
android:text="@string/base"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/jsonViewToolBar" />
<EditText
android:id="@+id/baseEditText"
style="@style/textViewOneLine"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/baseTextView" />
<TextView
android:id="@+id/quoteTextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/default_margin"
android:text="@string/quote"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/baseEditText" />
<EditText
android:id="@+id/quoteEditText"
style="@style/textViewOneLine"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/quoteTextView" />
<Button
android:id="@+id/startButton"
android:layout_width="0dp"
android:layout_height="@dimen/min_height"
android:layout_marginTop="@dimen/default_margin"
android:layout_marginBottom="@dimen/default_margin"
android:background="@color/button_gray"
android:text="@string/start"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/quoteEditText" />
</android.support.constraint.ConstraintLayout>
</layout>
answered Nov 19 at 15:31
Benjamin
428
428
compile error: ***Only one layout element and one data element are allowed
– Alexei
Nov 19 at 15:37
add a comment |
compile error: ***Only one layout element and one data element are allowed
– Alexei
Nov 19 at 15:37
compile error: ***Only one layout element and one data element are allowed
– Alexei
Nov 19 at 15:37
compile error: ***Only one layout element and one data element are allowed
– Alexei
Nov 19 at 15:37
add a comment |
up vote
-2
down vote
You need to add contraint to your include tag.
<Button
android:id="@+id/startButton"
android:layout_width="0dp"
android:layout_height="@dimen/min_height"
android:layout_marginTop="@dimen/default_margin"
android:layout_marginBottom="@dimen/default_margin"
android:background="@color/button_gray"
android:text="@string/start"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/quoteEditText" />
<include
layout="@layout/progress_bar_layout"
android:visibility="gone"
app:layout_constraintTop_toBottomOf="@+id/startButton" />
Or any other constraint.
add a comment |
up vote
-2
down vote
You need to add contraint to your include tag.
<Button
android:id="@+id/startButton"
android:layout_width="0dp"
android:layout_height="@dimen/min_height"
android:layout_marginTop="@dimen/default_margin"
android:layout_marginBottom="@dimen/default_margin"
android:background="@color/button_gray"
android:text="@string/start"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/quoteEditText" />
<include
layout="@layout/progress_bar_layout"
android:visibility="gone"
app:layout_constraintTop_toBottomOf="@+id/startButton" />
Or any other constraint.
add a comment |
up vote
-2
down vote
up vote
-2
down vote
You need to add contraint to your include tag.
<Button
android:id="@+id/startButton"
android:layout_width="0dp"
android:layout_height="@dimen/min_height"
android:layout_marginTop="@dimen/default_margin"
android:layout_marginBottom="@dimen/default_margin"
android:background="@color/button_gray"
android:text="@string/start"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/quoteEditText" />
<include
layout="@layout/progress_bar_layout"
android:visibility="gone"
app:layout_constraintTop_toBottomOf="@+id/startButton" />
Or any other constraint.
You need to add contraint to your include tag.
<Button
android:id="@+id/startButton"
android:layout_width="0dp"
android:layout_height="@dimen/min_height"
android:layout_marginTop="@dimen/default_margin"
android:layout_marginBottom="@dimen/default_margin"
android:background="@color/button_gray"
android:text="@string/start"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/quoteEditText" />
<include
layout="@layout/progress_bar_layout"
android:visibility="gone"
app:layout_constraintTop_toBottomOf="@+id/startButton" />
Or any other constraint.
edited Nov 19 at 15:34
answered Nov 19 at 15:25
Toinou
696
696
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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%2f53377666%2fprogress-bar-show-under-button%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
put your progressbar in a linearlayout and then inclue the file and also define this tag on your include element in xml => app:layout_constraintTop_toBottomOf="@+id/startButton" then you are good to go :)
– Har Kal
Nov 19 at 15:29
Not help. Same result.
– Alexei
Nov 19 at 15:40
Button
s haveelevation
by default, which will make them appear on top of other views. You can addelevation
to the ProgressBar or you can change your layout in order to have the button and progressbar not overlap.– Ben P.
Nov 19 at 17:09
set to button the next attirbutte - android:elevation="2dp" - not help. Same result.
– Alexei
Nov 20 at 8:16