diff --git a/.gitignore b/.gitignore index 32858aa..b6d93ab 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,7 @@ # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* + +local.properties +build/ +.gradle/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..5a8d6b0 --- /dev/null +++ b/README.md @@ -0,0 +1,31 @@ +Cheesesquare Sample +=================================== + +Demos the new Android Design library. + +Pre-requisites +-------------- + +- Android SDK v22 +- Android Build Tools v22.0.1 +- Android Support Repository v22.2 + +License +------- + +Copyright 2014 The Android Open Source Project, Inc. + +Licensed to the Apache Software Foundation (ASF) under one or more contributor +license agreements. See the NOTICE file distributed with this work for +additional information regarding copyright ownership. The ASF licenses this +file to you 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. \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..0e5d568 --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,34 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 22 + buildToolsVersion "22.0.1" + + defaultConfig { + applicationId "com.support.android.designlibdemo" + minSdkVersion 9 + targetSdkVersion 22 + versionCode 1 + versionName "1.0" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +repositories { + jcenter() +} + +dependencies { + compile 'com.android.support:design:22.2.0' + compile 'com.android.support:appcompat-v7:22.2.0' + compile 'com.android.support:cardview-v7:22.2.0' + compile 'com.android.support:recyclerview-v7:22.2.0' + + compile 'com.github.bumptech.glide:glide:3.6.0' + compile 'de.hdodenhof:circleimageview:1.3.0' +} diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..6bb4c1c --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in /usr/local/google/home/chrisbanes/bin/current-android-sdk/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..097a591 --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/java/com/support/android/designlibdemo/CheeseDetailActivity.java b/app/src/main/java/com/support/android/designlibdemo/CheeseDetailActivity.java new file mode 100644 index 0000000..5338c1e --- /dev/null +++ b/app/src/main/java/com/support/android/designlibdemo/CheeseDetailActivity.java @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2015 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 com.support.android.designlibdemo; + +import android.content.Intent; +import android.os.Bundle; +import android.support.design.widget.CollapsingToolbarLayout; +import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.Toolbar; +import android.view.Menu; +import android.view.MenuItem; +import android.widget.ImageView; + +import com.bumptech.glide.Glide; + +import java.util.Random; + +public class CheeseDetailActivity extends AppCompatActivity { + + public static final String EXTRA_NAME = "cheese_name"; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_detail); + + Intent intent = getIntent(); + final String cheeseName = intent.getStringExtra(EXTRA_NAME); + + final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + + CollapsingToolbarLayout collapsingToolbar = + (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar); + collapsingToolbar.setTitle(cheeseName); + + loadBackdrop(); + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case android.R.id.home: + finish(); + return true; + } + return super.onOptionsItemSelected(item); + } + + private void loadBackdrop() { + final ImageView imageView = (ImageView) findViewById(R.id.backdrop); + Glide.with(this).load(Cheeses.getRandomCheeseDrawable()).centerCrop().into(imageView); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(R.menu.sample_actions, menu); + return true; + } +} diff --git a/app/src/main/java/com/support/android/designlibdemo/CheeseListFragment.java b/app/src/main/java/com/support/android/designlibdemo/CheeseListFragment.java new file mode 100644 index 0000000..7890c01 --- /dev/null +++ b/app/src/main/java/com/support/android/designlibdemo/CheeseListFragment.java @@ -0,0 +1,138 @@ +/* + * Copyright (C) 2015 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 com.support.android.designlibdemo; + +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.support.annotation.Nullable; +import android.support.v4.app.Fragment; +import android.support.v4.widget.TextViewCompat; +import android.support.v7.widget.LinearLayoutManager; +import android.support.v7.widget.RecyclerView; +import android.util.TypedValue; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.TextView; + +import com.bumptech.glide.Glide; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +public class CheeseListFragment extends Fragment { + + @Nullable + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + RecyclerView rv = (RecyclerView) inflater.inflate( + R.layout.fragment_cheese_list, container, false); + setupRecyclerView(rv); + return rv; + } + + private void setupRecyclerView(RecyclerView recyclerView) { + recyclerView.setLayoutManager(new LinearLayoutManager(recyclerView.getContext())); + recyclerView.setAdapter(new SimpleStringRecyclerViewAdapter(getActivity(), + getRandomSublist(Cheeses.sCheeseStrings, 30))); + } + + private List getRandomSublist(String[] array, int amount) { + ArrayList list = new ArrayList<>(amount); + Random random = new Random(); + while (list.size() < amount) { + list.add(array[random.nextInt(array.length)]); + } + return list; + } + + public static class SimpleStringRecyclerViewAdapter + extends RecyclerView.Adapter { + + private final TypedValue mTypedValue = new TypedValue(); + private int mBackground; + private List mValues; + + public static class ViewHolder extends RecyclerView.ViewHolder { + public String mBoundString; + + public final View mView; + public final ImageView mImageView; + public final TextView mTextView; + + public ViewHolder(View view) { + super(view); + mView = view; + mImageView = (ImageView) view.findViewById(R.id.avatar); + mTextView = (TextView) view.findViewById(android.R.id.text1); + } + + @Override + public String toString() { + return super.toString() + " '" + mTextView.getText(); + } + } + + public String getValueAt(int position) { + return mValues.get(position); + } + + public SimpleStringRecyclerViewAdapter(Context context, List items) { + context.getTheme().resolveAttribute(R.attr.selectableItemBackground, mTypedValue, true); + mBackground = mTypedValue.resourceId; + mValues = items; + } + + @Override + public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()) + .inflate(R.layout.list_item, parent, false); + view.setBackgroundResource(mBackground); + return new ViewHolder(view); + } + + @Override + public void onBindViewHolder(final ViewHolder holder, int position) { + holder.mBoundString = mValues.get(position); + holder.mTextView.setText(mValues.get(position)); + + holder.mView.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Context context = v.getContext(); + Intent intent = new Intent(context, CheeseDetailActivity.class); + intent.putExtra(CheeseDetailActivity.EXTRA_NAME, holder.mBoundString); + + context.startActivity(intent); + } + }); + + Glide.with(holder.mImageView.getContext()) + .load(Cheeses.getRandomCheeseDrawable()) + .fitCenter() + .into(holder.mImageView); + } + + @Override + public int getItemCount() { + return mValues.size(); + } + } +} diff --git a/app/src/main/java/com/support/android/designlibdemo/Cheeses.java b/app/src/main/java/com/support/android/designlibdemo/Cheeses.java new file mode 100644 index 0000000..4c15ee2 --- /dev/null +++ b/app/src/main/java/com/support/android/designlibdemo/Cheeses.java @@ -0,0 +1,174 @@ +/* + * Copyright (C) 2015 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 com.support.android.designlibdemo; + +import java.util.Random; + +public class Cheeses { + + private static final Random RANDOM = new Random(); + + public static int getRandomCheeseDrawable() { + switch (RANDOM.nextInt(5)) { + default: + case 0: + return R.drawable.cheese_1; + case 1: + return R.drawable.cheese_2; + case 2: + return R.drawable.cheese_3; + case 3: + return R.drawable.cheese_4; + case 4: + return R.drawable.cheese_5; + } + } + + public static final String[] sCheeseStrings = { + "Abbaye de Belloc", "Abbaye du Mont des Cats", "Abertam", "Abondance", "Ackawi", + "Acorn", "Adelost", "Affidelice au Chablis", "Afuega'l Pitu", "Airag", "Airedale", + "Aisy Cendre", "Allgauer Emmentaler", "Alverca", "Ambert", "American Cheese", + "Ami du Chambertin", "Anejo Enchilado", "Anneau du Vic-Bilh", "Anthoriro", "Appenzell", + "Aragon", "Ardi Gasna", "Ardrahan", "Armenian String", "Aromes au Gene de Marc", + "Asadero", "Asiago", "Aubisque Pyrenees", "Autun", "Avaxtskyr", "Baby Swiss", + "Babybel", "Baguette Laonnaise", "Bakers", "Baladi", "Balaton", "Bandal", "Banon", + "Barry's Bay Cheddar", "Basing", "Basket Cheese", "Bath Cheese", "Bavarian Bergkase", + "Baylough", "Beaufort", "Beauvoorde", "Beenleigh Blue", "Beer Cheese", "Bel Paese", + "Bergader", "Bergere Bleue", "Berkswell", "Beyaz Peynir", "Bierkase", "Bishop Kennedy", + "Blarney", "Bleu d'Auvergne", "Bleu de Gex", "Bleu de Laqueuille", + "Bleu de Septmoncel", "Bleu Des Causses", "Blue", "Blue Castello", "Blue Rathgore", + "Blue Vein (Australian)", "Blue Vein Cheeses", "Bocconcini", "Bocconcini (Australian)", + "Boeren Leidenkaas", "Bonchester", "Bosworth", "Bougon", "Boule Du Roves", + "Boulette d'Avesnes", "Boursault", "Boursin", "Bouyssou", "Bra", "Braudostur", + "Breakfast Cheese", "Brebis du Lavort", "Brebis du Lochois", "Brebis du Puyfaucon", + "Bresse Bleu", "Brick", "Brie", "Brie de Meaux", "Brie de Melun", "Brillat-Savarin", + "Brin", "Brin d' Amour", "Brin d'Amour", "Brinza (Burduf Brinza)", + "Briquette de Brebis", "Briquette du Forez", "Broccio", "Broccio Demi-Affine", + "Brousse du Rove", "Bruder Basil", "Brusselae Kaas (Fromage de Bruxelles)", "Bryndza", + "Buchette d'Anjou", "Buffalo", "Burgos", "Butte", "Butterkase", "Button (Innes)", + "Buxton Blue", "Cabecou", "Caboc", "Cabrales", "Cachaille", "Caciocavallo", "Caciotta", + "Caerphilly", "Cairnsmore", "Calenzana", "Cambazola", "Camembert de Normandie", + "Canadian Cheddar", "Canestrato", "Cantal", "Caprice des Dieux", "Capricorn Goat", + "Capriole Banon", "Carre de l'Est", "Casciotta di Urbino", "Cashel Blue", "Castellano", + "Castelleno", "Castelmagno", "Castelo Branco", "Castigliano", "Cathelain", + "Celtic Promise", "Cendre d'Olivet", "Cerney", "Chabichou", "Chabichou du Poitou", + "Chabis de Gatine", "Chaource", "Charolais", "Chaumes", "Cheddar", + "Cheddar Clothbound", "Cheshire", "Chevres", "Chevrotin des Aravis", "Chontaleno", + "Civray", "Coeur de Camembert au Calvados", "Coeur de Chevre", "Colby", "Cold Pack", + "Comte", "Coolea", "Cooleney", "Coquetdale", "Corleggy", "Cornish Pepper", + "Cotherstone", "Cotija", "Cottage Cheese", "Cottage Cheese (Australian)", + "Cougar Gold", "Coulommiers", "Coverdale", "Crayeux de Roncq", "Cream Cheese", + "Cream Havarti", "Crema Agria", "Crema Mexicana", "Creme Fraiche", "Crescenza", + "Croghan", "Crottin de Chavignol", "Crottin du Chavignol", "Crowdie", "Crowley", + "Cuajada", "Curd", "Cure Nantais", "Curworthy", "Cwmtawe Pecorino", + "Cypress Grove Chevre", "Danablu (Danish Blue)", "Danbo", "Danish Fontina", + "Daralagjazsky", "Dauphin", "Delice des Fiouves", "Denhany Dorset Drum", "Derby", + "Dessertnyj Belyj", "Devon Blue", "Devon Garland", "Dolcelatte", "Doolin", + "Doppelrhamstufel", "Dorset Blue Vinney", "Double Gloucester", "Double Worcester", + "Dreux a la Feuille", "Dry Jack", "Duddleswell", "Dunbarra", "Dunlop", "Dunsyre Blue", + "Duroblando", "Durrus", "Dutch Mimolette (Commissiekaas)", "Edam", "Edelpilz", + "Emental Grand Cru", "Emlett", "Emmental", "Epoisses de Bourgogne", "Esbareich", + "Esrom", "Etorki", "Evansdale Farmhouse Brie", "Evora De L'Alentejo", "Exmoor Blue", + "Explorateur", "Feta", "Feta (Australian)", "Figue", "Filetta", "Fin-de-Siecle", + "Finlandia Swiss", "Finn", "Fiore Sardo", "Fleur du Maquis", "Flor de Guia", + "Flower Marie", "Folded", "Folded cheese with mint", "Fondant de Brebis", + "Fontainebleau", "Fontal", "Fontina Val d'Aosta", "Formaggio di capra", "Fougerus", + "Four Herb Gouda", "Fourme d' Ambert", "Fourme de Haute Loire", "Fourme de Montbrison", + "Fresh Jack", "Fresh Mozzarella", "Fresh Ricotta", "Fresh Truffles", "Fribourgeois", + "Friesekaas", "Friesian", "Friesla", "Frinault", "Fromage a Raclette", "Fromage Corse", + "Fromage de Montagne de Savoie", "Fromage Frais", "Fruit Cream Cheese", + "Frying Cheese", "Fynbo", "Gabriel", "Galette du Paludier", "Galette Lyonnaise", + "Galloway Goat's Milk Gems", "Gammelost", "Gaperon a l'Ail", "Garrotxa", "Gastanberra", + "Geitost", "Gippsland Blue", "Gjetost", "Gloucester", "Golden Cross", "Gorgonzola", + "Gornyaltajski", "Gospel Green", "Gouda", "Goutu", "Gowrie", "Grabetto", "Graddost", + "Grafton Village Cheddar", "Grana", "Grana Padano", "Grand Vatel", + "Grataron d' Areches", "Gratte-Paille", "Graviera", "Greuilh", "Greve", + "Gris de Lille", "Gruyere", "Gubbeen", "Guerbigny", "Halloumi", + "Halloumy (Australian)", "Haloumi-Style Cheese", "Harbourne Blue", "Havarti", + "Heidi Gruyere", "Hereford Hop", "Herrgardsost", "Herriot Farmhouse", "Herve", + "Hipi Iti", "Hubbardston Blue Cow", "Hushallsost", "Iberico", "Idaho Goatster", + "Idiazabal", "Il Boschetto al Tartufo", "Ile d'Yeu", "Isle of Mull", "Jarlsberg", + "Jermi Tortes", "Jibneh Arabieh", "Jindi Brie", "Jubilee Blue", "Juustoleipa", + "Kadchgall", "Kaseri", "Kashta", "Kefalotyri", "Kenafa", "Kernhem", "Kervella Affine", + "Kikorangi", "King Island Cape Wickham Brie", "King River Gold", "Klosterkaese", + "Knockalara", "Kugelkase", "L'Aveyronnais", "L'Ecir de l'Aubrac", "La Taupiniere", + "La Vache Qui Rit", "Laguiole", "Lairobell", "Lajta", "Lanark Blue", "Lancashire", + "Langres", "Lappi", "Laruns", "Lavistown", "Le Brin", "Le Fium Orbo", "Le Lacandou", + "Le Roule", "Leafield", "Lebbene", "Leerdammer", "Leicester", "Leyden", "Limburger", + "Lincolnshire Poacher", "Lingot Saint Bousquet d'Orb", "Liptauer", "Little Rydings", + "Livarot", "Llanboidy", "Llanglofan Farmhouse", "Loch Arthur Farmhouse", + "Loddiswell Avondale", "Longhorn", "Lou Palou", "Lou Pevre", "Lyonnais", "Maasdam", + "Macconais", "Mahoe Aged Gouda", "Mahon", "Malvern", "Mamirolle", "Manchego", + "Manouri", "Manur", "Marble Cheddar", "Marbled Cheeses", "Maredsous", "Margotin", + "Maribo", "Maroilles", "Mascares", "Mascarpone", "Mascarpone (Australian)", + "Mascarpone Torta", "Matocq", "Maytag Blue", "Meira", "Menallack Farmhouse", + "Menonita", "Meredith Blue", "Mesost", "Metton (Cancoillotte)", "Meyer Vintage Gouda", + "Mihalic Peynir", "Milleens", "Mimolette", "Mine-Gabhar", "Mini Baby Bells", "Mixte", + "Molbo", "Monastery Cheeses", "Mondseer", "Mont D'or Lyonnais", "Montasio", + "Monterey Jack", "Monterey Jack Dry", "Morbier", "Morbier Cru de Montagne", + "Mothais a la Feuille", "Mozzarella", "Mozzarella (Australian)", + "Mozzarella di Bufala", "Mozzarella Fresh, in water", "Mozzarella Rolls", "Munster", + "Murol", "Mycella", "Myzithra", "Naboulsi", "Nantais", "Neufchatel", + "Neufchatel (Australian)", "Niolo", "Nokkelost", "Northumberland", "Oaxaca", + "Olde York", "Olivet au Foin", "Olivet Bleu", "Olivet Cendre", + "Orkney Extra Mature Cheddar", "Orla", "Oschtjepka", "Ossau Fermier", "Ossau-Iraty", + "Oszczypek", "Oxford Blue", "P'tit Berrichon", "Palet de Babligny", "Paneer", "Panela", + "Pannerone", "Pant ys Gawn", "Parmesan (Parmigiano)", "Parmigiano Reggiano", + "Pas de l'Escalette", "Passendale", "Pasteurized Processed", "Pate de Fromage", + "Patefine Fort", "Pave d'Affinois", "Pave d'Auge", "Pave de Chirac", "Pave du Berry", + "Pecorino", "Pecorino in Walnut Leaves", "Pecorino Romano", "Peekskill Pyramid", + "Pelardon des Cevennes", "Pelardon des Corbieres", "Penamellera", "Penbryn", + "Pencarreg", "Perail de Brebis", "Petit Morin", "Petit Pardou", "Petit-Suisse", + "Picodon de Chevre", "Picos de Europa", "Piora", "Pithtviers au Foin", + "Plateau de Herve", "Plymouth Cheese", "Podhalanski", "Poivre d'Ane", "Polkolbin", + "Pont l'Eveque", "Port Nicholson", "Port-Salut", "Postel", "Pouligny-Saint-Pierre", + "Pourly", "Prastost", "Pressato", "Prince-Jean", "Processed Cheddar", "Provolone", + "Provolone (Australian)", "Pyengana Cheddar", "Pyramide", "Quark", + "Quark (Australian)", "Quartirolo Lombardo", "Quatre-Vents", "Quercy Petit", + "Queso Blanco", "Queso Blanco con Frutas --Pina y Mango", "Queso de Murcia", + "Queso del Montsec", "Queso del Tietar", "Queso Fresco", "Queso Fresco (Adobera)", + "Queso Iberico", "Queso Jalapeno", "Queso Majorero", "Queso Media Luna", + "Queso Para Frier", "Queso Quesadilla", "Rabacal", "Raclette", "Ragusano", "Raschera", + "Reblochon", "Red Leicester", "Regal de la Dombes", "Reggianito", "Remedou", + "Requeson", "Richelieu", "Ricotta", "Ricotta (Australian)", "Ricotta Salata", "Ridder", + "Rigotte", "Rocamadour", "Rollot", "Romano", "Romans Part Dieu", "Roncal", "Roquefort", + "Roule", "Rouleau De Beaulieu", "Royalp Tilsit", "Rubens", "Rustinu", "Saaland Pfarr", + "Saanenkaese", "Saga", "Sage Derby", "Sainte Maure", "Saint-Marcellin", + "Saint-Nectaire", "Saint-Paulin", "Salers", "Samso", "San Simon", "Sancerre", + "Sap Sago", "Sardo", "Sardo Egyptian", "Sbrinz", "Scamorza", "Schabzieger", "Schloss", + "Selles sur Cher", "Selva", "Serat", "Seriously Strong Cheddar", "Serra da Estrela", + "Sharpam", "Shelburne Cheddar", "Shropshire Blue", "Siraz", "Sirene", "Smoked Gouda", + "Somerset Brie", "Sonoma Jack", "Sottocenare al Tartufo", "Soumaintrain", + "Sourire Lozerien", "Spenwood", "Sraffordshire Organic", "St. Agur Blue Cheese", + "Stilton", "Stinking Bishop", "String", "Sussex Slipcote", "Sveciaost", "Swaledale", + "Sweet Style Swiss", "Swiss", "Syrian (Armenian String)", "Tala", "Taleggio", "Tamie", + "Tasmania Highland Chevre Log", "Taupiniere", "Teifi", "Telemea", "Testouri", + "Tete de Moine", "Tetilla", "Texas Goat Cheese", "Tibet", "Tillamook Cheddar", + "Tilsit", "Timboon Brie", "Toma", "Tomme Brulee", "Tomme d'Abondance", + "Tomme de Chevre", "Tomme de Romans", "Tomme de Savoie", "Tomme des Chouans", "Tommes", + "Torta del Casar", "Toscanello", "Touree de L'Aubier", "Tourmalet", + "Trappe (Veritable)", "Trois Cornes De Vendee", "Tronchon", "Trou du Cru", "Truffe", + "Tupi", "Turunmaa", "Tymsboro", "Tyn Grug", "Tyning", "Ubriaco", "Ulloa", + "Vacherin-Fribourgeois", "Valencay", "Vasterbottenost", "Venaco", "Vendomois", + "Vieux Corse", "Vignotte", "Vulscombe", "Waimata Farmhouse Blue", + "Washed Rind Cheese (Australian)", "Waterloo", "Weichkaese", "Wellington", + "Wensleydale", "White Stilton", "Whitestone Farmhouse", "Wigmore", "Woodside Cabecou", + "Xanadu", "Xynotyro", "Yarg Cornish", "Yarra Valley Pyramid", "Yorkshire Blue", + "Zamorano", "Zanetti Grana Padano", "Zanetti Parmigiano Reggiano" + }; + +} diff --git a/app/src/main/java/com/support/android/designlibdemo/MainActivity.java b/app/src/main/java/com/support/android/designlibdemo/MainActivity.java new file mode 100644 index 0000000..7f0f482 --- /dev/null +++ b/app/src/main/java/com/support/android/designlibdemo/MainActivity.java @@ -0,0 +1,151 @@ +/* + * Copyright (C) 2015 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 com.support.android.designlibdemo; + +import android.os.Bundle; +import android.support.design.widget.FloatingActionButton; +import android.support.design.widget.NavigationView; +import android.support.design.widget.Snackbar; +import android.support.design.widget.TabLayout; +import android.support.v4.app.Fragment; +import android.support.v4.app.FragmentManager; +import android.support.v4.app.FragmentPagerAdapter; +import android.support.v4.view.GravityCompat; +import android.support.v4.view.ViewPager; +import android.support.v4.widget.DrawerLayout; +import android.support.v7.app.ActionBar; +import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.Toolbar; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.widget.AdapterView; +import android.widget.ArrayAdapter; +import android.widget.Toast; + +import java.util.ArrayList; +import java.util.List; + +/** + * TODO + */ +public class MainActivity extends AppCompatActivity { + + private DrawerLayout mDrawerLayout; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + + final ActionBar ab = getSupportActionBar(); + ab.setHomeAsUpIndicator(R.drawable.ic_menu); + ab.setDisplayHomeAsUpEnabled(true); + + mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); + + NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view); + if (navigationView != null) { + setupDrawerContent(navigationView); + } + + ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager); + if (viewPager != null) { + setupViewPager(viewPager); + } + + FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); + fab.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Snackbar.make(view, "Here's a Snackbar", Snackbar.LENGTH_LONG) + .setAction("Action", null).show(); + } + }); + + TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs); + tabLayout.setupWithViewPager(viewPager); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(R.menu.sample_actions, menu); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case android.R.id.home: + mDrawerLayout.openDrawer(GravityCompat.START); + return true; + } + return super.onOptionsItemSelected(item); + } + + private void setupViewPager(ViewPager viewPager) { + Adapter adapter = new Adapter(getSupportFragmentManager()); + adapter.addFragment(new CheeseListFragment(), "Category 1"); + adapter.addFragment(new CheeseListFragment(), "Category 2"); + adapter.addFragment(new CheeseListFragment(), "Category 3"); + viewPager.setAdapter(adapter); + } + + private void setupDrawerContent(NavigationView navigationView) { + navigationView.setNavigationItemSelectedListener( + new NavigationView.OnNavigationItemSelectedListener() { + @Override + public boolean onNavigationItemSelected(MenuItem menuItem) { + menuItem.setChecked(true); + mDrawerLayout.closeDrawers(); + return true; + } + }); + } + + static class Adapter extends FragmentPagerAdapter { + private final List mFragments = new ArrayList<>(); + private final List mFragmentTitles = new ArrayList<>(); + + public Adapter(FragmentManager fm) { + super(fm); + } + + public void addFragment(Fragment fragment, String title) { + mFragments.add(fragment); + mFragmentTitles.add(title); + } + + @Override + public Fragment getItem(int position) { + return mFragments.get(position); + } + + @Override + public int getCount() { + return mFragments.size(); + } + + @Override + public CharSequence getPageTitle(int position) { + return mFragmentTitles.get(position); + } + } +} diff --git a/app/src/main/res/drawable-hdpi/ic_dashboard.png b/app/src/main/res/drawable-hdpi/ic_dashboard.png new file mode 100644 index 0000000..6aef196 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_dashboard.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_discuss.png b/app/src/main/res/drawable-hdpi/ic_discuss.png new file mode 100644 index 0000000..dc9341c Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_discuss.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_done.png b/app/src/main/res/drawable-hdpi/ic_done.png new file mode 100644 index 0000000..c26640d Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_done.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_event.png b/app/src/main/res/drawable-hdpi/ic_event.png new file mode 100644 index 0000000..70f281f Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_event.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_forum.png b/app/src/main/res/drawable-hdpi/ic_forum.png new file mode 100644 index 0000000..24d01be Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_forum.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_headset.png b/app/src/main/res/drawable-hdpi/ic_headset.png new file mode 100644 index 0000000..fbbcc1d Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_headset.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_menu.png b/app/src/main/res/drawable-hdpi/ic_menu.png new file mode 100644 index 0000000..8962cbd Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_menu.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_dashboard.png b/app/src/main/res/drawable-mdpi/ic_dashboard.png new file mode 100644 index 0000000..c4288e5 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_dashboard.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_discuss.png b/app/src/main/res/drawable-mdpi/ic_discuss.png new file mode 100644 index 0000000..6979bbe Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_discuss.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_done.png b/app/src/main/res/drawable-mdpi/ic_done.png new file mode 100644 index 0000000..ba9cf06 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_done.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_event.png b/app/src/main/res/drawable-mdpi/ic_event.png new file mode 100644 index 0000000..dd23be0 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_event.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_forum.png b/app/src/main/res/drawable-mdpi/ic_forum.png new file mode 100644 index 0000000..bdc8995 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_forum.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_headset.png b/app/src/main/res/drawable-mdpi/ic_headset.png new file mode 100644 index 0000000..8330844 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_headset.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_menu.png b/app/src/main/res/drawable-mdpi/ic_menu.png new file mode 100644 index 0000000..c62db8c Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_menu.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_dashboard.png b/app/src/main/res/drawable-xhdpi/ic_dashboard.png new file mode 100644 index 0000000..cc100a6 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_dashboard.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_discuss.png b/app/src/main/res/drawable-xhdpi/ic_discuss.png new file mode 100644 index 0000000..8eedc8a Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_discuss.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_done.png b/app/src/main/res/drawable-xhdpi/ic_done.png new file mode 100644 index 0000000..1f4846c Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_done.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_event.png b/app/src/main/res/drawable-xhdpi/ic_event.png new file mode 100644 index 0000000..348a805 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_event.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_forum.png b/app/src/main/res/drawable-xhdpi/ic_forum.png new file mode 100644 index 0000000..28759b6 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_forum.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_headset.png b/app/src/main/res/drawable-xhdpi/ic_headset.png new file mode 100644 index 0000000..a09aa7a Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_headset.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_menu.png b/app/src/main/res/drawable-xhdpi/ic_menu.png new file mode 100644 index 0000000..36859f0 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_menu.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_dashboard.png b/app/src/main/res/drawable-xxhdpi/ic_dashboard.png new file mode 100644 index 0000000..f6d0a0d Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_dashboard.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_discuss.png b/app/src/main/res/drawable-xxhdpi/ic_discuss.png new file mode 100644 index 0000000..e1d812b Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_discuss.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_done.png b/app/src/main/res/drawable-xxhdpi/ic_done.png new file mode 100644 index 0000000..699d0b2 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_done.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_event.png b/app/src/main/res/drawable-xxhdpi/ic_event.png new file mode 100644 index 0000000..efbe8f7 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_event.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_forum.png b/app/src/main/res/drawable-xxhdpi/ic_forum.png new file mode 100644 index 0000000..8f50781 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_forum.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_headset.png b/app/src/main/res/drawable-xxhdpi/ic_headset.png new file mode 100644 index 0000000..53169d9 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_headset.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_menu.png b/app/src/main/res/drawable-xxhdpi/ic_menu.png new file mode 100644 index 0000000..1a51098 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_menu.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_done.png b/app/src/main/res/drawable-xxxhdpi/ic_done.png new file mode 100644 index 0000000..bf5bc7e Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_done.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_menu.png b/app/src/main/res/drawable-xxxhdpi/ic_menu.png new file mode 100644 index 0000000..c15d634 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_menu.png differ diff --git a/app/src/main/res/drawable/cheese_1.jpg b/app/src/main/res/drawable/cheese_1.jpg new file mode 100644 index 0000000..65be51c Binary files /dev/null and b/app/src/main/res/drawable/cheese_1.jpg differ diff --git a/app/src/main/res/drawable/cheese_2.jpg b/app/src/main/res/drawable/cheese_2.jpg new file mode 100644 index 0000000..ae83e1a Binary files /dev/null and b/app/src/main/res/drawable/cheese_2.jpg differ diff --git a/app/src/main/res/drawable/cheese_3.jpg b/app/src/main/res/drawable/cheese_3.jpg new file mode 100644 index 0000000..362ef38 Binary files /dev/null and b/app/src/main/res/drawable/cheese_3.jpg differ diff --git a/app/src/main/res/drawable/cheese_4.jpg b/app/src/main/res/drawable/cheese_4.jpg new file mode 100644 index 0000000..052ef4c Binary files /dev/null and b/app/src/main/res/drawable/cheese_4.jpg differ diff --git a/app/src/main/res/drawable/cheese_5.jpg b/app/src/main/res/drawable/cheese_5.jpg new file mode 100644 index 0000000..137a7f3 Binary files /dev/null and b/app/src/main/res/drawable/cheese_5.jpg differ diff --git a/app/src/main/res/layout/activity_detail.xml b/app/src/main/res/layout/activity_detail.xml new file mode 100644 index 0000000..7b151ca --- /dev/null +++ b/app/src/main/res/layout/activity_detail.xml @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..c6328ac --- /dev/null +++ b/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,36 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_cheese_list.xml b/app/src/main/res/layout/fragment_cheese_list.xml new file mode 100644 index 0000000..20b4c2e --- /dev/null +++ b/app/src/main/res/layout/fragment_cheese_list.xml @@ -0,0 +1,20 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/layout/include_list_viewpager.xml b/app/src/main/res/layout/include_list_viewpager.xml new file mode 100644 index 0000000..aa03bfd --- /dev/null +++ b/app/src/main/res/layout/include_list_viewpager.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/list_item.xml b/app/src/main/res/layout/list_item.xml new file mode 100644 index 0000000..a6c6dff --- /dev/null +++ b/app/src/main/res/layout/list_item.xml @@ -0,0 +1,39 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/nav_header.xml b/app/src/main/res/layout/nav_header.xml new file mode 100644 index 0000000..e3bdb26 --- /dev/null +++ b/app/src/main/res/layout/nav_header.xml @@ -0,0 +1,33 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/menu/drawer_view.xml b/app/src/main/res/menu/drawer_view.xml new file mode 100644 index 0000000..d89d6e1 --- /dev/null +++ b/app/src/main/res/menu/drawer_view.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/menu/sample_actions.xml b/app/src/main/res/menu/sample_actions.xml new file mode 100644 index 0000000..6082477 --- /dev/null +++ b/app/src/main/res/menu/sample_actions.xml @@ -0,0 +1,23 @@ + + + + + diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..970cafc Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..e4e8121 Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..095a72b Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..c4d8f6b Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..1c7bf6e Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/values-v21/styles.xml b/app/src/main/res/values-v21/styles.xml new file mode 100644 index 0000000..8dedacf --- /dev/null +++ b/app/src/main/res/values-v21/styles.xml @@ -0,0 +1,25 @@ + + + + + + + + diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..f3d3e76 --- /dev/null +++ b/app/src/main/res/values/colors.xml @@ -0,0 +1,20 @@ + + + + + #FFF5F5F5 + \ No newline at end of file diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml new file mode 100644 index 0000000..bac1b25 --- /dev/null +++ b/app/src/main/res/values/dimens.xml @@ -0,0 +1,23 @@ + + + + + 256dp + 16dp + 16dp + 40dp + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..e2496da --- /dev/null +++ b/app/src/main/res/values/strings.xml @@ -0,0 +1,29 @@ + + + + + Cheesesquare + + Jarlsberg lancashire edam. Dolcelatte hard cheese brie st. agur blue + cheese caerphilly bavarian bergkase cheese and biscuits mascarpone. Cheeseburger swiss bavarian + bergkase cream cheese fromage frais cheesy feet port-salut airedale. St. agur blue cheese rubber + cheese caerphilly cheddar cheesecake cream cheese manchego lancashire. Roquefort squirty cheese + the big cheese. + Checkin + Settings + + diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..f360f46 --- /dev/null +++ b/app/src/main/res/values/styles.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..c0b83ec --- /dev/null +++ b/build.gradle @@ -0,0 +1,16 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.2.3' + } +} + +allprojects { + repositories { + jcenter() + } +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..1d3591c --- /dev/null +++ b/gradle.properties @@ -0,0 +1,18 @@ +# Project-wide Gradle settings. + +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx10248m -XX:MaxPermSize=256m +# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 + +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..0c71e76 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Wed Apr 10 15:27:10 PDT 2013 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip diff --git a/gradlew b/gradlew new file mode 100755 index 0000000..91a7e26 --- /dev/null +++ b/gradlew @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched. +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..8a0b282 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..e7b4def --- /dev/null +++ b/settings.gradle @@ -0,0 +1 @@ +include ':app'