Tag: android-layout

How to integrate a floating action button into linear layout with toolbar

I have the following list view to which I want to add a floating action button. <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:orientation=”vertical” android:background=”@drawable/background_serious” > <include layout=”@layout/toolbar”/> <ListView android:id=”@id/android:list” android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:cacheColorHint=”#00000000″> </ListView> <android.support.design.widget.FloatingActionButton android:id=”@+id/fab” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:layout_gravity=”end|bottom” android:layout_margin=”@dimen/fab_margin” android:src=”@drawable/ic_done” /> </LinearLayout> In the current form the button is not displayed at all. I […]

Change absolute position with FrameLayout

I has a View that should be displayed at a specific position over some images, I already did that using AbsoluteLayout, but I don’t want to use it and I’m trying to get the same result with a FrameLayout. But I can’t get this working, this is my two attempts: public void showVideo(RectF bounds) { […]

My views are being reset on orientation change

I have a small activity with an EditText and an imageview and a button. When you press the button it launches camera for result, and when it returns it changes the imageview to the picture you’ve just taken. But when the orientation changes, the imageview resets back to the default one on the layout. What […]

How to programmatically set the width of the LinearLayout?

Is the source of the slider and the lesson link: http://www.oodlestechnologies.com/blogs/Facebook-Style-Slide-Menu-In-Android In this case, the width of the file “left_menu.xml” determined TextView (android:layout_width=”260dp”) How do I set the width to “LinearLayout” file “left_menu.xml” depending on the device screen? For example, I want the width of the “LinearLayout” was always 1/3 of the screen device? Or […]

Coloring the Space widget

I am trying to color the Space widget. I tried using both the android:foreground and android:background attributes, but still it is displaying a transparent View. <android.support.v4.widget.Space android:layout_width=”match_parent” android:layout_height=”0dp” android:layout_weight=”1″ android:foreground=”@android:color/black” android:background=”@android:color/black” />

EditText – Gap between text and EditText's line

When I insert text to my EditText field the text has an abnormal gap between itself and the EditText‘s line. Here’s a printscreen from my terminal where you can see this gap I’m talking about, it is marked in red. I’ve played around with text alignment and gravity but to no success. Here’s the XML: […]

How to detect SearchView's back button press?

I’m using a single activity to display SearchView as well as to display search results. The search results is just a subset of items so the search acts as a filter. Everything seems to work fine except that I can’t figure out how to restore all items in the view when a back button of […]

ListView row styling – left aligned text, and right-aligned icon

I’m trying to get ListView row to look like the following: | Text-Text-Text <ImageButton> | With the imagebutton snapped to the right edge. How can I do this? Here’s the current layout code I’m using. What am I doing wrong? <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:id=”@+id/layercontainer” android:orientation=”horizontal” android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:background=”#699″> <LinearLayout android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:layout_weight=”1″ android:layout_gravity=”left”> […]

How to get image from url website in imageview in android

I am trying to get image in ImageView from url website but the image not show so, What is the wrong in this code? This is the url of the image. It is my Main Activity ImageView i; private Bitmap bitmap; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); i=(ImageView)findViewById(R.id.ImageView1); bitmap=GetBitmapfromUrl(“http://test-dashboard1.seeloz.com/system/images/products_images/86/5454544114_1401886223?1401886223”); i.setImageBitmap(bitmap); } public Bitmap […]

How to license my Android application?

I am just about to complete my Android application. Now I want to upload my application to the Android market for paid application. For that I have read the document from the Android site: android licensing But I want to see any demo or project that has done such licensing. I have seen the demo […]

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