diff --git a/Les Horaires/.gitignore b/Les Horaires/.gitignore
new file mode 100644
index 0000000..ee765f9
--- /dev/null
+++ b/Les Horaires/.gitignore
@@ -0,0 +1,39 @@
+/build
+
+.gradle
+/local.properties
+/.idea/workspace.xml
+/.idea/libraries
+.DS_Store
+/build
+
+# built application files
+*.apk
+*.ap_
+
+# files for the dex VM
+*.dex
+
+# Java class files
+*.class
+
+# generated files
+bin/
+gen/
+
+# Local configuration file (sdk path, etc)
+local.properties
+
+# Eclipse stuff
+.classpath
+.project
+.settings
+
+# Gradle stuff
+.gradle/
+build/
+.idea/
+out/
+*.iml
+
+Thumbs.db
diff --git a/Les Horaires/build.gradle b/Les Horaires/build.gradle
new file mode 100644
index 0000000..45d606d
--- /dev/null
+++ b/Les Horaires/build.gradle
@@ -0,0 +1,61 @@
+buildscript {
+ repositories {
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:1.1.1'
+ }
+}
+apply plugin: 'com.android.application'
+
+repositories {
+ jcenter()
+}
+
+android {
+ compileSdkVersion 22
+ buildToolsVersion "22.0.1"
+
+ defaultConfig {
+ applicationId "com.amine.horaires"
+ minSdkVersion 14
+ targetSdkVersion 22
+ versionCode 39
+ versionName "2.1.2"
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_6
+ targetCompatibility JavaVersion.VERSION_1_6
+ }
+
+ lintOptions {
+ checkReleaseBuilds true
+ abortOnError false
+ }
+
+ signingConfigs {
+ release {
+ }
+ }
+
+ buildTypes {
+ release {
+ signingConfig signingConfigs.release
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ compile fileTree(dir: 'libs', include: ['*.jar'])
+ compile 'com.android.support:appcompat-v7:+'
+ compile 'com.android.support:support-v4:+'
+ compile 'com.android.support:recyclerview-v7:+'
+ compile 'com.google.android.gms:play-services:4.3.23'
+ compile 'com.melnykov:floatingactionbutton:1.2.0'
+ compile 'com.pnikosis:materialish-progress:1.5'
+ compile 'com.wdullaer:materialdatetimepicker:1.3.0'
+ compile 'de.cketti.library.changelog:ckchangelog:1.2.2'
+}
diff --git a/Les Horaires/proguard-rules.pro b/Les Horaires/proguard-rules.pro
new file mode 100644
index 0000000..bef92eb
--- /dev/null
+++ b/Les Horaires/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 C:/Users/Amine/Desktop/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/Les Horaires/src/androidTest/java/com/amine/horaires/ApplicationTest.java b/Les Horaires/src/androidTest/java/com/amine/horaires/ApplicationTest.java
new file mode 100644
index 0000000..6ada1aa
--- /dev/null
+++ b/Les Horaires/src/androidTest/java/com/amine/horaires/ApplicationTest.java
@@ -0,0 +1,13 @@
+package com.amine.horaires;
+
+import android.app.Application;
+import android.test.ApplicationTestCase;
+
+/**
+ * Testing Fundamentals
+ */
+public class ApplicationTest extends ApplicationTestCase {
+ public ApplicationTest() {
+ super(Application.class);
+ }
+}
\ No newline at end of file
diff --git a/Les Horaires/src/main/AndroidManifest.xml b/Les Horaires/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..e568bb1
--- /dev/null
+++ b/Les Horaires/src/main/AndroidManifest.xml
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Les Horaires/src/main/java/com/amine/horaires/App.java b/Les Horaires/src/main/java/com/amine/horaires/App.java
new file mode 100644
index 0000000..2bb59e8
--- /dev/null
+++ b/Les Horaires/src/main/java/com/amine/horaires/App.java
@@ -0,0 +1,15 @@
+package com.amine.horaires;
+
+import android.app.Application;
+
+public class App extends Application {
+
+ public App() {
+ super();
+ }
+
+ @Override
+ public void onCreate() {
+ super.onCreate();
+ }
+}
diff --git a/Les Horaires/src/main/java/com/amine/horaires/MainActivity.java b/Les Horaires/src/main/java/com/amine/horaires/MainActivity.java
new file mode 100644
index 0000000..16ea1c3
--- /dev/null
+++ b/Les Horaires/src/main/java/com/amine/horaires/MainActivity.java
@@ -0,0 +1,132 @@
+package com.amine.horaires;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.os.Bundle;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.telephony.TelephonyManager;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.View;
+import android.widget.TextView;
+import com.amine.horaires.bdd.FavorisDao;
+import com.amine.horaires.models.Shop;
+import com.amine.horaires.util.Configuration;
+import com.amine.horaires.util.Parseur;
+import com.melnykov.fab.FloatingActionButton;
+import de.cketti.library.changelog.ChangeLog;
+
+import java.util.ArrayList;
+
+public class MainActivity extends OptionsActivity {
+
+ private static RecyclerView mRecyclerView;
+ private static RecyclerView.Adapter mAdapter;
+ private static ArrayList myDataset;
+ private static TextView emptyView;
+
+ static void razOrFavs(Context c) {
+ FavorisDao dao = FavorisDao.getInstance(c);
+ dao.open();
+ myDataset = dao.getAllFavoris();
+ dao.close();
+
+ if (myDataset.isEmpty()) {
+ mRecyclerView.setVisibility(View.GONE);
+ emptyView.setVisibility(View.VISIBLE);
+ } else {
+ mAdapter = new SearchAdapter(myDataset, c);
+ mRecyclerView.setAdapter(mAdapter);
+ mRecyclerView.setVisibility(View.VISIBLE);
+ emptyView.setVisibility(View.GONE);
+ }
+ }
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+
+ checkLocale();
+ ChangeLog cl = new ChangeLog(this);
+ if (cl.isFirstRun()) {
+ cl.getLogDialog().show();
+ }
+
+ mRecyclerView = (RecyclerView) findViewById(R.id.favs_list);
+ emptyView = (TextView) findViewById(R.id.empty_list);
+
+ FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
+ fab.attachToRecyclerView(mRecyclerView);
+
+ fab.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ final Intent i = new Intent(getBaseContext(), ShopSearch.class);
+ startActivityForResult(i, 0);
+ }
+ });
+
+ // use this setting to improve performance if you know that changes
+ // in content do not change the layout size of the RecyclerView
+ mRecyclerView.setHasFixedSize(true);
+
+ // use a linear layout manager
+ RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(this);
+ mRecyclerView.setLayoutManager(mLayoutManager);
+
+ // specify an adapter (see also next example)
+ myDataset = new ArrayList();
+
+ razOrFavs(getBaseContext());
+ }
+
+ private void checkLocale() {
+ TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
+ Configuration.pays = tm.getSimCountryIso().toUpperCase();
+ if (Configuration.pays == null || Configuration.pays.equals("") || Configuration.pays.isEmpty())
+ Configuration.pays = MainActivity.this.getResources().getConfiguration().locale.getCountry();
+
+ SharedPreferences settings = getSharedPreferences("UserInfo", 0);
+ if (settings.getString("Pays", "") == null || !settings.getString("Pays", "").equals(Configuration.pays)) {
+ settings = getSharedPreferences("UserInfo", 0);
+ SharedPreferences.Editor editor = settings.edit();
+ editor.putString("Pays", Configuration.pays);
+ editor.apply();
+ }
+ }
+
+ @Override
+ public void onActivityResult(int requestCode, int resultCode, Intent data) {
+ super.onActivityResult(requestCode, resultCode, data);
+ switch (requestCode) {
+ case (0): {
+ if (resultCode == Activity.RESULT_OK) {
+ myDataset = new ArrayList();
+ String result = data.getStringExtra("result");
+ myDataset = new Parseur().parserShops(result);
+ if (myDataset.isEmpty()) {
+ mRecyclerView.setVisibility(View.GONE);
+ emptyView.setVisibility(View.VISIBLE);
+ } else {
+ mAdapter = new SearchAdapter(myDataset, getBaseContext());
+ mRecyclerView.setAdapter(mAdapter);
+ mRecyclerView.setVisibility(View.VISIBLE);
+ emptyView.setVisibility(View.GONE);
+ }
+ }
+ break;
+ }
+ }
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ MenuInflater inflater = getMenuInflater();
+ inflater.inflate(R.menu.main_activity_actions_main, menu);
+ return super.onCreateOptionsMenu(menu);
+ }
+}
diff --git a/Les Horaires/src/main/java/com/amine/horaires/OptionsActivity.java b/Les Horaires/src/main/java/com/amine/horaires/OptionsActivity.java
new file mode 100644
index 0000000..456242a
--- /dev/null
+++ b/Les Horaires/src/main/java/com/amine/horaires/OptionsActivity.java
@@ -0,0 +1,89 @@
+package com.amine.horaires;
+
+import android.app.Dialog;
+import android.content.Intent;
+import android.net.Uri;
+import android.support.v7.app.AppCompatActivity;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
+import android.view.Window;
+import com.amine.horaires.bdd.FavorisDao;
+import com.amine.horaires.models.Shop;
+import com.amine.horaires.util.Configuration;
+
+class OptionsActivity extends AppCompatActivity {
+ MenuItem favMenu = null;
+ boolean isFav = false;
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ MenuInflater inflater = getMenuInflater();
+ inflater.inflate(R.menu.main_activity_actions, menu);
+ return super.onCreateOptionsMenu(menu);
+ }
+
+ public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()) {
+ case R.id.action_mail:
+ Intent intent = new Intent(Intent.ACTION_SENDTO); // it's not ACTION_SEND
+ intent.setType("text/plain");
+ intent.putExtra(Intent.EXTRA_SUBJECT, "Les Horaires");
+ intent.setData(Uri.parse("mailto:amine.bou.dev@gmail.com")); // or just "mailto:" for blank
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // this will make such that when user returns to your app, your app is displayed, instead of the email app.
+ startActivity(intent);
+ return true;
+ case R.id.action_about:
+ final Dialog dialog = new Dialog(this);
+ dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
+ dialog.setCancelable(true);
+
+ // Content of the dialog
+ dialog.setContentView(R.layout.activity_more);
+ dialog.show();
+ return true;
+ case R.id.action_reload:
+ MainActivity.razOrFavs(OptionsActivity.this);
+ return true;
+ case R.id.action_fav:
+ FavorisDao dao = FavorisDao.getInstance(OptionsActivity.this);
+ if (isFav) {
+ // REMOVE
+ dao.open();
+ dao.deleteFavori(Configuration.currentShop.getId());
+ dao.close();
+ updateFavStatus(false);
+ } else {
+ dao.open();
+ dao.insertFavori(Configuration.currentShop);
+ dao.close();
+ updateFavStatus(true);
+ }
+ return true;
+ case android.R.id.home:
+ this.finish();
+ return (true);
+ default:
+ return false;
+ }
+ }
+
+ private void updateFavStatus(boolean state) {
+ if (state) {
+ favMenu.setIcon(R.mipmap.ic_turned_in_black_24dp);
+ } else {
+ favMenu.setIcon(R.mipmap.ic_turned_in_not_black_24dp);
+ }
+ }
+
+ void updateFavStatus() {
+ FavorisDao dao = FavorisDao.getInstance(OptionsActivity.this);
+ dao.open();
+ Shop sh = dao.getFavori(Configuration.currentShop.getId());
+ dao.close();
+ if (sh == null) {
+ updateFavStatus(false);
+ } else {
+ updateFavStatus(true);
+ }
+ }
+}
diff --git a/Les Horaires/src/main/java/com/amine/horaires/SearchAdapter.java b/Les Horaires/src/main/java/com/amine/horaires/SearchAdapter.java
new file mode 100644
index 0000000..318468c
--- /dev/null
+++ b/Les Horaires/src/main/java/com/amine/horaires/SearchAdapter.java
@@ -0,0 +1,88 @@
+package com.amine.horaires;
+
+import android.content.Context;
+import android.content.Intent;
+import android.os.Handler;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+import com.amine.horaires.models.Shop;
+
+import java.util.ArrayList;
+
+public class SearchAdapter extends RecyclerView.Adapter {
+ private final ArrayList mDataset;
+ private final Context c;
+
+ // Provide a suitable constructor (depends on the kind of dataset)
+ public SearchAdapter(ArrayList myDataset, Context c) {
+ mDataset = myDataset;
+ this.c = c;
+ }
+
+ // Create new views (invoked by the layout manager)
+ @Override
+ public SearchAdapter.ViewHolder onCreateViewHolder(ViewGroup parent,
+ int viewType) {
+ // create a new view
+ View v = LayoutInflater.from(parent.getContext())
+ .inflate(R.layout.fav_list_item, parent, false);
+ // set the view's size, margins, paddings and layout parameters
+
+ return new ViewHolder((RelativeLayout) v, c, mDataset);
+ }
+
+ // Replace the contents of a view (invoked by the layout manager)
+ @Override
+ public void onBindViewHolder(ViewHolder holder, final int position) {
+ // - get element from your dataset at this position
+ // - replace the contents of the view with that element
+ holder.shopAddr.setText(mDataset.get(position).getAdresse());
+ holder.shopName.setText(mDataset.get(position).getName());
+ }
+
+ // Return the size of your dataset (invoked by the layout manager)
+ @Override
+ public int getItemCount() {
+ return mDataset.size();
+ }
+
+ // Provide a reference to the views for each data item
+ // Complex data items may need more than one view per item, and
+ // you provide access to all the views for a data item in a view holder
+ public static class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
+ // each data item is just a string in this case
+ public final TextView shopName;
+ public final TextView shopAddr;
+ private final Context c;
+ private final ArrayList mDataset;
+
+ public ViewHolder(RelativeLayout v, Context c, ArrayList mDataset) {
+ super(v);
+ v.setOnClickListener(this);
+ shopName = (TextView) v.findViewById(R.id.shop_name);
+ shopAddr = (TextView) v.findViewById(R.id.shop_adress);
+ this.c = c;
+ this.mDataset = mDataset;
+ }
+
+ @Override
+ public void onClick(View view) {
+ final Intent i = new Intent(view.getContext(), ShopDisplay.class);
+ final Handler handler = new Handler();
+ Runnable t = new Runnable() {
+ public void run() {
+ i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ i.putExtra("shop", mDataset.get(getLayoutPosition()));
+ c.startActivity(i);
+ }
+ };
+
+ handler.post(t);
+ }
+
+ }
+}
diff --git a/Les Horaires/src/main/java/com/amine/horaires/ShopDisplay.java b/Les Horaires/src/main/java/com/amine/horaires/ShopDisplay.java
new file mode 100644
index 0000000..ae14cab
--- /dev/null
+++ b/Les Horaires/src/main/java/com/amine/horaires/ShopDisplay.java
@@ -0,0 +1,249 @@
+package com.amine.horaires;
+
+import android.content.Context;
+import android.content.Intent;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.net.ConnectivityManager;
+import android.net.NetworkInfo;
+import android.net.Uri;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.TextView;
+import com.amine.horaires.bdd.FavorisDao;
+import com.amine.horaires.models.Shop;
+import com.amine.horaires.util.Configuration;
+import com.amine.horaires.util.Parseur;
+import com.amine.horaires.util.Utils;
+import com.melnykov.fab.FloatingActionButton;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.ProtocolException;
+import java.net.URL;
+import java.util.List;
+import java.util.Scanner;
+
+public class ShopDisplay extends OptionsActivity {
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.shop_display);
+ Shop s = getIntent().getExtras().getParcelable("shop");
+
+ Configuration.currentShop = s;
+
+ FavorisDao dao = FavorisDao.getInstance(ShopDisplay.this);
+ dao.open();
+ List fs = dao.getAllFavoris();
+ dao.close();
+
+ while (!isFav && !fs.isEmpty()) {
+ isFav = fs.remove(0).getId() == Configuration.currentShop.getId();
+ }
+ if (isFav) {
+ SearchTask st = new SearchTask();
+ st.execute(Utils.generateUrlForId(s.getId()));
+ s = Configuration.currentShop;
+ dao.open();
+ dao.updateFavori(s);
+ dao.close();
+ }
+ generateView(s);
+ FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
+
+ final Shop finalS = s;
+ fab.setOnClickListener(new View.OnClickListener() {
+
+ @Override
+ public void onClick(View v) {
+ final Intent i = new Intent(getBaseContext(), ShopUpdate.class);
+ i.putExtra("shop", finalS);
+ startActivity(i);
+ }
+ });
+ }
+
+ private void generateView(final Shop s) {
+ Configuration.currentShop = s;
+
+ ImageView imageResult = (ImageView) findViewById(R.id.imageView);
+
+ ImageTask t = new ImageTask(imageResult);
+ t.execute(s.getHoraires());
+
+ TextView shopName = (TextView) findViewById(R.id.shopName);
+ TextView shopAddress = (TextView) findViewById(R.id.shopAdress);
+ TextView shopOpen = (TextView) findViewById(R.id.shopOpen);
+ TextView shopStatus = (TextView) findViewById(R.id.shopStatus);
+ ImageView wifi = (ImageView) findViewById(R.id.wifi);
+ ImageView parking = (ImageView) findViewById(R.id.parking);
+ ImageView access = (ImageView) findViewById(R.id.handi);
+
+ shopName.setText(s.getName());
+ shopAddress.setText(s.getAdresse());
+ shopOpen.setText("Le magasin est " + (s.isOuvert() ? "ouvert" : "fermé"));
+ if (s.isOuvert()) {
+ shopStatus.setText(s.getOpenStatus());
+ }
+
+ if (!s.isWifi()) {
+ wifi.setAlpha((float) 0.1);
+ }
+
+ if (!s.isAccesHandicape()) {
+ access.setAlpha((float) 0.1);
+ }
+
+ if (!s.isParking()) {
+ parking.setAlpha((float) 0.1);
+ }
+
+ findViewById(R.id.imageView).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(s.getUrl()));
+ startActivity(browserIntent);
+ }
+ });
+
+ findViewById(R.id.callButton).setOnClickListener(new View.OnClickListener() {
+ public void onClick(View v) {
+ String numeroAppeler = "tel:" + s.getTel();
+ startActivity(new Intent(Intent.ACTION_DIAL, Uri
+ .parse(numeroAppeler)));
+ }
+ });
+
+ findViewById(R.id.gpsButton).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Intent intent = new
+ Intent(Intent.ACTION_VIEW,
+ Uri.parse("http://maps.google.com/maps?q="
+ + s.getAdresse() + "@" + s.getLat() + "," + s.getLng() + "")
+ );
+ startActivity(intent);
+
+ }
+ });
+ }
+
+ // @todo: use this to update the shop if connected.
+ private boolean checkDeviceConnected() {
+ ConnectivityManager connMgr = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
+ // Need permission : android.permission.ACCESS_NETWORK_STATE
+ NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();
+
+ return (networkInfo != null && networkInfo.isConnected());
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ MenuInflater inflater = getMenuInflater();
+ inflater.inflate(R.menu.main_activity_actions_shop, menu);
+ favMenu = menu.findItem(R.id.action_fav);
+ updateFavStatus();
+ return super.onCreateOptionsMenu(menu);
+ }
+
+ public class ImageTask extends AsyncTask {
+ private final ImageView contenu;
+
+ public ImageTask(ImageView contenu) {
+ this.contenu = contenu;
+ }
+
+ @Override
+ protected Bitmap doInBackground(String... params) {
+ URL url;
+ Bitmap b = null;
+ try {
+ url = new URL(params[0]);
+ HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+ conn.setRequestMethod("GET");
+ conn.setDoInput(true);
+ conn.connect();
+
+ InputStream is = conn.getInputStream();
+ b = BitmapFactory.decodeStream(is);
+
+
+ is.close();
+ conn.disconnect();
+
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ } catch (ProtocolException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return b;
+ }
+
+ protected void onPostExecute(Bitmap b) {
+ this.contenu.setImageBitmap(b);
+ }
+ }
+
+ private class SearchTask extends AsyncTask {
+
+ @Override
+ protected String doInBackground(URL... params) {
+ HttpURLConnection conn = null;
+ InputStream is = null;
+ String contentAsString = "";
+
+ try {
+ URL url = params[0];
+ conn = (HttpURLConnection) url.openConnection();
+ conn.setReadTimeout(10000 /* milliseconds */);
+ conn.setConnectTimeout(15000 /* milliseconds */);
+ conn.setRequestMethod("GET");
+ conn.setDoInput(true);
+
+ // Starts the query
+ conn.connect();
+ is = conn.getInputStream();
+
+ // Convert the InputStream into a String
+
+ Scanner reader = new Scanner(is, "ISO-8859-1");
+ while (reader.hasNextLine()) {
+ contentAsString = contentAsString + reader.nextLine();
+ }
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ } catch (ProtocolException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ } finally {
+ // Makes sure that the InputStream is closed after the app is finished using it.
+ if (is != null)
+ try {
+ is.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ if (conn != null)
+ conn.disconnect();
+ }
+ return contentAsString;
+ }
+
+ @Override
+ protected void onPostExecute(String string) {
+ super.onPostExecute(string);
+ Configuration.currentShop = new Parseur().parserShops(string).get(0);
+ }
+ }
+}
diff --git a/Les Horaires/src/main/java/com/amine/horaires/ShopSearch.java b/Les Horaires/src/main/java/com/amine/horaires/ShopSearch.java
new file mode 100644
index 0000000..ae4f1d8
--- /dev/null
+++ b/Les Horaires/src/main/java/com/amine/horaires/ShopSearch.java
@@ -0,0 +1,134 @@
+package com.amine.horaires;
+
+import android.content.Intent;
+import android.location.Location;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.RelativeLayout;
+import android.widget.Toast;
+import com.amine.horaires.util.MyLocation;
+import com.amine.horaires.util.Utils;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.ProtocolException;
+import java.net.URL;
+import java.util.Scanner;
+
+public class ShopSearch extends OptionsActivity {
+ private MyLocation myLocation;
+ private RelativeLayout loading;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.shop_search);
+
+ final EditText name = (EditText) findViewById(R.id.name);
+ final EditText location = (EditText) findViewById(R.id.location);
+ loading = (RelativeLayout) findViewById(R.id.loading);
+ Button searchButton = (Button) findViewById(R.id.searchAction);
+
+ // @todo form validation (empty ...)
+ searchButton.setOnClickListener(new View.OnClickListener() {
+
+ @Override
+ public void onClick(View v) {
+ loading.setVisibility(View.VISIBLE);
+ SearchTask s = new SearchTask();
+ s.execute(Utils.generateUrlForTextLocation(name.getText().toString(), location.getText().toString()));
+ }
+ });
+
+ findViewById(R.id.gpsAction).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+
+
+ loading.setVisibility(View.VISIBLE);
+
+ MyLocation.LocationResult locationResult = new MyLocation.LocationResult() {
+ @Override
+ public void gotLocation(Location location) {
+ if (location == null) {
+ Toast.makeText(getApplicationContext(), "Petit soucis lors de la localisation", Toast.LENGTH_SHORT).show();
+ } else {
+ URL url = Utils.generateUrlForLatLng(name.getText().toString(), location.getLatitude() + "", location.getLongitude() + "");
+ SearchTask s = new SearchTask();
+ s.execute(url);
+ }
+ }
+ };
+ myLocation = new MyLocation();
+ boolean gotLocation = myLocation.getLocation(getApplicationContext(),
+ locationResult);
+ if (!gotLocation) {
+ Toast.makeText(getApplicationContext(), "Erreur de localisation.", Toast.LENGTH_SHORT).show();
+ }
+ }
+ });
+ }
+
+ private class SearchTask extends AsyncTask {
+
+ @Override
+ protected String doInBackground(URL... params) {
+ HttpURLConnection conn = null;
+ InputStream is = null;
+ String contentAsString = "";
+
+ try {
+ URL url = params[0];
+ conn = (HttpURLConnection) url.openConnection();
+ conn.setReadTimeout(10000 /* milliseconds */);
+ conn.setConnectTimeout(15000 /* milliseconds */);
+ conn.setRequestMethod("GET");
+ conn.setDoInput(true);
+
+ // Starts the query
+ conn.connect();
+ is = conn.getInputStream();
+
+ // Convert the InputStream into a String
+
+ Scanner reader = new Scanner(is, "ISO-8859-1");
+ while (reader.hasNextLine()) {
+ contentAsString = contentAsString + reader.nextLine();
+ }
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ } catch (ProtocolException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ } finally {
+ // Makes sure that the InputStream is closed after the app is finished using it.
+ if (is != null)
+ try {
+ is.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ if (conn != null)
+ conn.disconnect();
+ }
+ return contentAsString;
+ }
+
+ @Override
+ protected void onPostExecute(String string) {
+ super.onPostExecute(string);
+
+ loading.setVisibility(View.GONE);
+ Intent resultIntent = new Intent();
+ resultIntent.putExtra("result", string);
+ setResult(MainActivity.RESULT_OK, resultIntent);
+ finish();
+ }
+ }
+}
diff --git a/Les Horaires/src/main/java/com/amine/horaires/ShopUpdate.java b/Les Horaires/src/main/java/com/amine/horaires/ShopUpdate.java
new file mode 100644
index 0000000..a735c4f
--- /dev/null
+++ b/Les Horaires/src/main/java/com/amine/horaires/ShopUpdate.java
@@ -0,0 +1,144 @@
+package com.amine.horaires;
+
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Button;
+import android.widget.ListView;
+import android.widget.RelativeLayout;
+import android.widget.Toast;
+import com.amine.horaires.models.Horaires;
+import com.amine.horaires.models.Shop;
+import com.amine.horaires.util.Utils;
+import com.melnykov.fab.FloatingActionButton;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.ProtocolException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Scanner;
+
+public class ShopUpdate extends OptionsActivity {
+ private ArrayList h;
+ private RelativeLayout loading;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.update_shop);
+
+ loading = (RelativeLayout) findViewById(R.id.loading);
+
+ final Shop s = getIntent().getExtras().getParcelable("shop");
+
+ ListView hList = (ListView) findViewById(R.id.horaires_list);
+ FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
+ Button save = (Button) findViewById(R.id.button);
+
+ h = new ArrayList();
+
+ initializeHoraires();
+
+ final UpdateAdapter adapter = new UpdateAdapter(this, h, getFragmentManager());
+
+ hList.setAdapter(adapter);
+
+ fab.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Horaires h = adapter.getItem(adapter.getCount() - 1);
+ adapter.add(new Horaires(h));
+ }
+ });
+
+ save.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ loading.setVisibility(View.VISIBLE);
+
+ ArrayList> periodes = new ArrayList>();
+ Collections.sort(h);
+
+ String periodsString = "";
+ int i = 0;
+ for (Horaires hor : h) {
+ periodsString += "&periods[0][" + i + "][day]=" + hor.getDay();
+ periodsString += "&periods[0][" + i + "][from_h]=" + hor.getFrom_h();
+ periodsString += "&periods[0][" + i + "][to_h]=" + hor.getTo_h();
+ periodsString += "&periods[0][" + i + "][to_m]=" + hor.getTo_m();
+ i++;
+ }
+
+ // Toast.makeText(getApplicationContext(), "Cette fonctionnalité est en attente de validation par Les-horaires.fr", Toast.LENGTH_SHORT).show();
+ UpdateTask u = new UpdateTask();
+ u.execute(Utils.generateUrlForEdit(s.getId(), periodsString));
+
+ }
+ });
+ }
+
+ private void initializeHoraires() {
+ h.add(new Horaires(1));
+ }
+
+ private class UpdateTask extends AsyncTask {
+
+ @Override
+ protected String doInBackground(URL... params) {
+ HttpURLConnection conn = null;
+ InputStream is = null;
+ String contentAsString = "";
+
+ try {
+ URL url = params[0];
+ conn = (HttpURLConnection) url.openConnection();
+ conn.setReadTimeout(10000 /* milliseconds */);
+ conn.setConnectTimeout(15000 /* milliseconds */);
+ conn.setRequestMethod("POST");
+ conn.setDoInput(true);
+ conn.setDoOutput(true);
+ conn.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
+
+ // Starts the query
+ conn.connect();
+ is = conn.getInputStream();
+
+ // Convert the InputStream into a String
+
+ Scanner reader = new Scanner(is, "ISO-8859-1");
+ while (reader.hasNextLine()) {
+ contentAsString = contentAsString + reader.nextLine();
+ }
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ } catch (ProtocolException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ } finally {
+ // Makes sure that the InputStream is closed after the app is finished using it.
+ if (is != null)
+ try {
+ is.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ if (conn != null)
+ conn.disconnect();
+ }
+ return contentAsString;
+ }
+
+ @Override
+ protected void onPostExecute(String string) {
+ loading.setVisibility(View.GONE);
+ super.onPostExecute(string);
+ Toast.makeText(getApplicationContext(), "Mise à jour effectuée!", Toast.LENGTH_SHORT).show();
+ }
+ }
+}
diff --git a/Les Horaires/src/main/java/com/amine/horaires/UpdateAdapter.java b/Les Horaires/src/main/java/com/amine/horaires/UpdateAdapter.java
new file mode 100644
index 0000000..e0c9681
--- /dev/null
+++ b/Les Horaires/src/main/java/com/amine/horaires/UpdateAdapter.java
@@ -0,0 +1,98 @@
+package com.amine.horaires;
+
+import android.app.FragmentManager;
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.*;
+import com.amine.horaires.models.Horaires;
+import com.wdullaer.materialdatetimepicker.time.RadialPickerLayout;
+import com.wdullaer.materialdatetimepicker.time.TimePickerDialog;
+
+import java.util.ArrayList;
+
+class UpdateAdapter extends ArrayAdapter {
+
+
+ private final ArrayList horaires;
+ private final Context context;
+ private final FragmentManager fm;
+
+ public UpdateAdapter(Context context, ArrayList objects, FragmentManager fm) {
+ super(context, R.layout.update_horaire_item, objects);
+ this.context = context;
+ this.horaires = objects;
+ this.fm = fm;
+ }
+
+ @Override
+ public View getView(final int position, View convertView, ViewGroup parent) {
+ LayoutInflater inflater = (LayoutInflater) context
+ .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ View rowView = inflater.inflate(R.layout.update_horaire_item, parent, false);
+ final Horaires h = horaires.get(position);
+ final TextView timeFrom = (TextView) rowView.findViewById(R.id.from);
+ timeFrom.setText(String.format("%02d", h.getFrom_h()) + ":" + String.format("%02d", h.getFrom_m()));
+ final TextView timeTo = (TextView) rowView.findViewById(R.id.to);
+ timeTo.setText(String.format("%02d", h.getTo_h()) + ":" + String.format("%02d", h.getTo_m()));
+ String[] days = {"Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi", "Dimanche"};
+ ArrayAdapter adapter = new ArrayAdapter(this.context, R.layout.spinner_item, days);
+ final Spinner s = (Spinner) rowView.findViewById(R.id.spinner);
+ s.setAdapter(adapter);
+ s.setSelection(h.getDay() - 1);
+
+ s.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+ @Override
+ public void onItemSelected(AdapterView> parent, View view, int position, long id) {
+ h.setDay(position + 1);
+ s.setSelection(position);
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView> parent) {
+ }
+ });
+
+
+ timeFrom.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ TimePickerDialog f = TimePickerDialog.newInstance(new TimePickerDialog.OnTimeSetListener() {
+ @Override
+ public void onTimeSet(RadialPickerLayout radialPickerLayout, int hours, int minutes) {
+ if (minutes % 5 == 0) {
+ timeFrom.setText(String.format("%02d", hours) + ":" + String.format("%02d", minutes));
+ h.setFrom_h(hours);
+ h.setFrom_m(minutes);
+ } else {
+ Toast.makeText(context, "Merci d'utiliser des tranches de 5 minutes maximum", Toast.LENGTH_SHORT).show();
+ }
+ }
+ }, h.getFrom_h(), h.getFrom_m(), true);
+ f.show(fm, "from");
+ }
+ });
+
+ timeTo.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ TimePickerDialog t = TimePickerDialog.newInstance(new TimePickerDialog.OnTimeSetListener() {
+ @Override
+ public void onTimeSet(RadialPickerLayout radialPickerLayout, int hours, int minutes) {
+ if (minutes % 5 == 0) {
+ timeTo.setText(String.format("%02d", hours) + ":" + String.format("%02d", minutes));
+ h.setTo_h(hours);
+ h.setTo_m(minutes);
+ } else {
+ Toast.makeText(context, "Merci d'utiliser des tranches de 5 minutes maximum", Toast.LENGTH_SHORT).show();
+ }
+ }
+ }, h.getTo_h(), h.getTo_m(), true);
+ t.show(fm, "to");
+ }
+ });
+
+ return rowView;
+ }
+}
diff --git a/Les Horaires/src/main/java/com/amine/horaires/bdd/FavorisBdd.java b/Les Horaires/src/main/java/com/amine/horaires/bdd/FavorisBdd.java
new file mode 100644
index 0000000..f85a63c
--- /dev/null
+++ b/Les Horaires/src/main/java/com/amine/horaires/bdd/FavorisBdd.java
@@ -0,0 +1,58 @@
+package com.amine.horaires.bdd;
+
+import android.content.Context;
+import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteOpenHelper;
+
+class FavorisBdd extends SQLiteOpenHelper {
+
+ private static final String TABLE_FAVORIS = "shop_favoris";
+ private static final String COL_ID = "ID";
+ private static final String COL_NOM = "Nom";
+ private static final String COL_ADR = "Adresse";
+ private static final String COL_ZIP = "Zip";
+ private static final String COL_LAT = "Lat";
+ private static final String COL_LNG = "Lng";
+ private static final String COL_TEL = "Tel";
+ private static final String COL_CITY = "City";
+ private static final String COL_OUVERT = "Ouvert";
+ private static final String COL_HORAIRES = "Horaires";
+ private static final String COL_URL = "Url";
+ private static final String COL_OPENSTATUS = "OpenStatus";
+ private static final String COL_PARKING = "Parking";
+ private static final String COL_WIFI = "Wifi";
+ private static final String COL_HANDI = "Handi";
+ private static final String COL_IDPOI = "IDPoi";
+
+ private static final String CREATE_BDD = "CREATE TABLE " + TABLE_FAVORIS + " (" +
+ COL_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
+ COL_NOM + " TEXT, " +
+ COL_ADR + " TEXT, " +
+ COL_ZIP + " INTEGER, " +
+ COL_LAT + " TEXT, " +
+ COL_LNG + " TEXT, " +
+ COL_TEL + " VARCHAR(40), " +
+ COL_CITY + " TEXT, " +
+ COL_OUVERT + " SHORT, " +
+ COL_HORAIRES + " TEXT, " +
+ COL_URL + " TEXT, " +
+ COL_OPENSTATUS + " TEXT, " +
+ COL_PARKING + " SHORT, " +
+ COL_WIFI + " SHORT, " +
+ COL_HANDI + " SHORT, " +
+ COL_IDPOI + " VARCHAR(40) NOT NULL);";
+
+ public FavorisBdd(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
+ super(context, name, factory, version);
+ }
+
+ @Override
+ public void onCreate(SQLiteDatabase db) {
+ db.execSQL(CREATE_BDD);
+ }
+
+ @Override
+ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
+
+ }
+}
diff --git a/Les Horaires/src/main/java/com/amine/horaires/bdd/FavorisDao.java b/Les Horaires/src/main/java/com/amine/horaires/bdd/FavorisDao.java
new file mode 100644
index 0000000..d2f1ee5
--- /dev/null
+++ b/Les Horaires/src/main/java/com/amine/horaires/bdd/FavorisDao.java
@@ -0,0 +1,159 @@
+package com.amine.horaires.bdd;
+
+import android.content.ContentValues;
+import android.content.Context;
+import android.database.Cursor;
+import android.database.sqlite.SQLiteDatabase;
+import com.amine.horaires.models.Shop;
+
+import java.util.ArrayList;
+
+public class FavorisDao {
+ private static final int VERSION_BDD = 1;// pour le onupgrade de BaseSQL
+ private static final String NOM_BDD = "shops.db";
+
+ private static final String TABLE_FAVORIS = "shop_favoris";
+ private static final String COL_NOM = "Nom";
+ private static final String COL_ADR = "Adresse";
+ private static final String COL_ZIP = "Zip";
+ private static final String COL_LAT = "Lat";
+ private static final String COL_LNG = "Lng";
+ private static final String COL_TEL = "Tel";
+ private static final String COL_CITY = "City";
+ private static final String COL_OUVERT = "Ouvert";
+ private static final String COL_HORAIRES = "Horaires";
+ private static final String COL_URL = "Url";
+ private static final String COL_OPENSTATUS = "OpenStatus";
+ private static final String COL_PARKING = "Parking";
+ private static final String COL_WIFI = "Wifi";
+ private static final String COL_HANDI = "Handi";
+ private static final String COL_IDPOI = "IDPoi";
+
+ private static final int NUM_COL_NOM = 1;
+ private static final int NUM_COL_ADR = 2;
+ private static final int NUM_COL_ZIP = 3;
+ private static final int NUM_COL_LAT = 4;
+ private static final int NUM_COL_LNG = 5;
+ private static final int NUM_COL_TEL = 6;
+ private static final int NUM_COL_CITY = 7;
+ private static final int NUM_COL_OUVERT = 8;
+ private static final int NUM_COL_HORAIRES = 9;
+ private static final int NUM_COL_URL = 10;
+ private static final int NUM_COL_OPENSTATUS = 11;
+ private static final int NUM_COL_PARKING = 12;
+ private static final int NUM_COL_WIFI = 13;
+ private static final int NUM_COL_HANDI = 14;
+ private static final int NUM_COL_IDPOI = 15;
+ private static FavorisDao instance = null;
+ private final FavorisBdd maBaseSQLite;
+ private SQLiteDatabase bdd;
+
+ private FavorisDao(Context context) {
+ maBaseSQLite = new FavorisBdd(context, NOM_BDD, null, VERSION_BDD);
+ }
+
+ public static FavorisDao getInstance(Context c) {
+ if (instance == null) {
+ instance = new FavorisDao(c);
+ return instance;
+ } else {
+ return instance;
+ }
+ }
+
+ public void open() {
+ bdd = maBaseSQLite.getWritableDatabase();
+ }
+
+ public void close() {
+ bdd.close();
+ }
+
+ public void insertFavori(Shop favori) {
+ ContentValues values = getContentValues(favori);
+ bdd.insert(TABLE_FAVORIS, null, values);
+ }
+
+ private ContentValues getContentValues(Shop favori) {
+ ContentValues values = new ContentValues();
+ values.put(COL_IDPOI, favori.getId());
+ values.put(COL_NOM, favori.getName());
+ values.put(COL_ADR, favori.getAdresse());
+ values.put(COL_ZIP, favori.getZip());
+ values.put(COL_LAT, favori.getLat());
+ values.put(COL_LNG, favori.getLng());
+ values.put(COL_TEL, favori.getTel());
+ values.put(COL_CITY, favori.getCity());
+ values.put(COL_OUVERT, favori.isOuvert());
+ values.put(COL_HORAIRES, favori.getHoraires());
+ values.put(COL_URL, favori.getUrl());
+ values.put(COL_OPENSTATUS, favori.getOpenStatus());
+ values.put(COL_PARKING, favori.isParking());
+ values.put(COL_WIFI, favori.isWifi());
+ values.put(COL_HANDI, favori.isAccesHandicape());
+ return values;
+ }
+
+ public void updateFavori(Shop favori) {
+ ContentValues values = getContentValues(favori);
+ bdd.update(TABLE_FAVORIS, values, COL_IDPOI + " LIKE " + "\"" + favori.getId() + "\"", null);
+ }
+
+ public void deleteFavori(int id) {
+ bdd.delete(TABLE_FAVORIS, COL_IDPOI + " LIKE \"" + id + "\"", null);
+ }
+
+ public Shop getFavori(int id) {
+ Cursor c = bdd.query(TABLE_FAVORIS, null, COL_IDPOI + " LIKE \"" + id
+ + "\"", null, null, null, null);
+ c.moveToFirst();
+ Shop s = cursorToFavori(c);
+ c.close();
+ return s;
+ }
+
+ private Shop cursorToFavori(Cursor c) {
+ if (c.getCount() == 0) {
+ return null;
+ } else {
+ Shop f = new Shop();
+ f.setId(c.getInt(NUM_COL_IDPOI));
+ f.setName(c.getString(NUM_COL_NOM));
+ f.setAdresse(c.getString(NUM_COL_ADR));
+ f.setZip(c.getString(NUM_COL_ZIP));
+ f.setLat(c.getString(NUM_COL_LAT));
+ f.setLng(c.getString(NUM_COL_LNG));
+ f.setTel(c.getString(NUM_COL_TEL));
+ f.setCity(c.getString(NUM_COL_CITY));
+ f.setOuvert(c.getShort(NUM_COL_OUVERT) != 0);
+ f.setHoraires(c.getString(NUM_COL_HORAIRES));
+ f.setUrl(c.getString(NUM_COL_URL));
+ f.setOpenStatus(c.getString(NUM_COL_OPENSTATUS));
+ f.setParking(c.getShort(NUM_COL_PARKING) != 0);
+ f.setWifi(c.getShort(NUM_COL_WIFI) != 0);
+ f.setAccesHandicape(c.getShort(NUM_COL_HANDI) != 0);
+ f.setId(c.getInt(NUM_COL_IDPOI));
+ return f;
+ }
+ }
+
+ public ArrayList getAllFavoris() {
+ Cursor c = bdd.rawQuery("SELECT * FROM " + TABLE_FAVORIS, null);
+ return cursorToListeFavoris(c);
+ }
+
+ private ArrayList cursorToListeFavoris(Cursor cursor) {
+ ArrayList list = new ArrayList();
+ if (cursor.getCount() != 0) {
+ if (cursor.moveToFirst()) {
+ while (!cursor.isAfterLast()) {
+
+ list.add(cursorToFavori(cursor));
+ cursor.moveToNext();
+ }
+ }
+ }
+ cursor.close();
+ return list;
+ }
+}
diff --git a/Les Horaires/src/main/java/com/amine/horaires/models/Horaires.java b/Les Horaires/src/main/java/com/amine/horaires/models/Horaires.java
new file mode 100644
index 0000000..32e139e
--- /dev/null
+++ b/Les Horaires/src/main/java/com/amine/horaires/models/Horaires.java
@@ -0,0 +1,112 @@
+package com.amine.horaires.models;
+
+import android.support.annotation.NonNull;
+
+public class Horaires implements Comparable {
+ /*
+ periods[N][title] Title of N period - optional
+ periods[N][T][day] 1 (Monday) to 7 (Sunday) - Day of opening window T for period N
+ periods[N][T][from_h] 0 to 23 - Hour of beginning of opening window T for period N
+ periods[N][T][from_m] 0 to 59 (minutes) - Minute of beginning of opening window T for period N
+ periods[N][T][to_h] 0 to 32 (8am the next morning) - Hour of end of opening window T for period N
+ periods[N][T][to_m] 0 to 59 (minutes) - Minute of end of opening window T for period N
+ */
+
+ private int day;
+ private int from_h;
+ private int from_m;
+ private int to_h;
+ private int to_m;
+
+ public Horaires(int day) {
+ this.day = day;
+ this.from_h = 8;
+ this.from_m = 0;
+ this.to_h = 18;
+ this.to_m = 0;
+ }
+
+ public Horaires() {
+ this.day = 1;
+ this.from_h = 8;
+ this.from_m = 0;
+ this.to_h = 18;
+ this.to_m = 0;
+ }
+
+ public Horaires(Horaires h) {
+ this.day = h.getDay();
+ this.from_h = h.getFrom_h();
+ this.from_m = h.getFrom_m();
+ this.to_h = h.getTo_h();
+ this.to_m = h.getTo_m();
+ }
+
+ public int getDay() {
+ return day;
+ }
+
+ public void setDay(int day) {
+ this.day = day;
+ }
+
+ public int getFrom_h() {
+ return from_h;
+ }
+
+ public void setFrom_h(int from_h) {
+ this.from_h = from_h;
+ }
+
+ public int getFrom_m() {
+ return from_m;
+ }
+
+ public void setFrom_m(int from_m) {
+ this.from_m = from_m;
+ }
+
+ public int getTo_h() {
+ return to_h;
+ }
+
+ public void setTo_h(int to_h) {
+ this.to_h = to_h;
+ }
+
+ public int getTo_m() {
+ return to_m;
+ }
+
+ public void setTo_m(int to_m) {
+ this.to_m = to_m;
+ }
+
+
+ @Override
+ public int compareTo(@NonNull Object another) {
+ Horaires h = (Horaires) another;
+ return this.day - h.day;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ Horaires horaires = (Horaires) o;
+
+ return this.day == horaires.day;
+
+ }
+
+ @Override
+ public int hashCode() {
+ int result = day;
+ result = 31 * result + from_h;
+ result = 31 * result + from_m;
+ result = 31 * result + to_h;
+ result = 31 * result + to_m;
+ return result;
+ }
+}
diff --git a/Les Horaires/src/main/java/com/amine/horaires/models/Shop.java b/Les Horaires/src/main/java/com/amine/horaires/models/Shop.java
new file mode 100644
index 0000000..78d96b4
--- /dev/null
+++ b/Les Horaires/src/main/java/com/amine/horaires/models/Shop.java
@@ -0,0 +1,240 @@
+package com.amine.horaires.models;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+public class Shop implements Parcelable {
+ public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {
+ @Override
+ public Shop createFromParcel(Parcel source) {
+ return new Shop(source);
+ }
+
+ @Override
+ public Shop[] newArray(int size) {
+ return new Shop[size];
+ }
+ };
+ private int id;
+ private String name;
+ private String adresse;
+ private String zip;
+ private String lat;
+ private String lng;
+ private String tel;
+ private String city;
+ private boolean ouvert;
+ private String horaires;
+ private String url;
+ private String openStatus;
+ private boolean parking;
+ private boolean wifi;
+ private boolean AccesHandicape;
+
+ public Shop() {
+ }
+
+ public Shop(int id, String name, String adresse, String zip, String lat,
+ String lng, String tel, String city,
+ boolean ouvert, String horaires, String url, String openStatus,
+ boolean parking, boolean wifi, boolean accesHandicape) {
+ this.id = id;
+ this.name = name;
+ this.adresse = adresse;
+ this.zip = zip;
+ this.lat = lat;
+ this.lng = lng;
+ this.tel = tel;
+ this.city = city;
+ this.ouvert = ouvert;
+ this.horaires = horaires;
+ this.url = url;
+ this.openStatus = openStatus;
+ this.parking = parking;
+ this.wifi = wifi;
+ AccesHandicape = accesHandicape;
+ }
+
+ private Shop(Parcel in) {
+ id = in.readInt();
+ name = in.readString();
+ adresse = in.readString();
+ zip = in.readString();
+ lat = in.readString();
+ lng = in.readString();
+ tel = in.readString();
+ city = in.readString();
+ ouvert = in.readByte() != 0;
+ horaires = in.readString();
+ url = in.readString();
+ openStatus = in.readString();
+ parking = in.readByte() != 0;
+ wifi = in.readByte() != 0;
+ AccesHandicape = in.readByte() != 0;
+ }
+
+ @Override
+ public String toString() {
+ return "Shop{" +
+ "id=" + id +
+ ", name='" + name + '\'' +
+ ", adresse='" + adresse + '\'' +
+ ", zip='" + zip + '\'' +
+ ", lat='" + lat + '\'' +
+ ", lng='" + lng + '\'' +
+ ", tel='" + tel + '\'' +
+ ", city='" + city + '\'' +
+ ", ouvert=" + ouvert +
+ ", horaires='" + horaires + '\'' +
+ ", url='" + url + '\'' +
+ ", openStatus='" + openStatus + '\'' +
+ ", parking=" + parking +
+ ", wifi=" + wifi +
+ ", AccesHandicape=" + AccesHandicape +
+ '}';
+ }
+
+ public boolean isAccesHandicape() {
+ return AccesHandicape;
+ }
+
+ public void setAccesHandicape(boolean accesHandicape) {
+ AccesHandicape = accesHandicape;
+ }
+
+ public String getOpenStatus() {
+ return openStatus;
+ }
+
+ public void setOpenStatus(String openStatus) {
+ this.openStatus = openStatus;
+ }
+
+ public boolean isParking() {
+ return parking;
+ }
+
+ public void setParking(boolean parking) {
+ this.parking = parking;
+ }
+
+ public boolean isWifi() {
+ return wifi;
+ }
+
+ public void setWifi(boolean wifi) {
+ this.wifi = wifi;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getTel() {
+ return tel;
+ }
+
+ public void setTel(String tel) {
+ this.tel = tel;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getAdresse() {
+ return adresse;
+ }
+
+ public void setAdresse(String adresse) {
+ this.adresse = adresse;
+ }
+
+ public String getLat() {
+ return lat;
+ }
+
+ public void setLat(String lat) {
+ this.lat = lat;
+ }
+
+ public String getLng() {
+ return lng;
+ }
+
+ public void setLng(String lng) {
+ this.lng = lng;
+ }
+
+ public boolean isOuvert() {
+ return ouvert;
+ }
+
+ public void setOuvert(boolean ouvert) {
+ this.ouvert = ouvert;
+ }
+
+ public String getHoraires() {
+ return horaires;
+ }
+
+ public void setHoraires(String horaires) {
+ this.horaires = horaires;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public String getZip() {
+ return zip;
+ }
+
+ public void setZip(String zip) {
+ this.zip = zip;
+ }
+
+ public String getCity() {
+ return city;
+ }
+
+ public void setCity(String city) {
+ this.city = city;
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeInt(id);
+ dest.writeString(name);
+ dest.writeString(adresse);
+ dest.writeString(zip);
+ dest.writeString(lat);
+ dest.writeString(lng);
+ dest.writeString(tel);
+ dest.writeString(city);
+ dest.writeByte((byte) (ouvert ? 1 : 0));
+ dest.writeString(horaires);
+ dest.writeString(url);
+ dest.writeString(openStatus);
+ dest.writeByte((byte) (parking ? 1 : 0));
+ dest.writeByte((byte) (wifi ? 1 : 0));
+ dest.writeByte((byte) (AccesHandicape ? 1 : 0));
+ }
+}
diff --git a/Les Horaires/src/main/java/com/amine/horaires/util/Configuration.java b/Les Horaires/src/main/java/com/amine/horaires/util/Configuration.java
new file mode 100644
index 0000000..5fd5767
--- /dev/null
+++ b/Les Horaires/src/main/java/com/amine/horaires/util/Configuration.java
@@ -0,0 +1,23 @@
+package com.amine.horaires.util;
+
+import com.amine.horaires.models.Shop;
+
+public class Configuration {
+ // Cles necessaires pour l'api lesHorraires
+ public static final String key = "REPLACE_THIS_WITH_KEY";
+ public static final String hashtag = "REPLACE_THIS_WITH_A_HASHTAG";
+ public static String pays = "FR";
+ public static Shop currentShop = null;
+
+ public static String getAPIUrl() {
+ if (pays.equals("FR"))
+ return "http://www.les-horaires.fr";
+ else if (pays.equals("GB"))
+ return "http://www.shopping-time.co.uk";
+ else if (pays.equals("US"))
+ return "http://www.shopping-time.com";
+
+ return "http://www.les-horaires.fr";
+ }
+
+}
diff --git a/Les Horaires/src/main/java/com/amine/horaires/util/MyLocation.java b/Les Horaires/src/main/java/com/amine/horaires/util/MyLocation.java
new file mode 100644
index 0000000..277ff91
--- /dev/null
+++ b/Les Horaires/src/main/java/com/amine/horaires/util/MyLocation.java
@@ -0,0 +1,129 @@
+package com.amine.horaires.util;
+
+import android.content.Context;
+import android.location.Location;
+import android.location.LocationListener;
+import android.location.LocationManager;
+import android.os.Bundle;
+import android.util.Log;
+
+import java.util.Timer;
+import java.util.TimerTask;
+
+// http://stackoverflow.com/questions/3145089/what-is-the-simplest-and-most-robust-way-to-get-the-users-current-location-in-a/3145655#3145655
+public class MyLocation {
+ private Timer timer1;
+ private LocationManager lm;
+ private LocationResult locationResult;
+ private final LocationListener locationListenerGps = new LocationListener() {
+ public void onLocationChanged(Location location) {
+ timer1.cancel();
+ locationResult.gotLocation(location);
+ lm.removeUpdates(this);
+ lm.removeUpdates(locationListenerNetwork);
+ }
+
+ public void onProviderDisabled(String provider) {
+ }
+
+ public void onProviderEnabled(String provider) {
+ }
+
+ public void onStatusChanged(String provider, int status, Bundle extras) {
+ }
+ };
+ private final LocationListener locationListenerNetwork = new LocationListener() {
+ public void onLocationChanged(Location location) {
+ timer1.cancel();
+ locationResult.gotLocation(location);
+ lm.removeUpdates(this);
+ lm.removeUpdates(locationListenerGps);
+ }
+
+ public void onProviderDisabled(String provider) {
+ }
+
+ public void onProviderEnabled(String provider) {
+ }
+
+ public void onStatusChanged(String provider, int status, Bundle extras) {
+ }
+ };
+ private boolean gps_enabled = false;
+ private boolean network_enabled = false;
+
+ public boolean getLocation(Context context, LocationResult result) {
+ locationResult = result;
+ if (lm == null)
+ lm = (LocationManager) context
+ .getSystemService(Context.LOCATION_SERVICE);
+
+ try {
+ gps_enabled = lm.isProviderEnabled(LocationManager.GPS_PROVIDER);
+ } catch (Exception ex) {
+ Log.w("LOC", "gps_enabled = lm.isProviderEnabled(LocationManager.GPS_PROVIDER);");
+ }
+ try {
+ network_enabled = lm
+ .isProviderEnabled(LocationManager.NETWORK_PROVIDER);
+ } catch (Exception ex) {
+ Log.w("LOC", "network_enabled = lm .isProviderEnabled(LocationManager.NETWORK_PROVIDER);");
+ }
+
+ if (!gps_enabled && !network_enabled)
+ return false;
+
+ if (gps_enabled)
+ lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0,
+ locationListenerGps);
+ if (network_enabled)
+ lm.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0,
+ locationListenerNetwork);
+ timer1 = new Timer();
+ timer1.schedule(new GetLastLocation(), 20000);
+ return true;
+ }
+
+ public void cancelTimer() {
+ timer1.cancel();
+ lm.removeUpdates(locationListenerGps);
+ lm.removeUpdates(locationListenerNetwork);
+ }
+
+ public static abstract class LocationResult {
+ public abstract void gotLocation(Location location);
+ }
+
+ private class GetLastLocation extends TimerTask {
+ @Override
+ public void run() {
+ lm.removeUpdates(locationListenerGps);
+ lm.removeUpdates(locationListenerNetwork);
+
+ Location net_loc = null, gps_loc = null;
+ if (gps_enabled)
+ gps_loc = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);
+ if (network_enabled)
+ net_loc = lm
+ .getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
+
+ if (gps_loc != null && net_loc != null) {
+ if (gps_loc.getTime() > net_loc.getTime())
+ locationResult.gotLocation(gps_loc);
+ else
+ locationResult.gotLocation(net_loc);
+ return;
+ }
+
+ if (gps_loc != null) {
+ locationResult.gotLocation(gps_loc);
+ return;
+ }
+ if (net_loc != null) {
+ locationResult.gotLocation(net_loc);
+ return;
+ }
+ locationResult.gotLocation(null);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Les Horaires/src/main/java/com/amine/horaires/util/Parseur.java b/Les Horaires/src/main/java/com/amine/horaires/util/Parseur.java
new file mode 100644
index 0000000..3cdd4f2
--- /dev/null
+++ b/Les Horaires/src/main/java/com/amine/horaires/util/Parseur.java
@@ -0,0 +1,224 @@
+package com.amine.horaires.util;
+
+import com.amine.horaires.models.Shop;
+import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.util.ArrayList;
+
+/**
+ * Parseur qui permet de parcourir le fichier xml genere
+ */
+public class Parseur {
+
+ /**
+ * Parcours le fichier xml , insere les donnees de l'utilisateur et son
+ * historique
+ *
+ * @return une arraylist de collections
+ */
+ public ArrayList parserShops(String contenuDuFichier) {
+ final ArrayList listeMagasins = new ArrayList();
+
+ try {
+
+ SAXParserFactory factory = SAXParserFactory.newInstance();
+ SAXParser saxParser = factory.newSAXParser();
+
+ DefaultHandler handler = new DefaultHandler() {
+ Shop magasin;
+
+ boolean url = false;
+ boolean name = false;
+ boolean address = false;
+ boolean ville = false;
+ boolean zip = false;
+ boolean lat = false;
+ boolean lng = false;
+ boolean tel = false;
+ boolean img = false;
+ boolean open = false;
+ boolean open_status = false;
+ boolean pmr = false;
+ boolean wifi = false;
+ boolean freepark = false;
+
+ public void startElement(String uri, String localName,
+ String qName, Attributes attributes)
+ throws SAXException {
+
+ if (qName.equalsIgnoreCase("shop"))
+ magasin = new Shop();
+
+ if (qName.equalsIgnoreCase("url"))
+ url = true;
+
+ if (qName.equalsIgnoreCase("name"))
+ name = true;
+
+ if (qName.equalsIgnoreCase("address"))
+ address = true;
+
+ if (qName.equalsIgnoreCase("city"))
+ ville = true;
+
+ if (qName.equalsIgnoreCase("zip"))
+ zip = true;
+
+ if (qName.equalsIgnoreCase("lat"))
+ lat = true;
+
+ if (qName.equalsIgnoreCase("lng"))
+ lng = true;
+
+ if (qName.equalsIgnoreCase("tel"))
+ tel = true;
+
+ if (qName.equalsIgnoreCase("img"))
+ img = true;
+
+ if (qName.equalsIgnoreCase("open"))
+ open = true;
+
+ if (qName.equalsIgnoreCase("open_status"))
+ open_status = true;
+
+ if (qName.equalsIgnoreCase("pmr"))
+ pmr = true;
+
+ if (qName.equalsIgnoreCase("pmr"))
+ pmr = true;
+
+ if (qName.equalsIgnoreCase("wifi"))
+ wifi = true;
+
+ if (qName.equalsIgnoreCase("freepark"))
+ freepark = true;
+
+ if (qName.equalsIgnoreCase("shop")) {
+ int length = attributes.getLength();
+
+ for (int i = 0; i < length; i++) {
+ String nameA = attributes.getQName(i);
+ String valueA = attributes.getValue(i);
+
+ if (nameA.compareTo("id") == 0) {
+ magasin.setId(Integer.parseInt(valueA));
+ }
+
+ }
+ }
+ }
+
+ public void endElement(String uri, String localName,
+ String qName) throws SAXException {
+
+ if (qName.equalsIgnoreCase("shop"))
+ listeMagasins.add(magasin);
+
+ }
+
+ public void characters(char ch[], int start, int length)
+ throws SAXException {
+
+ if (url) {
+ magasin.setUrl(new String(ch, start, length));
+ url = false;
+ }
+
+ if (name) {
+ magasin.setName(new String(ch, start, length));
+ name = false;
+ }
+
+ if (address) {
+ magasin.setAdresse(new String(ch, start, length));
+ address = false;
+ }
+
+ if (ville) {
+ magasin.setCity(new String(ch, start, length));
+ ville = false;
+ }
+
+ if (zip) {
+ magasin.setZip(new String(ch, start, length));
+ zip = false;
+ }
+
+ if (lat) {
+ magasin.setLat(new String(ch, start, length));
+ lat = false;
+ }
+
+ if (lng) {
+ magasin.setLng(new String(ch, start, length));
+ lng = false;
+ }
+
+ if (tel) {
+ magasin.setTel(new String(ch, start, length));
+ tel = false;
+ }
+
+ if (img) {
+ magasin.setHoraires(new String(ch, start, length));
+ img = false;
+ }
+
+ if (open) {
+ magasin.setOuvert(new String(ch, start, length)
+ .compareTo("1") == 0);
+ open = false;
+ }
+
+ if (open_status) {
+ magasin.setOpenStatus(new String(ch, start, length));
+ open_status = false;
+ }
+
+ if (pmr) {
+ magasin.setAccesHandicape(new String(ch, start, length)
+ .compareTo("1") == 0);
+ pmr = false;
+ }
+
+ if (wifi) {
+ magasin.setWifi(new String(ch, start, length)
+ .compareTo("1") == 0);
+ wifi = false;
+ }
+
+ if (freepark) {
+ magasin.setParking(new String(ch, start, length)
+ .compareTo("1") == 0);
+ freepark = false;
+ }
+ }
+
+ };
+
+ InputStream inputStream = new ByteArrayInputStream(
+ contenuDuFichier.getBytes());
+ Reader reader = new InputStreamReader(inputStream, "UTF-8");
+
+ InputSource is = new InputSource(reader);
+ is.setEncoding("UTF-8");
+
+ saxParser.parse(is, handler);
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ return listeMagasins;
+ }
+}
\ No newline at end of file
diff --git a/Les Horaires/src/main/java/com/amine/horaires/util/Utils.java b/Les Horaires/src/main/java/com/amine/horaires/util/Utils.java
new file mode 100644
index 0000000..fb2de9f
--- /dev/null
+++ b/Les Horaires/src/main/java/com/amine/horaires/util/Utils.java
@@ -0,0 +1,64 @@
+package com.amine.horaires.util;
+
+import java.io.UnsupportedEncodingException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLEncoder;
+
+public class Utils {
+ public static URL generateUrlForTextLocation(String name, String location) {
+ try {
+ return new URL(Configuration.getAPIUrl() + "/api?key="
+ + Configuration.key + "&h=" + Configuration.hashtag
+ + "&get=shops" + "&loc=" + URLEncoder.encode(location, "ISO-8859-1")
+ + "&name=" + URLEncoder.encode(name, "ISO-8859-1"));
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ return null;
+ } catch (UnsupportedEncodingException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ public static URL generateUrlForLatLng(String name, String lat,
+ String lng) {
+ try {
+
+ return new URL(Configuration.getAPIUrl() + "/api?key="
+ + Configuration.key + "&h=" + Configuration.hashtag
+ + "&get=shops" + "&lng=" + lng + "&lat=" + lat + "&name="
+ + URLEncoder.encode(name, "ISO-8859-1") + "&order=distance");
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ return null;
+ } catch (UnsupportedEncodingException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ public static URL generateUrlForId(int idPoi) {
+ try {
+
+ return new URL(Configuration.getAPIUrl() + "/api?key="
+ + Configuration.key + "&h=" + Configuration.hashtag
+ + "&get=shop" + "&id=" + idPoi);
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ public static URL generateUrlForEdit(int idPoi, String periodsString) {
+ try {
+
+ return new URL(Configuration.getAPIUrl() + "/api?key="
+ + Configuration.key + "&h=" + Configuration.hashtag
+ + "&get=edit" + "&id=" + idPoi + periodsString);
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+}
diff --git a/Les Horaires/src/main/res/layout/activity_main.xml b/Les Horaires/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..9dbb986
--- /dev/null
+++ b/Les Horaires/src/main/res/layout/activity_main.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
diff --git a/Les Horaires/src/main/res/layout/activity_more.xml b/Les Horaires/src/main/res/layout/activity_more.xml
new file mode 100644
index 0000000..32ed717
--- /dev/null
+++ b/Les Horaires/src/main/res/layout/activity_more.xml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Les Horaires/src/main/res/layout/fav_list_item.xml b/Les Horaires/src/main/res/layout/fav_list_item.xml
new file mode 100644
index 0000000..38d55eb
--- /dev/null
+++ b/Les Horaires/src/main/res/layout/fav_list_item.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Les Horaires/src/main/res/layout/shop_display.xml b/Les Horaires/src/main/res/layout/shop_display.xml
new file mode 100644
index 0000000..277a9fe
--- /dev/null
+++ b/Les Horaires/src/main/res/layout/shop_display.xml
@@ -0,0 +1,148 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Les Horaires/src/main/res/layout/shop_search.xml b/Les Horaires/src/main/res/layout/shop_search.xml
new file mode 100644
index 0000000..4b240a9
--- /dev/null
+++ b/Les Horaires/src/main/res/layout/shop_search.xml
@@ -0,0 +1,111 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Les Horaires/src/main/res/layout/spinner_item.xml b/Les Horaires/src/main/res/layout/spinner_item.xml
new file mode 100644
index 0000000..7ac242a
--- /dev/null
+++ b/Les Horaires/src/main/res/layout/spinner_item.xml
@@ -0,0 +1,10 @@
+
+
\ No newline at end of file
diff --git a/Les Horaires/src/main/res/layout/update_horaire_item.xml b/Les Horaires/src/main/res/layout/update_horaire_item.xml
new file mode 100644
index 0000000..07c53a9
--- /dev/null
+++ b/Les Horaires/src/main/res/layout/update_horaire_item.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Les Horaires/src/main/res/layout/update_shop.xml b/Les Horaires/src/main/res/layout/update_shop.xml
new file mode 100644
index 0000000..da1a3e0
--- /dev/null
+++ b/Les Horaires/src/main/res/layout/update_shop.xml
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Les Horaires/src/main/res/menu/main_activity_actions.xml b/Les Horaires/src/main/res/menu/main_activity_actions.xml
new file mode 100644
index 0000000..af192a3
--- /dev/null
+++ b/Les Horaires/src/main/res/menu/main_activity_actions.xml
@@ -0,0 +1,11 @@
+
\ No newline at end of file
diff --git a/Les Horaires/src/main/res/menu/main_activity_actions_main.xml b/Les Horaires/src/main/res/menu/main_activity_actions_main.xml
new file mode 100644
index 0000000..07f434e
--- /dev/null
+++ b/Les Horaires/src/main/res/menu/main_activity_actions_main.xml
@@ -0,0 +1,10 @@
+
\ No newline at end of file
diff --git a/Les Horaires/src/main/res/menu/main_activity_actions_shop.xml b/Les Horaires/src/main/res/menu/main_activity_actions_shop.xml
new file mode 100644
index 0000000..77cc202
--- /dev/null
+++ b/Les Horaires/src/main/res/menu/main_activity_actions_shop.xml
@@ -0,0 +1,10 @@
+
\ No newline at end of file
diff --git a/Les Horaires/src/main/res/mipmap-hdpi/call.png b/Les Horaires/src/main/res/mipmap-hdpi/call.png
new file mode 100644
index 0000000..6257783
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-hdpi/call.png differ
diff --git a/Les Horaires/src/main/res/mipmap-hdpi/handi.png b/Les Horaires/src/main/res/mipmap-hdpi/handi.png
new file mode 100644
index 0000000..7267c60
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-hdpi/handi.png differ
diff --git a/Les Horaires/src/main/res/mipmap-hdpi/ic_alarm_add_black_24dp.png b/Les Horaires/src/main/res/mipmap-hdpi/ic_alarm_add_black_24dp.png
new file mode 100644
index 0000000..aa0374e
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-hdpi/ic_alarm_add_black_24dp.png differ
diff --git a/Les Horaires/src/main/res/mipmap-hdpi/ic_cached_black_24dp.png b/Les Horaires/src/main/res/mipmap-hdpi/ic_cached_black_24dp.png
new file mode 100644
index 0000000..3105a2c
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-hdpi/ic_cached_black_24dp.png differ
diff --git a/Les Horaires/src/main/res/mipmap-hdpi/ic_clear_all_black_24dp.png b/Les Horaires/src/main/res/mipmap-hdpi/ic_clear_all_black_24dp.png
new file mode 100644
index 0000000..5f72641
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-hdpi/ic_clear_all_black_24dp.png differ
diff --git a/Les Horaires/src/main/res/mipmap-hdpi/ic_create_black_24dp.png b/Les Horaires/src/main/res/mipmap-hdpi/ic_create_black_24dp.png
new file mode 100644
index 0000000..0350968
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-hdpi/ic_create_black_24dp.png differ
diff --git a/Les Horaires/src/main/res/mipmap-hdpi/ic_launcher.png b/Les Horaires/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..8af6d80
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/Les Horaires/src/main/res/mipmap-hdpi/ic_turned_in_black_24dp.png b/Les Horaires/src/main/res/mipmap-hdpi/ic_turned_in_black_24dp.png
new file mode 100644
index 0000000..15aaccf
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-hdpi/ic_turned_in_black_24dp.png differ
diff --git a/Les Horaires/src/main/res/mipmap-hdpi/ic_turned_in_not_black_24dp.png b/Les Horaires/src/main/res/mipmap-hdpi/ic_turned_in_not_black_24dp.png
new file mode 100644
index 0000000..a6fe0d6
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-hdpi/ic_turned_in_not_black_24dp.png differ
diff --git a/Les Horaires/src/main/res/mipmap-hdpi/map.png b/Les Horaires/src/main/res/mipmap-hdpi/map.png
new file mode 100644
index 0000000..435146c
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-hdpi/map.png differ
diff --git a/Les Horaires/src/main/res/mipmap-hdpi/parking.png b/Les Horaires/src/main/res/mipmap-hdpi/parking.png
new file mode 100644
index 0000000..b286970
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-hdpi/parking.png differ
diff --git a/Les Horaires/src/main/res/mipmap-hdpi/plus.png b/Les Horaires/src/main/res/mipmap-hdpi/plus.png
new file mode 100644
index 0000000..e4a625e
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-hdpi/plus.png differ
diff --git a/Les Horaires/src/main/res/mipmap-hdpi/wifi.png b/Les Horaires/src/main/res/mipmap-hdpi/wifi.png
new file mode 100644
index 0000000..d606f02
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-hdpi/wifi.png differ
diff --git a/Les Horaires/src/main/res/mipmap-mdpi/call.png b/Les Horaires/src/main/res/mipmap-mdpi/call.png
new file mode 100644
index 0000000..b51b5d7
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-mdpi/call.png differ
diff --git a/Les Horaires/src/main/res/mipmap-mdpi/handi.png b/Les Horaires/src/main/res/mipmap-mdpi/handi.png
new file mode 100644
index 0000000..7267c60
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-mdpi/handi.png differ
diff --git a/Les Horaires/src/main/res/mipmap-mdpi/ic_alarm_add_black_24dp.png b/Les Horaires/src/main/res/mipmap-mdpi/ic_alarm_add_black_24dp.png
new file mode 100644
index 0000000..4e09557
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-mdpi/ic_alarm_add_black_24dp.png differ
diff --git a/Les Horaires/src/main/res/mipmap-mdpi/ic_cached_black_24dp.png b/Les Horaires/src/main/res/mipmap-mdpi/ic_cached_black_24dp.png
new file mode 100644
index 0000000..e93a8dc
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-mdpi/ic_cached_black_24dp.png differ
diff --git a/Les Horaires/src/main/res/mipmap-mdpi/ic_clear_all_black_24dp.png b/Les Horaires/src/main/res/mipmap-mdpi/ic_clear_all_black_24dp.png
new file mode 100644
index 0000000..c8cc143
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-mdpi/ic_clear_all_black_24dp.png differ
diff --git a/Les Horaires/src/main/res/mipmap-mdpi/ic_create_black_24dp.png b/Les Horaires/src/main/res/mipmap-mdpi/ic_create_black_24dp.png
new file mode 100644
index 0000000..0350968
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-mdpi/ic_create_black_24dp.png differ
diff --git a/Les Horaires/src/main/res/mipmap-mdpi/ic_launcher.png b/Les Horaires/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..0ed310f
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/Les Horaires/src/main/res/mipmap-mdpi/ic_turned_in_black_24dp.png b/Les Horaires/src/main/res/mipmap-mdpi/ic_turned_in_black_24dp.png
new file mode 100644
index 0000000..d7cd384
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-mdpi/ic_turned_in_black_24dp.png differ
diff --git a/Les Horaires/src/main/res/mipmap-mdpi/ic_turned_in_not_black_24dp.png b/Les Horaires/src/main/res/mipmap-mdpi/ic_turned_in_not_black_24dp.png
new file mode 100644
index 0000000..2e814d2
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-mdpi/ic_turned_in_not_black_24dp.png differ
diff --git a/Les Horaires/src/main/res/mipmap-mdpi/map.png b/Les Horaires/src/main/res/mipmap-mdpi/map.png
new file mode 100644
index 0000000..a05f87b
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-mdpi/map.png differ
diff --git a/Les Horaires/src/main/res/mipmap-mdpi/parking.png b/Les Horaires/src/main/res/mipmap-mdpi/parking.png
new file mode 100644
index 0000000..b286970
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-mdpi/parking.png differ
diff --git a/Les Horaires/src/main/res/mipmap-mdpi/plus.png b/Les Horaires/src/main/res/mipmap-mdpi/plus.png
new file mode 100644
index 0000000..91d07fb
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-mdpi/plus.png differ
diff --git a/Les Horaires/src/main/res/mipmap-mdpi/wifi.png b/Les Horaires/src/main/res/mipmap-mdpi/wifi.png
new file mode 100644
index 0000000..d606f02
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-mdpi/wifi.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xhdpi/call.png b/Les Horaires/src/main/res/mipmap-xhdpi/call.png
new file mode 100644
index 0000000..8da6163
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xhdpi/call.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xhdpi/handi.png b/Les Horaires/src/main/res/mipmap-xhdpi/handi.png
new file mode 100644
index 0000000..7267c60
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xhdpi/handi.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xhdpi/ic_alarm_add_black_24dp.png b/Les Horaires/src/main/res/mipmap-xhdpi/ic_alarm_add_black_24dp.png
new file mode 100644
index 0000000..eafa483
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xhdpi/ic_alarm_add_black_24dp.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xhdpi/ic_cached_black_24dp.png b/Les Horaires/src/main/res/mipmap-xhdpi/ic_cached_black_24dp.png
new file mode 100644
index 0000000..7929aae
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xhdpi/ic_cached_black_24dp.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xhdpi/ic_clear_all_black_24dp.png b/Les Horaires/src/main/res/mipmap-xhdpi/ic_clear_all_black_24dp.png
new file mode 100644
index 0000000..39a1f95
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xhdpi/ic_clear_all_black_24dp.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xhdpi/ic_create_black_24dp.png b/Les Horaires/src/main/res/mipmap-xhdpi/ic_create_black_24dp.png
new file mode 100644
index 0000000..aa7748a
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xhdpi/ic_create_black_24dp.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xhdpi/ic_launcher.png b/Les Horaires/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..23148a8
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xhdpi/ic_turned_in_black_24dp.png b/Les Horaires/src/main/res/mipmap-xhdpi/ic_turned_in_black_24dp.png
new file mode 100644
index 0000000..9992141
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xhdpi/ic_turned_in_black_24dp.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xhdpi/ic_turned_in_not_black_24dp.png b/Les Horaires/src/main/res/mipmap-xhdpi/ic_turned_in_not_black_24dp.png
new file mode 100644
index 0000000..62370f3
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xhdpi/ic_turned_in_not_black_24dp.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xhdpi/map.png b/Les Horaires/src/main/res/mipmap-xhdpi/map.png
new file mode 100644
index 0000000..39e2b1b
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xhdpi/map.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xhdpi/parking.png b/Les Horaires/src/main/res/mipmap-xhdpi/parking.png
new file mode 100644
index 0000000..b286970
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xhdpi/parking.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xhdpi/plus.png b/Les Horaires/src/main/res/mipmap-xhdpi/plus.png
new file mode 100644
index 0000000..2c42d58
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xhdpi/plus.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xhdpi/wifi.png b/Les Horaires/src/main/res/mipmap-xhdpi/wifi.png
new file mode 100644
index 0000000..d606f02
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xhdpi/wifi.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xxhdpi/call.png b/Les Horaires/src/main/res/mipmap-xxhdpi/call.png
new file mode 100644
index 0000000..ab8dd8e
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xxhdpi/call.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xxhdpi/handi.png b/Les Horaires/src/main/res/mipmap-xxhdpi/handi.png
new file mode 100644
index 0000000..7267c60
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xxhdpi/handi.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xxhdpi/ic_alarm_add_black_24dp.png b/Les Horaires/src/main/res/mipmap-xxhdpi/ic_alarm_add_black_24dp.png
new file mode 100644
index 0000000..3e563fc
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xxhdpi/ic_alarm_add_black_24dp.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xxhdpi/ic_cached_black_24dp.png b/Les Horaires/src/main/res/mipmap-xxhdpi/ic_cached_black_24dp.png
new file mode 100644
index 0000000..e84f145
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xxhdpi/ic_cached_black_24dp.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xxhdpi/ic_clear_all_black_24dp.png b/Les Horaires/src/main/res/mipmap-xxhdpi/ic_clear_all_black_24dp.png
new file mode 100644
index 0000000..7819a03
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xxhdpi/ic_clear_all_black_24dp.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xxhdpi/ic_create_black_24dp.png b/Les Horaires/src/main/res/mipmap-xxhdpi/ic_create_black_24dp.png
new file mode 100644
index 0000000..827b684
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xxhdpi/ic_create_black_24dp.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xxhdpi/ic_launcher.png b/Les Horaires/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..9a417df
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xxhdpi/ic_turned_in_black_24dp.png b/Les Horaires/src/main/res/mipmap-xxhdpi/ic_turned_in_black_24dp.png
new file mode 100644
index 0000000..1e4c01b
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xxhdpi/ic_turned_in_black_24dp.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xxhdpi/ic_turned_in_not_black_24dp.png b/Les Horaires/src/main/res/mipmap-xxhdpi/ic_turned_in_not_black_24dp.png
new file mode 100644
index 0000000..d5851e0
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xxhdpi/ic_turned_in_not_black_24dp.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xxhdpi/map.png b/Les Horaires/src/main/res/mipmap-xxhdpi/map.png
new file mode 100644
index 0000000..e2d72f6
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xxhdpi/map.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xxhdpi/parking.png b/Les Horaires/src/main/res/mipmap-xxhdpi/parking.png
new file mode 100644
index 0000000..b286970
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xxhdpi/parking.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xxhdpi/plus.png b/Les Horaires/src/main/res/mipmap-xxhdpi/plus.png
new file mode 100644
index 0000000..b899895
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xxhdpi/plus.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xxhdpi/wifi.png b/Les Horaires/src/main/res/mipmap-xxhdpi/wifi.png
new file mode 100644
index 0000000..d606f02
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xxhdpi/wifi.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xxxhdpi/handi.png b/Les Horaires/src/main/res/mipmap-xxxhdpi/handi.png
new file mode 100644
index 0000000..7267c60
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xxxhdpi/handi.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xxxhdpi/ic_alarm_add_black_24dp.png b/Les Horaires/src/main/res/mipmap-xxxhdpi/ic_alarm_add_black_24dp.png
new file mode 100644
index 0000000..b4edbe9
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xxxhdpi/ic_alarm_add_black_24dp.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xxxhdpi/ic_cached_black_24dp.png b/Les Horaires/src/main/res/mipmap-xxxhdpi/ic_cached_black_24dp.png
new file mode 100644
index 0000000..d349646
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xxxhdpi/ic_cached_black_24dp.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xxxhdpi/ic_clear_all_black_24dp.png b/Les Horaires/src/main/res/mipmap-xxxhdpi/ic_clear_all_black_24dp.png
new file mode 100644
index 0000000..0af11fe
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xxxhdpi/ic_clear_all_black_24dp.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xxxhdpi/ic_create_black_24dp.png b/Les Horaires/src/main/res/mipmap-xxxhdpi/ic_create_black_24dp.png
new file mode 100644
index 0000000..d3c4cce
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xxxhdpi/ic_create_black_24dp.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/Les Horaires/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..6cfb629
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xxxhdpi/ic_turned_in_black_24dp.png b/Les Horaires/src/main/res/mipmap-xxxhdpi/ic_turned_in_black_24dp.png
new file mode 100644
index 0000000..3be34a1
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xxxhdpi/ic_turned_in_black_24dp.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xxxhdpi/ic_turned_in_not_black_24dp.png b/Les Horaires/src/main/res/mipmap-xxxhdpi/ic_turned_in_not_black_24dp.png
new file mode 100644
index 0000000..7e6b4e7
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xxxhdpi/ic_turned_in_not_black_24dp.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xxxhdpi/map.png b/Les Horaires/src/main/res/mipmap-xxxhdpi/map.png
new file mode 100644
index 0000000..f79e1bf
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xxxhdpi/map.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xxxhdpi/parking.png b/Les Horaires/src/main/res/mipmap-xxxhdpi/parking.png
new file mode 100644
index 0000000..b286970
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xxxhdpi/parking.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xxxhdpi/plus.png b/Les Horaires/src/main/res/mipmap-xxxhdpi/plus.png
new file mode 100644
index 0000000..a8b21dc
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xxxhdpi/plus.png differ
diff --git a/Les Horaires/src/main/res/mipmap-xxxhdpi/wifi.png b/Les Horaires/src/main/res/mipmap-xxxhdpi/wifi.png
new file mode 100644
index 0000000..d606f02
Binary files /dev/null and b/Les Horaires/src/main/res/mipmap-xxxhdpi/wifi.png differ
diff --git a/Les Horaires/src/main/res/values-v21/strings.xml b/Les Horaires/src/main/res/values-v21/strings.xml
new file mode 100644
index 0000000..646775c
--- /dev/null
+++ b/Les Horaires/src/main/res/values-v21/strings.xml
@@ -0,0 +1,38 @@
+
+
+ Les Horaires
+
+ À propos
+ Paramètres
+ Jour
+ Ouverture
+ Fermeture
+ Retrourner aux favoris
+ Favoris
+ Quoi ?
+ Votre liste de magasins est vide.
+ Sauvegarder
+ Où ?
+ Chercher
+ Horaires
+ Boutton GPS
+ Wifi
+ Parking
+ Mobilité réduite
+ Appeler
+ Maps
+ Changements
+ Nouveautés
+ OK
+ Plus…
+ Contacter le dev
+
+ - Lundi
+ - Mardi
+ - Mercredi
+ - Jeudi
+ - Vendredi
+ - Samedi
+ - Dimanche
+
+
\ No newline at end of file
diff --git a/Les Horaires/src/main/res/values-v21/styles.xml b/Les Horaires/src/main/res/values-v21/styles.xml
new file mode 100644
index 0000000..258c1ef
--- /dev/null
+++ b/Les Horaires/src/main/res/values-v21/styles.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Les Horaires/src/main/res/values/strings.xml b/Les Horaires/src/main/res/values/strings.xml
new file mode 100644
index 0000000..d8ce2bb
--- /dev/null
+++ b/Les Horaires/src/main/res/values/strings.xml
@@ -0,0 +1,37 @@
+
+ Les Horaires
+
+ À propos
+ Paramètres
+ Jour
+ Ouverture
+ Fermeture
+ Retrourner aux favoris
+ Favoris
+ Quoi ?
+ Votre liste de magasins est vide.
+ Sauvegarder
+ Où ?
+ Chercher
+ Horaires
+ Boutton GPS
+ Wifi
+ Parking
+ Mobilité réduite
+ Appeler
+ Maps
+ Changements
+ Nouveautés
+ OK
+ Plus…
+ Contacter le dev
+
+ - Lundi
+ - Mardi
+ - Mercredi
+ - Jeudi
+ - Vendredi
+ - Samedi
+ - Dimanche
+
+
diff --git a/Les Horaires/src/main/res/values/styles.xml b/Les Horaires/src/main/res/values/styles.xml
new file mode 100644
index 0000000..71a65cf
--- /dev/null
+++ b/Les Horaires/src/main/res/values/styles.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+ #9c27b0
+ #6a1b9a
+ #ffab00
+ #FFFFFF
+ #000000
+ #EEEEEE
+
diff --git a/Les Horaires/src/main/res/xml/changelog_master.xml b/Les Horaires/src/main/res/xml/changelog_master.xml
new file mode 100644
index 0000000..9e4a479
--- /dev/null
+++ b/Les Horaires/src/main/res/xml/changelog_master.xml
@@ -0,0 +1,21 @@
+
+
+
+ Possibilité de modifier les horaires.
+
+
+ Mise à jour en Material Design.
+ L'écran des favoris est le premier à être affiché.
+ Correction: Quelques bugs.
+
+
+ Premières versions.
+ Pas très joli.
+
+
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..4f7a2f1
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,19 @@
+// 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.1.1'
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+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.jar b/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..8c0fb64
Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ
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 100644
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..0832722
--- /dev/null
+++ b/settings.gradle
@@ -0,0 +1 @@
+include ':Les Horaires'