Tag: xml

Should use “sp” instead of “dp” for text sizes

When I use android:textSizes=”20dp” in my XML for a textView, I got a warning “Should use “sp” instead of “dp” for text sizes.” Why should “dp” not be used? What is the correct approach? How can I achieve same textsizes on different displays?

Add multiple custom views to layout programmatically

If I for example have empty layout like this: layout1.xml <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:orientation=”vertical” > </LinearLayout> And some other Layout like this: layout2.xml <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:orientation=”horizontal” > <TextView android:id=”@+id/button1″ android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:text=”TextView 1″ /> <Button android:id=”@+id/button2″ android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:text=”Button 2″ /> <Button android:id=”@+id/button3″ android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:text=”Button 3″ android:layout_weight=”1″/> </LinearLayout> I would like […]

How to change the color of the Progress Bar in Android?- (I tried one way,and it isn't working)

This question already has an answer here: How to change color in circular progress bar? 12 answers

android – How to create xml's id?

I’m developing a dynamic keyboard application using soft keyboard sample. My application changes layout. For example I have a keyboard(has one key) then I set up the app and I can use keyboard(has one key). I want to create an XML file after compilation and use this file in the application (reading XML file with […]

Activity with fragments does not resize when the keyboard opens

In my main activity there is a RelativeLayout that has 2 childs: An ImageView which serves as the background A LinearLayout that has 2 fragment containers activity_main.xml <RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:tools=”http://schemas.android.com/tools” android:layout_width=”match_parent” android:layout_height=”match_parent” android:layout_gravity=”bottom” tools:context=”${packageName}.${activityClass}”> <ImageView android:layout_width=”match_parent” android:layout_height=”match_parent” android:adjustViewBounds=”true” android:baselineAlignBottom=”false” android:scaleType=”fitStart” android:src=”@drawable/bg_image” /> <LinearLayout android:layout_width=”match_parent” android:layout_height=”match_parent” android:orientation=”vertical” android:paddingTop=”?android:attr/actionBarSize” android:layout_alignParentBottom=”true”> <LinearLayout android:id=”@+id/ContainerA” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:layout_gravity=”center” android:orientation=”vertical” /> […]

How to remove title bar in android?

I want to do android program that contains no title bar. For some reason I cant remove title bar. I have already tried this coding. this.requestWindowFeature(Window.FEATURE_NO_TITLE); This one also I have tried but the program suddenly stops.. android:icon=”@drawable/icon” android:label=”@string/app_name” android:theme=”@android:style/Theme.NoTitleBar.Fullscreen” How can I fix this?

Android Flipboard animation

I want to animate a Flipboard while changing views in Android. Is it possible to animate a Flipboard on whole layout? Something similar to those letters on the picture but the whole layout. For example: <LinearLayout android:layout_width=”fill_parent” android:layout_height=”fill_parent”> // whole layout design <LinearLayout/> I would like to make an animation when changing this Layout and/or […]

creating a Circular view in android

I am trying to create a view where the icons are placed in the circular view rather then the existing view like grid or the gallery view. I tried with Carousel example but later on found that it will not meet my requirement because its 3D app, but i am looking for 2D View.Android 3D […]

*Any* way for linking Android /drawable graphics to /assets?

I am trying to support two Icon_Picker intents: org.adw.launcher.icons.ACTION_PICK_ICON and com.betterandroid.launcher2.icons.PICK_ICON_ACTION Unfortunately ADW, Go Launcher and LauncherPro look for drawables in the /drawable either using the intent mentioned above, or by using an XML which looks in /drawable Whereas the old BetterAndroid intent scans for images in the /assets folder. Now, I know of the […]

Should full backup content xml file be empty or not added at all to include all?

So I was adding some stuff to my application manifest and I saw that I had a warning on my application tag: On SDK version 23 and up, your app data will be automatically backed up and restored on app install. Consider adding the attribute android:fullBackupContent to specify an @xml resource which configures which files […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.