I want to use Pull-To-Refresh Library in my App that is already developed and the source is here.
I am running the launcher sample on Android 2.3.5.
The problem is when we add the PullToRefreshListView to our List with black background, the white separators between the items (dividers) disappear.
It is the same for me in my own app and in the sample of the link. Could you help me?
Try to apply below code
its is working programatically.
listview.getRefreshableView().setDividerHeight(0);
I should modify the activity_ptr_list.xml file. I forgot to fix the android:divider:
<com.handmark.pulltorefresh.library.PullToRefreshListView
android:id="#+id/pull_refresh_list"
android:cacheColorHint="#00000000"
android:divider="#FFFFFF"
try to apply next style to your ListView:
<item name="android:cacheColorHint">#android:color/transparent</item>
Related
I'm new at programming in Android studio and am trying to do something like this video down below. I don't know what should I use and how even to start, is this something like a collapse toolbar or something else? Thanks for the help :)
Video click here
Thanks all,
Peace :)
I think you should use:
CoordinatorLayout
AppBarLayout
CollapsingToolbarLayout
Here I found "similar" issue.
Issue with CoordinatorLayout and ImageView that adjusts width while scrolling
If you don't want your immage to fade completely, you can always set:
app:layout_collapseMode="pin"
Can Someone please help me out, in android studio there is only one default status indicator(Progress bar) that is vertical. I want to add a horizontal status indicator in my app please help, Thanks in advance.
Try to add this style to your ProgressBar, make sure you don't forget to add wrap_content to your layout-height attribute.
style="?android:attr/progressBarStyleHorizontal"
Also if you would need this, there is a nice option to make your ProgressBar to look like a loading bar, you need just to add this line to your ProgressBar layout:
android:indeterminateOnly="true"
I tried o follow another post and change the theme of my app to Theme.light but that broke my project so I reverted to my original theme that the blank activity starts with. I am building an app with a basic calculator feature and I want to style the EditTexts into text boxes but I don't want to change the theme of my app. Any ideas?? Thank you for any help you can provide!!
If you want to make some text box you could use the following attribute for EditText:
android:background="#android:drawable/editbox_background_normal"
So it would look like below. Hope that helps.
i am trying to add a scroll screen layout in my app just similar to main screen scroll of any android mobile. How can i Add such a screen in my activity.
Check the image below.
You can do this by using ViewPager. The ViewPager is also included in the Support library, so you can use it on HC< . It works excactly like this.
There are also custom implementations of the ViewPager, which increases its possibillities e.g.: The ViewPager from Jake Wharton.
This can be done by using "SwipeView"
A SwipeView is an Android UI view similar to the homescreens. You have several similar panes of content that you access by swiping left and right.
You can either go with Android ViewFlow or ViewPagerIndicator
Use Jack Wharton's ViewPagerIndicator, it should work for you.
https://github.com/JakeWharton/Android-ViewPagerIndicator/
I have a custom spinner dropdown xml file in /res/layout/:
spinner_view_dropdown.xml:
<?xml version="1.0" encoding="UTF-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/spinner_item_dropdown"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#android:color/transparent"
style="#style/spinner_item_dropdown" />
I'm setting the spinner dropdown via java:
// "Spinner", aka breadcrumbs
Spinner spin = (Spinner) findViewById(R.id.breadcrumb_dropdown);
ArrayAdapter adapter = ArrayAdapter.createFromResource(this, R.array.breadcrumb, R.layout.spinner_view);
adapter.setDropDownViewResource(R.layout.spinner_view_dropdown);
spin.setAdapter(adapter);
// /"Spinner"
Unfortunately, a white background still exists on the spinner popup regardless if I set the background to transparent.
How do I fix this?
You can override the style for the dropdown, and the dropdown item by using a Theme in your app that inherits from one of the Android themes, then override the
android:dropDownSpinnerStyle, or android:spinnerDropDownItemStyle, and even the android:dropDownListViewStyle attribute of the theme, pointing to your own custom style instead of the Android style that is defined in their theme. I created a fully customized spinner this way, with a transparent button AND dropdown. I even got rid of the dropdown list dividers, and set my own spacing for the dropdown items when I built the tablet app for Fandango (take a look at the sort movies spinner on the main page of the app).
Everything in Android is customizable, you just have to know where to look. ;-)
Try setting on the spinner this:
android:popupBackground="#android:color/transparent"
The layout you're defining is only used for an entry of your drop-down, not the drop-down itself. So setting the background to transparent won't have any effect on its background. But even if it would, setting the background to transparent would still have no effect, because a TextView (actually I believe any view) has a transparent background by default.
That being said, the right question would be: can you provide a custom layout for an entry's parent view (which is probably a List)? As far as I know, the answer is no, unfortunately.
Try
android:cacheColorHint="#00000000"
to get transparency.
I dont know if it works for you but there is a post
http://android-developers.blogspot.com/2009/01/why-is-my-list-black-android.html
that explains why the moving parts of a list appear in the background color.
Maybe its the same issue with your spinner.
It's a bug in 1.5 I think, see here
http://www.symsource.com/index.php?view=article&id=418&option=com_content&format=pdf
Run it in a 1.6 emulator or device, does it still stay white?
I actually came here looking for an approach to this, I suspect this may involve manually writing to the canvas or something like that.
Any ideas.
P.S. Accidentally posted when I thought I was logged in, anyone know how to get rid of the anonymous comment? Maybe an admin could fix this?