I originally had this working with ActionBarSherlock but since re-working my code to use the android.support.v7 libraries I'm seeing a blurred blue overlay when the SearchView is expanded.
The following is a screenshot from my Nexus 7 with the soft keyboard open.
When I close the keyboard the blurred blue image disappears but there is still a blur to the SearchView as in the image below.
I'm using a menu xml file to create the various menu items - the search item is as follows...
<item android:id="#+id/options_menu_search"
android:title="#string/search"
android:icon="#android:drawable/ic_menu_search"
com.mycompany.mypackage:showAsAction="ifRoom|collapseActionView"
com.mycompany.mypackage:actionViewClass="android.support.v7.widget.SearchView" >
</item>
It does actually work in the sense I can perform searches but for the life of me I can't work out where the blurred images are coming from.
I did find this SearchView drawables in ActionBar appear blurred but the accepted answer doesn't apply to my problem as I'm not creating the SearchView programatically.
Has anybody seen anything similar and found a fix?
I eventually found an answer to this problem. It seems like a bug in the Build Tools. Anything from v18 onwards causes this problem and I'm now sticking with Build Tools v17.
See this question and the OP's own answer (particularly the EDIT at the end)...
Searchview on support.v7.appcompat.library issue: default 9-patch background not renders properly
Related
After latest update of the Android Studio, the ActionBar doesn't appear in the preview screen. I reloaded the program several times, but it didn't help. Also, the text on the button looks a bit weird, but that isn't the main issue.
enter image description here
It looks like I just needed to enable "Show Layout Decorations", but rendering problem hasn't gone rendering problem
recent update to google chrome on android makes the navigation bar background white & dark themed sites look crappy with this at the bottom imo (screenshot below).
im wondering if there is a way to control the color with meta tags or something similar to how the top area theme color can be controlled like...
<meta name="theme-color" content="#353535" />
or any sorta way to alter this? even just setting to black would be great, dont really need a custom color. tried looking around through documentation but couldnt find anything exact, might not be doable. apologize if my terminology might be off.
screenshot of the white navigation bar at the bottom for reference
This is not fixable in Chrome 67. Whether or not it will be fixed is tracked in this chromium issue. Star it if you're interested in the issue getting more attention
https://bugs.chromium.org/p/chromium/issues/detail?id=797527
According to what I saw, there isn't a way to do this now. Maybe Google will add a way to do this in a future update but for now they are apparently using this to limit the burn in on the screens.
So we are unfortunately stuck with it for now
The last few days I've been doing great stuff in development, but I've seem to have hit a wall on something probably stupid simple. It's annoying. I was hoping I could get some help.
What I'm trying to do
I'm trying to create the awesome transparent ActionBar animation effect from Google Music (as described by Cyril Mottier here)
The problem
I can't even get the actionbar to go into overlay / transparent mode.
My set-up
I've got a library-oriented set-up in Eclipse. I've got a library project (let's call it master) that contains all the actual code and activities. Then I've got a project, that just plugs into the master library (let's call it slave). Lastly there's some open source support libraries that master uses (among others is ActionBarSherlock).
The activity I'm trying to apply this effect to is in the master library. It is declared in slave's manifest as com.example.master.DetailActivity, and that works like a charm.
Also: The theme for the activity may come from several places. Either it's set by slave's manifest, or by master at runtime. Themes may come from the master OR the slave project.
What I've tried
Feels like everything. I've started out by creating a custom theme based on Cyril's article. I made sure that for every item I've had a version with and without the android: prefix as per Jake Wharton's instructions.
I've also tried setting it at runtime using requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
What I've got
Nothing. The theme applied succesfully (I can see the actionbar's colors change appropriately), but it NEVER goes into overlay mode, nor does it become transparent.
Help would be greatly appreciated, and would probably be helpful to other's trying this effect.
EDIT:
Here are my themes and styles. Codes are kinda messy because I've been experimenting with them to see where I was going wrong. AppTheme and Theme.TranslucentActionBar.ActionBar.Overlay both won't work.
/res/values/
styles.xml
themes.xml
/res/values-v11/
styles.xml
themes.xml
I'm testing on a Nexus 4 with 4.2.2 installed as well as a 2.3.3 emulator.
OK, so apparently, with my set-up, you can't do it using themes.
I ended it up doing it, globally like this.
setTheme(theme.whatever);
requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
super.onCreate(savedInstanceState);
setContentView(R.layout.content);
getSupportActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.color)); // This is #212121 solid color for the dark action bar.
The lines are spread out over my code, but this is the gist of it. The order is important.
I also found out that sliding menu seemed to be blocking the overlay mode. I had to remove the instance for it to work. I'm still looking for a way to enable both overlay mode and the sliding menu.
I use ActionBarSherlock on my app compiled with Android 4.0.3.
When testing on my device running JellyBean 4.2.1, I can see the overflow icon both in the ActionBar and in the bottom buttons bar.
See Screenshot.
How can the bottom overflow button be removed?
EDIT: Both buttons work!
Increase your android:targetSdkVersion to 14 or higher, as I outline in this blog post.
I create a menu like that in my app and have some items in a menu.xml that looks like this:
<item
android:id="#+id/menu_main_about"
android:orderInCategory="100"
android:showAsAction="never|withText"
android:title="Acerca de"/>
Maybe you are supplying some extra or different attributes that cause that behavior. Please try with this to confirm that.
In the samples that brings the ActionBarSherlock, one's of these are what you need.
I think my SearchView widget population is working. However, all I see in the suggestions list are white text blocks. When I select one of the white blocks I see an orange highlight and I see the text behind the orange highlight. So it seems I'm showing white text and white background in my suggestions list. Any ideas on how to change that?
It doesn't look like you can customize your searchView. You could try setting the backgroundcolor of your searchview to (Color.WHITE).
I had exactly the same issue. I found that the root cause of the issue is related to theme I selected when creating the Android application project in Eclipse. I was using Android API 14, and originally I selected theme as None. I searched the web extensively and did not find an answer or even a similar question about this issue, which made me think that this is a very uncommon issue (most of people don't run into this issue). So I decide to create a new Android Project, with exactly the same components and set up, this time, only changed the theme from None to "Hollow Light with Dark Action Bar", suddenly, my search view suggestion drop down texts started to become visible. Now I went back to my original project, in AndroidManifest.xml, under Application tag, set android:theme="#android:style/Theme.Holo.Light.DarkActionBar", the search view suggestion drop down texts start to become visible in my old project now.