Search code examples
androidandroid-layoutuser-interfacestylesadapter

How to create User interface like the attached photo


Can any one tell me what is this photo effect called. And I would like to know how to create an adapter for this attached image effect.

@Edited: This is a sample photo of Android market. I want to create a layout like this. I suppose this should be made overriding a GridView adapter.

Portrait Screenshot


Photo

Landscape Screenshot


Photo


Another Screenshot


Photo

I'm extremely sorry my question was not clear to you guys.

Possible duplicate.


Solution

  • Have you tried this:

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="0.54" >
            <Button
                android:id="@+id/Button01"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1.00"
                android:text="Button" />    
            <Button
                android:id="@+id/Button02"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1.00"
                android:text="Button" />    
        </LinearLayout>
        <Button
            android:id="@+id/button3"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="Button" />  
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="99dp" > 
            <Button
                android:id="@+id/button1"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:text="Button" />  
            <Button
                android:id="@+id/button2"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:text="Button" />    
        </LinearLayout>   
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1" >    
            <LinearLayout
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:orientation="vertical" >   
                <Button
                    android:id="@+id/button4"
                    android:layout_width="match_parent"
                    android:layout_height="152dp"
                    android:text="Button" />    
                <Button
                    android:id="@+id/button5"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="Button" />    
            </LinearLayout>    
            <LinearLayout
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:orientation="vertical" >
                <Button
                    android:id="@+id/button6"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="Button" />
                <Button
                    android:id="@+id/button7"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:text="Button" />
            </LinearLayout>
        </LinearLayout>
    
    </LinearLayout>
    

    Check this thread: Heterogeneous GridLayout

    enter image description here