mirror of
https://github.com/zhanghai/MaterialFiles
synced 2024-07-08 19:45:51 +00:00
[Feature] Add working about page; Closes #36.
This commit is contained in:
parent
18497e1c0f
commit
de0b3c8bc2
|
@ -13,7 +13,8 @@ android {
|
|||
minSdkVersion 21
|
||||
targetSdkVersion 28
|
||||
versionCode 1
|
||||
versionName '1.0.0'
|
||||
versionName '1.0.0-alpha.1'
|
||||
resValue 'string', 'app_version', versionName + ' (' + versionCode + ')'
|
||||
buildConfigField 'String', 'FILE_PROVIDIER_AUTHORITY', 'APPLICATION_ID + ".file_provider"'
|
||||
resValue 'string', 'file_provider_authority', applicationId + '.file_provider'
|
||||
}
|
||||
|
|
|
@ -29,12 +29,21 @@ public class AboutFragment extends Fragment {
|
|||
private static final Uri GITHUB_URI = Uri.parse(
|
||||
"https://github.com/DreaminginCodeZH/MaterialFileManager");
|
||||
|
||||
private static final Uri AUTHOR_GITHUB_URI = Uri.parse("https://github.com/DreaminginCodeZH");
|
||||
|
||||
private static final Uri AUTHOR_GOOGLE_PLUS_URI = Uri.parse(
|
||||
"https://plus.google.com/105148560373589648355");
|
||||
|
||||
@BindView(R.id.toolbar)
|
||||
Toolbar mToolbar;
|
||||
@BindView(R.id.github)
|
||||
ViewGroup mGitHubLayout;
|
||||
@BindView(R.id.licenses)
|
||||
ViewGroup mLicensesLayout;
|
||||
@BindView(R.id.author_github)
|
||||
ViewGroup mAuthorGitHubLayout;
|
||||
@BindView(R.id.author_google_plus)
|
||||
ViewGroup mAuthorGooglePlusLayout;
|
||||
|
||||
@NonNull
|
||||
public static AboutFragment newInstance() {
|
||||
|
@ -78,6 +87,10 @@ public class AboutFragment extends Fragment {
|
|||
mGitHubLayout.setOnClickListener(view -> AppUtils.startActivity(IntentUtils.makeView(
|
||||
GITHUB_URI), this));
|
||||
mLicensesLayout.setOnClickListener(view -> LicensesDialogFragment.show(this));
|
||||
mAuthorGitHubLayout.setOnClickListener(view -> AppUtils.startActivity(IntentUtils.makeView(
|
||||
AUTHOR_GITHUB_URI), this));
|
||||
mAuthorGooglePlusLayout.setOnClickListener(view -> AppUtils.startActivity(
|
||||
IntentUtils.makeView(AUTHOR_GOOGLE_PLUS_URI), this));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
18
app/src/main/res/drawable/google_plus_icon_white_24dp.xml
Normal file
18
app/src/main/res/drawable/google_plus_icon_white_24dp.xml
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
~ Copyright (c) 2018 Zhang Hai <Dreaming.in.Code.ZH@Gmail.com>
|
||||
~ All Rights Reserved.
|
||||
-->
|
||||
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M23,11H21V9H19V11H17V13H19V15H21V13H23M8,11V13.4H12C11.8,14.4 10.8,16.4 8,16.4C5.6,16.4 3.7,14.4 3.7,12C3.7,9.6 5.6,7.6 8,7.6C9.4,7.6 10.3,8.2 10.8,8.7L12.7,6.9C11.5,5.7 9.9,5 8,5C4.1,5 1,8.1 1,12C1,15.9 4.1,19 8,19C12,19 14.7,16.2 14.7,12.2C14.7,11.7 14.7,11.4 14.6,11H8Z" />
|
||||
</vector>
|
18
app/src/main/res/drawable/information_icon_white_24dp.xml
Normal file
18
app/src/main/res/drawable/information_icon_white_24dp.xml
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
~ Copyright (c) 2018 Zhang Hai <Dreaming.in.Code.ZH@Gmail.com>
|
||||
~ All Rights Reserved.
|
||||
-->
|
||||
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z" />
|
||||
</vector>
|
18
app/src/main/res/drawable/person_icon_white_24dp.xml
Normal file
18
app/src/main/res/drawable/person_icon_white_24dp.xml
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
~ Copyright (c) 2018 Zhang Hai <Dreaming.in.Code.ZH@Gmail.com>
|
||||
~ All Rights Reserved.
|
||||
-->
|
||||
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" />
|
||||
</vector>
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
~ Copyright (c) 2018 Zhang Hai <Dreaming.in.Code.ZH@Gmail.com>
|
||||
~ All Rights Reserved.
|
||||
-->
|
||||
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<size android:height="16dp" />
|
||||
</shape>
|
|
@ -29,25 +29,97 @@
|
|||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="@dimen/card_list_horizontal_padding"
|
||||
android:paddingEnd="@dimen/card_list_horizontal_padding"
|
||||
android:paddingTop="@dimen/card_list_vertical_padding"
|
||||
android:paddingBottom="@dimen/card_list_vertical_padding"
|
||||
android:clipToPadding="false"
|
||||
android:divider="@drawable/transparent_divider_horizontal_16dp"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="@dimen/list_padding_vertical"
|
||||
android:paddingBottom="@dimen/list_padding_vertical">
|
||||
android:showDividers="middle">
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/card_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/card_margin_horizontal"
|
||||
app:cardCornerRadius="@dimen/card_corner_radius"
|
||||
app:cardPreventCornerOverlap="false">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="@dimen/list_padding_vertical"
|
||||
android:paddingBottom="@dimen/list_padding_vertical">
|
||||
android:paddingTop="@dimen/list_vertical_padding"
|
||||
android:paddingBottom="@dimen/list_vertical_padding">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?listPreferredItemHeight"
|
||||
android:paddingStart="?android:listPreferredItemPaddingStart"
|
||||
android:paddingEnd="?android:listPreferredItemPaddingEnd"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/large_icon_size"
|
||||
android:layout_height="@dimen/large_icon_size"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@mipmap/ic_launcher" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/content_start_from_screen_edge_margin_minus_40dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:text="@string/app_name"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Headline" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="?android:listPreferredItemPaddingStart"
|
||||
android:paddingEnd="?android:listPreferredItemPaddingEnd"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:background="?selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/icon_size"
|
||||
android:layout_height="@dimen/icon_size"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/information_icon_white_24dp"
|
||||
android:tint="?android:textColorSecondary" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/content_start_from_screen_edge_margin_minus_24dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:text="@string/about_version_title"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/content_start_from_screen_edge_margin_minus_24dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:text="@string/app_version"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Caption" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/github"
|
||||
|
@ -62,7 +134,6 @@
|
|||
<ImageView
|
||||
android:layout_width="@dimen/icon_size"
|
||||
android:layout_height="@dimen/icon_size"
|
||||
android:duplicateParentState="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/github_icon_white_24dp"
|
||||
android:tint="?android:textColorSecondary" />
|
||||
|
@ -90,7 +161,6 @@
|
|||
<ImageView
|
||||
android:layout_width="@dimen/icon_size"
|
||||
android:layout_height="@dimen/icon_size"
|
||||
android:duplicateParentState="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/text_file_icon_white_24dp"
|
||||
android:tint="?android:textColorSecondary" />
|
||||
|
@ -106,6 +176,120 @@
|
|||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardPreventCornerOverlap="false">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="@dimen/list_vertical_padding"
|
||||
android:paddingBottom="@dimen/list_vertical_padding">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?listPreferredItemHeightSmall"
|
||||
android:paddingStart="?android:listPreferredItemPaddingStart"
|
||||
android:paddingEnd="?android:listPreferredItemPaddingEnd"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:text="@string/about_author_title"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body2"
|
||||
android:textColor="?android:textColorSecondary" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?listPreferredItemHeightSmall"
|
||||
android:paddingStart="?android:listPreferredItemPaddingStart"
|
||||
android:paddingEnd="?android:listPreferredItemPaddingEnd"
|
||||
android:background="?selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/icon_size"
|
||||
android:layout_height="@dimen/icon_size"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/person_icon_white_24dp"
|
||||
android:tint="?android:textColorSecondary" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/content_start_from_screen_edge_margin_minus_24dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:text="@string/about_author_name_title"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/author_github"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?listPreferredItemHeightSmall"
|
||||
android:paddingStart="?android:listPreferredItemPaddingStart"
|
||||
android:paddingEnd="?android:listPreferredItemPaddingEnd"
|
||||
android:background="?selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/icon_size"
|
||||
android:layout_height="@dimen/icon_size"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/github_icon_white_24dp"
|
||||
android:tint="?android:textColorSecondary" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/content_start_from_screen_edge_margin_minus_24dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:text="@string/about_author_github_title"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/author_google_plus"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?listPreferredItemHeightSmall"
|
||||
android:paddingStart="?android:listPreferredItemPaddingStart"
|
||||
android:paddingEnd="?android:listPreferredItemPaddingEnd"
|
||||
android:background="?selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/icon_size"
|
||||
android:layout_height="@dimen/icon_size"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/google_plus_icon_white_24dp"
|
||||
android:tint="?android:textColorSecondary" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/content_start_from_screen_edge_margin_minus_24dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:text="@string/about_author_google_plus_title"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</android.support.v7.widget.CardView>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
|
|
|
@ -95,7 +95,7 @@
|
|||
android:id="@+id/recycler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingBottom="@dimen/list_padding_bottom_with_fab"
|
||||
android:paddingBottom="@dimen/list_bottom_padding_with_fab"
|
||||
android:clipToPadding="false"
|
||||
app:fastScrollEnableThumbInactiveColor="false"
|
||||
app:fastScrollPopupBgColor="?colorAccent"
|
||||
|
|
|
@ -15,6 +15,6 @@
|
|||
<dimen name="content_start_margin_minus_12dp">68dp</dimen>
|
||||
<dimen name="content_start_from_screen_edge_margin_minus_36dp_considering_at_least_8dp">20dp</dimen>
|
||||
<dimen name="navigation_header_height">192dp</dimen>
|
||||
<dimen name="card_margin_horizontal">@dimen/screen_edge_margin</dimen>
|
||||
<dimen name="card_corner_radius">2dp</dimen>
|
||||
<dimen name="card_list_horizontal_padding">@dimen/screen_edge_margin</dimen>
|
||||
<dimen name="card_list_vertical_padding">@dimen/screen_edge_margin</dimen>
|
||||
</resources>
|
||||
|
|
|
@ -15,18 +15,19 @@
|
|||
<dimen name="content_start_margin_minus_12dp">60dp</dimen>
|
||||
<dimen name="content_start_from_screen_edge_margin_minus_24dp">32dp</dimen>
|
||||
<dimen name="content_start_from_screen_edge_margin_minus_36dp_considering_at_least_8dp">16dp</dimen>
|
||||
<dimen name="content_start_from_screen_edge_margin_minus_40dp">16dp</dimen>
|
||||
<dimen name="content_start_from_screen_edge_margin_minus_44dp">12dp</dimen>
|
||||
<dimen name="dialog_padding">24dp</dimen>
|
||||
<dimen name="dialog_padding_minus_4dp">20dp</dimen>
|
||||
<dimen name="navigation_header_height">172dp</dimen>
|
||||
<dimen name="tab_layout_height">48dp</dimen>
|
||||
<dimen name="list_padding_vertical">8dp</dimen>
|
||||
<dimen name="list_padding_bottom_with_fab">88dp</dimen>
|
||||
<dimen name="list_vertical_padding">8dp</dimen>
|
||||
<dimen name="list_bottom_padding_with_fab">88dp</dimen>
|
||||
<dimen name="two_line_list_item_height">72dp</dimen>
|
||||
<dimen name="list_item_vertical_padding">16dp</dimen>
|
||||
<dimen name="horizontal_divider_height">1dp</dimen>
|
||||
<dimen name="card_margin_horizontal">0dp</dimen>
|
||||
<dimen name="card_corner_radius">0dp</dimen>
|
||||
<dimen name="card_list_horizontal_padding">8dp</dimen>
|
||||
<dimen name="card_list_vertical_padding">16dp</dimen>
|
||||
<dimen name="small_icon_size">18dp</dimen>
|
||||
<dimen name="icon_size">24dp</dimen>
|
||||
<dimen name="large_icon_size">40dp</dimen>
|
||||
|
|
|
@ -162,6 +162,7 @@
|
|||
</string-array>
|
||||
|
||||
<string name="about_title">About</string>
|
||||
<string name="about_version_title">Version</string>
|
||||
<string name="about_github_title">View on GitHub</string>
|
||||
<string name="about_licenses_title">Licenses</string>
|
||||
<string name="about_licenses_html_style_light" translatable="false">
|
||||
|
@ -194,4 +195,8 @@
|
|||
color: #e91e63;
|
||||
}
|
||||
</string>
|
||||
<string name="about_author_title">Author</string>
|
||||
<string name="about_author_name_title">Hai Zhang</string>
|
||||
<string name="about_author_github_title">Follow on GitHub</string>
|
||||
<string name="about_author_google_plus_title">Add to Google+ circles</string>
|
||||
</resources>
|
||||
|
|
Loading…
Reference in New Issue
Block a user