Is it possible to rotate a drawable in the xml description?

I could rotate in XML: <?xml version=”1.0″ encoding=”utf-8″?> <rotate xmlns:android=”http://schemas.android.com/apk/res/android” android:fromDegrees=”90″ android:toDegrees=”90″ android:pivotX=”50%” android:pivotY=”50%” android:drawable=”@drawable/mainmenu_background”> </rotate> The fromDegrees is important. Basically this is a rotate animation defined in XML. With fromDegrees you define the initial rotated state. The toDegrees is the final rotated state of the drawable in the animation sequence but can be anything … Read more

Storing R.drawable IDs in XML array

You use a typed array in arrays.xml file within your /res/values folder that looks like this: <?xml version=”1.0″ encoding=”utf-8″?> <resources> <integer-array name=”random_imgs”> <item>@drawable/car_01</item> <item>@drawable/balloon_random_02</item> <item>@drawable/dog_03</item> </integer-array> </resources> Then in your activity, access them like so: TypedArray imgs = getResources().obtainTypedArray(R.array.random_imgs); // get resource ID by index, use 0 as default to set null resource imgs.getResourceId(i, 0) … Read more

How can I access a BuildConfig value in my AndroidManifest.xml file?

Replace buildConfigField “long”, “FACEBOOK_APP_ID”, FACEBOOK_APP_ID with resValue “string”, “FACEBOOK_APP_ID”, FACEBOOK_APP_ID then rebuild your project (Android Studio -> Build -> Rebuild Project). The two commands both produce generated values – consisting of Java constants in the first case, and Android resources in the second – during project builds, but the second method will generate a string … Read more

Add a background image to shape in XML Android

Use following layerlist: <?xml version=”1.0″ encoding=”utf-8″?> <layer-list xmlns:android=”http://schemas.android.com/apk/res/android” > <item> <shape android:shape=”rectangle” android:padding=”10dp”> <corners android:bottomRightRadius=”5dp” android:bottomLeftRadius=”5dp” android:topLeftRadius=”5dp” android:topRightRadius=”5dp”/> </shape> </item> <item android:drawable=”@drawable/image_name_here” /> </layer-list>

dpi value of default “large”, “medium” and “small” text views android

See in the android sdk directory. In \platforms\android-X\data\res\values\themes.xml: <item name=”textAppearanceLarge”>@android:style/TextAppearance.Large</item> <item name=”textAppearanceMedium”>@android:style/TextAppearance.Medium</item> <item name=”textAppearanceSmall”>@android:style/TextAppearance.Small</item> In \platforms\android-X\data\res\values\styles.xml: <style name=”TextAppearance.Large”> <item name=”android:textSize”>22sp</item> </style> <style name=”TextAppearance.Medium”> <item name=”android:textSize”>18sp</item> </style> <style name=”TextAppearance.Small”> <item name=”android:textSize”>14sp</item> <item name=”android:textColor”>?textColorSecondary</item> </style> TextAppearance.Large means style is inheriting from TextAppearance style, you have to trace it also if you want to see full definition of … Read more

Vertical line using XML drawable

Instead of a shape, you could try a View: <View android:layout_width=”1dp” android:layout_height=”match_parent” android:background=”#FF0000FF” /> I have only used this for horizontal lines, but I would think it would work for vertical lines as well. Use: <View android:layout_width=”match_parent” android:layout_height=”1dp” android:background=”#FF0000FF” /> for a horizontal line.

Custom attributes in styles.xml

I figured it out! The answer is to NOT specify the namespace in the style. <?xml version=”1.0″ encoding=”utf-8″ ?> <resources xmlns:android=”http://schemas.android.com/apk/res/android”> <style name=”CustomStyle”> <item name=”android:layout_width”>wrap_content</item> <item name=”android:layout_height”>wrap_content</item> <item name=”custom_attr”>value</item> <!– tee hee –> </style> </resources>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)