• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

lengpiseth/material-design-library: A library that helps developers creating the ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

lengpiseth/material-design-library

开源软件地址(OpenSource Url):

https://github.com/lengpiseth/material-design-library

开源编程语言(OpenSource Language):

Java 100.0%

开源软件介绍(OpenSource Introduction):

Material Design Library

Description

A library that helps developers creating their Android Application with Material Design.
It offers a lot of Material Design classes easily to use like a CardView or a NavigationDrawerActivity that creates an Activity with a Material Design NavigationDrawer.

Demo

Material Design Library on Google Play Store

NavigationDrawer CardView with Image on the Top ListView with Pull To Refresh ViewPager with Tabs

Usage

1. Add the dependency in your build.gradle.

dependencies {
    compile 'com.blunderer:materialdesignlibrary:1.1.1'
}

2. In your values/styles.xml file, change the parent style and add your own colorPrimary/colorPrimaryDark colors:

<style name="AppTheme" parent="@style/MaterialDesignLibraryTheme">
    <item name="colorPrimary">#3f51b5</item>
    <item name="colorPrimaryDark">#303f9f</item>
</style>

Or if you want the Light Theme:

<style name="AppTheme" parent="@style/MaterialDesignLibraryTheme.Light">
    <item name="colorPrimary">#3f51b5</item>
    <item name="colorPrimaryDark">#303f9f</item>
</style>

3. Then you can:
- Extend your activity by one of mine (each activity will be in Material Design):

  • Activity
    Your Activity will be a basic Activity with Material Design.

  • ListViewActivity
    Your Activity will contain a ListView (with or not the Material Design Pull To Refresh).

  • NavigationDrawerActivity
    Your Activity will contain a NavigationDrawer.

  • ViewPagerActivity
    Your Activity will contain a ViewPager (with or not the indicator).

  • ViewPagerWithTabsActivity
    Your Activity will contain a ViewPager with tabs.

Example:
import com.blunderer.materialdesignlibrary.activities.NavigationDrawerActivity;

public class MyActivity extends NavigationDrawerActivity {

    @Override
    protected NavigationDrawerTopHandler getNavigationDrawerTopHandler() {
        return new NavigationDrawerTopHandler()
                .addItem(R.string.title_item1, new MainFragment())
                .addItem(R.string.title_item2, new MainFragment())
                .addSection(R.string.title_section2)
                .addItem(R.string.title_item3, new MainFragment())
                .addItem(R.string.title_item4, new MainFragment());
    }

    @Override
    protected NavigationDrawerBottomHandler getNavigationDrawerBottomHandler() {
        return new NavigationDrawerBottomHandler()
                .addSettings(new View.OnClickListener() {

                    @Override
                    public void onClick(View view) {
                        Intent intent = new Intent(getApplicationContext(), SettingsActivity.class);
                        startActivity(intent);
                    }

                })
                .addHelpAndFeedback(new View.OnClickListener() {

                    @Override
                    public void onClick(View view) {
                        Intent intent = new Intent(getApplicationContext(), HelpAndFeedbackActivity.class);
                        startActivity(intent);
                    }

                });
    }

    @Override
    protected int defaultNavigationDrawerItemSelectedPosition() {
        return 0;
    }

}

- Or use my CardView:

  • Normal CardView
    Your CardView will be a basic CardView.

  • Left Image CardView
    Your CardView will contain an image on the left.

  • Top Image CardView
    Your CardView will contain an image on the top.

Example:
<com.blunderer.materialdesignlibrary.views.CardView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:mdl_title="CardView"
        app:mdl_description="A Left Image CardView"
        app:mdl_normalButton="Normal"
        app:mdl_highlightButton="Highlight"
        app:mdl_imagePosition="left"
        app:mdl_image="@drawable/image" />

Developed by




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap