I am working on Android application. I am using progressBar component inside my application and I trying to put small button on the reached point in the progressBar. but all my tries fails to do this
The code of my progressBar.
<ProgressBar
android:id="#+id/progressBarStartScreen"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginBottom="14dp"
android:minHeight="14dip"
android:progressDrawable="#drawable/customprogressbar"
>
</ProgressBar>
And my button code is
<Button
android:id="#+id/setttingButton"
android:layout_width="wrap_content"
android:layout_height="51dp"
android:layout_weight="1"
android:background="#fff"
android:text="Reached Point"
android:textColor="#d85546"
android:textSize="25sp"
android:textStyle="bold" />
This image to describe what I mean.
Please There are any one to help me to put the button on the reached pointed in Progress bar.
Thanks and Regards
You can try to use this work around
#Override
protected void onProgressUpdate() {
//Do something...
}
This might not be exactly what you're looking for, but I'm quite positive that when the user touches the progress bar, it will move slightly.
This will work best when you set progressBar.setMax() to a high number.
Related
When I place a button in a layout, it has a standard gray background. However I want to make it more like the kind of button you see in the Dialogs where it's a background-less button (e.g. the white buttons with text).
Like this
Not like this... not like this...
Old question but I just stumbled on it and have the answer (or at least I think), I really don't know if that's the best approach, but it should do the job.
<Button
android:id="#+id/sign_in_button"
style="#style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
The trick here is the #style/Widget.AppCompat.Button.Borderless.Colored. Also see this answer, it explains a lot https://stackoverflow.com/a/36666660/1920068
try this
android:background="#android:color/transparent"
Just use a TextView instead, and put a click effect with the background:
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#23ac29"
android:text="Signup"
android:textSize="18sp"
android:padding="8dp"
android:background="?android:attr/selectableItemBackground"/>
I will be glad to get some help with how to do a speed animation bar for android app. Something like what is shown here so it fills up automatically but for an app.
So far I found this code, which pretty resembles what I was aiming for but
I don't want the animation to show on a pop up, but as part of the page.
If you are not sure please point me to the right source so I will figure out how this works.
Any help would be much appreciated:)
Add progress base in your activity layout (R.layout.main);
<ProgressBar
android:id="#+id/mybar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="38dp" />
And instead of doing this
progressBar = new ProgressDialog(v.getContext());
do this after setContentView();
progressBar = (ProgressBar) findViewById(R.id.mybar);
I am trying to create a custom auto complete text view that contains a progress bar (circle in my case).My problem is that every time the user inputs a char a web service is accessed and there is some delay until a display some results.I would like to place a progress circle that will suggest to the user that there is some work in progress.As an excelent example of what i would want you could take a look at googles maps address auto complete.
Thanks for any suggestions.
I think an AutoCompleteTextView is something what you are looking for.
Also, link to a tutorial.
Edit: For the progress bar part, I would have had a infinite progress bar on the title bar of my application. I feel that would be a more complete solution as I can re-use it for any other task also. Something similar is discussed here.
Use the below code for the implementation
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<AutoCompleteTextView
android:id="#+id/lkjk"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:completionThreshold="3"
android:dropDownHeight="200dp"
android:ems="10"
>
<requestFocus />
</AutoCompleteTextView>
<ProgressBar
android:id="#+id/progress_bar"
android:layout_width="25dip"
android:layout_height="25dip"
android:layout_gravity="right" />
</FrameLayout>
Follow http://developer.android.com/resources/tutorials/views/hello-autocomplete.html think and user Progress bar and u need to Use Handler in this case
There are two numbers constantly displayed in my UI. I need the user to be able to specify those numbers. In a desktop app I simply use 2 spinbuttons, and can beat it (I guess). However, there are problems with this in Android (I am targeting Android 3-based tablets).
First of all, I've tried NumberPicker widget, but it simply does not show itself properly (I've asked a question about it, but no response so far).
Then I've tried some 3rd-party numberpicker implementations one cand find on the Web, but for various reason didn't like neither of them. Some of them are too large to fit the side panel I'm squeezing controls into, some are just ugly (and too small, probably), and all of them automatically grab input focus causing the keyboard to show every time I open this side panel.
There is another option - only show the uneditable label with a number on the panel, and show popup window with some numberpickers in it. Apart from me not knowing how to implement such a popup (just learning), how do I decorate the label so that the user understands he can tap it to edit?
Perhaps, there are better solutions for this problem? I took a look at some apps from Google Market, and they all seem to either use huge NumberPickers at the center of the screen (and I need as much of the screen as possible clear), or a popup with the same huge Numberpickers I don't particularly like.
Can you suggest anything else? Thanks in advance!
There are two different issues in your question:
For the number picker for eaxmple in my case I have created a simple tool. You can just put a button with the text "-" then a textview and then a button with "+". You put it in a linear layout and t can be vertical or horizontal. If you want it you can make it very small. For example here is what I have wrote but you can try playing with the options to see which is better for you.
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="wrap_content" android:layout_height="wrap_content">
<LinearLayout android:orientation="vertical" android:id="#+id/linearLayout1"
android:layout_width="wrap_content" android:layout_weight="1"
android:layout_height="wrap_content">
<Button android:id="#+id/button22" android:layout_gravity="center"
android:layout_weight="1" android:text="+" android:gravity="center"
android:layout_width="30dip" android:layout_height="30dip"></Button>
<Button android:id="#+id/button11"
android:layout_gravity="center"
android:layout_weight="1" android:text="-"
android:gravity="center" android:textAppearance="?android:attr/textAppearanceSmall" android:layout_height="30dip" android:layout_width="30dip"></Button>
</LinearLayout>
<LinearLayout android:id="#+id/linearLayout2"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="1" android:orientation="vertical">
<Button android:layout_weight="1"
android:layout_height="fill_parent"
android:layout_width="30dip"
android:text="0" android:id="#+id/quantidad"></Button>
</LinearLayout>
then you can add onClick listeners on the buttons and setup to increase or decrase the text displayed in the text view.
As for the keyboard well if you use that example you not need it but if you use an edittext then you can setup an option for the keyboard to be hidden in the manifest: you can see the option here http://developer.android.com/guide/topics/manifest/activity-element.html
I am looking for a view or some sort of information regarding the bottom bar in default applications of Android such as Email, or Unlock pattern as shown in the picture below. I have not been able find anything about this on Androids site nor from Google searches.
Image: http://img11.imageshack.us/i/viewdn.jpg/
I believe that Christopher is correct; there is no special widget to create the bar in your image. However, if you want to emulate it, you can create a layout and use the style style="#android:style/ButtonBar". That will give you the light gray background and the correct margins.
I don't believe there's any standard view for the button bar used at the bottom of these apps; it's generally just two Button items placed together in a LinearLayout or RelativeLayout.
For example, looking at the Android Open Source Project, you can see the button bar for one of the email app setup screens is defined as two plain old Button objects.
However, it is surprising that Google didn't abstract more of the common stuff into an Android theme or sublayout, rather than having the same views and attributes in each layout XML.
From: http://code.google.com/p/k9mail/source/browse/k9mail/trunk/res/layout/account_setup_basics.xml?r=1314
<RelativeLayout
android:layout_marginTop="-45dip"
android:padding="0dip"
android:layout_alignParentBottom="true"
android:gravity="bottom|right"
android:background="#android:drawable/bottom_bar"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<Button
android:id="#+id/manual_setup"
android:text="#string/account_setup_basics_manual_setup_action"
android:minWidth="#dimen/button_minWidth"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginBottom="-4dip"
android:layout_alignParentLeft="true"
android:layout_centerVertical="false"
/>
<Button
android:id="#+id/next"
android:text="#string/next_action"
android:minWidth="#dimen/button_minWidth"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:drawableRight="#drawable/button_indicator_next"
android:layout_marginBottom="-4dip"
android:layout_alignParentRight="true"
android:layout_centerVertical="false"
/>
</RelativeLayout>