android-5.0-lollipop

?android:attr/selectableItemBackground not visible enough on a dark background

那年仲夏 提交于 2020-01-22 07:57:07
问题 On Android Lollipop, I'm using: android:background="?android:attr/selectableItemBackground" to have the material animated feedback when I click on a button. It works well when I have a button contained in a white/light layout, like a CardView for example. But when I want to use the same thing on a dark background, we barely see the effect, it is not visible enough. Does someone have an idea? Thank you 回答1: On API 21+ you can set android:theme="@android:style/ThemeOverlay.Material.Dark" on a

?android:attr/selectableItemBackground not visible enough on a dark background

大城市里の小女人 提交于 2020-01-22 07:57:05
问题 On Android Lollipop, I'm using: android:background="?android:attr/selectableItemBackground" to have the material animated feedback when I click on a button. It works well when I have a button contained in a white/light layout, like a CardView for example. But when I want to use the same thing on a dark background, we barely see the effect, it is not visible enough. Does someone have an idea? Thank you 回答1: On API 21+ you can set android:theme="@android:style/ThemeOverlay.Material.Dark" on a

Keeping the Holo Action Bar in Lollipop

走远了吗. 提交于 2020-01-21 12:18:27
问题 Is there any way to force an app to display the Holo Action Bar in Lollipop devices? My theme is currently inheriting from Holo.Light, yet I am seeing the new Action Bar. The Youtube app does this but I believe that it is using an older version of the AppCompat library. Any suggestions ? 回答1: Is there any way to force an app to display the Holo Action Bar in Lollipop devices? Use Theme.Holo or one of its subsidiary themes, directly or as an inherited theme. My theme is currently inheriting

Missing Up navigation icon after switching from ICS ActionBar to Lollipop Toolbar

蓝咒 提交于 2020-01-20 18:48:27
问题 I have an activity with many fragments that uses action bar and navigation drawer. It has "home as up" enabled. I have implemented proper logic that only top level fragments show action bar drawer toggle icon, other fragments show up arrow. I achieved this by: mDrawerToggle.setDrawerIndicatorEnabled(false); mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED, mDrawerList); Now old v4 support library ActionBarDrawerToggle became deprecated. I've switched to v7 version together

prevent shortClick when longClick pressed

十年热恋 提交于 2020-01-17 07:08:07
问题 I want to cancel shortClick when LongClicked an item, I'm using ripple effect material-ripple library in list view but when i long press list item it also call onClick-event list.setOnItemClickListner not work with MaterialRippleLayout on row item i have also return true in OnLongClicked but does not work.. also tried and added method in MaterialRippleLayout.java @Override public void setOnLongClickListener(OnLongClickListener l) { super.setOnLongClickListener(l); childView

FLAG_ACTIVITY_CLEAR_TOP not working on 5.0+ devices

穿精又带淫゛_ 提交于 2020-01-17 04:14:05
问题 I use the FLAG_ACTIVITY_CLEAR_TOP intent flag to clear the stack when transitioning from a login activity to the main app - everything works perfectly in 4.x devices, but on lollipop it's not working. Just to add some code, here's what I'm calling: Intent intent = new Intent(this, MyActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(intent); I've tried using the FLAG_ACTIVITY_NEW_TASK flag in conjunction but that also hasn't helped. 回答1: try these flags: intent

Retrofit is not working below Lollipop

扶醉桌前 提交于 2020-01-16 15:47:06
问题 I am trying to get data from my website using Retrofit . It's working fine from Android 5.0 but lesser android version showing error message Connection closed by peer . Here is my code... Retrofit retrofit = new Retrofit.Builder() .baseUrl("https://myWebsite.com/api/") .addConverterFactory(GsonConverterFactory.create()) .build(); service = retrofit.create(MyService.class); And here is MyService class @GET Call<CategoryResponse> getCategoryResponse(@Url String url); What am I missing here? It

Retrofit is not working below Lollipop

跟風遠走 提交于 2020-01-16 15:46:01
问题 I am trying to get data from my website using Retrofit . It's working fine from Android 5.0 but lesser android version showing error message Connection closed by peer . Here is my code... Retrofit retrofit = new Retrofit.Builder() .baseUrl("https://myWebsite.com/api/") .addConverterFactory(GsonConverterFactory.create()) .build(); service = retrofit.create(MyService.class); And here is MyService class @GET Call<CategoryResponse> getCategoryResponse(@Url String url); What am I missing here? It

Can “v17 leanback library”(android tv support library) support 2.x or 4.x device?

允我心安 提交于 2020-01-15 16:29:09
问题 I have some trouble when develop on TV device, Can "v17 leanback library" support 2.x or 4.x device? "v17 leanback library" is a TV Support Libraries.It request the app's minSdkVersion is "android-L",so app can't run on 2.x or 4.x device.Do you have some suggest? you can visit enter link description here for more infomation. 回答1: This seems to be quite an old question and since the Lollipop announcement, I guess it's easy to say that yes, since the Leanback API has been integrated in a

Can “v17 leanback library”(android tv support library) support 2.x or 4.x device?

≯℡__Kan透↙ 提交于 2020-01-15 16:28:29
问题 I have some trouble when develop on TV device, Can "v17 leanback library" support 2.x or 4.x device? "v17 leanback library" is a TV Support Libraries.It request the app's minSdkVersion is "android-L",so app can't run on 2.x or 4.x device.Do you have some suggest? you can visit enter link description here for more infomation. 回答1: This seems to be quite an old question and since the Lollipop announcement, I guess it's easy to say that yes, since the Leanback API has been integrated in a