Delete shrine demos

PiperOrigin-RevId: 318059097
This commit is contained in:
marianomartin 2020-06-24 10:24:35 -04:00 committed by ymarian
parent fcbaa82f12
commit a3ba9724eb
72 changed files with 2 additions and 2456 deletions

View File

@ -1,31 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.material.demo.shrine"
android:versionCode="1"
android:versionName="1.0">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:label="@string/app_name"
android:icon="@mipmap/product_logo_shrine_launcher_color_48"
android:allowBackup="true"
android:theme="@style/Theme.Shrine">
</application>
</manifest>

View File

@ -1,74 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2019 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<issues format="5" by="lint 3.3.2" client="gradle" variant="all" version="3.3.2">
<issue
id="OldTargetApi"
message="Not targeting the latest versions of Android; compatibility modes apply. Consider testing and updating this version. Consult the android.os.Build.VERSION_CODES javadoc for details."
errorLine1=" targetSdkVersion 28"
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
<location
file="build.gradle"
line="23"
column="5"/>
</issue>
<issue
id="AllowBackup"
message="On SDK version 23 and up, your app data will be automatically backed up and restored on app install. Consider adding the attribute `android:fullBackupContent` to specify an `@xml` resource which configures which files to backup. More info: https://developer.android.com/training/backup/autosyncapi.html"
errorLine1=" &lt;application"
errorLine2=" ~~~~~~~~~~~">
<location
file="AndroidManifest.xml"
line="24"
column="4"/>
</issue>
<issue
id="StaticFieldLeak"
message="Do not place Android context classes in static fields; this is a memory leak (and also breaks Instant Run)"
errorLine1=" private static Context ctx;"
errorLine2=" ~~~~~~">
<location
file="products/ImageRequester.java"
line="30"
column="11"/>
</issue>
<issue
id="StaticFieldLeak"
message="Do not place Android context classes in static fields (static reference to `ImageRequester` which has field `ctx` pointing to `Context`); this is a memory leak (and also breaks Instant Run)"
errorLine1=" private static ImageRequester instance;"
errorLine2=" ~~~~~~">
<location
file="products/ImageRequester.java"
line="31"
column="11"/>
</issue>
<issue
id="GoogleAppIndexingWarning"
message="App is not indexable by Google Search; consider adding at least one Activity with an ACTION-VIEW intent filter. See issue explanation for more details."
errorLine1=" &lt;application"
errorLine2=" ^">
<location
file="AndroidManifest.xml"
line="24"
column="3"/>
</issue>
</issues>

View File

@ -1,30 +0,0 @@
apply plugin: 'com.android.application'
dependencies {
implementation project(fromPath("demos/java/io/material/demo/shrine/filters"))
implementation project(fromPath("demos/java/io/material/demo/shrine/products"))
implementation project(fromPath("demos/java/io/material/demo/shrine/theme"))
}
android {
sourceSets {
main {
java.includes = ['*.java']
java.srcDirs = ['.']
main.java.excludes = [
'**/build/**',
]
res.srcDirs = ['res']
manifest.srcFile 'AndroidManifest.xml'
}
}
defaultConfig {
minSdkVersion 14
targetSdkVersion 28
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

View File

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.material.demo.shrine.filters">
<application>
<activity
android:name=".FiltersActivity"
android:parentActivityName="io.material.demo.shrine.products.ProductListActivity"
android:label="@string/shrine_filter_page_title"
android:theme="@style/Theme.Shrine.Filter"/>
</application>
</manifest>

View File

@ -1,40 +0,0 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.material.demo.shrine.filters;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
/**
* Activity that displays a list of filters the user can set to refine the list of products.
*/
public class FiltersActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.shrine_filters_activity);
initToolbar();
}
private void initToolbar() {
Toolbar toolbar = findViewById(R.id.AppBar);
setSupportActionBar(toolbar);
getSupportActionBar().setTitle(getString(R.string.shrine_filter_page_title));
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
}

View File

@ -1,48 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2019 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<issues format="5" by="lint 3.3.2" client="gradle" variant="all" version="3.3.2">
<issue
id="OldTargetApi"
message="Not targeting the latest versions of Android; compatibility modes apply. Consider testing and updating this version. Consult the android.os.Build.VERSION_CODES javadoc for details."
errorLine1=" targetSdkVersion 28"
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
<location
file="build.gradle"
line="25"
column="5"/>
</issue>
<issue
id="UnusedAttribute"
message="Attribute `parentActivityName` is only used in API level 16 and higher (current min is 14)"
errorLine1=" android:parentActivityName=&quot;io.material.demo.shrine.products.ProductListActivity&quot;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="AndroidManifest.xml"
line="23"
column="7"/>
</issue>
<issue
id="RtlEnabled"
message="The project references RTL attributes, but does not explicitly enable or disable RTL support with `android:supportsRtl` in the manifest">
<location
file="AndroidManifest.xml"/>
</issue>
</issues>

View File

@ -1,27 +0,0 @@
apply plugin: 'com.android.library'
dependencies {
api compatibility("appcompat")
api compatibility("core")
api compatibility("fragment")
api project(fromPath("demos/java/io/material/demo/shrine/theme"))
}
android {
sourceSets {
main {
java.includes = ['*.java']
java.srcDirs = ['.']
java.excludes = [
'**/build/**',
]
res.srcDirs = ['res']
manifest.srcFile 'AndroidManifest.xml'
}
}
defaultConfig {
minSdkVersion 14
targetSdkVersion 28
}
}

View File

@ -1,128 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.appcompat.widget.Toolbar
android:id="@+id/AppBar"
style="@style/Widget.Shrine.Toolbar.Filter"
tools:ignore="UnusedAttribute"/>
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
style="@style/Widget.Shrine.SectionItem.Container"
android:paddingTop="@dimen/shrine_large_spacing">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
style="@style/Widget.Shrine.TextView.SectionHeader"
android:text="@string/shrine_price_range_section_title"/>
<TextView
style="@style/Widget.Shrine.TextView.SectionHeaderEnd"
android:text="@string/shrine_price_range_max"/>
</LinearLayout>
<SeekBar
android:id="@+id/PriceRangeSeekBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/shrine_large_spacing"
android:layout_marginBottom="@dimen/shrine_large_spacing"
android:paddingLeft="@dimen/shrine_seekbar_padding"
android:paddingRight="@dimen/shrine_seekbar_padding"/>
</LinearLayout>
<LinearLayout
style="@style/Widget.Shrine.SectionItem.Container">
<LinearLayout
style="@style/Widget.Shrine.SectionItem"
android:paddingTop="@dimen/shrine_small_spacing">
<TextView
style="@style/Widget.Shrine.TextView"
android:text="@string/shrine_international_shipping"/>
<androidx.appcompat.widget.SwitchCompat
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"/>
</LinearLayout>
<LinearLayout
style="@style/Widget.Shrine.SectionItem"
android:paddingBottom="@dimen/shrine_small_spacing">
<TextView
style="@style/Widget.Shrine.TextView"
android:text="@string/shrine_personalized_feeds"/>
<androidx.appcompat.widget.SwitchCompat
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
style="@style/Widget.Shrine.SectionItem.Container">
<TextView
style="@style/Widget.Shrine.TextView.SectionHeader"
android:paddingTop="@dimen/shrine_standard_spacing"
android:paddingBottom="@dimen/shrine_standard_spacing"
android:text="@string/shrine_item_type_section_title"/>
<LinearLayout
style="@style/Widget.Shrine.SectionItem">
<TextView
style="@style/Widget.Shrine.TextView"
android:text="@string/shrine_item_type_women"/>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
style="@style/Widget.Shrine.SectionItem">
<TextView
style="@style/Widget.Shrine.TextView"
android:text="@string/shrine_item_type_men"/>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
style="@style/Widget.Shrine.SectionItem">
<TextView
style="@style/Widget.Shrine.TextView"
android:text="@string/shrine_item_type_girls"/>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
style="@style/Widget.Shrine.SectionItem">
<TextView
style="@style/Widget.Shrine.TextView"
android:text="@string/shrine_item_type_boys"/>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>

View File

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<style name="Widget.Shrine.SectionItem.Container">
<item name="android:layout_marginBottom">@dimen/shrine_small_spacing</item>
<item name="android:paddingStart">@dimen/shrine_standard_spacing</item>
<item name="android:paddingEnd">@dimen/shrine_standard_spacing</item>
<item name="android:background">?attr/colorPrimary</item>
<item name="android:orientation">vertical</item>
</style>
</resources>

View File

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<style name="Widget.Shrine.SectionItem.Container">
<item name="android:layout_marginBottom">@dimen/shrine_small_spacing</item>
<item name="android:paddingStart">@dimen/shrine_standard_spacing</item>
<item name="android:paddingEnd">@dimen/shrine_standard_spacing</item>
<item name="android:background">?attr/colorPrimary</item>
<item name="android:elevation">@dimen/shrine_section_elevation</item>
<item name="android:orientation">vertical</item>
</style>
</resources>

View File

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<dimen name="shrine_section_elevation">4dp</dimen>
<dimen name="shrine_section_header_text_size">16sp</dimen>
<dimen name="shrine_seekbar_padding">12dp</dimen>
</resources>

View File

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<string name="shrine_filter_page_title">Filters</string>
<string name="shrine_price_range_section_title">Price Range</string>
<string name="shrine_price_range_max">$1000+</string>
<string name="shrine_international_shipping">International Shipping</string>
<string name="shrine_personalized_feeds">Personalized Feeds</string>
<string name="shrine_item_type_section_title">Item Type</string>
<string name="shrine_item_type_women">Women</string>
<string name="shrine_item_type_men">Men</string>
<string name="shrine_item_type_girls">Girls</string>
<string name="shrine_item_type_boys">Boys</string>
</resources>

View File

@ -1,67 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<style name="Theme.Shrine.Filter">
<item name="android:textAppearance">@style/Widget.Shrine.TextView</item>
</style>
<style name="Widget.Shrine.Toolbar.Filter">
<item name="android:background">?attr/colorPrimary</item>
</style>
<style name="Widget.Shrine.SectionItem" parent="">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:paddingTop">@dimen/shrine_standard_spacing</item>
<item name="android:paddingBottom">@dimen/shrine_standard_spacing</item>
<item name="android:orientation">horizontal</item>
</style>
<style name="Widget.Shrine.SectionItem.Container">
<item name="android:layout_marginBottom">@dimen/shrine_small_spacing</item>
<item name="android:paddingLeft">@dimen/shrine_standard_spacing</item>
<item name="android:paddingRight">@dimen/shrine_standard_spacing</item>
<item name="android:background">?attr/colorPrimary</item>
<item name="android:orientation">vertical</item>
</style>
<style name="Widget.Shrine.TextView" parent="">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textAppearance">@style/TextAppearance.Shrine.Filter</item>
<item name="android:layout_weight">1</item>
</style>
<style name="Widget.Shrine.TextView.SectionHeader">
<item name="android:textAppearance">@style/TextAppearance.Shrine.Filter.SubHead</item>
</style>
<style name="Widget.Shrine.TextView.SectionHeaderEnd">
<item name="android:layout_weight">0</item>
<item name="android:textSize">@dimen/shrine_section_header_text_size</item>
</style>
<style name="TextAppearance.Shrine.Filter" parent="TextAppearance.AppCompat.Medium">
<item name="android:textColor">@color/textColorPrimary</item>
</style>
<style name="TextAppearance.Shrine.Filter.SubHead" parent="TextAppearance.AppCompat.Subhead">
<item name="android:textSize">@dimen/shrine_section_header_text_size</item>
<item name="android:textColor">@color/textColorSecondary</item>
</style>
</resources>

View File

@ -1,35 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.material.demo.shrine.products">
<application>
<activity
android:name=".ProductListActivity"
android:theme="@style/Theme.Shrine.Launcher">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name=".ItemActivity"
android:theme="@style/Theme.Shrine.ItemActivity"
android:parentActivityName=".ProductListActivity"/>
</application>
</manifest>

View File

@ -1,89 +0,0 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.material.demo.shrine.products;
import android.content.Context;
import android.graphics.Bitmap;
import android.util.DisplayMetrics;
import android.util.LruCache;
import com.android.volley.RequestQueue;
import com.android.volley.toolbox.ImageLoader;
import com.android.volley.toolbox.NetworkImageView;
import com.android.volley.toolbox.Volley;
/** Singleton class that handles image requests using Volley. */
public class ImageRequester {
private static Context ctx;
private static ImageRequester instance;
private final RequestQueue requestQueue;
private final ImageLoader imageLoader;
private final int maxByteSize;
private ImageRequester(Context context) {
ctx = context;
this.requestQueue = Volley.newRequestQueue(ctx.getApplicationContext());
this.requestQueue.start();
this.maxByteSize = calculateMaxByteSize();
this.imageLoader =
new ImageLoader(
requestQueue,
new ImageLoader.ImageCache() {
private final LruCache<String, Bitmap> lruCache =
new LruCache<String, Bitmap>(maxByteSize) {
@Override
protected int sizeOf(String url, Bitmap bitmap) {
return bitmap.getByteCount();
}
};
@Override
public synchronized Bitmap getBitmap(String url) {
return lruCache.get(url);
}
@Override
public synchronized void putBitmap(String url, Bitmap bitmap) {
lruCache.put(url, bitmap);
}
});
instance = this;
}
private static int calculateMaxByteSize() {
DisplayMetrics displayMetrics = ctx.getResources().getDisplayMetrics();
final int screenBytes = displayMetrics.widthPixels * displayMetrics.heightPixels * 4;
return screenBytes * 3;
}
/**
* Returns the existing ImageRequester instantiated, or a new instance if there is not yet an
* instance.
*
* @param context Of the calling activity.
* @return ImageRequester
*/
public static synchronized ImageRequester getInstance(Context context) {
if (instance == null) {
instance = new ImageRequester(context);
}
return instance;
}
public void setImageFromUrl(NetworkImageView networkImageView, String url) {
networkImageView.setImageUrl(url, imageLoader);
}
}

View File

@ -1,107 +0,0 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.material.demo.shrine.products;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.util.Log;
import android.view.Menu;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.Spinner;
import android.widget.TextView;
import com.android.volley.toolbox.NetworkImageView;
import com.google.android.material.snackbar.Snackbar;
/**
* Activity that displays an individual product, including an image, name, and a short description.
*/
public class ItemActivity extends AppCompatActivity {
private static final String PRODUCT_TITLE = "title";
private static final String PRODUCT_URL = "url";
private static final String PRODUCT_DESCRIPTION = "description";
private static final String TAG = ItemActivity.class.getSimpleName();
private String fabMessage;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.shrine_item_activity);
initToolbar();
populateProductViews();
initFab();
}
public static void createItemActivityIntent(Context context, ProductEntry productEntry) {
Intent intent = new Intent(context, ItemActivity.class);
intent.putExtra(PRODUCT_TITLE, productEntry.title);
intent.putExtra(PRODUCT_URL, productEntry.url);
intent.putExtra(PRODUCT_DESCRIPTION, productEntry.description);
context.startActivity(intent);
}
private void populateProductViews() {
Bundle bundle = getIntent().getExtras();
if (bundle == null) {
String error = "Error retrieving product information.";
Log.e(TAG, error);
Snackbar.make(findViewById(R.id.ProductTitle), error, Snackbar.LENGTH_SHORT).show();
fabMessage = error;
} else {
TextView productTitle = findViewById(R.id.ProductTitle);
productTitle.setText(bundle.getString(PRODUCT_TITLE));
TextView productDescription = findViewById(R.id.ProductDescription);
productDescription.setText(bundle.getString(PRODUCT_DESCRIPTION));
initSpinner();
NetworkImageView productImage = findViewById(R.id.ProductImage);
ImageRequester.getInstance(this).setImageFromUrl(productImage, bundle.getString(PRODUCT_URL));
fabMessage = getString(R.string.shrine_product_added_message);
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
getMenuInflater().inflate(R.menu.shrine_toolbar_menu, menu);
menu.findItem(R.id.ShrineToolbarFilterIcon).setVisible(false);
return true;
}
private void initToolbar() {
Toolbar toolbar = findViewById(R.id.AppBar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
private void initFab() {
findViewById(R.id.FloatingActionButton).setOnClickListener(clickListener);
}
private final OnClickListener clickListener =
v -> Snackbar.make(v, fabMessage, Snackbar.LENGTH_SHORT).show();
private void initSpinner() {
Spinner spinner = (Spinner) findViewById(R.id.QuantitySpinner);
ArrayAdapter<CharSequence> adapter =
ArrayAdapter.createFromResource(
this, R.array.product_quantities, R.layout.shrine_spinner_item);
spinner.setAdapter(adapter);
}
}

View File

@ -1,37 +0,0 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.material.demo.shrine.products;
import android.net.Uri;
/** A product entry in the list of products. */
public class ProductEntry {
public final String title;
public final Uri dynamicUrl;
public final String url;
public final String price;
public final String description;
public ProductEntry(
String title, String dynamicUrl, String url, String price, String description) {
this.title = title;
this.dynamicUrl = Uri.parse(dynamicUrl);
this.url = url;
this.price = price;
this.description = description;
}
}

View File

@ -1,197 +0,0 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.material.demo.shrine.products;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Point;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView.Adapter;
import androidx.recyclerview.widget.RecyclerView.ViewHolder;
import androidx.appcompat.widget.Toolbar;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.cardview.widget.CardView;
import com.android.volley.toolbox.NetworkImageView;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import io.material.demo.shrine.filters.FiltersActivity;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.io.StringWriter;
import java.io.Writer;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
/** Activity that displays a list of products. */
public class ProductListActivity extends AppCompatActivity {
private static final String TAG = ProductListActivity.class.getSimpleName();
private ImageRequester imageRequester;
private List<ProductEntry> productEntryList;
@Override
public void onCreate(Bundle savedInstanceState) {
setTheme(R.style.Theme_Shrine);
super.onCreate(savedInstanceState);
setContentView(R.layout.shrine_product_activity);
imageRequester = ImageRequester.getInstance(this);
initProductEntryList();
initCollapsingToolbar();
initItemGrid();
}
private void initProductEntryList() {
InputStream inputStream = getResources().openRawResource(R.raw.products);
Writer writer = new StringWriter();
char[] buffer = new char[1024];
try {
Reader reader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"));
int pointer;
while ((pointer = reader.read(buffer)) != -1) {
writer.write(buffer, 0, pointer);
}
} catch (IOException exception) {
Log.e(TAG, "Error writing/reading from the JSON file.", exception);
} finally {
try {
inputStream.close();
} catch (IOException exception) {
Log.e(TAG, "Error closing the input stream.", exception);
}
}
String jsonProductsString = writer.toString();
Gson gson = new Gson();
Type productListType = new TypeToken<ArrayList<ProductEntry>>() {}.getType();
this.productEntryList = gson.fromJson(jsonProductsString, productListType);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
getMenuInflater().inflate(R.menu.shrine_toolbar_menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem menuItem) {
if (menuItem.getItemId() == R.id.ShrineToolbarFilterIcon) {
startActivity(new Intent(this, FiltersActivity.class));
return true;
}
return false;
}
private void initCollapsingToolbar() {
Toolbar toolbar = findViewById(R.id.AppBar);
int collapsingToolbarImageIndex = 6;
int collapsingImageToolbarSize = 1200;
NetworkImageView collapsingToolbarImage = findViewById(R.id.CollapsingToolbarImage);
StringBuilder collapsingToolbarImageUrl =
new StringBuilder(productEntryList.get(collapsingToolbarImageIndex).url);
collapsingToolbarImageUrl.append("=s");
collapsingToolbarImageUrl.append(collapsingImageToolbarSize);
setSupportActionBar(toolbar);
CollapsingToolbarLayout collapsingToolbarLayout = findViewById(R.id.CollapsingToolbarLayout);
collapsingToolbarLayout.setTitle(toolbar.getTitle());
collapsingToolbarLayout.setExpandedTitleTextAppearance(R.style.TextAppearance_Shrine_Logo);
collapsingToolbarLayout.setCollapsedTitleTextAppearance(R.style.TextAppearance_Shrine_Logo);
imageRequester.setImageFromUrl(collapsingToolbarImage, collapsingToolbarImageUrl.toString());
Point windowSize = new Point();
getWindowManager().getDefaultDisplay().getSize(windowSize);
int windowWidth = windowSize.x;
collapsingToolbarImage.setX(collapsingToolbarImage.getX() - windowWidth / 4);
collapsingToolbarLayout.setScrimVisibleHeightTrigger(
(int) getResources().getDimension(R.dimen.shrine_tall_toolbar_height) / 2);
}
private void initItemGrid() {
RecyclerView recyclerView = findViewById(R.id.ProductGrid);
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(new GridLayoutManager(this, 2));
recyclerView.setAdapter(new ProductAdapter(this, productEntryList, imageRequester));
}
private static class ProductAdapter extends Adapter<ProductViewHolder> {
private final Activity activity;
private final List<ProductEntry> productEntries;
public ImageRequester imageRequester;
public ProductAdapter(
Activity activity, List<ProductEntry> productEntries, ImageRequester imageRequester) {
this.activity = activity;
this.productEntries = productEntries;
this.imageRequester = imageRequester;
}
@Override
public ProductViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
return new ProductViewHolder(activity, viewGroup);
}
@Override
public void onBindViewHolder(ProductViewHolder productViewHolder, int i) {
productViewHolder.bind(activity, productEntries.get(i), imageRequester);
}
@Override
public int getItemCount() {
return productEntries.size();
}
}
private static class ProductViewHolder extends ViewHolder {
private final TextView productPriceView;
private final NetworkImageView productImageView;
private final TextView productShopNameView;
private final CardView productEntryView;
public ProductViewHolder(Context context, ViewGroup parent) {
super(LayoutInflater.from(context).inflate(R.layout.shrine_product_entry, parent, false));
ViewGroup.LayoutParams layoutParams = itemView.getLayoutParams();
itemView.setLayoutParams(layoutParams);
productPriceView = itemView.findViewById(R.id.ProductPrice);
productImageView = itemView.findViewById(R.id.ProductImage);
productShopNameView = itemView.findViewById(R.id.ProductShopName);
productEntryView = itemView.findViewById(R.id.ProductEntry);
productEntryView.setOnClickListener(clickListener);
}
private final OnClickListener clickListener =
v -> ItemActivity.createItemActivityIntent(v.getContext(), (ProductEntry) v.getTag());
public void bind(Context context, ProductEntry productEntry, ImageRequester imageRequester) {
productPriceView.setText(productEntry.price);
imageRequester.setImageFromUrl(productImageView, productEntry.url);
productShopNameView.setText(productEntry.title);
productEntryView.setTag(productEntry);
}
}
}

View File

@ -1,173 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2019 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<issues format="5" by="lint 3.3.2" client="gradle" variant="all" version="3.3.2">
<issue
id="OldTargetApi"
message="Not targeting the latest versions of Android; compatibility modes apply. Consider testing and updating this version. Consult the android.os.Build.VERSION_CODES javadoc for details."
errorLine1=" targetSdkVersion 28"
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
<location
file="build.gradle"
line="30"
column="5"/>
</issue>
<issue
id="UnusedAttribute"
message="Attribute `parentActivityName` is only used in API level 16 and higher (current min is 14)"
errorLine1=" android:parentActivityName=&quot;.ProductListActivity&quot;/>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="AndroidManifest.xml"
line="32"
column="7"/>
</issue>
<issue
id="UnusedAttribute"
message="Attribute `fontFamily` is only used in API level 16 and higher (current min is 14) Did you mean `app:fontFamily` ?"
errorLine1=" android:fontFamily=&quot;sans-serif-light&quot;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/layout/shrine_spinner_item.xml"
line="20"
column="5"/>
</issue>
<issue
id="VectorDrawableCompat"
message="To use VectorDrawableCompat, you need to set `android.defaultConfig.vectorDrawables.useSupportLibrary = true`."
errorLine1=" app:srcCompat=&quot;@drawable/ic_add_shopping_cart_vd_theme_24&quot;/>"
errorLine2=" ~~~~~~~~~~~~~">
<location
file="res/layout/shrine_item_activity.xml"
line="105"
column="7"/>
</issue>
<issue
id="OutdatedLibrary"
message="This version is deprecated. Details: Bug affecting app stability. Consider switching to recommended version 1.1.0."
errorLine1=" api &apos;com.android.volley:volley:1.0.0&apos;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="build.gradle"
line="8"
column="3"/>
</issue>
<issue
id="StaticFieldLeak"
message="Do not place Android context classes in static fields; this is a memory leak (and also breaks Instant Run)"
errorLine1=" private static Context ctx;"
errorLine2=" ~~~~~~">
<location
file="ImageRequester.java"
line="30"
column="11"/>
</issue>
<issue
id="StaticFieldLeak"
message="Do not place Android context classes in static fields (static reference to `ImageRequester` which has field `ctx` pointing to `Context`); this is a memory leak (and also breaks Instant Run)"
errorLine1=" private static ImageRequester instance;"
errorLine2=" ~~~~~~">
<location
file="ImageRequester.java"
line="31"
column="11"/>
</issue>
<issue
id="AlwaysShowAction"
message="Prefer &quot;`ifRoom`&quot; instead of &quot;`always`&quot;"
errorLine1=" app:showAsAction=&quot;always&quot;/>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/menu/shrine_toolbar_menu.xml"
line="23"
column="5"/>
<location
file="res/menu/shrine_toolbar_menu.xml"
line="28"
column="5"/>
</issue>
<issue
id="RtlCompat"
message="To support older versions than API 17 (project specifies 14) you should **also** add `android:layout_marginLeft=&quot;@dimen/shrine_large_margin_start&quot;`"
errorLine1=" android:layout_marginStart=&quot;@dimen/shrine_large_margin_start&quot;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/layout/shrine_item_activity.xml"
line="58"
column="13"/>
</issue>
<issue
id="RtlCompat"
message="To support older versions than API 17 (project specifies 14) you should **also** add `android:layout_marginLeft=&quot;@dimen/shrine_toolbar_subtitle_offset_start&quot;`"
errorLine1=" android:layout_marginStart=&quot;@dimen/shrine_toolbar_subtitle_offset_start&quot;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/layout/shrine_product_activity.xml"
line="57"
column="11"/>
</issue>
<issue
id="RtlCompat"
message="To support older versions than API 17 (project specifies 14) you should **also** add `android:layout_marginRight=&quot;@dimen/shrine_standard_spacing&quot;`"
errorLine1=" android:layout_marginEnd=&quot;@dimen/shrine_standard_spacing&quot;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/layout/shrine_product_activity.xml"
line="58"
column="11"/>
</issue>
<issue
id="RtlSymmetry"
message="When you define `paddingRight` you should probably also define `paddingLeft` for right-to-left symmetry"
errorLine1=" android:paddingRight=&quot;@dimen/shrine_small_spacing&quot;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~">
<location
file="res/layout/shrine_item_activity.xml"
line="73"
column="15"/>
</issue>
<issue
id="RtlHardcoded"
message="Consider adding `android:paddingEnd=&quot;@dimen/shrine_small_spacing&quot;` to better support right-to-left layouts"
errorLine1=" android:paddingRight=&quot;@dimen/shrine_small_spacing&quot;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~">
<location
file="res/layout/shrine_item_activity.xml"
line="73"
column="15"/>
</issue>
<issue
id="RtlEnabled"
message="The project references RTL attributes, but does not explicitly enable or disable RTL support with `android:supportsRtl` in the manifest">
<location
file="AndroidManifest.xml"/>
</issue>
</issues>

View File

@ -1,37 +0,0 @@
apply plugin: 'com.android.library'
dependencies {
api compatibility("appcompat")
api compatibility("cardview")
api compatibility("recyclerview")
api 'com.android.volley:volley:1.1.0'
api 'com.google.code.gson:gson:2.2.4'
api project(':lib')
api project(fromPath("demos/java/io/material/demo/shrine/filters"))
api project(fromPath("demos/java/io/material/demo/shrine/theme"))
}
android {
sourceSets {
main {
java.includes = ['*.java']
java.srcDirs = ['.']
java.excludes = [
'**/build/**',
]
res.srcDirs = ['res']
manifest.srcFile 'AndroidManifest.xml'
}
}
defaultConfig {
minSdkVersion 14
targetSdkVersion 28
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

View File

@ -1,25 +0,0 @@
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M11,9h2L13,6h3L16,4h-3L13,1h-2v3L8,4v2h3v3zM7,18c-1.1,0 -1.99,0.9 -1.99,2S5.9,22 7,22s2,-0.9 2,-2 -0.9,-2 -2,-2zM17,18c-1.1,0 -1.99,0.9 -1.99,2s0.89,2 1.99,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM7.17,14.75l0.03,-0.12 0.9,-1.63h7.45c0.75,0 1.41,-0.41 1.75,-1.03l3.86,-7.01L19.42,4h-0.01l-1.1,2 -2.76,5L8.53,11l-0.13,-0.27L6.16,6l-0.95,-2 -0.94,-2L1,2v2h2l3.6,7.59 -1.35,2.45c-0.16,0.28 -0.25,0.61 -0.25,0.96 0,1.1 0.9,2 2,2h12v-2L7.42,15c-0.13,0 -0.25,-0.11 -0.25,-0.25z"/>
</vector>

View File

@ -1,25 +0,0 @@
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M7,10l5,5 5,-5z"/>
</vector>

View File

@ -1,25 +0,0 @@
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M12,21.35l-1.45,-1.32C5.4,15.36 2,12.28 2,8.5 2,5.42 4.42,3 7.5,3c1.74,0 3.41,0.81 4.5,2.09C13.09,3.81 14.76,3 16.5,3 19.58,3 22,5.42 22,8.5c0,3.78 -3.4,6.86 -8.55,11.54L12,21.35z"/>
</vector>

View File

@ -1,25 +0,0 @@
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M10,18h4v-2h-4v2zM3,6v2h18L21,6L3,6zM6,13h12v-2L6,11v2z"/>
</vector>

View File

@ -1,25 +0,0 @@
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z"/>
</vector>

View File

@ -1,25 +0,0 @@
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M7,18c-1.1,0 -1.99,0.9 -1.99,2S5.9,22 7,22s2,-0.9 2,-2 -0.9,-2 -2,-2zM1,2v2h2l3.6,7.59 -1.35,2.45c-0.16,0.28 -0.25,0.61 -0.25,0.96 0,1.1 0.9,2 2,2h12v-2L7.42,15c-0.14,0 -0.25,-0.11 -0.25,-0.25l0.03,-0.12 0.9,-1.63h7.45c0.75,0 1.41,-0.41 1.75,-1.03l3.58,-6.49c0.08,-0.14 0.12,-0.31 0.12,-0.48 0,-0.55 -0.45,-1 -1,-1L5.21,4l-0.94,-2L1,2zM17,18c-1.1,0 -1.99,0.9 -1.99,2s0.89,2 1.99,2 2,-0.9 2,-2 -0.9,-2 -2,-2z"/>
</vector>

View File

@ -1,25 +0,0 @@
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M17,2L7,2L2,6.62 12,22 22,6.62 17,2zM11.25,11.5L6.96,11.5L4.69,8h6.56v3.5zM11.25,13v5.1L7.94,13h3.31zM12.75,8L15,8v6.63l-2.25,3.46L12.75,8zM16.5,8h2.81l-2.81,4.32L16.5,8zM19.66,6.5L16.5,6.5L16.5,3.58l3.16,2.92zM7.59,3.5L15,3.5v3L4.34,6.5l3.25,-3z"/>
</vector>

View File

@ -1,23 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/colorPrimary"/>
<stroke
android:width="@dimen/shrine_spinner_border_width"
android:color="@color/colorDivider"/>
</shape>

View File

@ -1,110 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimary"
android:orientation="vertical">
<androidx.appcompat.widget.Toolbar
android:id="@+id/AppBar"
style="@style/Widget.Shrine.Toolbar.Logo.Product"
tools:ignore="UnusedAttribute"/>
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/shrine_standard_spacing"
android:layout_marginRight="@dimen/shrine_standard_spacing"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="@dimen/shrine_item_image_height">
<com.android.volley.toolbox.NetworkImageView
android:id="@+id/ProductImage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/shrine_standard_spacing"
android:layout_marginBottom="@dimen/shrine_standard_spacing"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:scaleType="fitCenter"/>
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/shrine_large_spacing"
android:layout_marginStart="@dimen/shrine_large_margin_start"
android:orientation="vertical">
<TextView
android:id="@+id/ProductTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/shrine_standard_spacing"
android:layout_marginBottom="@dimen/shrine_standard_spacing"
android:textAppearance="@style/TextAppearance.AppCompat.Display2"
android:textSize="@dimen/shrine_item_product_title_size"/>
<FrameLayout
android:layout_width="@dimen/shrine_spinner_width"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/shrine_standard_spacing"
android:layout_marginBottom="@dimen/shrine_standard_spacing"
android:paddingRight="@dimen/shrine_small_spacing"
android:background="@drawable/shrine_spinner_border">
<Spinner
android:id="@+id/QuantitySpinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:dropDownWidth="@dimen/shrine_spinner_width"
android:maxWidth="@dimen/shrine_spinner_width"/>
</FrameLayout>
<TextView
android:id="@+id/ProductDescription"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/shrine_standard_spacing"
android:layout_marginBottom="@dimen/shrine_large_spacing"
android:lineSpacingMultiplier="1.5"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"/>
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/FloatingActionButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/shrine_standard_spacing"
android:layout_marginBottom="@dimen/shrine_bottom_nav_view_height_with_standard_spacing"
android:layout_marginLeft="@dimen/shrine_standard_spacing"
android:layout_marginRight="@dimen/shrine_standard_spacing"
android:layout_gravity="bottom|end"
app:backgroundTint="@color/colorAccentSecondary"
app:fabSize="normal"
app:srcCompat="@drawable/ic_add_shopping_cart_vd_theme_24"/>
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/BottomNavView"
style="@style/Shrine.BottomNavView"
app:menu="@menu/shrine_bottom_nav_view_menu"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,87 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/CoordinatorLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/ProductGrid"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/shrine_grid_outer_margin"
android:layout_marginEnd="@dimen/shrine_grid_outer_margin"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="@dimen/shrine_tall_toolbar_height">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/CollapsingToolbarLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:collapsedTitleTextAppearance="@style/TextAppearance.Shrine.Logo"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleGravity="top"
app:expandedTitleMarginStart="@dimen/shrine_toolbar_offset_start"
app:expandedTitleMarginTop="@dimen/shrine_toolbar_offset_top"
app:expandedTitleTextAppearance="@style/TextAppearance.Shrine.Logo"
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap">
<com.android.volley.toolbox.NetworkImageView
android:id="@+id/CollapsingToolbarImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/shrine_toolbar_image_offset_top"
android:adjustViewBounds="true"
app:layout_collapseMode="parallax"
app:layout_collapseParallaxMultiplier="0.7"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/shrine_toolbar_subtitle_offset_top"
android:layout_marginStart="@dimen/shrine_toolbar_subtitle_offset_start"
android:layout_marginEnd="@dimen/shrine_standard_spacing"
android:layout_gravity="top"
android:orientation="vertical"
app:layout_collapseMode="parallax"
app:layout_collapseParallaxMultiplier="0.7">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/shrine_product_category"
android:textAppearance="@style/TextAppearance.AppCompat.Display2"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="@dimen/shrine_standard_spacing"
android:text="@string/shrine_product_description"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"/>
</LinearLayout>
<androidx.appcompat.widget.Toolbar
android:id="@+id/AppBar"
android:layout_width="match_parent"
android:layout_height="@dimen/shrine_toolbar_collapsed_height"
app:layout_collapseMode="pin"
tools:ignore="UnusedAttribute"/>
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/BottomNavView"
style="@style/Shrine.BottomNavView"
app:menu="@menu/shrine_bottom_nav_view_menu"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,51 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<androidx.cardview.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/ProductEntry"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/shrine_grid_item_margin"
android:orientation="vertical"
app:cardElevation="@dimen/cardview_default_elevation">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/shrine_card_inner_padding">
<TextView
android:id="@+id/ProductPrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:textColor="@color/textColorProduct"
android:textStyle="bold"/>
<com.android.volley.toolbox.NetworkImageView
android:id="@+id/ProductImage"
android:layout_width="wrap_content"
android:layout_height="@dimen/shrine_grid_image_height"
android:layout_gravity="center"
android:scaleType="fitCenter"/>
<TextView
android:id="@+id/ProductShopName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:textColor="@color/colorAccent"/>
</LinearLayout>
</androidx.cardview.widget.CardView>

View File

@ -1,24 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="@dimen/shrine_spinner_width"
android:layout_height="@dimen/shrine_spinner_height"
android:fontFamily="sans-serif-light"
android:gravity="center_vertical"
android:paddingLeft="@dimen/shrine_standard_spacing"
android:paddingRight="@dimen/shrine_standard_spacing"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"/>

View File

@ -1,37 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/BottomNavFavorites"
android:enabled="true"
android:title="@string/shrine_bottom_nav_favorites"
android:icon="@drawable/ic_favorite_vd_theme_24"
app:showAsAction="ifRoom"/>
<item
android:id="@+id/BottomNavHome"
android:enabled="true"
android:title="@string/shrine_bottom_nav_home"
android:icon="@drawable/ic_shrine_vd_theme_24"
app:showAsAction="ifRoom"/>
<item
android:id="@+id/BottomNavCart"
android:enabled="true"
android:title="@string/shrine_bottom_nav_cart"
android:icon="@drawable/ic_shopping_cart_vd_theme_24"
app:showAsAction="ifRoom"/>
</menu>

View File

@ -1,29 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/ShrineToolbarFilterIcon"
android:title="@string/shrine_icon_filter_title"
android:icon="@drawable/ic_filter_list_vd_theme_24"
app:showAsAction="always"/>
<item
android:id="@+id/ShrineToolbarSearchIcon"
android:title="@string/shrine_icon_search_title"
android:icon="@drawable/ic_search_vd_theme_24"
app:showAsAction="always"/>
</menu>

View File

@ -1,74 +0,0 @@
[
{
"title": "Red Popsicle",
"url": "https://lh3.googleusercontent.com/3w0neXbSlI4p6mtkRdwL7SwRH4NKHmmdBm1n58tNvUnV0DwnxZ6MfIwzSz0c7MlE3NZku1TmQAQm-4Tly6geteQpONOniM_m",
"price": "$5",
"description": "Looks can be deceiving. This Red Popsicle comes in a wide variety of flavors, including strawberry, that burst as soon as it hits the mouth. Red Popsicles melt slow, so savor the flavor."
},
{
"title": "Green Slip-ons",
"url": "https://lh3.googleusercontent.com/7O1nZyD9xwP0nel27kC49ZVfuUlMJrGdcI1j8PHBZxD2J8Gd-q1wQ5Rrn9sDQ_Q7Zi1-SNHDrBRaB5FD5zbtoEto1RpjBkXo",
"price": "$75",
"description": "Feetsy has been making extraordinary slip-ons for decades. With each pair of shoes purchased Feetsy donates a pair to those in need. Buy yourself a pair, buy someone else a pair. Very Comfortable."
},
{
"title": "Teapot",
"url": "https://lh3.googleusercontent.com/2L6RmCDcdBT_5160bg-rZaybSCGze6TCpEyTYko0Y6GWVp432qttKvXB19w4TgSnTz-Pxes12TPSzdRWT8Gq9dCJm2aF1zPj8g",
"price": "$210",
"description": "Impress your guests with Teapot by Kitchen Stuff. Teapot holds extremely hot liquids and pours them from the spout. Use the handle, shown on the left, so your fingers dont get burnt while pouring."
},
{
"title": "Beachball",
"url": "https://lh3.googleusercontent.com/FDlLqxdGjraCR8J0QzcuCh7eRHvnXNyWwP9mOTMviY2IX4WglCbAobxBD8tfYvUk-gZeOwvv02IC5vhbgEAk7F7gV2XwLJpAaw",
"price": "$25",
"description": "Are you at a baseball game and feeling bored? At a pool party and looking for a laugh? Do you need something to take your anger out on? Beachball, by inflatable fun, is the perfect outlet."
},
{
"title": "Clock",
"url": "https://lh3.googleusercontent.com/RJIsp5e-fQ_oQBWR-OJfJgcvCmfFJ8ZCL5D5_4-P3U4h7Im-WDvVJYqTl_YsCWcKFn5xbLI_9flEzUr0CA1PwCYGqDQDLvKxDA",
"price": "$120",
"description": "Timekeeper Co makes clocks that tell time precisely. Clock is very simple to use, set the time using your phone, hang it, and viola! Youll never be late again."
},
{
"title": "Lime Flippers",
"url": "https://lh3.googleusercontent.com/74P9JRtvjF4IIUYLxTZEFp9ffjNrcTFE1pCPduyTLPNjTAldtsRKn0iDx1CmOclJIsYJUWpyCKqXFrJzv3-ebEDe62wLci0R",
"price": "$25",
"description": "Flippers are a nice tool to have when youre being chased by an oversized sea turtle. Never get caught again with these fast water shoes. Youre like a fish, but more graceful."
},
{
"title": "Perfect Goldfish \nBowl",
"url": "https://lh3.googleusercontent.com/pfgpUuVo_9zWqn2lI6gAlDK2ceLe_MEzgNtj-RaClJb0w41NvSrOg-xgwMcr5FrYTdC6wJHKDSdP7GiuSbNAdjTSHlOdfXR1",
"price": "$25",
"description": "The Perfect Bowl Co makes the best bowls for just about anything you can think of. This Perfect Goldfish Bowl holds water and fish perfectly. Looks great in living rooms. Keep out of reach from cats."
},
{
"title": "Surfboard",
"url": "https://lh3.googleusercontent.com/585zsoqfGl58nbCDgM3MXLcVcZCfriN1k4N7KTnHDBULhSmeF9D80HhLAuDixrk0gLp9YdArxCQfZ7Yg-3zlEgkvQBaXzBwYSg",
"price": "$300",
"description": "Who says you cant walk on water? With Surfboard, by Surfboard Supply, you can fly on water. This beast is fast and handles like a porsche. Hang Ten Bro!"
},
{
"title": "Backpack",
"url": "https://lh3.googleusercontent.com/KE89imsb_0hMmO2YMxnZ6cQYelrmI3jdpDo06svFeNj_OjHUw9dfHoBj4pN7qqm1khs9-_japkG5As6TWgOmJzTa8Cv_9GcGfg",
"price": "$150",
"description": "This backpack by Bags n stuff can hold just about anything: a laptop, a pen, a protractor, notebooks, small animals, plugs for your devices, sunglasses, gym clothes, shoes, gloves, two kittens, and even lunch!"
},
{
"title": "Sunglasses",
"url": "https://lh3.googleusercontent.com/-0TR98kQUVgeSGyK24T0181IwtNgCWhxfMejw-fEXQF005lfuDERc-B6hxtSPBsPyFEJBxPv8H9FSNb7k3AgjRO2wm8YXeMa",
"price": "$100",
"description": "Be an optimist. Carry Sunglasses with you at all times. All Tints and Shades products come with polarized lenses and super duper UV protection so you can look at the sun for however long you want. Sunglasses make you look cool, wear them."
},
{
"title": "Red Lipstick Set",
"url": "https://lh3.googleusercontent.com/w7BggGOgZEVuI4_wsSO96PDi-y4kqtHVHqQknCMN7eyraQLIlh58QK5Y1Wc-eTAYDcmn7KmiJNvKsoFLAZBClSAYpI9vyuDRIw",
"price": "$25",
"description": "Trying to find the perfect shade to match your mood? Try no longer. Red Lipstick Set by StickLips has you covered for those nights when you need to get out, or even if youre just headed to work."
},
{
"title": "Dipped Brush",
"url": "https://lh3.googleusercontent.com/8dsHE4FwZ5VJOFj_EmhGt48r19ILh7rloMCBC5QPyP2Jrm7-Jz4wVZa1Q3cGFBBbi8OKJzb7nwUnBOqaPVwafMKOthbRtv6Z",
"price": "$15",
"description": "WeDipIt does it again. This handle dipped 4 inch brush is a perfect for painting 4 inch lines, or coloring in big areas with paint. Just be sure you dont drop it in a bucket of red paint, then it wont look dipped anymore."
}
]

View File

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<color name="colorAccentSecondary">#ffb300</color>
<color name="colorDivider">#1f000000</color>
<color name="textColorProduct">#0a3142</color>
</resources>

View File

@ -1,34 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<dimen name="shrine_tall_toolbar_height">474dp</dimen>
<dimen name="shrine_toolbar_image_offset_top">48dp</dimen>
<dimen name="shrine_toolbar_offset_start">124dp</dimen>
<dimen name="shrine_toolbar_offset_top">124dp</dimen>
<dimen name="shrine_toolbar_subtitle_offset_top">232dp</dimen>
<dimen name="shrine_toolbar_subtitle_offset_start">124dp</dimen>
<dimen name="shrine_card_inner_padding">8dp</dimen>
<dimen name="shrine_grid_item_margin">4dp</dimen>
<dimen name="shrine_grid_outer_margin">12dp</dimen>
<dimen name="shrine_grid_image_height">200dp</dimen>
<dimen name="shrine_item_image_height">292dp</dimen>
<dimen name="shrine_item_product_title_size">30sp</dimen>
<dimen name="shrine_large_margin_start">56dp</dimen>
<dimen name="shrine_spinner_width">212dp</dimen>
<dimen name="shrine_spinner_height">48dp</dimen>
<dimen name="shrine_spinner_border_width">2dp</dimen>
</resources>

View File

@ -1,37 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<string name="shrine_product_category">Best Gifts for Teen Girls</string>
<string name="shrine_product_description">
Leave the tunnel and the rain is fallin amazing things happen when you wait
</string>
<string name="shrine_product_added_message">Product was added to your cart.</string>
<string name="shrine_bottom_nav_favorites">Favorites</string>
<string name="shrine_bottom_nav_home">Home</string>
<string name="shrine_bottom_nav_cart">Cart</string>
<string name="shrine_icon_search_title">Search</string>
<string name="shrine_icon_filter_title">Filter</string>
<string-array name="product_quantities">
<item>Quantity 1</item>
<item>Quantity 2</item>
<item>Quantity 3</item>
<item>Quantity 4</item>
</string-array>
</resources>

View File

@ -1,25 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<style name="Theme.Shrine.ItemActivity">
<item name="android:textColorPrimary">@color/textColorProduct</item>
</style>
<style name="Widget.Shrine.Toolbar.Logo.Product">
<item name="android:background">?attr/colorPrimary</item>
</style>
</resources>

View File

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<string name="app_name">Shrine</string>
</resources>

View File

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.material.demo.shrine.theme">
<application/>
</manifest>

View File

@ -1,30 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2019 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<issues format="5" by="lint 3.3.2" client="gradle" variant="all" version="3.3.2">
<issue
id="OldTargetApi"
message="Not targeting the latest versions of Android; compatibility modes apply. Consider testing and updating this version. Consult the android.os.Build.VERSION_CODES javadoc for details."
errorLine1=" targetSdkVersion 28"
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
<location
file="build.gradle"
line="21"
column="5"/>
</issue>
</issues>

View File

@ -1,23 +0,0 @@
apply plugin: 'com.android.library'
dependencies {
api compatibility("appcompat")
}
android {
sourceSets {
main {
java.includes = [ '*.java' ]
java.srcDirs = ['.']
java.excludes = [
'**/build/**',
]
res.srcDirs = ['res']
manifest.srcFile 'AndroidManifest.xml'
}
}
defaultConfig {
minSdkVersion 14
targetSdkVersion 28
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

View File

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
android:opacity="opaque">
<item android:drawable="@android:color/white" />
<item
android:id="@+id/launchscreens_product_logo"
android:bottom="@dimen/launchscreens_product_logo_bottom">
<bitmap
android:src="@drawable/product_logo_shrine_color_192"
android:gravity="center"/>
</item>
</layer-list>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

View File

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
android:opacity="opaque">
<item android:drawable="@android:color/white" />
<item
android:id="@+id/launchscreens_product_logo"
android:bottom="@dimen/launchscreens_product_logo_bottom">
<bitmap
android:src="@drawable/product_logo_shrine_color_144"
android:gravity="center"/>
</item>
</layer-list>

View File

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<!-- Adjusted higher to deal with the smaller total height we have to deal with on phones -->
<dimen name="launchscreens_product_logo_bottom">48dp</dimen>
</resources>

View File

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<!-- Values adjusted for nav bar size due to windowDrawsSystemBarBackgrounds -->
<dimen name="launchscreens_product_logo_bottom">64dp</dimen>
</resources>

View File

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<!-- Values adjusted for nav bar size due to windowDrawsSystemBarBackgrounds -->
<dimen name="launchscreens_product_logo_bottom">72dp</dimen>
</resources>

View File

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<!-- Tablets have a lot more landscape height, so we undo the phone-only landscape adjustment -->
<dimen name="launchscreens_product_logo_bottom">24dp</dimen>
</resources>

View File

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<!-- Values adjusted for nav bar size due to windowDrawsSystemBarBackgrounds -->
<dimen name="launchscreens_product_logo_bottom">72dp</dimen>
</resources>

View File

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<dimen name="launchscreens_product_logo_bottom">24dp</dimen>
</resources>

View File

@ -1,31 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<style name="Widget.Shrine.Toolbar.Logo" parent="Base.Widget.Shrine.Toolbar.Logo">
<item name="android:elevation">@dimen/shrine_toolbar_elevation</item>
</style>
<style name="TextAppearance.Shrine.Logo" parent="Base.TextAppearance.Shrine.Logo">
<item name="android:letterSpacing">0.20</item>
</style>
<style name="Shrine.BottomNavView" parent="Base.Shrine.BottomNavView">
<item name="elevation">@dimen/shrine_bottom_nav_view_elevation</item>
</style>
</resources>

View File

@ -1,23 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<color name="colorPrimary">#ffffff</color>
<color name="colorPrimaryDark">#e0e0e0</color>
<color name="colorAccent">#607d8b</color>
<color name="textColorPrimary">#dd000000</color>
<color name="textColorSecondary">#89000000</color>
</resources>

View File

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<dimen name="shrine_standard_spacing">16dp</dimen>
<dimen name="shrine_small_spacing">8dp</dimen>
<dimen name="shrine_large_spacing">36dp</dimen>
<dimen name="shrine_toolbar_collapsed_height">72dp</dimen>
<dimen name="shrine_toolbar_elevation">4dp</dimen>
<dimen name="shrine_bottom_nav_view_elevation">16dp</dimen>
<dimen name="shrine_bottom_nav_view_height">56dp</dimen>
<dimen name="shrine_bottom_nav_view_height_with_standard_spacing">72dp</dimen>
<dimen name="launchscreens_product_logo_bottom">16dp</dimen>
</resources>

View File

@ -1,68 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<style name="Theme.Shrine" parent="Base.Theme.Shrine"/>
<style name="Theme.Shrine.Launcher">
<item name="colorPrimaryDark">?attr/colorPrimary</item>
<item name="android:windowBackground">@drawable/launch_screen</item>
</style>
<style name="Base.Theme.Shrine" parent="@style/Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:textColorPrimary">@color/textColorPrimary</item>
<item name="toolbarStyle">@style/Widget.Shrine.Toolbar.Logo</item>
</style>
<style name="Widget.Shrine.Toolbar" parent="Widget.AppCompat.Toolbar">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">@dimen/shrine_toolbar_collapsed_height</item>
<item name="android:minHeight">@dimen/shrine_toolbar_collapsed_height</item>
</style>
<style name="Base.Widget.Shrine.Toolbar.Logo" parent="Widget.Shrine.Toolbar">
<item name="titleTextAppearance">@style/TextAppearance.Shrine.Logo</item>
</style>
<style name="Widget.Shrine.Toolbar.Logo" parent="Base.Widget.Shrine.Toolbar.Logo" />
<style name="Base.TextAppearance.Shrine.Logo" parent="TextAppearance.AppCompat.Display3">
<item name="android:textAllCaps">true</item>
<item name="android:textSize">22sp</item>
<item name="android:textStyle">bold</item>
</style>
<style name="TextAppearance.Shrine.Logo" parent="Base.TextAppearance.Shrine.Logo"/>
<style name="ThemeOverlay.Shrine.BottomNavView" parent="">
<item name="colorPrimary">@color/colorAccent</item>
</style>
<style name="Base.Shrine.BottomNavView" parent="">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">@dimen/shrine_bottom_nav_view_height</item>
<item name="android:layout_gravity">bottom</item>
<item name="android:background">@color/colorPrimary</item>
<item name="android:theme">@style/ThemeOverlay.Shrine.BottomNavView</item>
</style>
<style name="Shrine.BottomNavView" parent="Base.Shrine.BottomNavView"/>
</resources>

View File

@ -1,54 +0,0 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.material.demo.shrine.products;
import static com.google.common.truth.Truth.assertThat;
import androidx.recyclerview.widget.RecyclerView;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.Robolectric;
import org.robolectric.RobolectricTestRunner;
/** Unit tests for {@link ProductListActivity}. */
@RunWith(RobolectricTestRunner.class)
public class ProductListActivityTest {
private ProductListActivity productListActivity;
private RecyclerView productsRecyclerView;
@Before
public void setUp() {
productListActivity = Robolectric.setupActivity(ProductListActivity.class);
productsRecyclerView = productListActivity.findViewById(R.id.ProductGrid);
}
@Ignore
@Test
public void testProductListIsNotNull() {
assertThat(productsRecyclerView).isNotNull();
}
@Ignore
@Test
public void testProductListHasProducts() {
int productCount = productsRecyclerView.getChildCount();
assertThat(productCount).isAtLeast(1);
}
}

View File

@ -8,11 +8,6 @@ include ':testing:java:com:google:android:material:testapp:theme'
include ':catalog'
include ':demos:java:io:material:demo:shrine'
include ':demos:java:io:material:demo:shrine:filters'
include ':demos:java:io:material:demo:shrine:products'
include ':demos:java:io:material:demo:shrine:theme'
rootProject.children.each { p ->
def allChildren = []
@ -27,8 +22,8 @@ rootProject.children.each { p ->
allChildren.each { project ->
// Give each project a repository-wide unique name based on their path from
// the top-level dir (e.g. the project at demos/java/io/material/shrine will
// be named :demos-java-io-material-shrine). Doing so avoids the need to
// the top-level dir (e.g. the project at java/io/material/catalog will
// be named :java-io-material-catalog). Doing so avoids the need to
// have unique directory names throughout our subprojects.
project.name = project.path.substring(1).replace(':', '-')
}