McNavy McNavy - 4 months ago 26
Android Question

Android - Blocks in XML

I am currently working on an Android project, Android Studio. I wonder if it's possible to make blocks (8 in total) Android Studio. These blocks will be in the part below the menu bar. I joined my

content_main.xml
you file, so you can help me.

I would view 8 blocks (4 blocks on one line, and 4 more on the one below).These blocks will be used to display weather data (graphics, text).

I makes you available to the project at this link:
Project on Dropbox

Thanks you in advance for your help, McNavy.

Answer

I would suggest you to use MaterialLeanBack library.

You will get a sample example in the code for understanding.

Usage

In your layout

<com.github.florent37.materialleanback.MaterialLeanBack
        android:id="@+id/materialLeanBack"
        android:layout_width="match_parent"
        android:layout_height="match_parent"

        app:mlb_background="@color/background"
        app:mlb_lineSpacing="30dp"

        app:mlb_paddingBottom="30dp"
        app:mlb_paddingLeft="30dp"
        app:mlb_paddingRight="30dp"
        app:mlb_paddingTop="40dp"

        app:mlb_titleColor="@android:color/white" />

Requires

compile 'com.github.florent37:materialleanback:1.0.0@aar'

compile 'com.android.support:cardview-v7:22.2.1'
compile 'com.android.support:recyclerview-v7:22.2.1'
compile 'com.nineoldandroids:library:2.4.0'

Sample layout

Comments