android-styles

Problem with indexing in RecyclerView Adapter. How to do it in a good way?

做~自己de王妃 提交于 2019-12-11 15:00:51
问题 I have some problems with RecyclerView Adapter. I want to do the list with id index: 1,2,3... When an item is removed it should set every next item position to position-1. Like this: (for example delete number 3) 1|2|3|4|5 -> 1|2|3|4 It works perfectly when: @Override public long getItemId(int position) { return position; } @Override public int getItemViewType(int position) { return position; } But this causes other errors with notifyItemRemoved() . When I set: @Override public long getItemId

Picker button's color not changing on android 5.1

岁酱吖の 提交于 2019-12-11 14:58:10
问题 I was searching for a way to change the colors of the ok and cancel button of my custom picker. I added this code to the styles file on the android project: <style name="SpinnerDialog" parent="Theme.AppCompat.Light.Dialog"> <item name="android:popupBackground">#039BE5</item> <item name="colorPrimary">#039BE5</item> <item name="colorPrimaryDark">#039BE5</item> <item name="colorAccent">#039BE5</item> </style> I run the app on my Xiaomi POCOPHONE F1 (Android v9) and on 2 emulators (Android v8.1)

Toolbar's popup menu - custom background (color and borders)

纵然是瞬间 提交于 2019-12-11 14:15:21
问题 How can I make such popup item menu for my toolbar (support v7)? screenshot of transparent toolbar's popup menu (MX Player) I found out how to make transparent background: from layout <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:theme="@style/MyToolbarTheme"/> from style <style name="ToolbarTheme" parent="ThemeOverlay.AppCompat.Dark.ActionBar"> <item name="android:colorBackground">@color/my

Changing default Android fade/scrim color when calling a Dialog

纵饮孤独 提交于 2019-12-11 13:36:59
问题 I've been working on an app and I've reaching the point where it requires me to display a menu window in the middle of the screen. I've been using an AlertDialog object filled with a custom View but now it was required of me to "surround" the window with a semi-transparent white glow as opposed to the default grayish one. I did a similar with the fade-in color of some navigation drawers I have on my app but in that case I had a specific method to quickly help me solve that problem. So far I

android:textColor no longer works in Marshmallow

一曲冷凌霜 提交于 2019-12-11 11:10:35
问题 I have written an app which relies on colors defined in resources. Some are set directly in the layout XML file, others are set in code. Examples: Color definition in res/values/styles.xml : <color name="orvGyro">#33B5E5</color> Layout: <TextView android:id="@+id/textView3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/dotSpace" android:textAppearance="?android:attr/textAppearanceSmall" android:textColor="@color/orvGyro" /> Color in code:

Error inflating class android.support.v7.widget.Toolbar in Android Lollipop

て烟熏妆下的殇ゞ 提交于 2019-12-11 11:06:36
问题 I use the android.support library for my project, I have developed my app using android 4.4 and everything works good but my problem comes when I try to run the application in a device with Android Lollipop. When it loads the Activity with the Toolbar, the application stops and returns this error. Error inflating class android.support.v7.widget.Toolbar I have found the same problem on the internet but I haven't found the solution in the answers. This is my styles.xml <!-- Base application

Action bar doesn't accept personal styles

拟墨画扇 提交于 2019-12-11 09:27:58
问题 I am trying to personilize my action bar. I want it to support API-9 and above the problem is that action bar doesn't accept changed made in styles.xml and items are not shown. this is my styles.xml : <resources> <style name="AppBaseTheme" parent="Theme.AppCompat.Light"></style> <style name="AppTheme" parent="AppBaseTheme"> <item name="android:windowBackground">@color/background_window</item> <item name="android:actionBarStyle">@style/ActionBarStyle</item> </style> <style name="ActionBarStyle

android Q content above navigation bar

…衆ロ難τιáo~ 提交于 2019-12-11 06:27:43
问题 we are targeting our application at api 28 and draw content under status bar , for this we are using following flag and styles : window.addFlags(FLAG_LAYOUT_NO_LIMITS) <item name="windowNoTitle">true</item> <item name="android:windowTranslucentStatus">true</item> <item name="android:windowTranslucentNavigation">false</item> <item name="android:windowDrawsSystemBarBackgrounds">false</item> everything is okay under Q ( content lay out under status bar and above navigation bar). In android Q ,

RatingBar Theme working in Marshmallow but not in Lollipop

冷暖自知 提交于 2019-12-11 05:45:07
问题 I am trying to style my RatingBar with the following code: <style name="RatingBarfeed" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="colorControlNormal">@color/white</item> <item name="colorControlActivated">@color/duskYellow</item> </style> And in layout.xml I am using the following code: <android.support.v7.widget.AppCompatRatingBar android:theme="@style/RatingBarfeed" android:layout_width="wrap_content" android:layout_height="wrap_content" style="?android:attr

Change DatePicker Text Color

99封情书 提交于 2019-12-11 05:37:44
问题 I want to change the text color of DatePicker . I have tried couple of suggestions found here but nothing has worked for me. The text color, and the selected background stays the same. The top header background did changed. <style name="MyThemeDesign" parent="Theme.AppCompat.Light.NoActionBar"> <item name="colorPrimary">@color/btnColor</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="android:datePickerStyle">@style/MyDatePickerStyle</item> </style> <style name=