Tag: android-layout

ImageView within RelativeLayout has top and bottom padding

I have a 640px wide, 208px tall PNG that I’ve placed in my /drawable folder and I’m having a very hard time properly placing it in an ImageView. I want to scale the image so that it maxes out the horizontal resolution, and I want it to scale vertically only as much as it takes […]

missing ActionBar in material design

I want to develop an Android app with AndroidStudio and the new material design and it looks great on Android 5.0 but when I test the app on my 4.4.2 phone, the ActionBar of the app is missing. Here is my Manifest: <application android:allowBackup=”true” android:icon=”@drawable/ic_launcher” android:label=”@string/app_name” android:theme=”@style/MyTheme” > <activity android:name=”.MainActivity” android:label=”@string/app_name” > <intent-filter> <action android:name=”android.intent.action.MAIN” […]

Android – ScrollView like foursquare with maps + list

This is the Android equivalent of this iOS question. Trying to create a view that contains a MapView at about 20% of the screen (under an ActionBar…) and the rest of the screen is a ScrollView that when scrolling down, overlaps on top of the MapView and hides it. In short like FourSquare’s Android app. […]

android – EditText height resize based on keyboard

I am having an activity in android where there is an editbox and 3 buttons below the editbox. Please see attachment. When this activity is launched, the default state is STATE1.(Please see image). The keyboard is visible by default. Now when I press the back button or dispose the keyboard, I wish to have the […]

Using custom Views in XML without using fully-qualified class name

I have my own style for buttons defined as themes but I also use my own class to handle buttons (because of own fonts). Is it possible to call my button with a pretty name such as <MyButton> instead of <com.wehavelongdomainname.android.ui.MyButton>

Android: Viewpager inside a fragment of Navigation Drawer

I’m currently developing an Android application what I need is to implement a Viewpager or Tabs inside a fragment of Navigation Drawer. I already implemented the Navigation Drawer from this tutorial: Navigation Drawer Tutorial Now I have my Navigation Drawer consist of 3 fragments. Fragment A, Fragment B, Fragment C on Fragment A how can […]

Divide screen by percentage

I am trying to create a Relative layout in when it 3 views layed out vertically. The first view is text and supposed to take 10% of the screen. Second view is image and is supposed to take 50% of the screen. 3rd view is text and is supposed to take the remaining 40%. The […]

Styling AutoCompleteTextView with AppCompat.EditText does not work

I make material design style application I want to change AutoCompleteTextView style to style like in android.support.v7.internal.widget.TintEditText I added style to my style.xml: <style name=”AppTheme” parent=”AppTheme.Base”/> <style name=”AppTheme.Base” parent=”Theme.AppCompat”> <item name=”colorPrimary”>@color/colorPrimary</item> <item name=”colorPrimaryDark”>@color/colorPrimaryDark</item> <item name=”android:autoCompleteTextViewStyle”>@style/AutoCompleteTextViewAppTheme</item> </style> <style name=”AutoCompleteTextViewAppTheme” parent=”Base.Widget.AppCompat.EditText”/> That works but the line colors does not change. EditTexts with material design seem to use […]

How can make several different screen configurations map to a small set of layouts without having to duplicate portions of my layout XML?

My application shows either a one-pane UI or a two-pane UI depending on the screen configuration. On smaller screens, it should be one-pane both on portrait and landscape. On mid-sized screens (anything with a “smallest width” of 600dp and up), the landscape orientation accomodates the two-pane layout pretty well, but on portrait orientation, it should […]

Scrolling with Collapsing Toolbar and Tabs

I’m trying to make a layout with a CollapsingToolbarLayout which has scroll|exitUntilCollapsed flag, and a TabLayout which has scroll|enterAlways scrollFlag property. Basically I want my toolbar to be pinned and show and hide the tabs while scrolling. I’ve modified the cheesesquare app from https://github.com/chrisbanes/cheesesquare. Here is my layout xml; <?xml version=”1.0″ encoding=”utf-8″?> <android.support.design.widget.CoordinatorLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto” […]

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