android-support-library

Implementing a TabListener using the Support Library

柔情痞子 提交于 2019-12-17 23:23:03
问题 I am trying to implement Tab Navigation, but I want to make sure people that have older versions of Android can still use my application. The app in mind ATM is fairly simple, I just want to be able to understand how to implement the layout and then I'll add the missing bits. Anyhow, I have a Container Activity that extends Fragment Activity (to ensure compatibility), and this Activity creates a TabView using an ActionBar (I believe my problem resides here). The app will try to create three

What does ?attr/ mean on Android?

北慕城南 提交于 2019-12-17 23:10:25
问题 I am working on an example about Support Library and Toolbar, this is the code of the layout on the Android documentation <android.support.v7.widget.Toolbar android:id="@+id/my_toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" android:elevation="4dp" android:theme="@style/ThemeOverlay.AppCompat.ActionBar" app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/> It is the first time I see these ?attr and I have no

Android BottomSheetDialogFragment does not expand completely

谁说胖子不能爱 提交于 2019-12-17 22:47:07
问题 I have the following test bottom sheet implementation. When I set the peekHeight to a value less than 500, it works. After some value, any increase in peek height will not change how the bottom sheet is expanded. It Just remains there to only drag manually. How do we set the peekHeight programmatically to ensure that the bottom sheet is auto expanded to the peek height. bottom_sheet_dialog_main <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns

Styling the popup menu in Android 5.0

China☆狼群 提交于 2019-12-17 22:19:06
问题 I'm making my app ready for Android 5.0, I'm using the latest compatibility library, here is what my style looks like. <resources> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="colorPrimary">@color/theme_accent</item> <item name="colorAccent">@color/theme_accent_secondary</item> </style> <style name="AppThemeDark" parent="Theme.AppCompat"> <item name="colorPrimary">@color/theme_accent</item> <item name="colorAccent">@color/theme_accent_secondary</item> <

How to adjust the swipe down distance in SwipeRefreshLayout?

会有一股神秘感。 提交于 2019-12-17 21:48:34
问题 I implemented SwipeRefreshLayout in my app. I need to change the height which has to be scrolled down to call onRefresh() method. Which method should I use to add a custom height ? Implementation of SwipeRefreshLayout private SwipeRefreshLayout swipeLayout; In oncreate swipeLayout = (SwipeRefreshLayout)view.findViewById(R.id.swipe_container); swipeLayout.setOnRefreshListener(this); swipeLayout.setColorScheme(android.R.color.holo_blue_dark, android.R.color.holo_green_dark, android.R.color.holo

New Preference support library incorrect theme at runtime

你离开我真会死。 提交于 2019-12-17 20:38:01
问题 I'm trying to use the new Preference v14 Support library. To give the preferences a material style, I use the following style on my Activity: <style name="PreferenceTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar"> <item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item> </style> That works fine. My problem is that when I add new Preferences at runtime, they get inflated using an old theme. Here's a screenshot of the result: As you can see, the first preference

Is there a native component for the Floating action button in Android Material Design?

穿精又带淫゛_ 提交于 2019-12-17 19:25:59
问题 My question revolves around the Floating action button that was introduced in Android Material Design. There are many library offering this component on GitHub as: Android-floating-action-button FloatingActionButton CircularFloatingActionMenu Fab Floating-action-button But my question is: Is there a native component with the last release of android.support.vX that was built for Floating action button ? Components such as : android.support.v7.cardview android.support.v4.widget.DrawerLayout

Android V7 Support Library Popup Menu

我的未来我决定 提交于 2019-12-17 18:57:07
问题 I'm trying to implement a PopupMenu with the Support V7 Library. All compiles fine but when I try to call: PopupMenu popup = new PopupMenu(this, v); popup.getMenu().add(Menu.NONE,MENU_SHARE_A,1,R.string.A); popup.getMenu().add(Menu.NONE,MENU_SHARE_B,2,R.string.B); popup.show(); an error occurs on call: 07-31 17:23:53.365: E/AndroidRuntime(14128): java.lang.RuntimeException: Binary XML file line #17: You must supply a layout_height attribute. Which refers I think to "abc_popup_menu_item_layout

NavigationDrawer using only Android Support Library

时间秒杀一切 提交于 2019-12-17 18:44:50
问题 is there any example project which use only Android Support Library (revision 18) to implement Navigation Drawer on Android +2.2 without using any additional library (ABS etc.) ? Here is the example which use ASL but it's work only on API +14 : http://developer.android.com/training/implementing-navigation/nav-drawer.html . Here is my MainActivity: package com.example.android.navigationdrawerexample; import java.util.Locale; import android.app.Activity; //import android.app.Fragment; //import

Android Support Package / Compatibility Library - use v4 or v13?

Deadly 提交于 2019-12-17 18:25:44
问题 I've just read this description of the Android Support Package / Compatibility Library... http://developer.android.com/sdk/compatibility-library.html ... and it's left me a little confused! It says that the v13 library is a superset of v4 but I thought it was the other way around? Getting practical: If I want to use the compatibility library such that my app builds and works fine for phones running Android 2.2 (API 8) through to 4.0 (API 14) and beyond, will v4 suffice for me? 回答1: To target