android-support-library

After setting up android-support-v7-appcompat R.java is missing

那年仲夏 提交于 2019-12-17 16:10:11
问题 I am trying to change my Eclipse project to make it backward compatible to Android 2.1. I followed the instructions to set up the Support Library from here but after I attached the Library project to my project, the R.java from the gen directory gone. Plus I got some errors in the console, like: [2013-09-02 00:08:26 - gitarshopAndroidClient] /usr/local/external/android-sdk-linux/extras/android/support/v7/appcompat/res/values-v14/styles_base.xml:24: error: Error retrieving parent for item: No

Adding a colored background with text/icon under swiped row when using Android's RecyclerView

你离开我真会死。 提交于 2019-12-17 15:26:58
问题 EDIT: The real problem was that my LinearLayout was wrapped in another layout, which caused the incorrect behavior. The accepted answer by Sanvywell has a better, more complete example of how to draw a color under swiped view than the code snippet I provided in the question. Now that RecyclerView widget has native support for row swiping with the help of ItemTouchHelper class, I'm attempting to use it in an app where rows will behave similarly to Google's Inbox app. That is, swiping to the

Support library VectorDrawable Resources$NotFoundException

痞子三分冷 提交于 2019-12-17 15:19:37
问题 I am using Design Support Library version 23.4.0 . I have enabled the gradle flag: defaultConfig { vectorDrawables.useSupportLibrary = true } I am using build tools version 23.0.2 , but still, I am getting Resources$NotFoundException on KitKat or lower. It is occurring when I use android:drawableLeft or imageView.setImageResource(R.drawable.drawable_image) . And yes, I am putting this on every activity where I am using drawables static { AppCompatDelegate.setCompatVectorFromResourcesEnabled

error can not resolve symbol TabLayout and 'design

安稳与你 提交于 2019-12-17 14:04:08
问题 Please help: I got error when import android.support.design.widget.TabLayout It say "can not resolve symbol 'design' My build.gradle: compileSdkVersion 26 buildToolsVersion "26.0.0" dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.android.support:appcompat-v7:26' compile 'com.android.support.constraint:constraint

Action Bar not showing action view icons

淺唱寂寞╮ 提交于 2019-12-17 10:57:28
问题 I'm using the new Action Bar Support and all my action views are shown in overflow and not as icons in the bar. My app is for 7+ API. HomeActivity: public class HomeActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { ActionBar actionBar = getSupportActionBar(); actionBar.setTitle(R.string.app_name); actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setHomeButtonEnabled(true); } @Override public boolean onCreateOptionsMenu(Menu menu) {

How to reduce the gap between navigation icon and toolbar title?

我的梦境 提交于 2019-12-17 10:54:13
问题 My problem is the extra space between the nav-drawer icon and toolbar title. The sample images are below: The xml view of the toolbar is <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" app:titleTextAppearance="@style/Toolbar.TitleText" app:popupTheme="@style/AppTheme.PopupOverlay" /> I have tried to solve this problem by using code below but no change occurred.

How to use the v7/v14 Preference Support library?

依然范特西╮ 提交于 2019-12-17 10:22:10
问题 Together with the M release, there are new support libraries. One of them that seems to be very useful is the v7 Preference Support library. It does not seem to have PreferenceActivity or something similar, how do we integrate it to our app? 回答1: You have to extend AppCompatActivity , which is required for fragment, and include a subclass of PreferenceFragmentCompat. The abstract fragment requires to override one method, in which you should place your preference inflation logic. And last,

java.lang.NoClassDefFoundError: android/graphics/drawable/Icon

試著忘記壹切 提交于 2019-12-17 10:15:04
问题 So far I got this error only for one user, who uses a rooted phone (SM-G900R7 Android 4.4.2). The error is like this: Fatal Exception: java.lang.NoClassDefFoundError: android/graphics/drawable/Icon at java.lang.Class.getDeclaredMethods(Class.java) at java.lang.Class.getDeclaredMethods(Class.java:656) at android.view.ViewDebug.getExportedPropertyMethods(ViewDebug.java:960) at android.view.ViewDebug.exportMethods(ViewDebug.java:1047) at android.view.ViewDebug.dumpViewProperties(ViewDebug.java

FloatingActionButton with text instead of image

心不动则不痛 提交于 2019-12-17 08:34:06
问题 I'm trying to figure out how can be modified FloatingActionButton from android support library. Can it be used with the text instead of image? Something like this one: I see it extends ImageButton so I think not. Am I right? Is this correct in terms of Material Design in general? 回答1: With API 28 you can simply add text to Fabs using: Visit: https://material.io/develop/android/components/extended-floating-action-button/ <com.google.android.material.floatingactionbutton

Android v21 Theme.Appcompat color accent is ignored, no padding on dialogs

北慕城南 提交于 2019-12-17 08:23:28
问题 I'm using ActionBarActivity from the Android 5 SDK and here is my theme.xml for v21 <style name="AppTheme_Light" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="android:colorPrimary">@color/abc1</item> <item name="android:colorPrimaryDark">@color/abc2</item> <item name="android:colorAccent">@color/abc3</item> </style> But the colors are ignored, and are replaced by a default teal color and all the dialogs appear without padding. Also, padding is also ignored in other places like