开源软件名称(OpenSource Name):lengpiseth/material-design-library开源软件地址(OpenSource Url):https://github.com/lengpiseth/material-design-library开源编程语言(OpenSource Language):Java 100.0%开源软件介绍(OpenSource Introduction):Material Design LibraryDescriptionA library that helps developers creating their Android Application with Material Design. DemoUsage1. 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:
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:
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
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论