Tag: android-layout

How to get the default alert Dialog on android have a black theme

How do you get the black themed Dialog in android like shown on the android guide http://developer.android.com/guide/topics/ui/dialogs.html I took a screen shot. Whenever I use Alert Dialog, I get the dialog on the left, I want the one on the right.

Layout width equal height

Is there a method to have the height depending from the width in my xml? I have some Buttons in a linear layout. The button‘s widths depending from the device because they fill the screen horizontally. I want to have square buttons and this is my problem. Is there one can help me? <Button android:id=”@+id/b_0xa” […]

Fragment.onCreateView has null container

The following is running on an Android 1.6 so I’m using the compatibility package for fragments. In the following TestFragment is a static nested class: public class FragmentTestActivity extends FragmentActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } public static class TestFragment extends Fragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle […]

Resize drawable in layer-list item

I have this: <?xml version=”1.0″ encoding=”utf-8″?> <layer-list xmlns:android=”http://schemas.android.com/apk/res/android”> <item> <shape xmlns:android=”http://schemas.android.com/apk/res/android” android:shape=”oval”> <solid android:color=”#000000″/> <size android:width=”70dp” android:height=”70dp”/> </shape> </item> <item android:drawable=”@drawable/ic_person_white_48dp” android:adjustViewBounds=”true” android:scaleType=”fitXY” android:layout_width=”10dp” android:layout_height=”10dp” /> </layer-list> How can I resize the drawable image? Currently, it’s too big for the shape.

Issues recreating a material design lists with leave behind in Android

I’d like to recreate the Material Design list: controls in Android inside a sliding panel. I’m making use of: com.android.support:appcompat-v7 com.android.support:support-v4 com.android.support:recyclerview-v7 com.android.support:design https://github.com/umano/AndroidSlidingUpPanel https://github.com/serso/android-linear-layout-manager https://github.com/daimajia/AndroidSwipeLayout https://github.com/tmiyamon/gradle-mdicons I ended up using portions of the support libraries, but this specific app is 5.0+ only so there may be some Lollipop-only stuff in my code. Here is […]

Is it possible to make ActionBar tabs height higher than ActionBar height? If so, how?

I’m using ActionBarSherlock In a similar question about ActionBar tabs height, I used: <style name=”YourTheme” parent=”@android:style/Theme.Holo”> <item name=”android:actionBarStyle”>@style/blah1</item> <item name=”android:actionBarTabStyle”>@style/blah2</item> <item name=”android:actionBarSize”>80dp</item> .. </style> And I assumed I could use this specific attribute on each style instead <item name=”android:actionBarSize”>80dp</item> And individually adjust ActionBar height from ActionBar tabs height. But it doesn’t work. So, is this […]

How to make a page indicator for horizontal recyclerview

Any idea how to create a page indicator for recyclerview list ?

Sizing an Android multi-line TextView

I have an Activity where I want to display a heading that takes up the top quarter of the app and displays a dynamic set of text. In some cases it’ll all fit on one line and I’d like the font size to get sized up so it’s large and easy to read. In some […]

How to put two buttons on same line in Android

How can I place two buttons on the same line in my login layout on my Android application?

Android – Remove CacheColorHint for ListView

I am developing Android Application having the listview in an activity. I implemented the listview in an activity. By default, while scrolling the list, the background of the entire list changes to black. So, i had given this parameter: android:cacheColorHint = “#000000”. Now while going to the end of the list a white background is […]

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