android-drawable
Dotted line is actually not dotted when app is running on real Android device
This is most likely related to hardware acceleration: Dashed lines are not supported in GL mode. Its documented here: https://code.google.com/p/android/issues/detail?id=29944 Turn off your HW-acceleration in your AndroidManifest.xml like this: android:hardwareAccelerated=”false” or: myView.setLayerType(View.LAYER_TYPE_SOFTWARE, null) For more information how to use first solution: http://developer.android.com/guide/topics/graphics/hardware-accel.html
How to return to default style on EditText if I apply a background?
First, before you call setBackgroundResource with your own ninepatch, store the original background of the EditText, like this: Drawable originalDrawable = myEditText.getBackground(); Then, if the user entered the wrong data, you can set your red border ninepatch: myEditText.setBackgroundResource(R.drawable.edittext_red); And later, when you want to restore the look of the EditText, use the stored drawable: myEditText.setBackgroundDrawable(originalDrawable); … Read more
Material design suggestions for lists with avatar, text and icon
#1 Two line items: Layout minHeight is 72dp, layout_height is wrap_content. Icon size is 40dp (usually it’s a circle bitmap). Icon has 16dp top margin and 16dp left margin, no other. Both TextViews are in a vertically oriented and vertically centered LinearLayout. This layout has 16dp left margin and 16dp right margin. This will allow … Read more
Change the color of a disabled button in android
You’ll have to use a selector for different drawables in those states. You can create a selector like this: <selector xmlns:android=”http://schemas.android.com/apk/res/android”> <item android:drawable=”@drawable/your_enabled_drawable” android:state_enabled=”true” /> <item android:drawable=”@drawable/your_disabled_drawable” android:state_enabled=”false” /> <!– default state–> <item android:drawable=”@drawable/your_enabled_drawable” /> </selector>
Android drawable-hdpi-night folder
It should be /res/drawable-night-**
Android: How to Make A Drawable Selector
You can add this in Android Studio, use Right click on project structure -> New -> Drawable resource file. It should look like this: <?xml version=”1.0″ encoding=”utf-8″?> <selector xmlns:android=”http://schemas.android.com/apk/res/android”> <item android:state_enabled=”false” android:drawable=”@drawable/cell_top_selected” /> <item android:drawable=”@drawable/cell_top” /> </selector>
Change gravity of image drawable in textview
Try using android:gravity=”top” if it didnt work then go with negative margin like this android:drawablePadding=”-20sp” Another alternative way is to take an ImageView beside TextView inside LinearLayout so you can apply gravity
How to remove Black background between start new activity during slide_left animation?
Setting the Theme didn’t work for me, but adding an exit animation did. overridePendingTransition (R.anim.push_up_in,R.anim.hold); For the exit animation, I just used an animation that does nothing. <?xml version=”1.0″ encoding=”utf-8″?> <set xmlns:android=”http://schemas.android.com/apk/res/android”> <translate android:fromYDelta=”0%p” android:toYDelta=”0%p” android:duration=”2000″/> </set>
Binary XML file line #1: invalid drawable tag vector
Documentation about Vector Graphics says: Android 4.4 (API level 20) and lower doesn’t support vector drawables. With Support Library you have backward-compatibility using the attribute app:srcCompat, but it is not backported for android:drawableRight. The solution is to keep using .PNG files for those cases or try to set it by code.