android 旅游模板,Material Design Android模板

Material Design Android Template

First of all, a few screenshots:

Smartphone

Tablet

625332134c6f4d4600884b99daebf603.png

625332134c6f4d4600884b99daebf603.png

Collapsing Toolbar

Navigation Drawer

625332134c6f4d4600884b99daebf603.png

625332134c6f4d4600884b99daebf603.png

Support Design Library Views

Preferences

625332134c6f4d4600884b99daebf603.png

625332134c6f4d4600884b99daebf603.png

What is this?

This is a State of the Art Android Material Design template. You can use this project as a template for upcoming App projects. Just clone the project, change package name and make all necessary customisations.

Dependencies

The focus of this project lies on the view layer and app navigation. It uses the following dependencies:

AppCompat Support Library

Support Design Library

Support Card View Library

Butterknife

Glide

Supported devices

The template support every device with a SDK level of at least 14 (Android 4+).

Quick walkthrough

Gradle

Nothing special here. Please note that the version of the support library is extracted to gradle.properties:

compile "com.android.support:appcompat-v7:${android_support_lib_version}"

compile "com.android.support:design:${android_support_lib_version}"

compile "com.android.support:cardview-v7:${android_support_lib_version}"

compile 'com.github.bumptech.glide:glide:3.6.1'

compile 'com.jakewharton:butterknife:7.0.1'

Manifest

There are only three Activities declared. The main theme is @style/Theme.Main.

Theme

The project contains three styles.xml.

res/values/styles.xml (basic colors, styles)

res/values-v21/styles.xml (contains Android 5 statusbar/systembar features)

res/values-sw600dp-land/styles.xml (used for tablet layout)

You can easily change the colors of your app. You only have to set the color values in colors.xml

#8BC34A

#1976D2

#2196F3

#FFF5F5F5

#B6B6B6

#212121

#727272

Navigation

The navigation drawer is configured in menu/drawer_view.xml:

android:id="@+id/nav_quotes"

android:icon="@drawable/ic_discuss"

android:title="@string/navigation_quotes" />

android:id="@+id/nav_samples"

android:icon="@drawable/ic_forum"

android:title="@string/navigation_samples" />

...

Base classes

BaseActivity is the parent class for every Activity inside this template. This class creates and provides the navigation drawer and toolbar.

BaseFragment is the parent for every Fragment class. It is responsible for view inflating and view binding (via ButterKnife).

Quotes View

The ListActivity is the start Activity and supports two differend layout modes:

One pane mode: Used on devices with a small screen size. The Activity shows only a list of all available quotes.

Two pane mode: Used on tablets and every device with a high screen size (>= 600dp width). The Activity shows the list of quotes and displays the selected item in a seperate Fragment.

Settings

The SettingsActivity represents some dummy preferences. You can easily configure your settings by modifying the settings_prefs.xml.

View Samples

The ViewSamplesActivity shows some stuff from the Support Design Library.

Butterknife is not only used for view binding, furthermore it is also used for configuring click listeners:

@OnClick(R.id.fab)

public void onFabClicked(View view) {

// floating action button clicked

}

For example, the following snippet (ArticleDetailFragment.java) binds automatically the view:

@Bind(R.id.quote)

TextView quote;

@Bind(R.id.author)

TextView author;

@Bind(R.id.backdrop)

ImageView backdropImg;

@Bind(R.id.collapsing_toolbar)

CollapsingToolbarLayout collapsingToolbar;

About

My name is Andreas Schrade and I am a freelance software developer with an interest in Android and Java backend development.

  • 0
    点赞
  • 0
    评论
  • 0
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

表情包
插入表情
评论将由博主筛选后显示,对所有人可见 | 还能输入1000个字符
相关推荐
©️2020 CSDN 皮肤主题: 游动-白 设计师:白松林 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值