I just updated the support library - and the new SwipeRefreshLayout is not my taste. Is there a way to get the old style back? There are still the setColor methods - which is kind of strange - they seem to have no use anmore. I really hope to have the old style I do not have to stick to the old library.
I actually had to do this as well - I needed the "Holo" SwipeRefreshLayout with the top horizontal line indicator as opposed to the pull-down-rotating-arrow indicator.
You can actually just reference an older version of the android support library in your project if you want the old SwipeRefreshLayout; e.g.
compile 'com.android.support:support-v4:21.0.+'
I'm not sure if version 21 is old enough; you might have to go back to 20. The caveat here is of course if you need functionality from one of the newer support library versions you won't have access to that functionality.
Related
I used Theme.MaterialComponents.Light.NoActionBar theme and it seems to be affecting constrained layout which is some of elements(such as buttons) can not see in the "Design and Blueprint". But they are appearing properly when the app is running.
I tried the following steps but no use.
1) Try to clean the project
2) Try to invalidate and restart Android Studio
3) Try Rebuilding the project
I tried adding Base key word but it seems to be wrong.
<style name="AppTheme" parent="Base.Theme.MaterialComponents.Light.NoActionBar">
I'm currently using the latest dependency which is 'com.google.android.material:material:1.1.0-alpha07'
It seems to be ok with early dependency such as 'com.google.android.material:material:1.0.0' but I'm wondering why it is not working with the latest releases.
I could use different theme which do not have material components and overcome this problem as well, but it is not what I'm expecting.
Your answers and comments are highly appreciated.
This issue is directly related to the version of material design. I used the latest version of android studio with latest version material design in the constraint layout. The same issue happened when I dropped a button from the palette to layout, it made the layout vanish and I changed the theme to the default, it also worked fine. But as u said, I should use material design. When I used latest material design version( com.google.android.material:material:1.7.0), it didn't work but when I used com.google.android.material:material:1.5.0, it worked fine. That's why u can change the version to find the one which is compatible and not buggy.
I am really new to android so pardon me. Why is there a strike-through
for example (fill_parent)
in some android variables and not others
The strikeout shows deprecated methods or attributes (assuming you are using Android Studio / IntelliJ). In your case FILL_PARENT (LayoutParams?) is deprecated for a really long time (API Level 8). It is now called MATCH_PARENT (see https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html). Hovering the variable should show you a tooltip with more information on the deprecation and when it was deprecated. Just make sure you don't use those deprecated elements.
Using the Design Support Library version 23.0.1, menu items within the NavigationView appear to, by the default, support the ripple animation when selected. However, when upgraded to Design Support Library version 23.1.0 the ripple animation appears to be lost. Is this a bug? Has anyone else noticed this as well and can replicate it? And, better yet, does anyone have a solution?
I first discovered this issue while utilizing the NavigationView via Design Support Library version 23.4.0 and noticed a lack of the ripple effect on menu items. However, it wasn't until I followed this NavigationView tutorial, provided by AndroidForDevs, that I was able to place blame on Design Support Library version 23.1.0.
To replicate and reproduce the issue, checkout this tutorial's sample code, which utilizes Design Support Library version 22.2.0, and bump the version to 23.1.0 in the app's build.gradle. You'll then notice the menu items do not ripple when selected. However, if you revert back to version 22.2.0 or 23.0.1 you'll notice the items ripple when selected.
For reference, here is a link to the Support Library change log. While it mentions an update allowing for custom views within the NavigationView I can't think of why this might have led to the removal of the ripple effect by default as it sounds unrelated. Here is change description word-for-word
Added support for custom views to the NavigationView class by using
the app:actionLayout attribute or MenuItemCompat.setActionView()
method.
Note: This issue is most easily visualized when the drawer is prevented from closing when a menu item is selected. This can be achieved by commenting this line
after update the version 23.2.0 of the appcompat, when I first run the application I find that the screen looks horrible, all the layout looks horrible in all activities in the app.
I have to uninstall the application and install it again to work well.
What can be ?
I'm desperate
i had the same problem a few days ago. This is because the new support library have new changes for the RecyclerView and the most important for your case is the following:
RecyclerView.LayoutManager no longer ignores some RecyclerView.LayoutParams settings, such as MATCH_PARENT in the scroll direction.
Note: These lifted restrictions may cause unexpected behavior in your layouts. Make sure you specify the correct layout parameters.
So you should review your .xml in order to use the correctly height and width that before was ignoring it.
You can see more of the changes in this new version of the library here.
I've discovered the problem, it is the THEME of the application.
I have defined several themes in my app (styles.xml), I give the user to select some of them, and when the user select a color theme, i save the ID of the theme in a SharedPreferences and i assign the theme to the activity with setTheme(int) but something happened in the latest version of appcompat that the id i saved do not match and do not exist anymore. I'll have to save something else and not the id(int) of the theme
I realized that when i delete the "data" from the application and everything worked fine, because when i deleted the data the sharedpreferences is deleted too.
I want to know if someone knows a library that contains a back ported implementation for ListPopupMenu that works on pre android 11
I don't but you could use PopupWindow whcich is available since API 1. You can create a list as your contentView. You can use showAsDropDown which could give you the same type of effect
This might be worth checking out. I like to use it for backwards compatibility sometimes for the effect it gives
PopupWindow
showAsDropDown