android-appcompat

popupBackground glitches with Material Design

◇◆丶佛笑我妖孽 提交于 2020-01-03 06:44:13
问题 I have been working on updating my apps to Material Design. I have an app that uses tabs. For some reason whenever I use android:popupBackground to set the drop down menu color it freaks out. I set up a default project with tabs and used the following theme and the same thing happened. Has anyone one else had this problem? My app is open source and so all the code is available here GitHub <?xml version="1.0" encoding="utf-8"?> <resources> <style name="AppTheme" parent="Theme.AppCompat.Light

Using AppCompat Toolbar with FrameLayout

房东的猫 提交于 2020-01-02 07:32:10
问题 So my XML goes like this: <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" > <android.support.v7.widget.Toolbar android:id="@+id/my_toolbar" android:layout_height="56dp" android:layout_width="match_parent" android:minHeight="?attr/actionBarSize" android:background="?attr/colorPrimary" /> <FrameLayout

onPrepareOptionsMenu in Fragment not being called as of AppCompat v22 (API 10)

时间秒杀一切 提交于 2020-01-02 04:52:24
问题 We have an app that uses AppCompatActivity with multiple fragments, each of which contribute to the options menu. (i.e. the fragments override onCreateOptionsMenu and insert their own menu items) The fragments also override onPrepareOptionsMenu , in order to conditionally enable/disable certain menu items based on the state of the app. Prior to the updated version (22) of appcompat, the onPrepareOptionsMenu function was called for each fragment, and everything was working correctly. But now,

How to trigger swiperefreshlayout in android?

℡╲_俬逩灬. 提交于 2020-01-02 04:35:13
问题 I want to trigger my SwipeRefreshLayout in the event onCreateView of my MainFragment . What I want to do is start downloading the information in the event onCreateView and at the same time I show the SwipeRefreshLayout refreshing. Any ideas? Here is my code in my Java code in MainFragment @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_main, container, false); SwipeRefreshLayout

AppCompat v7 r21 changing Alpha of the ActionBar's title

别来无恙 提交于 2020-01-01 19:56:32
问题 With the previous versions of AppCompat it was easy to get the ActionBar 's title TextView and modify it. There is the method I was using: private TextView getActionBarTitleView() { int id = getResources().getIdentifier("action_bar_title", "id", "android"); return (TextView) findViewById(id); } And then to change the alpha's value of the title: getActionBarTitleView().setAlpha(ratio*255); Now for some reasons, "action_bar_title" with the lastest AppCompat version isn't working anymore. When I

toolbar not appearing in pre lollipop devices

不问归期 提交于 2020-01-01 12:25:27
问题 Toolbar is not appearing on pre lollipop devices. I'm using drawer layout with toolbar. The same toolbar works on other activities but not when used along with drawer layout. Activity with drawer layout and toolbar @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_home_screen); { /*supportChatImageButton = (ImageButton) findViewById(R.id.homeSupportChatImageButton); orderImageButton = (ImageButton) findViewById

Android L ActionBarActivity using Feinstein SldingMenu and AppCompat v21 is cut off at bottom of the screen

我与影子孤独终老i 提交于 2020-01-01 12:09:06
问题 I'm using AppCompat v21 with the Style "NoActionBar" and add a Action/Toolbar in onCreate . Also a SlidingMenu of Feinstein is added and that causes the problem that the that the Activity (and therefore the inside Fragments) overlap with the navigation buttons of Android (it is not fully shown, cut off at the bottom) if i add: android:layout_marginBottom="48dp" in the layout it everything is visible (of course). On Android 4.4. everything is shown properly. What am I missing on Android L

how to set NAVIGATION_MODE_LIST on Toolbar new appcompat v7 21

风格不统一 提交于 2020-01-01 08:34:10
问题 Now all methods related to navigation modes in the ActionBar class, such as setNavigationMode() ... are now deprecated. The documentation explains: Action bar navigation modes are deprecated and not supported by inline toolbar action bars. Consider using other common navigation patterns instead. In my current application, there is a spinner on ActionBar. How do I apply NAVIGATION_MODE_LIST on the new widget Toolbar in the new version appcompat v7 21. Thanks in advance. 回答1: With the API 21

android: RecyclerView inside a ScrollView (or parallax)

假如想象 提交于 2020-01-01 05:21:11
问题 I have a fragment with 2 cardviews with multiple controls within. below the second cardview I have a recyclerview , this works perfect . the problem is that the recyclerview starts very bottom of the screen , and scroll the recylcerview is very small . previously used a listview, and this kept me fit your content and thus make scroll across the screen at once, but with recylclerview can not. How to make when I scroll in the recyclerview, controls go up like parallax effect? EDIT: more clear,

AppCompat - Item not showing in action bar for API levels v8-13

我的梦境 提交于 2020-01-01 05:05:07
问题 I have one item I want to always display in the action bar using the AppCompat library. It's just a sub menu using the default overflow image. This is not working for me on API levels v8-13 and I've done everything the developer guide says, including adding my own namespace. I'm using a custom style which has Theme.AppCompat as its parent (below). This is my first post so I don't have enough reputation points to post an image of the activity, but the item is missing from the action bar and