I'm trying to customize the letter popup that appears during scroll. I was able to change it's colors and the position from my styles, but I need to make the text and the whole element bigger as well as move it closer to the vertical center of the screen. Is any of these things possible? How can I do them?
This is my current code from my style.xml file:
<item name="android:fastScrollOverlayPosition">floating</item>
<item name="android:fastScrollTextColor">#000000</item>
<item name="android:fastScrollPreviewBackgroundLeft">#drawable/square</item>
<item name="android:fastScrollPreviewBackgroundRight">#drawable/square</item>
I don't have any info about further customization of the default overlay.
There's a more flexible alternative, though. You could add a TextView to your layout which only appears when the user is scrolling, and show the letter returned from your SectionIndexer's getPositionForSection method. You could then style this view exactly to your liking, and center it in a full-screen RelativeLayout.
Related
The current problem is that our theme is inheriting from Theme.AppCompat, which appears to have a white scrollbar, and that is not visible on the white background.
I know that I can use
<item name="android:scrollbarThumbVertical">#drawable/scroll_thumb</item>
And create a shape for the custom Scrollbar. But I only want to change it to a darker color. When I use a simple colored rectangle shape, it has a different width than the normal scrollbar.
Is this possible?
ok, it is possible to use a color for the scrollbarThumbVertical item value, but this will change the width, so I set the size to 4dp, which
seems to be the same as in the other views with the native scrollbars
<item name="android:scrollbarSize">4dp</item>
<item name="android:scrollbarThumbVertical">#color/scrollbar_thumb</item>
I don't like having to set the size, but I don't see any other way that would be cleaner.
I have a custom theme created with this generator. It has a custom style for Spinners which I don't like. I want to change the background drawable but I can't seem to figure out which property controls this.
This is what the themed version looks like
And here is what it will look like when using the Holo.Light theme.
Notice the dark gray lines around the dropdown list in the first (themed) image. This is what I want to get rid of. What property controls this? I want them to match the default.
Also, what controls the vertical aligment of the dropdown list? As you can see, it is overlapping with the Spinner in the first image (the line under it isn't visible as it is in the second image).
The attribute you want is android:popupBackground on the Spinner element.
If you look closely, the holo popup also overlaps the spinner some, but there is a bunch of padding for the drop shadow, so it looks good.
However, you can use android:dropDownVerticalOffset on the Spinner element to adjust it.
We came across the same issue. It has to do with the Android Holo theme generator.
Here are the lines that you should remove from your Theme.xml file...
<item name="android:spinnerStyle">#style/SpinnerCustom</item>
<item name="android:spinnerDropDownItemStyle">#style/SpinnerDropDownItemCustom</item>
<item name="android:popupMenuStyle">#style/PopupMenu.Custom</item>
<item name="android:dropDownListViewStyle">#style/DropDownListView.Custom</item>
<item name="android:actionDropDownStyle">#style/DropDownNav.Custom</item>
...by removing these, we now have the standard Holo.Light theme on the spinner dropdowns.
You need to change the parent of spinnertheme to android:Widget.Holo.Light.Spinner
<style name="SpinnerTHEME" parent="android:Widget.Holo.Light.Spinner">
<style name="spinner_style" parent="android:Widget.Holo.Light.Spinner">
<item name="android:paddingLeft">#dimen/ten_dp</item>
<item name="android:paddingRight">#dimen/ten_dp</item>
</style>
I need to customize ScrollView so it will look like in the picture:
I already successfully customized the Thumb and the Track, but I don't know how to add Arrows like in the picture I provided.
Here is the style I'm using:
<!-- Scrollbar -->
<style name="scroll_view">
<item name="android:scrollbarAlwaysDrawVerticalTrack">true</item>
<item name="android:scrollbars">vertical</item>
<item name="android:fadeScrollbars">false</item>
<item name="android:scrollbarThumbVertical">#drawable/sb_thumb</item>
<item name="android:scrollbarTrackVertical">#drawable/sb_track_vertical_bg</item>
</style>
The Arrows should be a part of the ScrollView style to avoid extra spacing and also they need to be simple, non clickable and e.t.c.
If you want to add buttons for up and down, you can place two buttons above and below of Scrollview.And programatically scroll the scroll bar on button click.
For that purpose, you can use following code,
scrollview.scrollTo(5, 10);
I'm using this tutorial:
http://android-developers.blogspot.com/2011/04/customizing-action-bar.html
I set a drop down list theme like this
<!-- style the list navigation -->
<style name="MyDropDownNav" parent="android:style/Widget.Holo.Light.Spinner.DropDown.ActionBar">
<item name="android:textColor">#ffffff</item>
</style>
and now pressing the spinner causes it to show up centered on the screen instead of as a drop down. Has anyone run into this? I'm using exactly what they said in the example. Even if I remove the text color and just have the empty style that is based on the parent, the spinner appears in the middle of the screen. Has anyone discovered a way to fix this?
Edit: One more thing I forgot to mention, the style does not even update the text to be white.
Found the solution, the parent is incorrect in the example. It should be:
parent="android:style/Widget.Holo.Light.Spinner"
I am designing an android user interface I am facing some problem in designing it can anybody guide me.
I need UI same as the above where there is not space between 2 EditText.
Regards
Altaf
You need to change its background. The default Android EditText has padding because of its background.
Here's the EditText's background xml description:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true"
android:drawable="#drawable/editbox_background_focus_yellow"/>
<item android:drawable="#drawable/editbox_background_normal"/>
</selector>
Just provide image for these states, create a similar drawable xml file in your project and you'll be able to change how EditTexts look like.
You need to set the background to either your own drawable or a color. Try setting the background of each EditText to #FFFFFFFF, and make sure there are no margins set. That will cause them to be flush next to each other.
For the grey separator between the 2, add a View (just plain View) with layout_height of 1dp and layout_width of fill_parent between the two EditTexts. Then set the background color of that to #FF868686.