I am developing an application that has a home page with a progress bar I have to represent many progress bar on slideshow, I tried ViewFlipper but its only for images. What shall I do. help.`
viewFlipper=findViewById(R.id.Vi);
b = findViewById(R.id.progressBar);
viewFlipper.addView(b); //this doesn't work
the layout
<ViewFlipper
android:id="#+id/Vi"
android:layout_width="412dp"
android:layout_height="263dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.110000014"></ViewFlipper>
This where should the slideshow should be
Create a scroll view and add the progress bar on a recycler view as item in order to show them on the scroll view on parent app
Related
I have a spinner element inside a table row, like this:
<TableRow android:background="#drawable/cell_styles_1">
<TextView
android:text="Bill type"
android:layout_width="match_parent"
android:fontFamily="sans-serif-condensed"
android:textColor="#color/white"
android:padding="5dp"
android:layout_marginStart="10pt"/>
<Spinner
android:layout_width="wrap_content"
android:id="#+id/bill_type"
android:textStyle="bold"
android:textColor="#color/white"
android:padding="5dp"
android:layout_marginStart="10pt">
</Spinner>
</TableRow>
Rendered view:
Please click here
I want an animation to play where the spinner is focused, so that it gets highlighted to the user. For this purpose I implemented TapTargetView library, like this:
TapTargetView.showFor(this,
TapTarget.forView(findViewById(R.id.bill_type),)
.outerCircleColor(R.color.red)
.outerCircleAlpha(0.96f)
.targetCircleColor(R.color.white)
.titleTextSize(20)
.titleTextColor(R.color.white)
.descriptionTextSize(10)
.descriptionTextColor(R.color.red)
.textColor(R.color.blue)
.textTypeface(Typeface.SANS_SERIF)
.dimColor(R.color.black)
.drawShadow(true)
.cancelable(false)
.tintTarget(true)
.transparentTarget(false)
.icon(Drawable)
.targetRadius(60),
new TapTargetView.Listener() {
#Override
public void onTargetClick(TapTargetView view) {
//do something
}
});
But to my utter disappointment, it just shows a circular focus on the spinner. I want the complete spinner to be focused (the one outlined by the blue border in the image). Is there a way to do so? Is there any other library which will give the desired output?
Im currently working on my bottom navigation bar, and I am very satisfied on how it turned out, my problem is that I use the Layout behaivour hide while scrolling, and if I now change my fragment while scrolling down my bottom navigation is hidden on a page where you cannot scroll up again to show the bottom navigation, so its stuck on hidden!
here is my XML for the bottom navigation bar:
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="#+id/navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="10dp"
android:elevation="50dp"
android:background="#drawable/round_bottomnavigation"
android:layout_gravity="bottom"
app:labelVisibilityMode="unlabeled"
app:layout_behavior="com.google.android.material.behavior.HideBottomViewOnScrollBehavior"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/FragmentContainer"
app:menu="#menu/bottom_navigation_menu" />
the fragment changing is just a on click listener and a switch, and its on Main Activty.
Thanks in advance for takin your time for me.
In my Android app, I have a WebView and 6 buttons inside a ConstraintLayout. The WebView should zoom fully out on start, but it instead goes only to the width of the device.
The WebView is set up like layout_width="fill_parent" layout_height="0dp", which should be match_constraint
My current code is:
web.getSettings().setSupportZoom(true);
web.getSettings().setBuiltInZoomControls(true);
web.getSettings().setDisplayZoomControls(false);
web.getSettings().setLoadWithOverviewMode(true);
web.getSettings().setUseWideViewPort(true);
WebView XML:
<WebView
android:id="#+id/webView"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:clickable="false"
app:layout_constraintBottom_toTopOf="#id/button1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible">
</WebView>
I expect the WebView to show the full image/video, but it's still scrollable in horizontal direction, sometimes it even puts black bars below and above it.
Video demonstation: https://youtu.be/ucmLNksNGRI
I'm trying to use a progress bar (the normal one, not the horizontal one) as a compass of sorts, but for some reason the bar just keeps spinning without control. I've set the indeterminate to false, both in the xml and in the attached Java code, but it seems to do nothing.
This is the xml code for the View:
<ProgressBar
android:id="#+id/brujula"
style="?android:attr/progressBarStyle"
android:layout_width="229dp"
android:layout_height="507dp"
android:layout_marginStart="91dp"
android:layout_marginTop="90dp"
android:layout_marginEnd="91dp"
android:layout_marginBottom="135dp"
android:visibility="invisible"
android:indeterminate="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
The code I'm using to set it to false in Java too is
ProgressBar brujula = (ProgressBar) FindViewById(R.id.brujula);
brujula.setIndeterminate(false);
I have no idea whatsoever of why it keeps doing that, so any help at all will be appreciated
hi try this if you want to show progressbar do like this.
ProgressBar brujula = (ProgressBar) FindViewById(R.id.brujula);
brujula.setVisibility(View.VISIBLE);
and where you want to stop loading and want to hide progressbar use
brujula.setVisibility(View.GONE);
If you want to use the Progress bar again it's better to just hide it:
brujula.setVisibility(View.GONE);
Or you can remove it completely:
((ViewGroup) brujula.getParent()).removeView(brujula);
I have tried marquee limit 1 but it does not work
<TextView
android:id="#+id/marqueText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:marqueeRepeatLimit="1"
android:textStyle="bold"
android:textColor="#FFFFFF"
android:gravity="center"
android:singleLine="true"
android:textSize="26sp" />
</RelativeLayout>
It seems to me that you are looking for the marquee animation. There is no XML attribute that you set for that purpose
This is a good link for the marquee animation in android. Hope it helps!
The XML attribute simply fades the textview if it goes out of your device screen.
Try using setSelected(true) method of TextView in onCreate()
TextView textView = (TextView) findViewById(R.id.marqueText);
textView.setSelected(true);