Merge branch 'material-design' into 'master'

Material Design

Similar to !94, this wants to merge from the F-Droid branch.
Old MR is !84.

See merge request !95
This commit is contained in:
Nico Alt 2015-06-18 21:17:36 +00:00
commit 5be35d1d87
98 changed files with 178 additions and 95 deletions

View File

@ -16,9 +16,9 @@ if ( !hasProperty( 'sourceDeps' ) ) {
dependencies {
compile 'com.android.support:support-v4:20.0.0',
'com.android.support:appcompat-v7:20.0.0',
'com.android.support:support-annotations:20.0.0',
compile 'com.android.support:support-v4:22.1.0',
'com.android.support:appcompat-v7:22.1.0',
'com.android.support:support-annotations:22.1.0',
'org.thoughtcrime.ssl.pinning:AndroidPinning:1.0.0',
'com.nostra13.universalimageloader:universal-image-loader:1.9.4',
@ -80,9 +80,9 @@ if ( !hasProperty( 'sourceDeps' ) ) {
// then you can find the relevant portions of the ../build.gradle file that
// include magic required to make it work at around about the v0.78 git tag.
// They have since been removed to clean up the build file.
compile 'com.android.support:support-v4:20.0.0',
'com.android.support:appcompat-v7:20.0.0',
'com.android.support:support-annotations:20.0.0'
compile 'com.android.support:support-v4:22.1.0',
'com.android.support:appcompat-v7:22.1.0',
'com.android.support:support-annotations:22.1.0'
androidTestCompile 'commons-io:commons-io:2.2'
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 663 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 490 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1000 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 565 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 399 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 875 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 871 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 974 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 857 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 470 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 815 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 703 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 591 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 737 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 771 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 632 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 774 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 477 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 356 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 574 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 843 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 666 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 470 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 719 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 835 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 460 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 470 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 815 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 703 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 591 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 737 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 B

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<Spinner
android:id="@+id/category_spinner"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</Spinner>
<ListView
android:id="@android:id/list"
android:fastScrollEnabled="true"
android:layout_width="match_parent"
android:layout_height="match_parent">
</ListView>
</LinearLayout>

View File

@ -18,6 +18,7 @@
android:text="@string/swap_start"
style="@style/SwapTheme.StartSwap.StartButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/text_description"
android:layout_centerHorizontal="true"/>

View File

@ -4,12 +4,12 @@
<item
android:id="@+id/action_search"
android:icon="@android:drawable/ic_menu_search"
android:icon="@drawable/ic_search_white"
android:title="@string/menu_search"
app:showAsAction="always"/>
<item
android:id="@+id/action_update_repo"
android:icon="@drawable/ic_menu_refresh"
android:icon="@drawable/ic_refresh_white"
android:title="@string/menu_update_repo"
app:showAsAction="ifRoom"/>
<item
@ -18,22 +18,22 @@
app:showAsAction="ifRoom"/>
<item
android:id="@+id/action_manage_repos"
android:icon="@android:drawable/ic_menu_agenda"
android:icon="@drawable/ic_view_headline_white"
android:title="@string/menu_manage"
app:showAsAction="ifRoom"/>
<item
android:id="@+id/action_bluetooth_apk"
android:icon="@android:drawable/stat_sys_data_bluetooth"
android:icon="@drawable/ic_bluetooth_white"
android:title="@string/menu_send_apk_bt"
app:showAsAction="ifRoom"/>
<item
android:id="@+id/action_settings"
android:icon="@android:drawable/ic_menu_preferences"
android:icon="@drawable/ic_settings_white"
android:title="@string/menu_preferences"
app:showAsAction="ifRoom"/>
<item
android:id="@+id/action_about"
android:icon="@android:drawable/ic_menu_help"
android:icon="@drawable/ic_help_white"
android:title="@string/menu_about"
app:showAsAction="ifRoom"/>

View File

@ -5,11 +5,11 @@
<item
android:id="@+id/edit_repo"
android:title="@string/edit"
android:icon="@android:drawable/ic_menu_edit" />
android:icon="@drawable/ic_edit_white" />
<item
android:id="@+id/delete_repo"
android:title="@string/delete"
android:icon="@android:drawable/ic_menu_delete" />
android:icon="@drawable/ic_delete_white" />
</menu>

View File

@ -4,12 +4,12 @@
<item
android:id="@+id/action_update_repo"
android:icon="@drawable/ic_menu_refresh"
android:icon="@drawable/ic_refresh_white"
android:title="@string/menu_update_repo"
app:showAsAction="always|withText"/>
<item
android:id="@+id/action_add_repo"
android:icon="@android:drawable/ic_menu_add"
android:icon="@drawable/ic_add_white"
android:title="@string/menu_add_repo"
app:showAsAction="always|withText"/>
<item

View File

@ -7,7 +7,7 @@
<item
android:id="@+id/action_search"
android:icon="@android:drawable/ic_menu_search"
android:icon="@drawable/ic_search_white"
android:title="@string/menu_search"
android:titleCondensed="@string/menu_search"/>

View File

@ -1,15 +0,0 @@
<resources>
<style name="AppBaseThemeDark" parent="Theme.AppCompat">
<!-- API 11 theme customizations go here -->
</style>
<style name="AppBaseThemeLight" parent="Theme.AppCompat.Light">
<!-- API 11 theme customizations go here -->
</style>
<style name="AppBaseThemeLightWithDarkActionBar" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- API 11 theme customizations go here -->
</style>
</resources>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppThemeDark" parent="AppBaseThemeDark">
<!-- customizations that are not API-level specific go here. -->
<item name="android:colorEdgeEffect">@color/fdroid_blue</item>
<item name="android:colorControlActivated">@color/fdroid_green</item>
<item name="android:colorControlHighlight">@color/fdroid_green</item>
</style>
<style name="AppThemeLight" parent="AppBaseThemeLight">
<!-- customizations that are not API-level specific go here. -->
<item name="android:colorEdgeEffect">@color/fdroid_blue</item>
</style>
</resources>

View File

@ -13,6 +13,5 @@
<string-array name="themeNames">
<item>Dark</item>
<item>Light</item>
<item>Light (with dark action bar)</item>
</string-array>
</resources>

View File

@ -4,6 +4,10 @@
<color name="unsigned">#ffCC0000</color>
<color name="unverified">#ff999999</color>
<color name="fdroid_blue">#FF6097C5</color>
<color name="fdroid_blue_dark">#ff4b7195</color>
<color name="fdroid_green">#FFAAD024</color>
<color name="swap_light_blue">#27aae1</color>
<color name="swap_light_blue_pressed">#ff98cce1</color>
<color name="swap_blue">#1c6bbc</color>

View File

@ -26,7 +26,6 @@
<string-array name="themeValues">
<item>dark</item>
<item>light</item>
<item>lightWithDarkActionBar</item>
</string-array>
<string-array name="languageValues">

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<item type="id" name="categorySpinner" />
<item type="id" name="category_spinner" />
<item type="id" name="appDetailsSummaryHeader" />
</resources>

View File

@ -2,14 +2,17 @@
<style name="AppBaseThemeDark" parent="Theme.AppCompat">
<!-- backward-compatibility theme options go here -->
<item name="colorPrimary">@color/fdroid_blue</item>
<item name="colorPrimaryDark">@color/fdroid_blue_dark</item>
</style>
<style name="AppBaseThemeLight" parent="Theme.AppCompat.Light">
<style name="AppBaseThemeLight" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- backward-compatibility theme options go here -->
</style>
<style name="AppBaseThemeLightWithDarkActionBar" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- backward-compatibility theme options go here -->
<item name="colorPrimary">@color/fdroid_blue</item>
<item name="colorPrimaryDark">@color/fdroid_blue_dark</item>
</style>
<color name="black">#FF000000</color>
@ -29,24 +32,20 @@
<!-- customizations that are not API-level specific go here. -->
</style>
<style name="AppThemeLightWithDarkActionBar" parent="AppBaseThemeLightWithDarkActionBar">
<!-- customizations that are not API-level specific go here. -->
</style>
<style name="SwapTheme.Wizard" parent="AppThemeDark">
<item name="android:windowBackground">@drawable/swap_window_background</item>
<item name="android:actionBarStyle">@style/Widget.AppCompat.ActionBar.Solid</item>
<item name="android:actionButtonStyle">@style/SwapTheme.Wizard.ActionButton</item>
</style>
<style name="SwapTheme.StartSwap" parent="AppThemeLightWithDarkActionBar">
<style name="SwapTheme.StartSwap" parent="AppThemeLight">
<item name="android:background">@color/white</item>
</style>
<style name="SwapTheme.AppList" parent="AppThemeLightWithDarkActionBar">
<style name="SwapTheme.AppList" parent="AppThemeLight">
</style>
<style name="SwapTheme.AppList.ListItem" parent="AppThemeLightWithDarkActionBar">
<style name="SwapTheme.AppList.ListItem" parent="AppThemeLight">
</style>
<style name="SwapTheme.StartSwap.StartButton">
@ -54,10 +53,10 @@
<item name="android:layout_marginRight">9dp</item> <!-- 16px * 96dpi / 160dpi -->
<item name="android:layout_height">63.3dp</item> <!-- 113px * 96dpi / 160dpi -->
<item name="android:layout_width">match_parent</item>
<item name="android:textColor">@android:color/white</item>
<item name="android:textSize">18.5sp</item> <!-- 33px * 96dpi / 160dpi -->
<item name="android:background">@drawable/swap_start_button_skin</item>
<item name="android:textColor">#fff</item>
<item name="android:drawableLeft">@drawable/ic_swap</item>
<item name="android:paddingLeft">10dp</item>
@ -105,7 +104,6 @@
<item name="android:paddingRight">10dp</item>
<item name="android:paddingTop">5dp</item>
<item name="android:paddingBottom">5dp</item>
<item name="android:background">@drawable/swap_action_button_skin</item>
</style>
<style name="SwapTheme.Wizard.MainText" parent="@style/SwapTheme.Wizard.Text">
@ -179,4 +177,4 @@
<item name="android:textStyle">italic</item>
</style>
</resources>
</resources>

View File

@ -632,14 +632,14 @@ public class AppDetails extends ActionBarActivity implements ProgressListener, A
MenuItemCompat.setShowAsAction(menu.add(
Menu.NONE, SHARE, 1, R.string.menu_share)
.setIcon(android.R.drawable.ic_menu_share),
.setIcon(R.drawable.ic_share_white),
MenuItemCompat.SHOW_AS_ACTION_IF_ROOM |
MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT);
if (app.isInstalled()) {
MenuItemCompat.setShowAsAction(menu.add(
Menu.NONE, UNINSTALL, 1, R.string.menu_uninstall)
.setIcon(android.R.drawable.ic_menu_delete),
.setIcon(R.drawable.ic_delete_white),
MenuItemCompat.SHOW_AS_ACTION_IF_ROOM |
MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT);
}
@ -647,19 +647,19 @@ public class AppDetails extends ActionBarActivity implements ProgressListener, A
if (mPm.getLaunchIntentForPackage(app.id) != null && app.canAndWantToUpdate()) {
MenuItemCompat.setShowAsAction(menu.add(
Menu.NONE, LAUNCH, 1, R.string.menu_launch)
.setIcon(android.R.drawable.ic_media_play),
.setIcon(R.drawable.ic_play_arrow_white),
MenuItemCompat.SHOW_AS_ACTION_ALWAYS |
MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT);
}
menu.add(Menu.NONE, IGNOREALL, 2, R.string.menu_ignore_all)
.setIcon(android.R.drawable.ic_menu_close_clear_cancel)
.setIcon(R.drawable.ic_do_not_disturb_white)
.setCheckable(true)
.setChecked(app.ignoreAllUpdates);
if (app.hasUpdates()) {
menu.add(Menu.NONE, IGNORETHIS, 2, R.string.menu_ignore_this)
.setIcon(android.R.drawable.ic_menu_close_clear_cancel)
.setIcon(R.drawable.ic_do_not_disturb_white)
.setCheckable(true)
.setChecked(app.ignoreThisUpdate >= app.suggestedVercode);
}
@ -667,7 +667,7 @@ public class AppDetails extends ActionBarActivity implements ProgressListener, A
// Ignore on devices without Bluetooth
if (app.isInstalled() && fdroidApp.bluetoothAdapter != null) {
menu.add(Menu.NONE, SEND_VIA_BLUETOOTH, 3, R.string.send_via_bluetooth)
.setIcon(android.R.drawable.stat_sys_data_bluetooth);
.setIcon(R.drawable.ic_bluetooth_white);
}
return true;
}

View File

@ -87,12 +87,12 @@ public class FDroidApp extends Application {
dark, light, lightWithDarkActionBar
}
private static Theme curTheme = Theme.dark;
private static Theme curTheme = Theme.light;
public void reloadTheme() {
curTheme = Theme.valueOf(PreferenceManager
.getDefaultSharedPreferences(getBaseContext())
.getString(Preferences.PREF_THEME, "dark"));
.getString(Preferences.PREF_THEME, Preferences.DEFAULT_THEME));
}
public void applyTheme(Activity activity) {
@ -109,8 +109,6 @@ public class FDroidApp extends Application {
return R.style.AppThemeDark;
case light:
return R.style.AppThemeLight;
case lightWithDarkActionBar:
return R.style.AppThemeLightWithDarkActionBar;
default:
return R.style.AppThemeDark;
}

View File

@ -17,7 +17,6 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.Spinner;
@ -124,28 +123,25 @@ public class AvailableAppsFragment extends AppListFragment implements
*/
@SuppressWarnings("deprecation")
private void styleSpinner(Spinner spinner) {
if (Build.VERSION.SDK_INT >= 14) {
Drawable menuButton = getResources().getDrawable(android.R.drawable.btn_dropdown);
if (FDroidApp.getCurTheme() == FDroidApp.Theme.dark) {
menuButton.setAlpha(32); // make it darker via alpha
}
if (Build.VERSION.SDK_INT >= 16) {
spinner.setBackground(menuButton);
} else {
spinner.setBackgroundDrawable(menuButton);
}
Drawable menuButton = getResources().getDrawable(android.R.drawable.btn_dropdown);
if (FDroidApp.getCurTheme() == FDroidApp.Theme.dark) {
menuButton.setAlpha(32); // make it darker via alpha
}
if (Build.VERSION.SDK_INT >= 16) {
spinner.setBackground(menuButton);
} else {
spinner.setBackgroundDrawable(menuButton);
}
}
private Spinner createCategorySpinner() {
private Spinner setupCategorySpinner(Spinner spinner) {
categorySpinner = spinner;
categorySpinner.setId(R.id.category_spinner);
categories = AppProvider.Helper.categories(getActivity());
categorySpinner = new Spinner(getActivity());
// Giving it an ID lets the default save/restore state functionality do its stuff.
categorySpinner.setId(R.id.categorySpinner);
styleSpinner(categorySpinner);
ArrayAdapter<String> adapter = new ArrayAdapter<>(
@ -173,24 +169,11 @@ public class AvailableAppsFragment extends AppListFragment implements
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
LinearLayout view = new LinearLayout(getActivity());
view.setOrientation(LinearLayout.VERTICAL);
View view = inflater.inflate(R.layout.available_app_list, container, false);
view.addView(
createCategorySpinner(),
new ViewGroup.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT));
setupCategorySpinner((Spinner)view.findViewById(R.id.category_spinner));
ListView list = new ListView(getActivity());
list.setId(android.R.id.list);
list.setFastScrollEnabled(true);
list.setOnItemClickListener(this);
view.addView(
list,
new ViewGroup.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.MATCH_PARENT));
((ListView)view.findViewById(android.R.id.list)).setOnItemClickListener(this);
// R.string.category_whatsnew is the default set in AppListManager
DEFAULT_CATEGORY = getActivity().getString(R.string.category_whatsnew);

View File

@ -274,13 +274,13 @@ public class RepoDetailsFragment extends Fragment {
menu.clear();
MenuItem update = menu.add(Menu.NONE, UPDATE, 0, R.string.repo_update);
update.setIcon(R.drawable.ic_menu_refresh);
update.setIcon(R.drawable.ic_refresh_white);
MenuItemCompat.setShowAsAction(update,
MenuItemCompat.SHOW_AS_ACTION_ALWAYS |
MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT);
MenuItem delete = menu.add(Menu.NONE, DELETE, 0, R.string.delete);
delete.setIcon(android.R.drawable.ic_menu_delete);
delete.setIcon(R.drawable.ic_delete_white);
MenuItemCompat.setShowAsAction(delete,
MenuItemCompat.SHOW_AS_ACTION_IF_ROOM |
MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT);
@ -307,7 +307,7 @@ public class RepoDetailsFragment extends Fragment {
if (enableNfc != null)
return; // already created
enableNfc = menu.add(Menu.NONE, ENABLE_NFC, 0, R.string.enable_nfc_send);
enableNfc.setIcon(android.R.drawable.ic_menu_preferences);
enableNfc.setIcon(R.drawable.ic_nfc_white);
MenuItemCompat.setShowAsAction(enableNfc,
MenuItemCompat.SHOW_AS_ACTION_IF_ROOM |
MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT);

View File

@ -0,0 +1,74 @@
#!/bin/bash
#
# Helper script to download icons from https://github.com/google/material-design-icons and
# put the in the relevant drawable-* directories.
#
function usage {
echo "USAGE: download-material-icon.sh res-directory category icon"
echo " res-directory Usually \"res\" in your android project"
echo " category the grouping seen in the URL below (e.g. action, alert, av, communication, content, etc)"
echo " icon is the name if the icon (see URL below for icons)"
echo ""
echo "To see available icons, visit http://google.github.io/material-design-icons/"
}
function download {
REMOTE_DRAWABLE_DIR=$1
LOCAL_DRAWABLE_DIR=$2
FILE="ic_${ICON}_48dp.png"
URL="$BASE_URL/$CATEGORY/$REMOTE_DRAWABLE_DIR/$FILE"
DIR="$RES_DIR/$LOCAL_DRAWABLE_DIR"
if [ ! -d $DIR ]
then
echo "Creating dir $DIR"
mkdir $DIR
fi
LOCAL_PATH="$DIR/ic_${ICON}.png"
echo "Downloading to $LOCAL_PATH"
wget --quiet --output-document=$LOCAL_PATH $URL
if [ ! -s $LOCAL_PATH ]
then
if [ -f $LOCAL_PATH ]
then
rm $LOCAL_PATH
fi
echo "ERROR: Could not download from $URL to $LOCAL_PATH failed."
echo ""
usage
exit
fi
}
RES_DIR=$1
CATEGORY=$2
ICON="${3}_white"
BASE_URL="https://raw.githubusercontent.com/google/material-design-icons/master"
SCREENS="mdpi hdpi xhdpi xxhdpi xxxhdpi"
if [ ! -d $RES_DIR ]
then
echo "ERROR: $RES_DIR is not a directory"
echo ""
usage
exit
fi
download drawable-mdpi drawable
for SCREEN in $SCREENS
do
download "drawable-$SCREEN" "drawable-$SCREEN"
done
echo ""
echo "Please make sure you have the following attribution (or words to this effect) somewhere in your project:"
echo ""
echo " Some icons are from the Material Design Icon set (https://github.com/google/material-design-icons)"
echo " released under an Attribution 4.0 International license (http://creativecommons.org/licenses/by/4.0/)"
echo ""

View File

@ -139,3 +139,8 @@ Some icons are made by [Picol](http://www.flaticon.com/authors/picol),
[Dave Gandy](http://www.flaticon.com/authors/dave-gandy) from
[Flaticon](http://www.flaticon.com) or by Google and are licensed by
[Creative Commons BY 3.0](http://creativecommons.org/licenses/by/3.0/).
Other icons are from the
[Material Design Icon set](https://github.com/google/material-design-icons)
released under an
[Attribution 4.0 International license](http://creativecommons.org/licenses/by/4.0/).