Răsfoiți Sursa

Code optimizations and clean ups.

Iñigo Valentin 9 ani în urmă
părinte
comite
40b89c481d
83 a modificat fișierele cu 2152 adăugiri și 2967 ștergeri
  1. 8 8
      app/src/main/AndroidManifest.xml
  2. 11 33
      app/src/main/java/com/ivalentin/margolariak/ActivityFutureLayout.java
  3. 228 237
      app/src/main/java/com/ivalentin/margolariak/ActivityLayout.java
  4. 71 78
      app/src/main/java/com/ivalentin/margolariak/ActivityPastLayout.java
  5. 3 3
      app/src/main/java/com/ivalentin/margolariak/AlarmReceiver.java
  6. 92 99
      app/src/main/java/com/ivalentin/margolariak/AlbumLayout.java
  7. 209 215
      app/src/main/java/com/ivalentin/margolariak/BlogLayout.java
  8. 1 1
      app/src/main/java/com/ivalentin/margolariak/BootReceiver.java
  9. 28 27
      app/src/main/java/com/ivalentin/margolariak/CustomScrollView.java
  10. 1 1
      app/src/main/java/com/ivalentin/margolariak/Distance.java
  11. 46 45
      app/src/main/java/com/ivalentin/margolariak/DownloadImage.java
  12. 8 6
      app/src/main/java/com/ivalentin/margolariak/FetchURL.java
  13. 58 7
      app/src/main/java/com/ivalentin/margolariak/GM.java
  14. 135 139
      app/src/main/java/com/ivalentin/margolariak/GalleryLayout.java
  15. 23 43
      app/src/main/java/com/ivalentin/margolariak/HomeLayout.java
  16. 0 91
      app/src/main/java/com/ivalentin/margolariak/HomeSectionLocation.java
  17. 7 20
      app/src/main/java/com/ivalentin/margolariak/LablancaLayout.java
  18. 2 6
      app/src/main/java/com/ivalentin/margolariak/LablancaNoFestivalsLayout.java
  19. 0 1
      app/src/main/java/com/ivalentin/margolariak/LocationLayout.java
  20. 38 16
      app/src/main/java/com/ivalentin/margolariak/MainActivity.java
  21. 20 12
      app/src/main/java/com/ivalentin/margolariak/PhotoLayout.java
  22. 160 146
      app/src/main/java/com/ivalentin/margolariak/PostComment.java
  23. 135 143
      app/src/main/java/com/ivalentin/margolariak/PostLayout.java
  24. 13 11
      app/src/main/java/com/ivalentin/margolariak/ReceiveLocation.java
  25. 17 31
      app/src/main/java/com/ivalentin/margolariak/ScheduleLayout.java
  26. 8 2
      app/src/main/java/com/ivalentin/margolariak/SettingsActivity.java
  27. 0 179
      app/src/main/java/com/ivalentin/margolariak/SettingsLayout.java
  28. 2 4
      app/src/main/java/com/ivalentin/margolariak/SponsorActivity.java
  29. 12 9
      app/src/main/java/com/ivalentin/margolariak/UsActivity.java
  30. 0 14
      app/src/main/res/drawable/album.xml
  31. BIN
      app/src/main/res/drawable/divider.png
  32. BIN
      app/src/main/res/drawable/ic_launcher_old.png
  33. BIN
      app/src/main/res/drawable/menu.png
  34. BIN
      app/src/main/res/drawable/photo_placeholder.png
  35. 0 15
      app/src/main/res/drawable/row_home_image.xml
  36. 0 18
      app/src/main/res/drawable/titlebar.xml
  37. BIN
      app/src/main/res/drawable/tutorial_point.png
  38. BIN
      app/src/main/res/drawable/tutorial_slide.png
  39. 1 14
      app/src/main/res/layout/activity_main.xml
  40. 0 6
      app/src/main/res/layout/activity_settings.xml
  41. 0 3
      app/src/main/res/layout/activity_sponsor.xml
  42. 0 3
      app/src/main/res/layout/activity_us.xml
  43. 0 4
      app/src/main/res/layout/dialog_changelog.xml
  44. 0 2
      app/src/main/res/layout/dialog_notification.xml
  45. 1 8
      app/src/main/res/layout/dialog_schedule.xml
  46. 0 50
      app/src/main/res/layout/dialog_settings.xml
  47. 13 13
      app/src/main/res/layout/dialog_sponsor.xml
  48. 0 2
      app/src/main/res/layout/dialog_sync.xml
  49. 0 2
      app/src/main/res/layout/dialog_sync_failed.xml
  50. 4 8
      app/src/main/res/layout/dialog_us.xml
  51. 0 4
      app/src/main/res/layout/fragment_layout_activities.xml
  52. 0 2
      app/src/main/res/layout/fragment_layout_activity_future.xml
  53. 0 2
      app/src/main/res/layout/fragment_layout_activity_past.xml
  54. 0 2
      app/src/main/res/layout/fragment_layout_album.xml
  55. 0 2
      app/src/main/res/layout/fragment_layout_blog.xml
  56. 0 2
      app/src/main/res/layout/fragment_layout_gallery.xml
  57. 726 747
      app/src/main/res/layout/fragment_layout_home.xml
  58. 1 8
      app/src/main/res/layout/fragment_layout_lablanca.xml
  59. 9 36
      app/src/main/res/layout/fragment_layout_lablanca_nofestivals.xml
  60. 1 3
      app/src/main/res/layout/fragment_layout_location.xml
  61. 0 2
      app/src/main/res/layout/fragment_layout_photo.xml
  62. 0 2
      app/src/main/res/layout/fragment_layout_post.xml
  63. 2 7
      app/src/main/res/layout/fragment_layout_schedule.xml
  64. 0 149
      app/src/main/res/layout/fragment_layout_settings.xml
  65. 8 9
      app/src/main/res/layout/row_activity_future.xml
  66. 4 2
      app/src/main/res/layout/row_activity_past.xml
  67. 0 4
      app/src/main/res/layout/row_album.xml
  68. 0 1
      app/src/main/res/layout/row_comment.xml
  69. 0 1
      app/src/main/res/layout/row_festival_price_day.xml
  70. 0 1
      app/src/main/res/layout/row_festival_price_pack.xml
  71. 0 5
      app/src/main/res/layout/row_gallery.xml
  72. 7 6
      app/src/main/res/layout/row_home_activities.xml
  73. 3 1
      app/src/main/res/layout/row_home_blog.xml
  74. 1 6
      app/src/main/res/layout/row_home_schedule.xml
  75. 0 2
      app/src/main/res/layout/row_schedule.xml
  76. 11 43
      app/src/main/res/values-en/strings.xml
  77. 9 37
      app/src/main/res/values-eu-rES/strings.xml
  78. 0 4
      app/src/main/res/values-v14/styles.xml
  79. 0 10
      app/src/main/res/values-v21/styles.xml
  80. 0 5
      app/src/main/res/values-v24/styles.xml
  81. 14 48
      app/src/main/res/values/strings.xml
  82. 0 38
      app/src/main/res/xml/preferences.xml
  83. 1 1
      build/intermediates/dex-cache/cache.xml

+ 8 - 8
app/src/main/AndroidManifest.xml

@@ -24,13 +24,13 @@
         android:allowBackup="true"
         android:icon="@drawable/ic_launcher"
         android:label="@string/app_name"
-        android:theme="@style/Theme.AppBaseTheme"
+        android:theme="@style/AppTheme"
         android:supportsRtl="true"
         android:isGame="false"
         android:fullBackupContent="@xml/backup"
         android:hardwareAccelerated="true"
         android:allowClearUserData="true"
-        tools:ignore="UnusedAttribute"
+        tools:ignore="GoogleAppIndexingWarning,UnusedAttribute"
         android:name="android.support.multidex.MultiDexApplication">
 
         <activity
@@ -42,7 +42,7 @@
             
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
-				<category android:name="android.intent.category.LAUNCHER" />
+                <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
         </activity>
 
@@ -62,11 +62,11 @@
         
         <receiver
             android:name="com.ivalentin.margolariak.BootReceiver"
-			android:enabled="false">
-		    <intent-filter>
-		        <action android:name="android.intent.action.BOOT_COMPLETED"></action>
-		    </intent-filter>
-		</receiver>
+            android:enabled="false">
+            <intent-filter>
+                <action android:name="android.intent.action.BOOT_COMPLETED"/>
+            </intent-filter>
+        </receiver>
     </application>
 
 </manifest>

+ 11 - 33
app/src/main/java/com/ivalentin/margolariak/ActivityFutureLayout.java

@@ -1,17 +1,13 @@
 package com.ivalentin.margolariak;
 
-import android.annotation.SuppressLint;
 import android.app.Dialog;
 import android.app.Fragment;
-import android.content.DialogInterface;
-import android.content.pm.PackageManager;
 import android.content.Intent;
 import android.database.Cursor;
 import android.database.sqlite.SQLiteDatabase;
 import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
 import android.graphics.drawable.Drawable;
-import android.os.Build;
 import android.os.Bundle;
 import android.util.Log;
 import android.view.Gravity;
@@ -32,8 +28,6 @@ import android.net.Uri;
 import java.io.File;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
 import java.util.Locale;
 import java.util.ArrayList;
 
@@ -58,16 +52,11 @@ import org.osmdroid.views.overlay.Polyline;
  */
 public class ActivityFutureLayout extends Fragment {
 
-	private final Bundle bund = null;
-	private View v;
-
-	@SuppressWarnings("ResultOfMethodCallIgnored")
-	@SuppressLint("InflateParams")
 	@Override
 	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
 
 		//Load the layout
-		View view = inflater.inflate(R.layout.fragment_layout_activity_future, null);
+		View view = inflater.inflate(R.layout.fragment_layout_activity_future, container, false);
 
 		//Get bundled id
 		Bundle bundle = this.getArguments();
@@ -103,12 +92,8 @@ public class ActivityFutureLayout extends Fragment {
 		tvTitle.setText(cursor.getString(1));
 		((MainActivity) getActivity()).setSectionTitle(cursor.getString(1));
 		((MainActivity) getActivity()).setShareLink(String.format(getString(R.string.share_with_title), cursor.getString(1)), GM.SHARE.ACTIVITIES + cursor.getString(6));
-		if (Build.VERSION.SDK_INT >= 19) {
-			wvText.setLayerType(View.LAYER_TYPE_HARDWARE, null);
-		}
-		else {
-			wvText.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
-		}
+		wvText.setLayerType(View.LAYER_TYPE_HARDWARE, null);
+
 		wvText.loadDataWithBaseURL(null, cursor.getString(2), "text/html", "utf-8", null);
 		//wvText.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
 		tvDate.setText(GM.formatDate(cursor.getString(3) + " 00:00:00", lang, true, false, false));
@@ -154,9 +139,10 @@ public class ActivityFutureLayout extends Fragment {
 			LinearLayout list = (LinearLayout) view.findViewById(R.id.ll_activity_future_schedule_list);
 			LinearLayout entry;
 			LayoutInflater factory = LayoutInflater.from(getActivity());
+
 			while (cursorItinerary.moveToNext()) {
 				//Create a new row
-				entry = (LinearLayout) factory.inflate(R.layout.row_activity_schedule, null);
+				entry = (LinearLayout) factory.inflate(R.layout.row_activity_schedule, list, false);
 
 				//Set time
 				TextView tvSchTime = (TextView) entry.findViewById(R.id.tv_row_activity_itinerary_time);
@@ -210,7 +196,6 @@ public class ActivityFutureLayout extends Fragment {
 		cursorItinerary.close();
 		db.close();
 
-		v = view;
 		return view;
 	}
 
@@ -231,7 +216,6 @@ public class ActivityFutureLayout extends Fragment {
 
 		//Date formatters
 		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US);
-		SimpleDateFormat dayFormat = new SimpleDateFormat("yyyy-MM-dd-", Locale.US);
 		SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm", Locale.US);
 
 		//Set the custom dialog components - text, image, buttons, map
@@ -316,7 +300,7 @@ public class ActivityFutureLayout extends Fragment {
 
 					// Read from route_point and draw the route on the map.
 					Cursor pointCursor = db.rawQuery("SELECT lat_o, lon_o, lat_d, lon_d FROM route_point WHERE route = " + routeId + " ORDER BY part;", null);
-					final ArrayList<GeoPoint> points = new ArrayList<GeoPoint>();
+					final ArrayList<GeoPoint> points = new ArrayList<>();
 					GeoPoint lastPoint = new GeoPoint(0.0, 0.0);
 					while (pointCursor.moveToNext()){
 
@@ -331,10 +315,11 @@ public class ActivityFutureLayout extends Fragment {
 					//Create path
 					Polyline line = new Polyline();
 					line.setPoints(points);
-					line.setColor(getResources().getColor(R.color.background_menu));
+					line.setColor(getResources().getColor(R.color.background_menu, null));
 					mapView.getOverlays().add(line);
 
 				}
+				routeCursor.close();
 
 			}
 			else{
@@ -348,11 +333,11 @@ public class ActivityFutureLayout extends Fragment {
 					GeoPoint center = new GeoPoint(placeCursor.getDouble(2), placeCursor.getDouble(3));
 					mapController.setCenter(center);
 					OverlayItem locationOverlayItem = new OverlayItem(title, placeCursor.getString(0), center);
-					Drawable locationMarker = this.getResources().getDrawable(R.drawable.pinpoint);
+					Drawable locationMarker = this.getResources().getDrawable(R.drawable.pinpoint, null);
 					locationOverlayItem.setMarker(locationMarker);
-					final ArrayList<OverlayItem> items = new ArrayList<OverlayItem>();
+					final ArrayList<OverlayItem> items = new ArrayList<>();
 					items.add(locationOverlayItem);
-					ItemizedIconOverlay locationOverlay = new ItemizedIconOverlay<OverlayItem>(items,
+					ItemizedIconOverlay locationOverlay = new ItemizedIconOverlay<>(items,
 							new ItemizedIconOverlay.OnItemGestureListener<OverlayItem>() {
 								public boolean onItemSingleTapUp(final int index, final OverlayItem item) {
 									return true;
@@ -415,11 +400,4 @@ public class ActivityFutureLayout extends Fragment {
 		super.onResume();
 	}
 
-	/**
-	 * Checks app permission to access the user location.
-	 * @return true if the permission has been granted, false otherwise.
-	 */
-	private boolean checkLocationPermission(){
-		return getContext().checkSelfPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED && getContext().checkSelfPermission(android.Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED;
-	}
 }

+ 228 - 237
app/src/main/java/com/ivalentin/margolariak/ActivityLayout.java

@@ -1,7 +1,6 @@
 package com.ivalentin.margolariak;
 
 
-import android.annotation.SuppressLint;
 import android.database.Cursor;
 import android.database.sqlite.SQLiteDatabase;
 import android.graphics.Bitmap;
@@ -11,7 +10,6 @@ import android.app.Fragment;
 import android.app.FragmentManager;
 import android.app.FragmentTransaction;
 import android.text.Html;
-import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -29,241 +27,234 @@ import java.io.File;
  * @see Fragment
  *
  */
-@SuppressLint("ResultOfMethodCallIgnored")
 public class ActivityLayout extends Fragment{
 
-    /**
-     * Run when the fragment is inflated.
-     * Assigns views, gets the date and does the first call to the {@link #populate} function.
-     *
-     * @param inflater A LayoutInflater to manage views
-     * @param container The container View
-     * @param savedInstanceState Bundle containing the state
-     *
-     * @return The fragment view
-     *
-     * @see android.support.v4.app.Fragment#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)
-     */
-    @SuppressLint("InflateParams") //Throws unknown error when done properly.
-    @Override
-    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
-
-        //Load the layout
-        View view = inflater.inflate(R.layout.fragment_layout_activities, null);
-
-        //Set the title
-        ((MainActivity) getActivity()).setSectionTitle(view.getContext().getString(R.string.menu_activities));
-
-        populate(view);
-        return view;
-    }
-
-    /**
-     * Populates the list of activities.
-     * It uses the default layout as parent.
-     */
-    @SuppressWarnings("ResultOfMethodCallIgnored")
-    @SuppressLint("InflateParams") //Throws unknown error when done properly.
-    private void populate(View view){
-        LinearLayout llListFuture = (LinearLayout) view.findViewById(R.id.ll_activities_future_list);
-        LinearLayout llListPast = (LinearLayout) view.findViewById(R.id.ll_activities_past_list);
-        LinearLayout entry;
-
-        //An inflater
-        LayoutInflater factory = LayoutInflater.from(getActivity());
-
-        SQLiteDatabase db = SQLiteDatabase.openDatabase(getActivity().getDatabasePath(GM.DB.NAME).getAbsolutePath(), null, SQLiteDatabase.NO_LOCALIZED_COLLATORS | SQLiteDatabase.OPEN_READONLY);
-        final Cursor cursor;
-        String lang = GM.getLang();
-
-        //Get data from the database of the future activities
-        cursor = db.rawQuery("SELECT id, date, city, title_" + lang+ " AS title, text_" + lang + " AS text, price FROM activity WHERE date >= date('now') ORDER BY date DESC;", null);
-        if (cursor.getCount() > 0) {
-            TextView tvNoFuture = (TextView) view.findViewById(R.id.tv_activities_no_future);
-            tvNoFuture.setVisibility(View.GONE);
-
-            //Print rows
-            while (cursor.moveToNext()) {
-                //Create a new row
-                entry = (LinearLayout) factory.inflate(R.layout.row_activity_future, null);
-
-                //Set margins TODO: I dont know why it doesnt read margins from the xml
-                LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
-                int margin = (int) (9 * getActivity().getResources().getDisplayMetrics().density);
-                layoutParams.setMargins(margin, margin, margin, margin);
-                entry.setLayoutParams(layoutParams);
-
-                //Set title
-                TextView tvTitle = (TextView) entry.findViewById(R.id.tv_row_activity_future_title);
-                tvTitle.setText(cursor.getString(3));
-
-                //Set city
-                TextView tvCity = (TextView) entry.findViewById(R.id.tv_row_activity_future_city);
-                tvCity.setText(cursor.getString(2));
-
-                //Set price
-                TextView tvPrice = (TextView) entry.findViewById(R.id.tv_row_activity_future_price);
-                tvPrice.setText(String.format(getString(R.string.price), cursor.getInt(5)));
-
-                //Set text
-                String text = Html.fromHtml(cursor.getString(4)).toString();
-                TextView tvText = (TextView) entry.findViewById(R.id.tv_row_activity_future_text);
-                tvText.setText(text);
-
-                //Set date
-                TextView tvDate = (TextView) entry.findViewById(R.id.tv_row_activity_future_date);
-                tvDate.setText(GM.formatDate(cursor.getString(1) + " 00:00:00", lang, true, false, false));
-
-                //Set hidden id
-                TextView tvId = (TextView) entry.findViewById(R.id.tv_row_activity_future_hidden);
-                tvId.setText(cursor.getString(0));
-
-                //Get image
-                ImageView iv = (ImageView) entry.findViewById(R.id.iv_row_activity_future);
-                Cursor cursorImage = db.rawQuery("SELECT image FROM activity_image WHERE activity = " + cursor.getString(0) + " ORDER BY idx LIMIT 1;", null);
-                if (cursorImage.getCount() > 0) {
-                    cursorImage.moveToFirst();
-                    String image = cursorImage.getString(0);
-
-                    //Check if image exists
-                    File f;
-                    f = new File(this.getActivity().getFilesDir().toString() + "/img/actividades/miniature/" + image);
-                    if (f.exists()) {
-                        //If the image exists, set it.
-                        Bitmap myBitmap = BitmapFactory.decodeFile(this.getActivity().getFilesDir().toString() + "/img/actividades/miniature/" + image);
-                        iv.setImageBitmap(myBitmap);
-                    } else {
-                        //If not, create directories and download asynchronously
-                        File fpath;
-                        fpath = new File(this.getActivity().getFilesDir().toString() + "/img/actividades/miniature/");
-                        fpath.mkdirs();
-                        new DownloadImage(GM.API.SERVER + "/img/actividades/miniature/" + image, this.getActivity().getFilesDir().toString() + "/img/actividades/miniature/" + image, iv, GM.IMG.SIZE.MINIATURE).execute();
-                    }
-                }
-                cursorImage.close();
-
-                //Set onCLickListener
-                entry.setOnClickListener(new View.OnClickListener() {
-                    @Override
-                    public void onClick(View v) {
-                        //Toast.makeText(getActivity(), "OPENING POST", Toast.LENGTH_LONG).show();
-                        Fragment fragment = new ActivityFutureLayout();
-                        Bundle bundle = new Bundle();
-                        //Pass post id
-                        int id = Integer.parseInt(((TextView) v.findViewById(R.id.tv_row_activity_future_hidden)).getText().toString());
-                        bundle.putInt("activity", id);
-                        fragment.setArguments(bundle);
-
-                        FragmentManager fm = ActivityLayout.this.getActivity().getFragmentManager();
-                        FragmentTransaction ft = fm.beginTransaction();
-
-                        ft.replace(R.id.activity_main_content_fragment, fragment);
-                        ft.addToBackStack("activity_" + id);
-                        ft.commit();
-                    }
-                });
-
-                //Add to the list
-                llListFuture.addView(entry);
-            }
-            cursor.close();
-
-        }
-
-        //Get data from the database of the past activities
-        Cursor cursorPast = db.rawQuery("SELECT id, date, city, title_" + lang + " AS title, text_" + lang + " AS text, after_" + lang + " AS after FROM activity WHERE date < date('now') ORDER BY date DESC;", null);
-
-
-        //Print rows
-        while (cursorPast.moveToNext()) {
-            //Create a new row
-            entry = (LinearLayout) factory.inflate(R.layout.row_activity_past, null);
-
-            //Set margins TODO: I dont know why it doesnt read margins from the xml
-            LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
-            int margin = (int) (9 * getActivity().getResources().getDisplayMetrics().density);
-            layoutParams.setMargins(margin, margin, margin, margin);
-            entry.setLayoutParams(layoutParams);
-
-            //Set title
-            TextView tvTitle = (TextView) entry.findViewById(R.id.tv_row_activity_past_title);
-            tvTitle.setText(cursorPast.getString(3));
-
-            //Set text
-            String text;
-            if (cursorPast.getString(5) == null){
-                text = Html.fromHtml(cursorPast.getString(4)).toString();
-            }
-            else {
-                if (cursorPast.getString(5) == null || cursorPast.getString(5).length() < 1) {
-                    text = Html.fromHtml(cursorPast.getString(4)).toString();
-                } else {
-                    text = Html.fromHtml(cursorPast.getString(5)).toString();
-                }
-            }
-            TextView tvText = (TextView) entry.findViewById(R.id.tv_row_activity_past_text);
-            tvText.setText(text);
-
-            //Set date
-            TextView tvDate = (TextView) entry.findViewById(R.id.tv_row_activity_past_date);
-            tvDate.setText(GM.formatDate(cursorPast.getString(1) + " 00:00:00", lang, true, true, false));
-
-            //Set hidden id
-            TextView tvId = (TextView) entry.findViewById(R.id.tv_row_activity_past_hidden);
-            tvId.setText(cursorPast.getString(0));
-
-            //Get image
-            ImageView iv = (ImageView) entry.findViewById(R.id.iv_row_activity_past);
-            Cursor cursorImage = db.rawQuery("SELECT image FROM activity_image WHERE activity = " + cursorPast.getString(0) + " ORDER BY idx LIMIT 1;", null);
-            if (cursorImage.getCount() > 0) {
-                cursorImage.moveToFirst();
-                String image = cursorImage.getString(0);
-
-                //Check if image exists
-                File f;
-                f = new File(this.getActivity().getFilesDir().toString() + "/img/actividades/miniature/" + image);
-                if (f.exists()) {
-                    //If the image exists, set it.
-                    Bitmap myBitmap = BitmapFactory.decodeFile(this.getActivity().getFilesDir().toString() + "/img/actividades/miniature/" + image);
-                    iv.setImageBitmap(myBitmap);
-                } else {
-                    //If not, create directories and download asynchronously
-                    File fpath;
-                    fpath = new File(this.getActivity().getFilesDir().toString() + "/img/actividades/miniature/");
-                    fpath.mkdirs();
-                    new DownloadImage(GM.API.SERVER + "/img/actividades/miniature/" + image, this.getActivity().getFilesDir().toString() + "/img/actividades/miniature/" + image, iv, GM.IMG.SIZE.MINIATURE).execute();
-                }
-            }
-            cursorImage.close();
-
-            //Set onCLickListener
-            entry.setOnClickListener(new View.OnClickListener() {
-                @Override
-                public void onClick(View v) {
-                //Toast.makeText(getActivity(), "OPENING POST", Toast.LENGTH_LONG).show();
-                Fragment fragment = new ActivityPastLayout();
-                Bundle bundle = new Bundle();
-                //Pass post id
-                int id = Integer.parseInt(((TextView) v.findViewById(R.id.tv_row_activity_past_hidden)).getText().toString());
-                bundle.putInt("activity", id);
-                fragment.setArguments(bundle);
-
-                FragmentManager fm = ActivityLayout.this.getActivity().getFragmentManager();
-                FragmentTransaction ft = fm.beginTransaction();
-
-                ft.replace(R.id.activity_main_content_fragment, fragment);
-                ft.addToBackStack("activity_" + id);
-                ft.commit();
-                }
-            });
-
-            //Add to the list
-            llListPast.addView(entry);
-        }
-        cursorPast.close();
-        db.close();
-
-
-
-    }
+	/**
+	 * Run when the fragment is inflated.
+	 * Assigns views, gets the date and does the first call to the {@link #populate} function.
+	 *
+	 * @param inflater A LayoutInflater to manage views
+	 * @param container The container View
+	 * @param savedInstanceState Bundle containing the state
+	 *
+	 * @return The fragment view
+	 *
+	 * @see Fragment#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)
+	 */
+	@Override
+	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+
+		//Load the layout
+		View view = inflater.inflate(R.layout.fragment_layout_activities, container, false);
+
+		//Set the title
+		((MainActivity) getActivity()).setSectionTitle(view.getContext().getString(R.string.menu_activities));
+
+		populate(view);
+		return view;
+	}
+
+	/**
+	 * Populates the list of activities.
+	 * It uses the default layout as parent.
+	 */
+	private void populate(View view){
+		LinearLayout llListFuture = (LinearLayout) view.findViewById(R.id.ll_activities_future_list);
+		LinearLayout llListPast = (LinearLayout) view.findViewById(R.id.ll_activities_past_list);
+		LinearLayout entry;
+
+		//An inflater
+		LayoutInflater factory = LayoutInflater.from(getActivity());
+
+		SQLiteDatabase db = SQLiteDatabase.openDatabase(getActivity().getDatabasePath(GM.DB.NAME).getAbsolutePath(), null, SQLiteDatabase.NO_LOCALIZED_COLLATORS | SQLiteDatabase.OPEN_READONLY);
+		final Cursor cursor;
+		String lang = GM.getLang();
+
+		//Get data from the database of the future activities
+		cursor = db.rawQuery("SELECT id, date, city, title_" + lang+ " AS title, text_" + lang + " AS text, price FROM activity WHERE date >= date('now') ORDER BY date DESC;", null);
+		if (cursor.getCount() > 0) {
+			TextView tvNoFuture = (TextView) view.findViewById(R.id.tv_activities_no_future);
+			tvNoFuture.setVisibility(View.GONE);
+
+			//Print rows
+			while (cursor.moveToNext()) {
+				//Create a new row
+				entry = (LinearLayout) factory.inflate(R.layout.row_activity_future, llListFuture, false);
+
+				//Set margins
+				LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
+				int margin = (int) (9 * getActivity().getResources().getDisplayMetrics().density);
+				layoutParams.setMargins(margin, margin, margin, margin);
+				entry.setLayoutParams(layoutParams);
+
+				//Set title
+				TextView tvTitle = (TextView) entry.findViewById(R.id.tv_row_activity_future_title);
+				tvTitle.setText(cursor.getString(3));
+
+				//Set city
+				TextView tvCity = (TextView) entry.findViewById(R.id.tv_row_activity_future_city);
+				tvCity.setText(cursor.getString(2));
+
+				//Set price
+				TextView tvPrice = (TextView) entry.findViewById(R.id.tv_row_activity_future_price);
+				tvPrice.setText(String.format(getString(R.string.price), cursor.getInt(5)));
+
+				//Set text
+				String text = Html.fromHtml(cursor.getString(4)).toString();
+				TextView tvText = (TextView) entry.findViewById(R.id.tv_row_activity_future_text);
+				tvText.setText(text);
+
+				//Set date
+				TextView tvDate = (TextView) entry.findViewById(R.id.tv_row_activity_future_date);
+				tvDate.setText(GM.formatDate(cursor.getString(1) + " 00:00:00", lang, true, false, false));
+
+				//Set hidden id
+				TextView tvId = (TextView) entry.findViewById(R.id.tv_row_activity_future_hidden);
+				tvId.setText(cursor.getString(0));
+
+				//Get image
+				ImageView iv = (ImageView) entry.findViewById(R.id.iv_row_activity_future);
+				Cursor cursorImage = db.rawQuery("SELECT image FROM activity_image WHERE activity = " + cursor.getString(0) + " ORDER BY idx LIMIT 1;", null);
+				if (cursorImage.getCount() > 0) {
+					cursorImage.moveToFirst();
+					String image = cursorImage.getString(0);
+
+					//Check if image exists
+					File f;
+					f = new File(this.getActivity().getFilesDir().toString() + "/img/actividades/miniature/" + image);
+					if (f.exists()) {
+						//If the image exists, set it.
+						Bitmap myBitmap = BitmapFactory.decodeFile(this.getActivity().getFilesDir().toString() + "/img/actividades/miniature/" + image);
+						iv.setImageBitmap(myBitmap);
+					} else {
+						//If not, create directories and download asynchronously
+						File fpath;
+						fpath = new File(this.getActivity().getFilesDir().toString() + "/img/actividades/miniature/");
+						if (fpath.mkdirs()) {
+							new DownloadImage(GM.API.SERVER + "/img/actividades/miniature/" + image, this.getActivity().getFilesDir().toString() + "/img/actividades/miniature/" + image, iv, GM.IMG.SIZE.MINIATURE).execute();
+						}
+					}
+				}
+				cursorImage.close();
+
+				//Set onCLickListener
+				entry.setOnClickListener(new View.OnClickListener() {
+					@Override
+					public void onClick(View v) {
+						//Toast.makeText(getActivity(), "OPENING POST", Toast.LENGTH_LONG).show();
+						Fragment fragment = new ActivityFutureLayout();
+						Bundle bundle = new Bundle();
+						//Pass post id
+						int id = Integer.parseInt(((TextView) v.findViewById(R.id.tv_row_activity_future_hidden)).getText().toString());
+						bundle.putInt("activity", id);
+						fragment.setArguments(bundle);
+
+						FragmentManager fm = ActivityLayout.this.getActivity().getFragmentManager();
+						FragmentTransaction ft = fm.beginTransaction();
+
+						ft.replace(R.id.activity_main_content_fragment, fragment);
+						ft.addToBackStack("activity_" + id);
+						ft.commit();
+					}
+				});
+
+				llListFuture.addView(entry);
+			}
+			cursor.close();
+
+		}
+
+		//Get data from the database of the past activities
+		Cursor cursorPast = db.rawQuery("SELECT id, date, city, title_" + lang + " AS title, text_" + lang + " AS text, after_" + lang + " AS after FROM activity WHERE date < date('now') ORDER BY date DESC;", null);
+
+
+		//Print rows
+		while (cursorPast.moveToNext()) {
+			//Create a new row
+			entry = (LinearLayout) factory.inflate(R.layout.row_activity_past, llListPast, false);
+
+			//Set margins
+			LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
+			int margin = (int) (9 * getActivity().getResources().getDisplayMetrics().density);
+			layoutParams.setMargins(margin, margin, margin, margin);
+			entry.setLayoutParams(layoutParams);
+
+			//Set title
+			TextView tvTitle = (TextView) entry.findViewById(R.id.tv_row_activity_past_title);
+			tvTitle.setText(cursorPast.getString(3));
+
+			//Set text
+			String text;
+			if (cursorPast.getString(5) == null){
+				text = Html.fromHtml(cursorPast.getString(4)).toString();
+			}
+			else {
+				if (cursorPast.getString(5) == null || cursorPast.getString(5).length() < 1) {
+					text = Html.fromHtml(cursorPast.getString(4)).toString();
+				} else {
+					text = Html.fromHtml(cursorPast.getString(5)).toString();
+				}
+			}
+			TextView tvText = (TextView) entry.findViewById(R.id.tv_row_activity_past_text);
+			tvText.setText(text);
+
+			//Set date
+			TextView tvDate = (TextView) entry.findViewById(R.id.tv_row_activity_past_date);
+			tvDate.setText(GM.formatDate(cursorPast.getString(1) + " 00:00:00", lang, true, true, false));
+
+			//Set hidden id
+			TextView tvId = (TextView) entry.findViewById(R.id.tv_row_activity_past_hidden);
+			tvId.setText(cursorPast.getString(0));
+
+			//Get image
+			ImageView iv = (ImageView) entry.findViewById(R.id.iv_row_activity_past);
+			Cursor cursorImage = db.rawQuery("SELECT image FROM activity_image WHERE activity = " + cursorPast.getString(0) + " ORDER BY idx LIMIT 1;", null);
+			if (cursorImage.getCount() > 0) {
+				cursorImage.moveToFirst();
+				String image = cursorImage.getString(0);
+
+				//Check if image exists
+				File f;
+				f = new File(this.getActivity().getFilesDir().toString() + "/img/actividades/miniature/" + image);
+				if (f.exists()) {
+					//If the image exists, set it.
+					Bitmap myBitmap = BitmapFactory.decodeFile(this.getActivity().getFilesDir().toString() + "/img/actividades/miniature/" + image);
+					iv.setImageBitmap(myBitmap);
+				} else {
+					//If not, create directories and download asynchronously
+					File fpath;
+					fpath = new File(this.getActivity().getFilesDir().toString() + "/img/actividades/miniature/");
+					if (fpath.mkdirs()) {
+						new DownloadImage(GM.API.SERVER + "/img/actividades/miniature/" + image, this.getActivity().getFilesDir().toString() + "/img/actividades/miniature/" + image, iv, GM.IMG.SIZE.MINIATURE).execute();
+					}
+				}
+			}
+			cursorImage.close();
+
+			//Set onCLickListener
+			entry.setOnClickListener(new View.OnClickListener() {
+				@Override
+				public void onClick(View v) {
+				//Toast.makeText(getActivity(), "OPENING POST", Toast.LENGTH_LONG).show();
+				Fragment fragment = new ActivityPastLayout();
+				Bundle bundle = new Bundle();
+				//Pass post id
+				int id = Integer.parseInt(((TextView) v.findViewById(R.id.tv_row_activity_past_hidden)).getText().toString());
+				bundle.putInt("activity", id);
+				fragment.setArguments(bundle);
+
+				FragmentManager fm = ActivityLayout.this.getActivity().getFragmentManager();
+				FragmentTransaction ft = fm.beginTransaction();
+
+				ft.replace(R.id.activity_main_content_fragment, fragment);
+				ft.addToBackStack("activity_" + id);
+				ft.commit();
+				}
+			});
+
+			llListPast.addView(entry);
+		}
+		cursorPast.close();
+		db.close();
+	}
 }

+ 71 - 78
app/src/main/java/com/ivalentin/margolariak/ActivityPastLayout.java

@@ -1,11 +1,9 @@
 package com.ivalentin.margolariak;
 
-import android.annotation.SuppressLint;
 import android.database.Cursor;
 import android.database.sqlite.SQLiteDatabase;
 import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
-import android.os.Build;
 import android.os.Bundle;
 import android.app.Fragment;
 import android.util.Log;
@@ -27,91 +25,86 @@ import java.io.File;
  * @see Fragment
  *
  */
-
 public class ActivityPastLayout extends Fragment {
 
-	@SuppressWarnings("ResultOfMethodCallIgnored")
-    @SuppressLint("InflateParams")
-    @Override
-    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
 
-        //Load the layout
-        View view = inflater.inflate(R.layout.fragment_layout_activity_past, null);
+	@Override
+	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+
+		//Load the layout
+		View view = inflater.inflate(R.layout.fragment_layout_activity_past, container, false);
+
+		//Get bundled id
+		Bundle bundle = this.getArguments();
+		int id = bundle.getInt("activity", -1);
+		if (id == -1){
+			Log.e("ACTIVITY_PAST_LAYOUT", "No such activity: " + id);
+			this.getActivity().onBackPressed();
+		}
 
-        //Get bundled id
-        Bundle bundle = this.getArguments();
-        int id = bundle.getInt("activity", -1);
-        if (id == -1){
-            Log.e("Activity error", "No such activity: " + id);
-            this.getActivity().onBackPressed();
-        }
+		//Get data from database
+		SQLiteDatabase db = SQLiteDatabase.openDatabase(getActivity().getDatabasePath(GM.DB.NAME).getAbsolutePath(), null, SQLiteDatabase.NO_LOCALIZED_COLLATORS | SQLiteDatabase.OPEN_READONLY);
+		final Cursor cursor;
+		String lang = GM.getLang();
+		cursor = db.rawQuery("SELECT id, title_" + lang+ " AS title, text_" + lang + " AS text, date, city, after_" + lang + " AS after, permalink FROM activity WHERE id = " + id + ";", null);
+		cursor.moveToFirst();
 
-        //Get data from database
-        SQLiteDatabase db = SQLiteDatabase.openDatabase(getActivity().getDatabasePath(GM.DB.NAME).getAbsolutePath(), null, SQLiteDatabase.NO_LOCALIZED_COLLATORS | SQLiteDatabase.OPEN_READONLY);
-        final Cursor cursor;
-        String lang = GM.getLang();
-        cursor = db.rawQuery("SELECT id, title_" + lang+ " AS title, text_" + lang + " AS text, date, city, after_" + lang + " AS after, permalink FROM activity WHERE id = " + id + ";", null);
-        cursor.moveToFirst();
+		//Get display elements
+		ImageView images[] = new ImageView[5];
+		images[0] = (ImageView) view.findViewById(R.id.iv_activity_past_0);
+		images[1] = (ImageView) view.findViewById(R.id.iv_activity_past_1);
+		images[2] = (ImageView) view.findViewById(R.id.iv_activity_past_2);
+		images[3] = (ImageView) view.findViewById(R.id.iv_activity_past_3);
+		images[4] = (ImageView) view.findViewById(R.id.iv_activity_past_4);
 
-        //Get display elements
-        ImageView images[] = new ImageView[5];
-        images[0] = (ImageView) view.findViewById(R.id.iv_activity_past_0);
-        images[1] = (ImageView) view.findViewById(R.id.iv_activity_past_1);
-        images[2] = (ImageView) view.findViewById(R.id.iv_activity_past_2);
-        images[3] = (ImageView) view.findViewById(R.id.iv_activity_past_3);
-        images[4] = (ImageView) view.findViewById(R.id.iv_activity_past_4);
+		TextView tvTitle = (TextView) view.findViewById(R.id.tv_activity_past_title);
+		TextView tvDate = (TextView) view.findViewById(R.id.tv_activity_past_date);
+		TextView tvCity = (TextView) view.findViewById(R.id.tv_activity_past_city);
+		WebView wvText = (WebView) view.findViewById(R.id.wv_activity_past_text);
+		wvText.setLayerType(View.LAYER_TYPE_HARDWARE, null);
 
-        TextView tvTitle = (TextView) view.findViewById(R.id.tv_activity_past_title);
-        TextView tvDate = (TextView) view.findViewById(R.id.tv_activity_past_date);
-        TextView tvCity = (TextView) view.findViewById(R.id.tv_activity_past_city);
-        WebView wvText = (WebView) view.findViewById(R.id.wv_activity_past_text);
-        if (Build.VERSION.SDK_INT >= 19) {
-            wvText.setLayerType(View.LAYER_TYPE_HARDWARE, null);
-        }
-        else {
-            wvText.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
-        }
 
-        //Set fields
-        tvTitle.setText(cursor.getString(1));
-        ((MainActivity) getActivity()).setSectionTitle(cursor.getString(1));
-        ((MainActivity) getActivity()).setShareLink(String.format(getString(R.string.share_with_title), cursor.getString(1)), GM.SHARE.ACTIVITIES + cursor.getString(6));
-        if (cursor.getString(5) == null || cursor.getString(5).length() < 1) {
-            wvText.loadDataWithBaseURL(null, cursor.getString(2), "text/html", "utf-8", null);
-        } else {
-            wvText.loadDataWithBaseURL(null, cursor.getString(5), "text/html", "utf-8", null);
-        }
-        tvDate.setText(GM.formatDate(cursor.getString(3) + " 00:00:00", lang, true, true, false));
-        tvCity.setText(cursor.getString(4));
+		//Set fields
+		tvTitle.setText(cursor.getString(1));
+		((MainActivity) getActivity()).setSectionTitle(cursor.getString(1));
+		((MainActivity) getActivity()).setShareLink(String.format(getString(R.string.share_with_title), cursor.getString(1)), GM.SHARE.ACTIVITIES + cursor.getString(6));
+		if (cursor.getString(5) == null || cursor.getString(5).length() < 1) {
+			wvText.loadDataWithBaseURL(null, cursor.getString(2), "text/html", "utf-8", null);
+		} else {
+			wvText.loadDataWithBaseURL(null, cursor.getString(5), "text/html", "utf-8", null);
+		}
+		tvDate.setText(GM.formatDate(cursor.getString(3) + " 00:00:00", lang, true, true, false));
+		tvCity.setText(cursor.getString(4));
 
-        //Get images
-        Cursor imageCursor = db.rawQuery("SELECT image, idx FROM activity_image WHERE activity = " + id + " ORDER BY idx LIMIT 5;", null);
-        int i = 0;
-        while (imageCursor.moveToNext()) {
-            String image = imageCursor.getString(0);
+		//Get images
+		Cursor imageCursor = db.rawQuery("SELECT image, idx FROM activity_image WHERE activity = " + id + " ORDER BY idx LIMIT 5;", null);
+		int i = 0;
+		while (imageCursor.moveToNext()) {
+			String image = imageCursor.getString(0);
 
-            //Check if image exists
-            File f;
-            f = new File(this.getActivity().getFilesDir().toString() + "/img/actividades/preview/" + image);
-            if (f.exists()){
-                //If the image exists, set it.
-                Bitmap myBitmap = BitmapFactory.decodeFile(this.getActivity().getFilesDir().toString() + "/img/actividades/preview/" + image);
-                images[i].setImageBitmap(myBitmap);
-            }
-            else {
-                //If not, create directories and download asynchronously
-                File fpath;
-                fpath = new File(this.getActivity().getFilesDir().toString() + "/img/actividades/preview/");
-                fpath.mkdirs();
-                new DownloadImage(GM.API.SERVER + "/img/actividades/preview/" + image, this.getActivity().getFilesDir().toString() + "/img/actividades/preview/" + image, images[i], GM.IMG.SIZE.PREVIEW).execute();
-             }
-            images[i].setVisibility(View.VISIBLE);
-            i ++;
-        }
-        imageCursor.close();
+			//Check if image exists
+			File f;
+			f = new File(this.getActivity().getFilesDir().toString() + "/img/actividades/preview/" + image);
+			if (f.exists()){
+				//If the image exists, set it.
+				Bitmap myBitmap = BitmapFactory.decodeFile(this.getActivity().getFilesDir().toString() + "/img/actividades/preview/" + image);
+				images[i].setImageBitmap(myBitmap);
+			}
+			else {
+				//If not, create directories and download asynchronously
+				File fpath;
+				fpath = new File(this.getActivity().getFilesDir().toString() + "/img/actividades/preview/");
+				if(fpath.mkdirs()) {
+					new DownloadImage(GM.API.SERVER + "/img/actividades/preview/" + image, this.getActivity().getFilesDir().toString() + "/img/actividades/preview/" + image, images[i], GM.IMG.SIZE.PREVIEW).execute();
+				}
+			 }
+			images[i].setVisibility(View.VISIBLE);
+			i ++;
+		}
+		imageCursor.close();
 
-        cursor.close();
-        db.close();
-        return view;
-    }
+		cursor.close();
+		db.close();
+		return view;
+	}
 }

+ 3 - 3
app/src/main/java/com/ivalentin/margolariak/AlarmReceiver.java

@@ -181,10 +181,10 @@ public class AlarmReceiver extends BroadcastReceiver {
 
 			}
 			catch(NumberFormatException ex) {
-				Log.e("NOTIFICATION", "Error parsing remote file: " + ex.toString());
+				Log.e("ALARM_RECEIVER", "Notification: Error parsing remote file: " + ex.toString());
 			}
 			catch (Exception ex){
-				Log.e("NOTIFICATION", "Error fetching notifications: " + ex.toString());
+				Log.e("ALARM_RECEIVER", "Notification: Error fetching notifications: " + ex.toString());
 			}
     	}
 
@@ -198,7 +198,7 @@ public class AlarmReceiver extends BroadcastReceiver {
 		 * @param in String to be decoded.
 		 * @return Decoded string.
 		 */
-		static final String decode(final String in){
+		static String decode(final String in){
 			String working = in;
 			int index = working.indexOf("\\u");
 			while(index > -1){

+ 92 - 99
app/src/main/java/com/ivalentin/margolariak/AlbumLayout.java

@@ -1,9 +1,7 @@
 package com.ivalentin.margolariak;
 
-import android.annotation.SuppressLint;
 import android.database.Cursor;
 import android.database.sqlite.SQLiteDatabase;
-import android.os.Build;
 import android.os.Bundle;
 import android.app.Fragment;
 import android.app.FragmentManager;
@@ -32,73 +30,66 @@ import java.io.File;
  */
 public class AlbumLayout extends Fragment {
 
-	@SuppressWarnings("ResultOfMethodCallIgnored")
-    @SuppressLint("InflateParams") //Throws unknown error when done properly.
-    @Override
-    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+	@Override
+	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
 
-        //Load the layout
-        View view = inflater.inflate(R.layout.fragment_layout_album, null);
+		//Load the layout
+		View view = inflater.inflate(R.layout.fragment_layout_album, container, false);
 
-        //Get bundled id
-        Bundle bundle = this.getArguments();
-        int id = bundle.getInt("album", -1);
-        if (id == -1){
-			Log.e("Album error", "No such album: " + id);
+		//Get bundled id
+		Bundle bundle = this.getArguments();
+		int id = bundle.getInt("album", -1);
+		if (id == -1){
+			Log.e("ALBUM_LAYOUT", "No such album: " + id);
 			this.getActivity().onBackPressed();
-        }
+		}
 
-        //Get data from database
-        SQLiteDatabase db = SQLiteDatabase.openDatabase(getActivity().getDatabasePath(GM.DB.NAME).getAbsolutePath(), null, SQLiteDatabase.NO_LOCALIZED_COLLATORS | SQLiteDatabase.OPEN_READONLY);
-        final Cursor cursor;
+		//Get data from database
+		SQLiteDatabase db = SQLiteDatabase.openDatabase(getActivity().getDatabasePath(GM.DB.NAME).getAbsolutePath(), null, SQLiteDatabase.NO_LOCALIZED_COLLATORS | SQLiteDatabase.OPEN_READONLY);
+		final Cursor cursor;
 		String lang = GM.getLang();
-        cursor = db.rawQuery("SELECT id, title_" + lang + " AS title, description_" + lang + " AS description, permalink FROM album WHERE id = " + id + ";", null);
-        cursor.moveToFirst();
+		cursor = db.rawQuery("SELECT id, title_" + lang + " AS title, description_" + lang + " AS description, permalink FROM album WHERE id = " + id + ";", null);
+		cursor.moveToFirst();
 
-        //Set album elements
-        TextView tvTitle = (TextView) view.findViewById(R.id.tv_album_title);
-        WebView tvDescription = (WebView) view.findViewById(R.id.wv_album_description);
+		//Set album elements
+		TextView tvTitle = (TextView) view.findViewById(R.id.tv_album_title);
+		WebView tvDescription = (WebView) view.findViewById(R.id.wv_album_description);
 
-		if (Build.VERSION.SDK_INT >= 19) {
-			tvDescription.setLayerType(View.LAYER_TYPE_HARDWARE, null);
-		}
-		else {
-			tvDescription.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
-		}
+		tvDescription.setLayerType(View.LAYER_TYPE_HARDWARE, null);
 
-        tvTitle.setText(cursor.getString(1));
+		tvTitle.setText(cursor.getString(1));
 		((MainActivity) getActivity()).setSectionTitle(cursor.getString(1));
 		((MainActivity) getActivity()).setShareLink(String.format(getString(R.string.share_with_title), cursor.getString(1)), GM.SHARE.GALLERY + cursor.getString(3));
 
 		final String albumName = cursor.getString(1);
 		final String albumPerm = cursor.getString(3);
-        if (cursor.getString(2) == null || cursor.getString(2).length() < 1){
-            tvDescription.setVisibility(View.GONE);
-        }
-        else {
-            tvDescription.loadDataWithBaseURL(null, cursor.getString(2), "text/html", "utf-8", null);
-        }
+		if (cursor.getString(2) == null || cursor.getString(2).length() < 1){
+			tvDescription.setVisibility(View.GONE);
+		}
+		else {
+			tvDescription.loadDataWithBaseURL(null, cursor.getString(2), "text/html", "utf-8", null);
+		}
 		cursor.close();
 
 
-        //Assign elements
-        LinearLayout llList = (LinearLayout) view.findViewById(R.id.ll_album_list);
-        LinearLayout entry;
+		//Assign elements
+		LinearLayout llList = (LinearLayout) view.findViewById(R.id.ll_album_list);
+		LinearLayout entry;
 
-        //An inflater
-        LayoutInflater factory = LayoutInflater.from(getActivity());
+		//An inflater
+		LayoutInflater factory = LayoutInflater.from(getActivity());
 
-        String image;
-        Cursor imageCursor = db.rawQuery("SELECT id, title_" + lang + " AS title, file, width, height FROM photo, photo_album WHERE photo = id AND album = " + id + " ORDER BY uploaded DESC;", null);
-        while (imageCursor.moveToNext()){
-            //Create a new row
-            entry = (LinearLayout) factory.inflate(R.layout.row_album, null);
+		String image;
+		Cursor imageCursor = db.rawQuery("SELECT id, title_" + lang + " AS title, file, width, height FROM photo, photo_album WHERE photo = id AND album = " + id + " ORDER BY uploaded DESC;", null);
+		while (imageCursor.moveToNext()){
+			//Create a new row
+			entry = (LinearLayout) factory.inflate(R.layout.row_album, llList, false);
 
 			//Set left and right layouts
 			LinearLayout left = (LinearLayout) entry.findViewById(R.id.ll_row_album_left);
 
-            //Set title
-            TextView tvTitleLeft = (TextView) entry.findViewById(R.id.tv_row_album_title_left);
+			//Set title
+			TextView tvTitleLeft = (TextView) entry.findViewById(R.id.tv_row_album_title_left);
 
 			if (imageCursor.getString(1) != null && imageCursor.getString(1).length() > 0) {
 				tvTitleLeft.setText(imageCursor.getString(1));
@@ -107,19 +98,19 @@ public class AlbumLayout extends Fragment {
 				tvTitleLeft.setVisibility(View.GONE);
 			}
 
-            //Set id
-            TextView tvHiddenLeft = (TextView) entry.findViewById(R.id.tv_row_album_hidden_left);
-            tvHiddenLeft.setText(imageCursor.getString(0));
+			//Set id
+			TextView tvHiddenLeft = (TextView) entry.findViewById(R.id.tv_row_album_hidden_left);
+			tvHiddenLeft.setText(imageCursor.getString(0));
 
-            //Set image
-            ImageView ivLeft = (ImageView) entry.findViewById(R.id.iv_row_album_left);
-            image = imageCursor.getString(2);
+			//Set image
+			ImageView ivLeft = (ImageView) entry.findViewById(R.id.iv_row_album_left);
+			image = imageCursor.getString(2);
 
-            //Check if image exists
-            File f;
-            f = new File(this.getActivity().getFilesDir().toString() + "/img/galeria/preview/" + image);
-            if (f.exists()){
-                //If the image exists, set it.
+			//Check if image exists
+			File f;
+			f = new File(this.getActivity().getFilesDir().toString() + "/img/galeria/preview/" + image);
+			if (f.exists()){
+				//If the image exists, set it.
 				try{
 					File file = new File(this.getActivity().getFilesDir().toString() + "/img/galeria/preview/" + image);
 					ivLeft.setImageBitmap(GM.decodeSampledBitmapFromFile(file.getAbsolutePath(), GM.IMG.SIZE.PREVIEW));
@@ -127,14 +118,15 @@ public class AlbumLayout extends Fragment {
 				catch (Exception ex){
 					Log.e("Bitmap error", "Not loading image " + image + ": " + ex.toString());
 				}
-            }
-            else {
-                //If not, create directories and download asynchronously
-                File fpath;
-                fpath = new File(this.getActivity().getFilesDir().toString() + "/img/galeria/preview/");
-                fpath.mkdirs();
-				new DownloadImage(GM.API.SERVER + "/img/galeria/preview/" + image, this.getActivity().getFilesDir().toString() + "/img/galeria/preview/" + image, ivLeft, GM.IMG.SIZE.PREVIEW).execute();
-            }
+			}
+			else {
+				//If not, create directories and download asynchronously
+				File fpath;
+				fpath = new File(this.getActivity().getFilesDir().toString() + "/img/galeria/preview/");
+				if (fpath.mkdirs()) {
+					new DownloadImage(GM.API.SERVER + "/img/galeria/preview/" + image, this.getActivity().getFilesDir().toString() + "/img/galeria/preview/" + image, ivLeft, GM.IMG.SIZE.PREVIEW).execute();
+				}
+			}
 
 			//Count comments
 			Cursor cursorComments = db.rawQuery("SELECT id FROM photo_comment WHERE photo = " + imageCursor.getString(0) + ";", null);
@@ -164,15 +156,15 @@ public class AlbumLayout extends Fragment {
 				ft.commit();
 				}
 			});
-            
-            //If odd pass, to the right line
-            if (imageCursor.moveToNext()){
+			
+			//If odd pass, to the right line
+			if (imageCursor.moveToNext()){
 
-                LinearLayout right = (LinearLayout) entry.findViewById(R.id.ll_row_album_right);
-                right.setVisibility(View.VISIBLE);
+				LinearLayout right = (LinearLayout) entry.findViewById(R.id.ll_row_album_right);
+				right.setVisibility(View.VISIBLE);
 
-                //Set title
-                TextView tvTitleRight = (TextView) entry.findViewById(R.id.tv_row_album_title_right);
+				//Set title
+				TextView tvTitleRight = (TextView) entry.findViewById(R.id.tv_row_album_title_right);
 				if (imageCursor.getString(1) != null && imageCursor.getString(1).length() > 0) {
 					tvTitleRight.setText(imageCursor.getString(1));
 				}
@@ -180,17 +172,17 @@ public class AlbumLayout extends Fragment {
 					tvTitleRight.setVisibility(View.GONE);
 				}
 
-                //Set id
-                TextView tvHiddenRight = (TextView) entry.findViewById(R.id.tv_row_album_hidden_right);
-                tvHiddenRight.setText(imageCursor.getString(0));
-
-                //Set image
-                ImageView ivRight = (ImageView) entry.findViewById(R.id.iv_row_album_right);
-                image = imageCursor.getString(2);
-                //Check if image exists
-                f = new File(this.getActivity().getFilesDir().toString() + "/img/galeria/preview/" + image);
-                if (f.exists()){
-                    //If the image exists, set it.
+				//Set id
+				TextView tvHiddenRight = (TextView) entry.findViewById(R.id.tv_row_album_hidden_right);
+				tvHiddenRight.setText(imageCursor.getString(0));
+
+				//Set image
+				ImageView ivRight = (ImageView) entry.findViewById(R.id.iv_row_album_right);
+				image = imageCursor.getString(2);
+				//Check if image exists
+				f = new File(this.getActivity().getFilesDir().toString() + "/img/galeria/preview/" + image);
+				if (f.exists()){
+					//If the image exists, set it.
 					try {
 						File file = new File(this.getActivity().getFilesDir().toString() + "/img/galeria/preview/" + image);
 						ivRight.setImageBitmap(GM.decodeSampledBitmapFromFile(file.getAbsolutePath(), GM.IMG.SIZE.PREVIEW));
@@ -198,14 +190,15 @@ public class AlbumLayout extends Fragment {
 					catch (Exception ex){
 						Log.e("Bitmap error", "Not loading image " + image + ": " + ex.toString());
 					}
-                }
-                else {
-                    //If not, create directories and download asynchronously
-                    File fpath;
-                    fpath = new File(this.getActivity().getFilesDir().toString() + "/img/galeria/preview/");
-                    fpath.mkdirs();
-					new DownloadImage(GM.API.SERVER + "/img/galeria/preview/" + image, this.getActivity().getFilesDir().toString() + "/img/galeria/preview/" + image, ivRight, GM.IMG.SIZE.PREVIEW).execute();
-                }
+				}
+				else {
+					//If not, create directories and download asynchronously
+					File fpath;
+					fpath = new File(this.getActivity().getFilesDir().toString() + "/img/galeria/preview/");
+					if (fpath.mkdirs()) {
+						new DownloadImage(GM.API.SERVER + "/img/galeria/preview/" + image, this.getActivity().getFilesDir().toString() + "/img/galeria/preview/" + image, ivRight, GM.IMG.SIZE.PREVIEW).execute();
+					}
+				}
 
 				//Count comments
 				cursorComments = db.rawQuery("SELECT id FROM photo_comment WHERE photo = " + imageCursor.getString(0) + ";", null);
@@ -233,13 +226,13 @@ public class AlbumLayout extends Fragment {
 					ft.commit();
 					}
 				});
-            }
+			}
 
-            llList.addView(entry);
-        }
+			llList.addView(entry);
+		}
 
-        imageCursor.close();
-        db.close();
-        return view;
-    }
+		imageCursor.close();
+		db.close();
+		return view;
+	}
 }

+ 209 - 215
app/src/main/java/com/ivalentin/margolariak/BlogLayout.java

@@ -1,7 +1,6 @@
 package com.ivalentin.margolariak;
 
 
-import android.annotation.SuppressLint;
 import android.database.Cursor;
 import android.database.sqlite.SQLiteDatabase;
 import android.graphics.Bitmap;
@@ -31,218 +30,213 @@ import java.io.File;
  */
 public class BlogLayout extends Fragment{
 
-    //Main View
-    private View view;
-
-    private int offset = 0;
-    private int totalPost = 0;
-
-    /**
-     * Run when the fragment is inflated.
-     * Assigns views, gets the date and does the first call to the {@link #populate} function.
-     *
-     * @param inflater A LayoutInflater to manage views
-     * @param container The container View
-     * @param savedInstanceState Bundle containing the state
-     *
-     * @return The fragment view
-     *
-     * @see android.support.v4.app.Fragment#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)
-     */
-    @SuppressLint("InflateParams")
-    @Override
-    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
-
-        //Load the layout
-        view = inflater.inflate(R.layout.fragment_layout_blog, null);
-
-        //Set the title
-        ((MainActivity) getActivity()).setSectionTitle(view.getContext().getString(R.string.menu_blog));
-
-        //Get total posts
-        SQLiteDatabase db = SQLiteDatabase.openDatabase(getActivity().getDatabasePath(GM.DB.NAME).getAbsolutePath(), null, SQLiteDatabase.NO_LOCALIZED_COLLATORS | SQLiteDatabase.OPEN_READONLY);
-        Cursor cursor = db.rawQuery("SELECT id FROM post;", null);
-        totalPost = cursor.getCount();
-        cursor.close();
-        db.close();
-
-        //Assign pager buttons
-        final Button btnPrevious = (Button) view.findViewById(R.id.bt_blog_previous);
-        final Button btnNext = (Button) view.findViewById(R.id.bt_blog_next);
-
-        btnPrevious.setOnClickListener(new View.OnClickListener() {
-           @Override
-           public void onClick(View v) {
-               offset -= 5;
-               btnNext.setVisibility(View.VISIBLE);
-               populate(offset);
-               if (offset == 0){
-                   v.setVisibility(View.INVISIBLE);
-               }
-           }
-        });
-
-        btnNext.setOnClickListener(new View.OnClickListener() {
-           @Override
-           public void onClick(View v) {
-               offset += 5;
-               btnPrevious.setVisibility(View.VISIBLE);
-               populate(offset);
-               if (offset >= totalPost - 5){
-                   v.setVisibility(View.INVISIBLE);
-               }
-           }
-        });
-
-        populate(offset);
-
-        return view;
-    }
-
-    /**
-     * Called when the fragment is brought back into the foreground.
-     * Shows or hides the pager buttons.
-     *
-     * @see android.app.Fragment#onResume()
-     */
-    @Override
-    @SuppressLint("InflateParams")
-    @SuppressWarnings("ResultOfMethodCallIgnored")
-    public void onResume(){
-        //Assign pager buttons
-        Button btnPrevious = (Button) view.findViewById(R.id.bt_blog_previous);
-        Button btnNext = (Button) view.findViewById(R.id.bt_blog_next);
-        if (offset == 0){
-            btnPrevious.setVisibility(View.INVISIBLE);
-        }
-        else{
-            btnPrevious.setVisibility(View.VISIBLE);
-        }
-        if (offset >= totalPost - 5){
-            btnNext.setVisibility(View.INVISIBLE);
-        }
-        else{
-            btnNext.setVisibility(View.VISIBLE);
-        }
-        super.onResume();
-    }
-
-    /**
-     * Populates the list of activities around.
-     * It uses the default layout as parent.
-     */
-    @SuppressLint("InflateParams")
-    @SuppressWarnings("ResultOfMethodCallIgnored")
-    private void populate(int offset){
-
-        //Assign elements
-        LinearLayout llList = (LinearLayout) view.findViewById(R.id.ll_blog_list);
-        LinearLayout entry;
-
-        //An inflater
-        LayoutInflater factory = LayoutInflater.from(getActivity());
-
-        SQLiteDatabase db = SQLiteDatabase.openDatabase(getActivity().getDatabasePath(GM.DB.NAME).getAbsolutePath(), null, SQLiteDatabase.NO_LOCALIZED_COLLATORS | SQLiteDatabase.OPEN_READONLY);
-        final Cursor cursor;
-        String lang = GM.getLang();
-
-        //Get data from the database
-        cursor = db.rawQuery("SELECT id, title_" + lang+ " AS title, text_" + lang + " AS text, dtime FROM post ORDER BY dtime DESC LIMIT 5 OFFSET " + offset + ";", null);
-
-        //Clear the list
-        llList.removeAllViews();
-
-        //Loop
-        while (cursor.moveToNext()){
-
-            //Create a new row
-            entry = (LinearLayout) factory.inflate(R.layout.row_blog, null);
-
-            //Set margins TODO: I dont know why it doesnt read margins from the xml
-            LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
-            int margin = (int) (9 * getActivity().getResources().getDisplayMetrics().density);
-            layoutParams.setMargins(margin, margin, margin, margin);
-            entry.setLayoutParams(layoutParams);
-
-            //Set title
-            TextView tvTitle = (TextView) entry.findViewById(R.id.tv_row_blog_title);
-            tvTitle.setText(cursor.getString(1));
-
-            //Set text
-            String text = Html.fromHtml(cursor.getString(2)).toString();
-            TextView tvText = (TextView) entry.findViewById(R.id.tv_row_blog_text);
-            tvText.setText(text);
-
-            //Set date
-            TextView tvDate = (TextView) entry.findViewById(R.id.tv_row_blog_date);
-            tvDate.setText(GM.formatDate(cursor.getString(3), lang, true, true, false));
-
-            //Set hidden id
-            TextView tvId = (TextView) entry.findViewById(R.id.tv_row_blog_hidden);
-            tvId.setText(cursor.getString(0));
-
-            //Get image
-            ImageView iv = (ImageView) entry.findViewById(R.id.iv_row_blog_image);
-            Cursor cursorImage = db.rawQuery("SELECT image FROM post_image WHERE post = " + cursor.getString(0) +" ORDER BY idx LIMIT 1;", null);
-            if (cursorImage.getCount() > 0){
-                cursorImage.moveToFirst();
-                String image = cursorImage.getString(0);
-
-                //Check if image exists
-                File f;
-                f = new File(this.getActivity().getFilesDir().toString() + "/img/blog/miniature/" + image);
-                if (f.exists()){
-                    //If the image exists, set it.
-                    Bitmap myBitmap = BitmapFactory.decodeFile(this.getActivity().getFilesDir().toString() + "/img/blog/miniature/" + image);
-                    iv.setImageBitmap(myBitmap);
-                }
-                else {
-                    //If not, create directories and download asynchronously
-                    File fpath;
-                    fpath = new File(this.getActivity().getFilesDir().toString() + "/img/blog/miniature/");
-                    fpath.mkdirs();
-                    new DownloadImage(GM.API.SERVER + "/img/blog/miniature/" + image, this.getActivity().getFilesDir().toString() + "/img/blog/miniature/" + image, iv, GM.IMG.SIZE.MINIATURE).execute();
-                }
-            }
-            else{
-                iv.setVisibility(View.GONE);
-            }
-            cursorImage.close();
-
-            //Count comments
-            Cursor cursorComment = db.rawQuery("SELECT * FROM post_comment WHERE post = " + cursor.getString(0) +";", null);
-            TextView tvDetails = (TextView) entry.findViewById(R.id.tv_row_blog_details);
-            tvDetails.setText(String.valueOf(cursorComment.getCount()));
-            cursorComment.close();
-
-            //Set onCLickListener
-            entry.setOnClickListener(new View.OnClickListener(){
-                @Override
-                public void onClick(View v) {
-                //Toast.makeText(getActivity(), "OPENING POST", Toast.LENGTH_LONG).show();
-                Fragment fragment = new PostLayout();
-                Bundle bundle = new Bundle();
-                //Pass post id
-                int id = Integer.parseInt(((TextView) v.findViewById(R.id.tv_row_blog_hidden)).getText().toString());
-                bundle.putInt("post", id);
-                fragment.setArguments(bundle);
-
-                FragmentManager fm = BlogLayout.this.getActivity().getFragmentManager();
-                FragmentTransaction ft = fm.beginTransaction();
-
-                ft.replace(R.id.activity_main_content_fragment, fragment);
-                ft.addToBackStack("post_" + id);
-                ft.commit();
-                }
-            });
-
-            //Add to the list
-            llList.addView(entry);
-        }
-
-        //Close the database
-        cursor.close();
-        db.close();
-
-    }
+	//Main View
+	private View view;
+
+	private int offset = 0;
+	private int totalPost = 0;
+
+	/**
+	 * Run when the fragment is inflated.
+	 * Assigns views, gets the date and does the first call to the {@link #populate} function.
+	 *
+	 * @param inflater A LayoutInflater to manage views
+	 * @param container The container View
+	 * @param savedInstanceState Bundle containing the state
+	 *
+	 * @return The fragment view
+	 *
+	 * @see Fragment#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)
+	 */
+	@Override
+	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+
+		//Load the layout
+		view = inflater.inflate(R.layout.fragment_layout_blog, container, false);
+
+		//Set the title
+		((MainActivity) getActivity()).setSectionTitle(view.getContext().getString(R.string.menu_blog));
+
+		//Get total posts
+		SQLiteDatabase db = SQLiteDatabase.openDatabase(getActivity().getDatabasePath(GM.DB.NAME).getAbsolutePath(), null, SQLiteDatabase.NO_LOCALIZED_COLLATORS | SQLiteDatabase.OPEN_READONLY);
+		Cursor cursor = db.rawQuery("SELECT id FROM post;", null);
+		totalPost = cursor.getCount();
+		cursor.close();
+		db.close();
+
+		//Assign pager buttons
+		final Button btnPrevious = (Button) view.findViewById(R.id.bt_blog_previous);
+		final Button btnNext = (Button) view.findViewById(R.id.bt_blog_next);
+
+		btnPrevious.setOnClickListener(new View.OnClickListener() {
+		   @Override
+		   public void onClick(View v) {
+			   offset -= 5;
+			   btnNext.setVisibility(View.VISIBLE);
+			   populate(offset);
+			   if (offset == 0){
+				   v.setVisibility(View.INVISIBLE);
+			   }
+		   }
+		});
+
+		btnNext.setOnClickListener(new View.OnClickListener() {
+		   @Override
+		   public void onClick(View v) {
+			   offset += 5;
+			   btnPrevious.setVisibility(View.VISIBLE);
+			   populate(offset);
+			   if (offset >= totalPost - 5){
+				   v.setVisibility(View.INVISIBLE);
+			   }
+		   }
+		});
+
+		populate(offset);
+
+		return view;
+	}
+
+	/**
+	 * Called when the fragment is brought back into the foreground.
+	 * Shows or hides the pager buttons.
+	 *
+	 * @see android.app.Fragment#onResume()
+	 */
+	@Override
+	public void onResume(){
+		//Assign pager buttons
+		Button btnPrevious = (Button) view.findViewById(R.id.bt_blog_previous);
+		Button btnNext = (Button) view.findViewById(R.id.bt_blog_next);
+		if (offset == 0){
+			btnPrevious.setVisibility(View.INVISIBLE);
+		}
+		else{
+			btnPrevious.setVisibility(View.VISIBLE);
+		}
+		if (offset >= totalPost - 5){
+			btnNext.setVisibility(View.INVISIBLE);
+		}
+		else{
+			btnNext.setVisibility(View.VISIBLE);
+		}
+		super.onResume();
+	}
+
+	/**
+	 * Populates the list of activities around.
+	 * It uses the default layout as parent.
+	 */
+	private void populate(int offset){
+
+		//Assign elements
+		LinearLayout llList = (LinearLayout) view.findViewById(R.id.ll_blog_list);
+		LinearLayout entry;
+
+		//An inflater
+		LayoutInflater factory = LayoutInflater.from(getActivity());
+
+		SQLiteDatabase db = SQLiteDatabase.openDatabase(getActivity().getDatabasePath(GM.DB.NAME).getAbsolutePath(), null, SQLiteDatabase.NO_LOCALIZED_COLLATORS | SQLiteDatabase.OPEN_READONLY);
+		final Cursor cursor;
+		String lang = GM.getLang();
+
+		//Get data from the database
+		cursor = db.rawQuery("SELECT id, title_" + lang+ " AS title, text_" + lang + " AS text, dtime FROM post ORDER BY dtime DESC LIMIT 5 OFFSET " + offset + ";", null);
+
+		//Clear the list
+		llList.removeAllViews();
+
+		//Loop
+		while (cursor.moveToNext()){
+
+			//Create a new row
+			entry = (LinearLayout) factory.inflate(R.layout.row_blog, llList, false);
+
+			//Set margins
+			LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
+			int margin = (int) (9 * getActivity().getResources().getDisplayMetrics().density);
+			layoutParams.setMargins(margin, margin, margin, margin);
+			entry.setLayoutParams(layoutParams);
+
+			//Set title
+			TextView tvTitle = (TextView) entry.findViewById(R.id.tv_row_blog_title);
+			tvTitle.setText(cursor.getString(1));
+
+			//Set text
+			String text = Html.fromHtml(cursor.getString(2)).toString();
+			TextView tvText = (TextView) entry.findViewById(R.id.tv_row_blog_text);
+			tvText.setText(text);
+
+			//Set date
+			TextView tvDate = (TextView) entry.findViewById(R.id.tv_row_blog_date);
+			tvDate.setText(GM.formatDate(cursor.getString(3), lang, true, true, false));
+
+			//Set hidden id
+			TextView tvId = (TextView) entry.findViewById(R.id.tv_row_blog_hidden);
+			tvId.setText(cursor.getString(0));
+
+			//Get image
+			ImageView iv = (ImageView) entry.findViewById(R.id.iv_row_blog_image);
+			Cursor cursorImage = db.rawQuery("SELECT image FROM post_image WHERE post = " + cursor.getString(0) +" ORDER BY idx LIMIT 1;", null);
+			if (cursorImage.getCount() > 0){
+				cursorImage.moveToFirst();
+				String image = cursorImage.getString(0);
+
+				//Check if image exists
+				File f;
+				f = new File(this.getActivity().getFilesDir().toString() + "/img/blog/miniature/" + image);
+				if (f.exists()){
+					//If the image exists, set it.
+					Bitmap myBitmap = BitmapFactory.decodeFile(this.getActivity().getFilesDir().toString() + "/img/blog/miniature/" + image);
+					iv.setImageBitmap(myBitmap);
+				}
+				else {
+					//If not, create directories and download asynchronously
+					File fpath;
+					fpath = new File(this.getActivity().getFilesDir().toString() + "/img/blog/miniature/");
+					if (fpath.mkdirs()) {
+						new DownloadImage(GM.API.SERVER + "/img/blog/miniature/" + image, this.getActivity().getFilesDir().toString() + "/img/blog/miniature/" + image, iv, GM.IMG.SIZE.MINIATURE).execute();
+					}
+				}
+			}
+			else{
+				iv.setVisibility(View.GONE);
+			}
+			cursorImage.close();
+
+			//Count comments
+			Cursor cursorComment = db.rawQuery("SELECT * FROM post_comment WHERE post = " + cursor.getString(0) +";", null);
+			TextView tvDetails = (TextView) entry.findViewById(R.id.tv_row_blog_details);
+			tvDetails.setText(String.valueOf(cursorComment.getCount()));
+			cursorComment.close();
+
+			//Set onCLickListener
+			entry.setOnClickListener(new View.OnClickListener(){
+				@Override
+				public void onClick(View v) {
+				//Toast.makeText(getActivity(), "OPENING POST", Toast.LENGTH_LONG).show();
+				Fragment fragment = new PostLayout();
+				Bundle bundle = new Bundle();
+				//Pass post id
+				int id = Integer.parseInt(((TextView) v.findViewById(R.id.tv_row_blog_hidden)).getText().toString());
+				bundle.putInt("post", id);
+				fragment.setArguments(bundle);
+
+				FragmentManager fm = BlogLayout.this.getActivity().getFragmentManager();
+				FragmentTransaction ft = fm.beginTransaction();
+
+				ft.replace(R.id.activity_main_content_fragment, fragment);
+				ft.addToBackStack("post_" + id);
+				ft.commit();
+				}
+			});
+
+			llList.addView(entry);
+		}
+
+		//Close the database
+		cursor.close();
+		db.close();
+
+	}
 }

+ 1 - 1
app/src/main/java/com/ivalentin/margolariak/BootReceiver.java

@@ -7,7 +7,7 @@ import android.content.Intent;
 /**
  * Broadcast receiver that receives the BOOT_COMPLETED event and sets an alarm.
  * 
- * @see @android.content.BroadCastReceiver
+ * @see BroadcastReceiver
  * 
  * @author Iñigo Valentin
  *

+ 28 - 27
app/src/main/java/com/ivalentin/margolariak/CustomScrollView.java

@@ -1,6 +1,5 @@
 package com.ivalentin.margolariak;
 
-import android.annotation.SuppressLint;
 import android.content.Context;
 import android.util.AttributeSet;
 import android.view.MotionEvent;
@@ -16,37 +15,40 @@ import android.widget.ScrollView;
  *
  */
 public class CustomScrollView extends ScrollView{
-	
+
 	/**
-     * Constructor.
-     * 
-     * @param context The context of the app or Activity.
-     */
+	 * Constructor.
+	 * 
+	 * @param context The context of the app or Activity.
+	 */
 	public CustomScrollView(Context context) {
 		super(context);
 	}
-	
+
+
 	/**
-     * Constructor.
-     * 
-     * @param context The context of the app or Activity.
-     * @param attrs Attributes.
-     */
+	 * Constructor.
+	 * 
+	 * @param context The context of the app or Activity.
+	 * @param attrs Attributes.
+	 */
 	public CustomScrollView(Context context, AttributeSet attrs) {
-        super(context, attrs);
-    }
+		super(context, attrs);
+	}
+
+
+	/**
+	 * Constructor.
+	 * 
+	 * @param context The context of the app or Activity.
+	 * @param attrs Attributes.
+	 * @param defStyle Default style.
+	 */
+	public CustomScrollView(Context context, AttributeSet attrs, int defStyle) {
+		super(context, attrs, defStyle);
+	}
+
 
-    /**
-     * Constructor.
-     * 
-     * @param context The context of the app or Activity.
-     * @param attrs Attributes.
-     * @param defStyle Default style.
-     */
-    public CustomScrollView(Context context, AttributeSet attrs, int defStyle) {
-        super(context, attrs, defStyle);
-    }
-	
 	/**
 	 * Overrides the default onTouchListener. 
 	 * 
@@ -59,9 +61,8 @@ public class CustomScrollView extends ScrollView{
 	 * 
 	 * @return True if the app handles the motion (i.e. to slide), false otherwise (normal event)
 	 */
-	@SuppressLint("ClickableViewAccessibility") //Disturbs the sliding process
 	@Override
-    public boolean onTouchEvent(MotionEvent ev) {
+	public boolean onTouchEvent(MotionEvent ev) {
 		int width = this.getWidth();
 		super.onTouchEvent(ev);
 		return ev.getX() >= (float) width / 10;

+ 1 - 1
app/src/main/java/com/ivalentin/margolariak/Distance.java

@@ -22,7 +22,7 @@ final class Distance {
 	 *
 	 * @return The distance between the points
 	 */
-	public static double calculateDistance(double lat1, double lon1, double lat2, double lon2) {
+	static double calculateDistance(double lat1, double lon1, double lat2, double lon2) {
 		double theta = lon1 - lon2;
 		double dist = Math.sin(deg2rad(lat1)) * Math.sin(deg2rad(lat2)) + Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) * Math.cos(deg2rad(theta));
 		dist = Math.acos(dist);

+ 46 - 45
app/src/main/java/com/ivalentin/margolariak/DownloadImage.java

@@ -22,11 +22,12 @@ import java.net.URLConnection;
  */
 class DownloadImage extends AsyncTask<Void, Void, Void> {
 
-    private final String file;
-    private final String path;
-    private final ImageView iv;
+	private final String file;
+	private final String path;
+	private final ImageView iv;
 	private final int size;
 
+
 	/**
 	 * Constructor.
 	 *
@@ -37,63 +38,63 @@ class DownloadImage extends AsyncTask<Void, Void, Void> {
 	 *
 	 * @see android.widget.ImageView
 	 */
-    public DownloadImage(String file, String path, ImageView iv, int size) {
-        super();
-        this.file = file;
-        this.path = path;
-        this.iv = iv;
+	public DownloadImage(String file, String path, ImageView iv, int size) {
+		super();
+		this.file = file;
+		this.path = path;
+		this.iv = iv;
 		this.size = size;
-    }
+	}
 
-    /**
-     * Downloading file in background thread.
-	 */
-    @Override
-    protected Void doInBackground(Void... v) {
-        int count;
-        try {
 
-            URL url = new URL(file);
+	/**
+	 * Downloading file in background thread.
+	 */
+	@Override
+	protected Void doInBackground(Void... v) {
+		int count;
+		try {
 
-            URLConnection conection = url.openConnection();
-            conection.connect();
+			URL url = new URL(file);
 
-            // input stream to read file - with 8k buffer
-            InputStream input = new BufferedInputStream(url.openStream(), 8192);
+			URLConnection conection = url.openConnection();
+			conection.connect();
 
-            // Output stream to write file
-            OutputStream output = new FileOutputStream(path);
-            byte data[] = new byte[1024];
+			// input stream to read file - with 8k buffer
+			InputStream input = new BufferedInputStream(url.openStream(), 8192);
 
-            while ((count = input.read(data)) != -1) {
+			// Output stream to write file
+			OutputStream output = new FileOutputStream(path);
+			byte data[] = new byte[1024];
 
-                // writing data to file
-                output.write(data, 0, count);
+			while ((count = input.read(data)) != -1) {
 
-            }
+				// writing data to file
+				output.write(data, 0, count);
 
-            // flushing output
-            output.flush();
+			}
 
-            // closing streams
-            output.close();
-            input.close();
+			// flushing output
+			output.flush();
 
-        } catch (Exception e) {
-            Log.e("Error downloading: ", e.getMessage());
-        }
+			// closing streams
+			output.close();
+			input.close();
 
-        return null;
-    }
+		} catch (Exception e) {
+			Log.e("Error downloading: ", e.getMessage());
+		}
 
+		return null;
+	}
 
 
-    /**
-     * After completing background task, set the image on the ImageView.
-     */
-    @Override
-    protected void onPostExecute(Void v) {
-        Log.d("File downloaded", path);
+	/**
+	 * After completing background task, set the image on the ImageView.
+	 */
+	@Override
+	protected void onPostExecute(Void v) {
+		Log.d("File downloaded", path);
 		try {
 			File file = new File(path);
 			iv.setImageBitmap(GM.decodeSampledBitmapFromFile(file.getAbsolutePath(), size));
@@ -102,6 +103,6 @@ class DownloadImage extends AsyncTask<Void, Void, Void> {
 		catch(Exception ex){
 			Log.e("Bitmap error", "Not loading image " + path + ": " + ex.toString());
 		}
-    }
+	}
 
 }

+ 8 - 6
app/src/main/java/com/ivalentin/margolariak/FetchURL.java

@@ -17,24 +17,26 @@ class FetchURL {
 	//List of strings that will contain the output, line by line
 	private List<String> output;
 	private String url;
-  
+
+
 	/**
 	 * Constructor.
 	 */
-	public FetchURL(){
+	FetchURL(){
 		output = new ArrayList<>();
 	}
-  
+
+
 	/**
 	 * Returns the content of the fetched page.
 	 * 
 	 * @return A List of strings containing the lines of the web page.
 	 */
-	public List<String> getOutput(){
+	List<String> getOutput(){
 		return output;
 	}
-  
-		
+
+
 	/**
 	 * Actually fetches the web page.
 	 * 

+ 58 - 7
app/src/main/java/com/ivalentin/margolariak/GM.java

@@ -1035,7 +1035,7 @@ final class GM {
 		}
 
 		/**
-		 * Utilities for the COMMENT V3 API.
+		 * Utilities for posting comment
 		 */
 		static final class COMMENT {
 
@@ -1045,7 +1045,28 @@ final class GM {
 			static final String PATH = "/API/v3/comment.php";
 
 			/**
-			 * Keys fotr the API parameters.
+			 * Sections where comments can be posted
+			 */
+			static final class TYPE {
+
+				/**
+				 * Comment in a blog post.
+				 */
+				static final String BLOG = "post";
+
+				/**
+				 * Comment in an activity.
+				 */
+				static final String ACTIVITIES = "activity";
+
+				/**
+				 * Comment in a photo.
+				 */
+				static final String GALLERY = "photo";
+			}
+
+			/**
+			 * Keys for the API parameters.
 			 */
 			static final class KEY {
 
@@ -1060,12 +1081,12 @@ final class GM {
 				static final String USER = "user";
 
 				/**
-				 * Key for the action to perform with the API ("sync" or "version").
+				 * Key to indicate the section.
 				 */
-				static final String TARGET = "target";
+				static final String TYPE = "target";
 
 				/**
-				 * Key to indicate the format of the data for the API to send.
+				 * Key to indicate the entry ID.
 				 */
 				static final String ID = "id";
 
@@ -1079,6 +1100,11 @@ final class GM {
 				 */
 				static final String TEXT = "text";
 
+				/**
+				 * Key to indicate the text language.
+				 */
+				static final String LANGUAGE = "lang";
+
 			}
 		}
 
@@ -1324,6 +1350,32 @@ final class GM {
 		static final String GALLERY = HOME + "/galeria/";
 	}
 
+	/**
+	 * Text encoding.
+	 */
+	static final String ENCODING = "UTF-8";
+
+	/**
+	 * Valid languages.
+	 */
+	static final class LANGUAGE{
+
+		/**
+		 * Spanish
+		 */
+		static final String ES = "es";
+
+		/**
+		 * English
+		 */
+		static final String EN = "en";
+
+		/**
+		 * Basque
+		 */
+		static final String EU = "eu";
+	}
+
 	/**
 	 * Gets the language code for sql queries.
 	 * Only three values can be returned: es, eu, en.
@@ -1355,9 +1407,8 @@ final class GM {
 	 * @param includeYear Also returns the year.
 	 * @param includeTime Also returns the hour and minute.
 	 *
-	 * @return The fragment view
+	 * @return The formatted date.
 	 *
-	 * @see android.support.v4.app.Fragment#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)
 	 */
 	static String formatDate(String dateString, String lang, boolean includeDay, boolean includeYear, boolean includeTime){
 

+ 135 - 139
app/src/main/java/com/ivalentin/margolariak/GalleryLayout.java

@@ -1,7 +1,6 @@
 package com.ivalentin.margolariak;
 
 
-import android.annotation.SuppressLint;
 import android.database.Cursor;
 import android.database.sqlite.SQLiteDatabase;
 import android.graphics.Bitmap;
@@ -30,152 +29,149 @@ import java.util.Random;
  */
 public class GalleryLayout extends Fragment{
 
-    /**
-     * Run when the fragment is inflated.
-     * Assigns views, gets the date and does the first call to the {@link @populate()} function.
-     *
-     * @param inflater A LayoutInflater to manage views
-     * @param container The container View
-     * @param savedInstanceState Bundle containing the state
-     *
-     * @return The fragment view
-     *
-     * @see android.support.v4.app.Fragment#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)
-     */
-    @SuppressLint("InflateParams") //Throws unknown error when done properly.
-    @Override
-    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
-
-        //Load the layout
-        View view = inflater.inflate(R.layout.fragment_layout_gallery, null);
-
-        //Set the title
-        ((MainActivity) getActivity()).setSectionTitle(view.getContext().getString(R.string.menu_gallery));
-
-        populate(view);
-
-        return view;
-    }
-
-    /**
-     * Populates the list of activities around.
-     * It uses the default layout as parent.
-     */
-    @SuppressLint("InflateParams") //Throws unknown error when done properly.
-    @SuppressWarnings("ResultOfMethodCallIgnored")
-    private void populate(View view){
-
-        //Assign elements
-        LinearLayout llList = (LinearLayout) view.findViewById(R.id.ll_gallery_album_list);
-        LinearLayout entry;
-
-        //An inflater
-        LayoutInflater factory = LayoutInflater.from(getActivity());
-
-        SQLiteDatabase db = SQLiteDatabase.openDatabase(getActivity().getDatabasePath(GM.DB.NAME).getAbsolutePath(), null, SQLiteDatabase.NO_LOCALIZED_COLLATORS | SQLiteDatabase.OPEN_READONLY);
-        final Cursor cursor;
+	/**
+	 * Run when the fragment is inflated.
+	 * Assigns views, gets the date and does the first call to the {@link @populate()} function.
+	 *
+	 * @param inflater A LayoutInflater to manage views
+	 * @param container The container View
+	 * @param savedInstanceState Bundle containing the state
+	 *
+	 * @return The fragment view
+	 *
+	 * @see Fragment#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)
+	 */
+	@Override
+	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+
+		//Load the layout
+		View view = inflater.inflate(R.layout.fragment_layout_gallery, container, false);
+
+		//Set the title
+		((MainActivity) getActivity()).setSectionTitle(view.getContext().getString(R.string.menu_gallery));
+
+		populate(view);
+
+		return view;
+	}
+
+	/**
+	 * Populates the list of activities around.
+	 * It uses the default layout as parent.
+	 */
+	private void populate(View view){
+
+		//Assign elements
+		LinearLayout llList = (LinearLayout) view.findViewById(R.id.ll_gallery_album_list);
+		LinearLayout entry;
+
+		//An inflater
+		LayoutInflater factory = LayoutInflater.from(getActivity());
+
+		SQLiteDatabase db = SQLiteDatabase.openDatabase(getActivity().getDatabasePath(GM.DB.NAME).getAbsolutePath(), null, SQLiteDatabase.NO_LOCALIZED_COLLATORS | SQLiteDatabase.OPEN_READONLY);
+		final Cursor cursor;
 		String lang = GM.getLang();
 
-        //Get data from the database
-        cursor = db.rawQuery("SELECT DISTINCT album.id AS id, album.title_" + lang + " AS name FROM photo, album, photo_album WHERE photo.id = photo AND album.id = album ORDER BY uploaded DESC;", null);
+		//Get data from the database
+		cursor = db.rawQuery("SELECT DISTINCT album.id AS id, album.title_" + lang + " AS name FROM photo, album, photo_album WHERE photo.id = photo AND album.id = album ORDER BY uploaded DESC;", null);
 
-        //Loop
-        while (cursor.moveToNext()){
+		//Loop
+		while (cursor.moveToNext()){
 
-            //Create a new row
-            entry = (LinearLayout) factory.inflate(R.layout.row_gallery, null);
+			//Create a new row
+			entry = (LinearLayout) factory.inflate(R.layout.row_gallery, llList, false);
 
-            //Set margins TODO: I dont know why it doesnt read margins from the xml
-            LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
+			//Set margins
+			LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
 			int margin = (int) (9 * getActivity().getResources().getDisplayMetrics().density);
-            layoutParams.setMargins(margin, margin, margin, margin);
-            entry.setLayoutParams(layoutParams);
-
-            //Set title
-            TextView tvTitle = (TextView) entry.findViewById(R.id.tv_row_gallery_title);
-            tvTitle.setText(cursor.getString(1));
-
-            //Set hidden id
-            TextView tvId = (TextView) entry.findViewById(R.id.tv_row_gallery_hidden);
-            tvId.setText(cursor.getString(0));
-
-            //Get images
-            ImageView preview[] = new ImageView[4];
-            preview[0] = (ImageView) entry.findViewById(R.id.iv_row_gallery_0);
-            preview[1] = (ImageView) entry.findViewById(R.id.iv_row_gallery_1);
-            preview[2] = (ImageView) entry.findViewById(R.id.iv_row_gallery_2);
-            preview[3] = (ImageView) entry.findViewById(R.id.iv_row_gallery_3);
-
-            //Get db rows
-            Cursor cursorImage = db.rawQuery("SELECT id, file, width, height FROM photo, photo_album WHERE photo = id AND album = " + cursor.getString(0) + " ORDER BY random() LIMIT 4;", null);
-
-            //Loop
-            int i = 0;
-            Random r;
-            while (cursorImage.moveToNext()){
-                String image = cursorImage.getString(1);
-
-                //Check if image exists
-                File f;
-                f = new File(this.getActivity().getFilesDir().toString() + "/img/galeria/miniature/" + image);
-                if (f.exists()){
-                    //If the image exists, set it.
-                    Bitmap myBitmap = BitmapFactory.decodeFile(this.getActivity().getFilesDir().toString() + "/img/galeria/miniature/" + image);
-                    preview[i].setImageBitmap(myBitmap);
-                }
-                else {
-                    //If not, create directories and download asynchronously
-                    File fpath;
-                    fpath = new File(this.getActivity().getFilesDir().toString() + "/img/galeria/miniature/");
-                    fpath.mkdirs();
-                    new DownloadImage(GM.API.SERVER + "/img/galeria/miniature/" + image, this.getActivity().getFilesDir().toString() + "/img/galeria/miniature/" + image, preview[i], GM.IMG.SIZE.MINIATURE).execute();
-                }
-
-                //Rotate the image
-                r = new Random();
-                int rot = r.nextInt(31) - 15;
-                preview[i].setRotation(rot);
-
-                i ++;
-            }
-
-            //Set photo counter
+			layoutParams.setMargins(margin, margin, margin, margin);
+			entry.setLayoutParams(layoutParams);
+
+			//Set title
+			TextView tvTitle = (TextView) entry.findViewById(R.id.tv_row_gallery_title);
+			tvTitle.setText(cursor.getString(1));
+
+			//Set hidden id
+			TextView tvId = (TextView) entry.findViewById(R.id.tv_row_gallery_hidden);
+			tvId.setText(cursor.getString(0));
+
+			//Get images
+			ImageView preview[] = new ImageView[4];
+			preview[0] = (ImageView) entry.findViewById(R.id.iv_row_gallery_0);
+			preview[1] = (ImageView) entry.findViewById(R.id.iv_row_gallery_1);
+			preview[2] = (ImageView) entry.findViewById(R.id.iv_row_gallery_2);
+			preview[3] = (ImageView) entry.findViewById(R.id.iv_row_gallery_3);
+
+			//Get db rows
+			Cursor cursorImage = db.rawQuery("SELECT id, file, width, height FROM photo, photo_album WHERE photo = id AND album = " + cursor.getString(0) + " ORDER BY random() LIMIT 4;", null);
+
+			//Loop
+			int i = 0;
+			Random r;
+			while (cursorImage.moveToNext()){
+				String image = cursorImage.getString(1);
+
+				//Check if image exists
+				File f;
+				f = new File(this.getActivity().getFilesDir().toString() + "/img/galeria/miniature/" + image);
+				if (f.exists()){
+					//If the image exists, set it.
+					Bitmap myBitmap = BitmapFactory.decodeFile(this.getActivity().getFilesDir().toString() + "/img/galeria/miniature/" + image);
+					preview[i].setImageBitmap(myBitmap);
+				}
+				else {
+					//If not, create directories and download asynchronously
+					File fpath;
+					fpath = new File(this.getActivity().getFilesDir().toString() + "/img/galeria/miniature/");
+					if (fpath.mkdirs()) {
+						new DownloadImage(GM.API.SERVER + "/img/galeria/miniature/" + image, this.getActivity().getFilesDir().toString() + "/img/galeria/miniature/" + image, preview[i], GM.IMG.SIZE.MINIATURE).execute();
+					}
+				}
+
+				//Rotate the image
+				r = new Random();
+				int rot = r.nextInt(31) - 15;
+				preview[i].setRotation(rot);
+
+				i ++;
+			}
+
+			//Set photo counter
 			Cursor cursorCounter = db.rawQuery("SELECT id FROM photo, photo_album WHERE photo = id AND album = " + cursor.getString(0) + ";", null);
-            TextView tvPhotoCounter = (TextView) entry.findViewById(R.id.tv_row_gallery_counter);
-            tvPhotoCounter.setText(getResources().getQuantityString(R.plurals.gallery_photo_count, cursorCounter.getCount(), cursorCounter.getCount()));
+			TextView tvPhotoCounter = (TextView) entry.findViewById(R.id.tv_row_gallery_counter);
+			tvPhotoCounter.setText(getResources().getQuantityString(R.plurals.gallery_photo_count, cursorCounter.getCount(), cursorCounter.getCount()));
 
 			//Close cursors
 			cursorCounter.close();
-            cursorImage.close();
-
-            //Set onCLickListener
-            entry.setOnClickListener(new View.OnClickListener(){
-                @Override
-                public void onClick(View v) {
-                Fragment fragment = new AlbumLayout();
-                Bundle bundle = new Bundle();
-
-                //Pass post id
-                int id = Integer.parseInt(((TextView) v.findViewById(R.id.tv_row_gallery_hidden)).getText().toString());
-                bundle.putInt("album", id);
-                fragment.setArguments(bundle);
-
-                FragmentManager fm = GalleryLayout.this.getActivity().getFragmentManager();
-                FragmentTransaction ft = fm.beginTransaction();
-
-                ft.replace(R.id.activity_main_content_fragment, fragment);
-                ft.addToBackStack("album_" + id);
-                ft.commit();
-                }
-            });
-
-            //Add to the list
-            llList.addView(entry);
-        }
-
-        //Close database
-        cursor.close();
-        db.close();
-
-    }
+			cursorImage.close();
+
+			//Set onCLickListener
+			entry.setOnClickListener(new View.OnClickListener(){
+				@Override
+				public void onClick(View v) {
+				Fragment fragment = new AlbumLayout();
+				Bundle bundle = new Bundle();
+
+				//Pass post id
+				int id = Integer.parseInt(((TextView) v.findViewById(R.id.tv_row_gallery_hidden)).getText().toString());
+				bundle.putInt("album", id);
+				fragment.setArguments(bundle);
+
+				FragmentManager fm = GalleryLayout.this.getActivity().getFragmentManager();
+				FragmentTransaction ft = fm.beginTransaction();
+
+				ft.replace(R.id.activity_main_content_fragment, fragment);
+				ft.addToBackStack("album_" + id);
+				ft.commit();
+				}
+			});
+
+			llList.addView(entry);
+		}
+
+		//Close database
+		cursor.close();
+		db.close();
+
+	}
 }

+ 23 - 43
app/src/main/java/com/ivalentin/margolariak/HomeLayout.java

@@ -6,7 +6,6 @@ import java.text.SimpleDateFormat;
 import java.util.Calendar;
 import java.util.Locale;
 
-import android.annotation.SuppressLint;
 import android.Manifest;
 import android.app.Activity;
 import android.content.Context;
@@ -48,7 +47,6 @@ import android.widget.Toast;
  * @see Fragment
  *
  */
-@SuppressWarnings("UnusedReturnValue")
 public class HomeLayout extends Fragment implements LocationListener {
 
 	//The location manager
@@ -73,12 +71,11 @@ public class HomeLayout extends Fragment implements LocationListener {
 	 *
 	 * @see android.app.Fragment#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)
 	 */
-	@SuppressLint("InflateParams") //Throws unknown error when done properly.
 	@Override
 	public View onCreateView(LayoutInflater inflater, final ViewGroup container, Bundle savedInstanceState) {
 
 		//Load the layout.
-		view = inflater.inflate(R.layout.fragment_layout_home, null);
+		view = inflater.inflate(R.layout.fragment_layout_home, container, false);
 
 		//Request location permissions if not set
 		if (!checkLocationPermission()) {
@@ -108,10 +105,6 @@ public class HomeLayout extends Fragment implements LocationListener {
 		//Set up the gallery section
 		setUpGallery(view);
 
-		//Asynchronously set up location section
-		//This will trigger onLocationChanged, that will trigger setUpLocation
-		new HomeSectionLocation(view).execute();
-
 		//Set up schedule sections
 		setUpSchedule(1, view);
 		setUpSchedule(0, view);
@@ -128,7 +121,6 @@ public class HomeLayout extends Fragment implements LocationListener {
 	 *
 	 * @return The number of entries shown.
 	 */
-	@SuppressLint("InflateParams")
 	private int setUpSchedule(int gm, View view) {
 		int count = 0;
 
@@ -196,7 +188,7 @@ public class HomeLayout extends Fragment implements LocationListener {
 		while (cursorNow.moveToNext()) {
 			count++;
 
-			entry = (LinearLayout) factory.inflate(R.layout.row_home_schedule, null);
+			entry = (LinearLayout) factory.inflate(R.layout.row_home_schedule, listNow, false);
 
 			//Set id
 			tvRowId = (TextView) entry.findViewById(R.id.tv_row_home_schedule_id);
@@ -220,7 +212,6 @@ public class HomeLayout extends Fragment implements LocationListener {
 			tvRowTime = (TextView) entry.findViewById(R.id.tv_row_home_schedule_time);
 			tvRowTime.setVisibility(View.GONE);
 
-			//Add the view
 			listNow.addView(entry);
 		}
 		cursorNow.close();
@@ -244,7 +235,7 @@ public class HomeLayout extends Fragment implements LocationListener {
 		while (cursorNext.moveToNext()) {
 			count++;
 
-			entry = (LinearLayout) factory.inflate(R.layout.row_home_schedule, null);
+			entry = (LinearLayout) factory.inflate(R.layout.row_home_schedule, listNext, false);
 
 			//Set id
 			tvRowId = (TextView) entry.findViewById(R.id.tv_row_home_schedule_id);
@@ -270,7 +261,6 @@ public class HomeLayout extends Fragment implements LocationListener {
 			String tm = cursorNext.getString(4).substring(cursorNext.getString(4).length() - 8, cursorNext.getString(4).length() - 3);
 			tvRowTime.setText(tm);
 
-			//Add the view
 			listNext.addView(entry);
 		}
 		cursorNext.close();
@@ -405,7 +395,6 @@ public class HomeLayout extends Fragment implements LocationListener {
 	 *
 	 * @return True if the section has been shown, false otherwise.
 	 */
-	@SuppressWarnings("ResultOfMethodCallIgnored")
 	private boolean setUpLablanca(View view) {
 		SharedPreferences preferences = view.getContext().getSharedPreferences(GM.DATA.DATA, Context.MODE_PRIVATE);
 		Boolean set = false;
@@ -431,10 +420,6 @@ public class HomeLayout extends Fragment implements LocationListener {
 				cursor.moveToFirst();
 				llSection.setVisibility(View.VISIBLE);
 
-				//Enable menu entries
-				//this.getActivity().findViewById(R.id.menu_lablanca_gm_schedule).setVisibility(View.VISIBLE);
-				//this.getActivity().findViewById(R.id.menu_lablanca_schedule).setVisibility(View.VISIBLE);
-
 				//Set text
 				String text = Html.fromHtml(cursor.getString(0)).toString();
 				String shortText = text.substring(0, 80);
@@ -463,8 +448,9 @@ public class HomeLayout extends Fragment implements LocationListener {
 						//If not, create directories and download asynchronously
 						File fpath;
 						fpath = new File(this.getActivity().getFilesDir().toString() + "/img/fiestas/preview/");
-						fpath.mkdirs();
-						new DownloadImage(GM.API.SERVER + "/img/fiestas/preview/" + image, this.getActivity().getFilesDir().toString() + "/img/fiestas/preview/" + image, ivImage, GM.IMG.SIZE.PREVIEW).execute();
+						if (fpath.mkdirs()) {
+							new DownloadImage(GM.API.SERVER + "/img/fiestas/preview/" + image, this.getActivity().getFilesDir().toString() + "/img/fiestas/preview/" + image, ivImage, GM.IMG.SIZE.PREVIEW).execute();
+						}
 					}
 				}
 				else {
@@ -530,7 +516,6 @@ public class HomeLayout extends Fragment implements LocationListener {
 	 *
 	 * @return The number of entries shown
 	 */
-	@SuppressWarnings("ResultOfMethodCallIgnored")
 	private int setUpGallery(View view) {
 		int counter = 0;
 
@@ -574,8 +559,9 @@ public class HomeLayout extends Fragment implements LocationListener {
 				//If not, create directories and download asynchronously
 				File fpath;
 				fpath = new File(this.getActivity().getFilesDir().toString() + "/img/galeria/preview/");
-				fpath.mkdirs();
-				new DownloadImage(GM.API.SERVER + "/img/galeria/preview/" + image, this.getActivity().getFilesDir().toString() + "/img/galeria/preview/" + image, ivPhoto[counter], GM.IMG.SIZE.PREVIEW).execute();
+				if (fpath.mkdirs()){
+					new DownloadImage(GM.API.SERVER + "/img/galeria/preview/" + image, this.getActivity().getFilesDir().toString() + "/img/galeria/preview/" + image, ivPhoto[counter], GM.IMG.SIZE.PREVIEW).execute();
+				}
 			}
 
 			//Set listeners for images
@@ -615,12 +601,10 @@ public class HomeLayout extends Fragment implements LocationListener {
 	/**
 	 * Populates the Past Activities section of the home screen.
 	 * Makes the section visible and adds two rows with the two last activities.
-	 * Tapping them takes to the post, tapping anywhere else, to the blog section.
+	 * Tapping them takes to the activity, tapping anywhere else, to the activities section.
 	 *
 	 * @return The number of entries shown
 	 */
-	@SuppressLint("InflateParams") //Throws unknown error when done properly.
-	@SuppressWarnings("ResultOfMethodCallIgnored")
 	private int setUpPastActivities(View view) {
 		int counter = 0;
 		String lang = GM.getLang();
@@ -650,7 +634,7 @@ public class HomeLayout extends Fragment implements LocationListener {
 		//Print rows
 		while (cursor.moveToNext()) {
 			//Create a new row
-			entry = (LinearLayout) factory.inflate(R.layout.row_home_activities, null);
+			entry = (LinearLayout) factory.inflate(R.layout.row_home_activities, llList, false);
 
 			//Set margins
 			LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
@@ -707,8 +691,9 @@ public class HomeLayout extends Fragment implements LocationListener {
 					//If not, create directories and download asynchronously
 					File fpath;
 					fpath = new File(this.getActivity().getFilesDir().toString() + "/img/actividades/miniature/");
-					fpath.mkdirs();
-					new DownloadImage(GM.API.SERVER + "/img/actividades/miniature/" + image, this.getActivity().getFilesDir().toString() + "/img/actividades/miniature/" + image, iv, GM.IMG.SIZE.MINIATURE).execute();
+					if (fpath.mkdirs()) {
+						new DownloadImage(GM.API.SERVER + "/img/actividades/miniature/" + image, this.getActivity().getFilesDir().toString() + "/img/actividades/miniature/" + image, iv, GM.IMG.SIZE.MINIATURE).execute();
+					}
 				}
 			}
 			cursorImage.close();
@@ -734,7 +719,6 @@ public class HomeLayout extends Fragment implements LocationListener {
 				}
 			});
 
-			//Add to the list
 			llList.addView(entry);
 			counter++;
 		}
@@ -750,12 +734,10 @@ public class HomeLayout extends Fragment implements LocationListener {
 	 * Populates the Future activities section of the home screen.
 	 * If there are future activities, makes the section visible.
 	 * Adds two rows with the two next activities.
-	 * Tapping them takes to the post, tapping anywhere else, to the blog section.
+	 * Tapping them takes to the activity, tapping anywhere else, to the activities section.
 	 *
 	 * @return The number of entries shown
 	 */
-	@SuppressLint("InflateParams") //Throws unknown error when done properly.
-	@SuppressWarnings("ResultOfMethodCallIgnored")
 	private int setUpFutureActivities(View view) {
 		int counter = 0;
 		String lang = GM.getLang();
@@ -788,7 +770,7 @@ public class HomeLayout extends Fragment implements LocationListener {
 			//Print rows
 			while (cursor.moveToNext()) {
 				//Create a new row
-				entry = (LinearLayout) factory.inflate(R.layout.row_home_activities, null);
+				entry = (LinearLayout) factory.inflate(R.layout.row_home_activities, llList, false);
 
 				//Set margins
 				LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
@@ -838,8 +820,9 @@ public class HomeLayout extends Fragment implements LocationListener {
 						//If not, create directories and download asynchronously
 						File fpath;
 						fpath = new File(this.getActivity().getFilesDir().toString() + "/img/actividades/miniature/");
-						fpath.mkdirs();
-						new DownloadImage(GM.API.SERVER + "/img/actividades/miniature/" + image, this.getActivity().getFilesDir().toString() + "/img/actividades/miniature/" + image, iv, GM.IMG.SIZE.MINIATURE).execute();
+						if (fpath.mkdirs()) {
+							new DownloadImage(GM.API.SERVER + "/img/actividades/miniature/" + image, this.getActivity().getFilesDir().toString() + "/img/actividades/miniature/" + image, iv, GM.IMG.SIZE.MINIATURE).execute();
+						}
 					}
 				}
 
@@ -865,7 +848,6 @@ public class HomeLayout extends Fragment implements LocationListener {
 					}
 				});
 
-				//Add to the list
 				llList.addView(entry);
 				counter++;
 			}
@@ -884,8 +866,6 @@ public class HomeLayout extends Fragment implements LocationListener {
 	 *
 	 * @return The number of entries shown
 	 */
-	@SuppressLint("InflateParams") //Throws unknown error when done properly.
-	@SuppressWarnings("ResultOfMethodCallIgnored")
 	private int setUpBlog(View view) {
 		int counter = 0;
 		String lang = GM.getLang();
@@ -915,7 +895,7 @@ public class HomeLayout extends Fragment implements LocationListener {
 		while (cursor.moveToNext()) {
 
 			//Create a new row
-			entry = (LinearLayout) factory.inflate(R.layout.row_home_blog, null);
+			entry = (LinearLayout) factory.inflate(R.layout.row_home_blog, llList, false);
 
 			//Set margins
 			LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
@@ -957,8 +937,9 @@ public class HomeLayout extends Fragment implements LocationListener {
 					//If not, create directories and download asynchronously
 					File fpath;
 					fpath = new File(this.getActivity().getFilesDir().toString() + "/img/blog/miniature/");
-					fpath.mkdirs();
-					new DownloadImage(GM.API.SERVER + "/img/blog/miniature/" + image, this.getActivity().getFilesDir().toString() + "/img/blog/miniature/" + image, iv, GM.IMG.SIZE.MINIATURE).execute();
+					if (fpath.mkdirs()) {
+						new DownloadImage(GM.API.SERVER + "/img/blog/miniature/" + image, this.getActivity().getFilesDir().toString() + "/img/blog/miniature/" + image, iv, GM.IMG.SIZE.MINIATURE).execute();
+					}
 				}
 			}
 
@@ -984,7 +965,6 @@ public class HomeLayout extends Fragment implements LocationListener {
 				}
 			});
 
-			//Add to the list
 			llList.addView(entry);
 
 			counter++;

+ 0 - 91
app/src/main/java/com/ivalentin/margolariak/HomeSectionLocation.java

@@ -1,91 +0,0 @@
-package com.ivalentin.margolariak;
-
-import android.app.Activity;
-import android.content.Context;
-import android.content.SharedPreferences;
-import android.os.AsyncTask;
-import android.util.Log;
-import android.view.View;
-import android.widget.LinearLayout;
-
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Locale;
-
-/**
- * Async task to download images on the fly.
- * The remote image file, the local path, and the ImageView where the image will be loaded are set on the constructor.
- *
- * @author Iñigo Valentin
- *
- */
-class HomeSectionLocation extends AsyncTask<Void, Void, Void> {
-
-	private boolean isLocationReported;
-	//private LatLng coord;
-	private final View view;
-
-	/**
-	 * Constructor.
-	 *
-	 * @param v Application top view.
-	 *
-	 * @see android.widget.ImageView
-	 */
-	public HomeSectionLocation(View v) {
-		super();
-		this.view = v;
-	}
-
-	/**
-	 * Downloading file in background thread.
-	 */
-	@Override
-	protected Void doInBackground(Void... v) {
-
-		String o = "";
-
-		try {
-
-			FetchURL fu = new FetchURL();
-			fu.Run(GM.API.SERVER + "/app/location.php");
-			//All the info
-			o = fu.getOutput().toString();
-
-		} catch (Exception e) {
-			Log.e("Location error: ", e.getMessage());
-		}
-
-		if (o.contains("<reporting>1</reporting>")){
-			isLocationReported = true;
-			String latString = o.substring(o.indexOf("<lat>") + 5, o.indexOf("</lat>"));
-			String lonString = o.substring(o.indexOf("<lon>") + 5, o.indexOf("</lon>"));
-			//coord = new LatLng(Double.parseDouble(latString), Double.parseDouble(lonString));
-		}
-
-		return null;
-	}
-
-
-
-	/**
-	 * After completing background task, set the image on the ImageView.
-	 */
-	@Override
-	protected void onPostExecute(Void v) {
-		if (isLocationReported){
-
-			//Set up home view section
-			LinearLayout section = (LinearLayout) view.findViewById(R.id.ll_home_section_location);
-			section.setVisibility(View.VISIBLE);
-			section.setOnClickListener(new View.OnClickListener(){
-				@Override
-				public void onClick(View v) {
-					((MainActivity) v.getContext()).loadSection(GM.SECTION.LOCATION);
-				}
-			});
-
-		}
-	}
-
-}

+ 7 - 20
app/src/main/java/com/ivalentin/margolariak/LablancaLayout.java

@@ -1,14 +1,11 @@
 package com.ivalentin.margolariak;
 
-import android.annotation.SuppressLint;
 import android.app.Fragment;
 import android.database.Cursor;
 import android.database.sqlite.SQLiteDatabase;
 import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
-import android.os.Build;
 import android.os.Bundle;
-import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -19,11 +16,7 @@ import android.widget.LinearLayout;
 import android.widget.TextView;
 
 import java.io.File;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
 import java.util.Calendar;
-import java.util.Date;
-import java.util.Locale;
 
 /**
  * Fragment opened for La Blanca sections while the festivals are not close.
@@ -45,12 +38,10 @@ public class LablancaLayout extends Fragment {
 	 * @see android.app.Fragment#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)
 	 */
 	@Override
-	@SuppressLint({"InflateParams", "SwitchIntDef"})
-	@SuppressWarnings("ResultOfMethodCallIgnored")
 	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
 
 		//Load the layout
-		View view = inflater.inflate(R.layout.fragment_layout_lablanca, null);
+		View view = inflater.inflate(R.layout.fragment_layout_lablanca, container, false);
 
 		//Set the title
 		((MainActivity) getActivity()).setSectionTitle(view.getContext().getString(R.string.menu_lablanca));
@@ -67,12 +58,7 @@ public class LablancaLayout extends Fragment {
 			//Set text
 			WebView headerText = (WebView) view.findViewById(R.id.wv_lablanca_header);
 
-			if (Build.VERSION.SDK_INT >= 19) {
-				headerText.setLayerType(View.LAYER_TYPE_HARDWARE, null);
-			} else {
-				headerText.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
-			}
-
+			headerText.setLayerType(View.LAYER_TYPE_HARDWARE, null);
 			headerText.loadDataWithBaseURL(null, cursor.getString(0), "text/html", "utf-8", null);
 
 			//Set image
@@ -91,8 +77,9 @@ public class LablancaLayout extends Fragment {
 					//If not, create directories and download asynchronously
 					File fpath;
 					fpath = new File(this.getActivity().getFilesDir().toString() + "/img/fiestas/preview/");
-					fpath.mkdirs();
-					new DownloadImage(GM.API.SERVER + "/img/fiestas/preview/" + image, this.getActivity().getFilesDir().toString() + "/img/fiestas/preview/" + image, headerImage, GM.IMG.SIZE.PREVIEW).execute();
+					if (fpath.mkdirs()) {
+						new DownloadImage(GM.API.SERVER + "/img/fiestas/preview/" + image, this.getActivity().getFilesDir().toString() + "/img/fiestas/preview/" + image, headerImage, GM.IMG.SIZE.PREVIEW).execute();
+					}
 				}
 			} else {
 				headerImage.setVisibility(View.GONE);
@@ -106,7 +93,7 @@ public class LablancaLayout extends Fragment {
 			while (cursorDays.moveToNext()) {
 
 				//Create a new row
-				entry = (LinearLayout) factory.inflate(R.layout.row_festival_price_day, null);
+				entry = (LinearLayout) factory.inflate(R.layout.row_festival_price_day, list, false);
 
 				//Set margins
 				LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
@@ -155,7 +142,7 @@ public class LablancaLayout extends Fragment {
 			while (cursorPacks.moveToNext()) {
 
 				//Create a new row
-				entry = (LinearLayout) factory.inflate(R.layout.row_festival_price_pack, null);
+				entry = (LinearLayout) factory.inflate(R.layout.row_festival_price_pack, list, false);
 
 				//Set margins
 				LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);

+ 2 - 6
app/src/main/java/com/ivalentin/margolariak/LablancaNoFestivalsLayout.java

@@ -1,13 +1,10 @@
 package com.ivalentin.margolariak;
 
-import android.annotation.SuppressLint;
 import android.app.Fragment;
 import android.os.Bundle;
-import android.text.Html;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
-import android.widget.TextView;
 
 /**
  * Fragment openen for La Blanca sections while the festivals are not close.
@@ -26,14 +23,13 @@ public class LablancaNoFestivalsLayout extends Fragment {
 	 * @param container          The container View
 	 * @param savedInstanceState Bundle containing the state
 	 * @return The fragment view
-	 * @see android.app.Fragment#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)
+	 * @see Fragment#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)
 	 */
 	@Override
-	@SuppressLint("InflateParams")
 	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
 
 		//Load the layout
-		View view = inflater.inflate(R.layout.fragment_layout_lablanca_nofestivals, null);
+		View view = inflater.inflate(R.layout.fragment_layout_lablanca_nofestivals, container, false);
 
 		//Set the title
 		((MainActivity) getActivity()).setSectionTitle(view.getContext().getString(R.string.menu_lablanca));

+ 0 - 1
app/src/main/java/com/ivalentin/margolariak/LocationLayout.java

@@ -60,7 +60,6 @@ public class LocationLayout extends Fragment implements LocationListener {
 			if (mapView != null) {
 				if (refreshLocation()) {
 					
-					//mapController.setCenter(self.gmLocation);
 					OverlayItem locationOverlayItem = new OverlayItem("Gasteizko Margolariak", "", gmLocation);
 					locationOverlayItem.setMarker(locationMarker);
 					final ArrayList<OverlayItem> items = new ArrayList<>();

+ 38 - 16
app/src/main/java/com/ivalentin/margolariak/MainActivity.java

@@ -16,9 +16,7 @@ import android.graphics.Color;
 import android.graphics.Typeface;
 import android.graphics.drawable.ColorDrawable;
 import android.graphics.drawable.Drawable;
-import android.net.Uri;
 import android.os.Bundle;
-import android.os.StrictMode;
 import android.util.DisplayMetrics;
 import android.util.Log;
 import android.view.Gravity;
@@ -53,6 +51,7 @@ public class MainActivity extends Activity {
 
 	//Handler to periodically check for location updates
 	private final Handler locationHandler = new Handler();
+
 	// Code to check for location updates
 	private MainActivity activity = this;
 	private final Runnable checkForLocation = new Runnable() {
@@ -70,6 +69,7 @@ public class MainActivity extends Activity {
 	private String shareURL = GM.SHARE.HOME;
 	private String shareTitle = "";
 
+
 	/**
 	 * Sets the displayed section url and localized title.
 	 * Thy can be retrieved later with getShareLink() to share the URL.
@@ -84,6 +84,7 @@ public class MainActivity extends Activity {
 		shareURL = url;
 	}
 
+
 	/**
 	 * Returns the url of the current sections and a title.
 	 * To be used with the share option.
@@ -94,6 +95,7 @@ public class MainActivity extends Activity {
 		return(new String[]{shareTitle, shareURL});
 	}
 
+
 	/**
 	 * Enables o disables the location section.
 	 *
@@ -116,6 +118,7 @@ public class MainActivity extends Activity {
 		}
 	}
 
+
 	/**
 	 * Opens and closes the app menu.
 	 * Not referenced in code.
@@ -285,10 +288,12 @@ public class MainActivity extends Activity {
 		ft.addToBackStack(title);
 		ft.commit();
 		setSectionTitle(title);
+
 		//Set the shareable url
 		setShareLink(shareTitle, shareURL);
 	}
 
+
 	/**
 	 * Sets the title of the current section.
 	 *
@@ -299,13 +304,13 @@ public class MainActivity extends Activity {
 		tvTitle.setText(title);
 	}
 
+
 	/**
 	 * Runs when the activity is created.
 	 *
 	 * @param savedInstanceState Saved state of the activity.
 	 * @see Activity#onCreate(Bundle)
 	 */
-	@SuppressWarnings("deprecation, ConstantConditions")
 	@Override
 	protected void onCreate(Bundle savedInstanceState) {
 
@@ -334,7 +339,7 @@ public class MainActivity extends Activity {
 						}
 					});
 				} catch (InterruptedException e) {
-					Log.e("Sleep interrupted", e.toString());
+					Log.e("MAIN_ACTIVITY", "Sleep interrupted: " +  e.toString());
 				}
 			}
 		};
@@ -430,7 +435,7 @@ public class MainActivity extends Activity {
 
 		//If the database has just been updated, recreate the database
 		if (sharedData.getInt(GM.DATA.KEY.PREVIOUS_APP_VERSION, GM.DATA.DEFAULT.PREVIOUS_APP_VERSION) < BuildConfig.VERSION_CODE) {
-			Log.d("UPDATE", "App updated from version " + sharedData.getInt(GM.DATA.KEY.PREVIOUS_APP_VERSION, GM.DATA.DEFAULT.PREVIOUS_APP_VERSION) + " to " + BuildConfig.VERSION_CODE + ". Forcing a new sync...");
+			Log.d("MAIN_ACTIVITY", "App updated from version " + sharedData.getInt(GM.DATA.KEY.PREVIOUS_APP_VERSION, GM.DATA.DEFAULT.PREVIOUS_APP_VERSION) + " to " + BuildConfig.VERSION_CODE + ". Forcing a new sync...");
 			deleteDatabase();
 			dataEditor.putInt(GM.DATA.KEY.PREVIOUS_APP_VERSION, BuildConfig.VERSION_CODE);
 			dataEditor.apply();
@@ -476,7 +481,7 @@ public class MainActivity extends Activity {
 					});
 
 					//Set the icon
-					dialogIcon = getResources().getDrawable(R.drawable.ic_launcher);
+					dialogIcon = getResources().getDrawable(R.drawable.ic_launcher, null);
 					if (dialogIcon != null) {
 						dialogIcon.setBounds(0, 0, (int) (tvDialogTitle.getTextSize() * 1.4), (int) (tvDialogTitle.getTextSize() * 1.4));
 					}
@@ -607,7 +612,13 @@ public class MainActivity extends Activity {
 
 					//Set dialog parameters
 					WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
-					lp.copyFrom(dialog.getWindow().getAttributes());
+					try {
+						//noinspection ConstantConditions
+						lp.copyFrom(dialog.getWindow().getAttributes());
+					}
+					catch (NullPointerException e){
+						Log.e("MAIN_ACTIVITY", "Error setting dialog parameters: " + e.toString());
+					}
 					lp.width = WindowManager.LayoutParams.MATCH_PARENT;
 					lp.height = WindowManager.LayoutParams.WRAP_CONTENT;
 					lp.gravity = Gravity.CENTER;
@@ -623,6 +634,7 @@ public class MainActivity extends Activity {
 		}
 	}
 
+
 	/**
 	 * Creates the app database and fills it with the hard coded, default data.
 	 */
@@ -656,7 +668,6 @@ public class MainActivity extends Activity {
 			db.execSQL(GM.DB.QUERY.CREATE.POST_TAG);
 			db.execSQL(GM.DB.QUERY.CREATE.ROUTE);
 			db.execSQL(GM.DB.QUERY.CREATE.ROUTE_POINT);
-			//db.execSQL(GM.DB.QUERY.CREATE.SETTINGS);
 			db.execSQL(GM.DB.QUERY.CREATE.SPONSOR);
 			db.execSQL(GM.DB.QUERY.CREATE.VERSION);
 			db.close();
@@ -665,6 +676,7 @@ public class MainActivity extends Activity {
 		}
 	}
 
+
 	/**
 	 * Creates the app database and fills it with the hard coded, default data.
 	 */
@@ -676,6 +688,7 @@ public class MainActivity extends Activity {
 		}
 	}
 
+
 	/**
 	 * Performs a full sync against the remote database.
 	 */
@@ -685,6 +698,7 @@ public class MainActivity extends Activity {
 		new Sync(this, pbSync, ivSync).execute();
 	}
 
+
 	/**
 	 * Asks the activity to performa a sync.
 	 * Intended to be called from any screen.
@@ -693,12 +707,12 @@ public class MainActivity extends Activity {
 		new Sync(this).execute();
 	}
 
+
 	/**
 	 * Perform an initial sync before the app can be used.
 	 * A dialog will block the UI.
 	 * It is intended to be used only when the database is empty.
 	 */
-	@SuppressWarnings("ConstantConditions")
 	private void initialSync() {
 		//Create a dialog
 		Dialog dialog = new Dialog(this);
@@ -710,8 +724,13 @@ public class MainActivity extends Activity {
 
 		//Set dialog parameters
 		WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
-		lp.copyFrom(dialog.getWindow().getAttributes());
-		lp.width = WindowManager.LayoutParams.MATCH_PARENT;
+		try {
+			//noinspection ConstantConditions
+			lp.copyFrom(dialog.getWindow().getAttributes());
+		}
+		catch (NullPointerException e){
+			Log.e("MAIN_ACTIVITY", "Error setting dialog parameters: " + e.toString());
+		}		lp.width = WindowManager.LayoutParams.MATCH_PARENT;
 		lp.height = WindowManager.LayoutParams.WRAP_CONTENT;
 		lp.gravity = Gravity.CENTER;
 		dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
@@ -723,17 +742,17 @@ public class MainActivity extends Activity {
 		new Sync(this, pbSync, ivSync, dialog, this).execute();
 	}
 
+
 	/**
 	 * Overrides onBackPressed().
 	 * Used to show the previous fragment instead of finishing the app.
 	 *
-	 * @see AppCompatActivity#onBackPressed()
+	 * @see Activity#onBackPressed()
 	 */
 	@Override
 	public void onBackPressed() {
 		try {
 			FragmentManager fm = getFragmentManager();
-			Log.d("BACK", "StackEntryCount " + fm.getBackStackEntryCount());
 			if (fm.getBackStackEntryCount() > 1) {
 				fm.popBackStack();
 			} else {
@@ -741,17 +760,17 @@ public class MainActivity extends Activity {
 				super.onBackPressed();
 			}
 		} catch (Exception ex) {
-			Log.e("Error going back", "Finishing activity: " + ex.toString());
+			Log.e("MAIN_ACTIVITY", "Error going back. Finishing activity: " + ex.toString());
 			locationHandler.removeCallbacks(checkForLocation);
 			finish();
-			//super.onBackPressed();
 		}
 
 	}
 
+
 	/**
 	 * Overrides onKeyUp().
-	 * Used to toggle the menu whent the key is pressed.
+	 * Used to toggle the menu when the key is pressed.
 	 *
 	 * @see Activity#onKeyUp(int, KeyEvent)
 	 */
@@ -764,6 +783,7 @@ public class MainActivity extends Activity {
 		return super.onKeyUp(keyCode, event);
 	}
 
+
 	/**
 	 * Overrides onResume().
 	 * Resumes the location handler to check for location regularly.
@@ -776,6 +796,7 @@ public class MainActivity extends Activity {
 		super.onResume();
 	}
 
+
 	/**
 	 * Overrides onPause().
 	 * Stops the location handler to check for location regularly.
@@ -788,6 +809,7 @@ public class MainActivity extends Activity {
 		super.onPause();
 	}
 
+
 	/**
 	 * Overrides onDestroy().
 	 * Stops the location handler to check for location regularly.

+ 20 - 12
app/src/main/java/com/ivalentin/margolariak/PhotoLayout.java

@@ -1,6 +1,5 @@
 package com.ivalentin.margolariak;
 
-import android.annotation.SuppressLint;
 import android.app.Fragment;
 import android.content.Context;
 import android.database.Cursor;
@@ -22,6 +21,7 @@ import android.widget.Toast;
 
 import java.io.File;
 
+
 /**
  * Section that shows a photo of the gallery, with details and comments.
  * Contains info from almost every other section.
@@ -37,25 +37,24 @@ public class PhotoLayout extends Fragment {
 	private View view;
 
 	private String albumName;
-	private String albumPerm;
 
 	private Integer photos[];
 	private int position;
 
 	private Context context;
 
-	@SuppressLint("InflateParams") //Throws unknown error when done properly.
+
 	@Override
 	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
 
 		//Load the layout
-		view = inflater.inflate(R.layout.fragment_layout_photo, null);
+		view = inflater.inflate(R.layout.fragment_layout_photo, container, false);
 		context = view.getContext();
 
 		//Get bundled id
 		Bundle bundle = this.getArguments();
 		albumName = bundle.getString("albumName", "");
-		albumPerm = bundle.getString("albumPerm", "");
+		String albumPerm = bundle.getString("albumPerm", "");
 		int id = bundle.getInt("photo", -1);
 		if (id == -1) {
 			Log.e("Photo error", "No such photo: " + id);
@@ -95,6 +94,7 @@ public class PhotoLayout extends Fragment {
 		return view;
 	}
 
+
 	/**
 	 * Given a photo id array and a photo id, tells the position of the photo in the array.
 	 *
@@ -119,6 +119,7 @@ public class PhotoLayout extends Fragment {
 		return i;
 	}
 
+
 	/**
 	 * Given a photo, builds an ordered array with the ids of all photos in the same album.
 	 *
@@ -149,12 +150,20 @@ public class PhotoLayout extends Fragment {
 		return list;
 	}
 
+	/**
+	 * Retrieves data from the database and populates the layout.
+	 * @param id Photo id.
+	 */
 	private void populate(int id){
 		populate(id, view);
 	}
 
-	@SuppressLint("InflateParams") //Throws unknown error when done properly.
-	@SuppressWarnings("ResultOfMethodCallIgnored")
+
+	/**
+	 * Retrieves data from the database and populates the layout.
+	 * @param id Photo id.
+	 * @param v Parent view.
+	 */
 	private void populate(int id, View v){
 
 		final int photoId = id;
@@ -211,8 +220,9 @@ public class PhotoLayout extends Fragment {
 			imageView.setImageResource(getResources().getIdentifier("com.ivalentin.margolariak:drawable/photo_placeholder", null, null));
 			File fpath;
 			fpath = new File(this.getActivity().getFilesDir().toString() + "/img/galeria/view/");
-			fpath.mkdirs();
-			new DownloadImage(GM.API.SERVER + "/img/galeria/view/" + image, this.getActivity().getFilesDir().toString() + "/img/galeria/view/" + image, imageView, GM.IMG.SIZE.VIEW).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
+			if (fpath.mkdirs()) {
+				new DownloadImage(GM.API.SERVER + "/img/galeria/view/" + image, this.getActivity().getFilesDir().toString() + "/img/galeria/view/" + image, imageView, GM.IMG.SIZE.VIEW).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
+			}
 		}
 
 		//Hide or show comments, as needed
@@ -231,8 +241,6 @@ public class PhotoLayout extends Fragment {
 			btNext.setVisibility(View.VISIBLE);
 		}
 
-
-
 		//Get comments
 		Cursor commentCursor = db.rawQuery("SELECT text, dtime, username FROM photo_comment WHERE photo = " + id + ";", null);
 		tvComments.setText(String.format(getResources().getQuantityString(R.plurals.comment_comments, commentCursor.getCount()), commentCursor.getCount()));
@@ -242,7 +250,7 @@ public class PhotoLayout extends Fragment {
 		LayoutInflater factory = LayoutInflater.from(getActivity());
 		llCommentList.removeAllViews();
 		while (commentCursor.moveToNext()) {
-			entry = (LinearLayout) factory.inflate(R.layout.row_comment, null);
+			entry = (LinearLayout) factory.inflate(R.layout.row_comment, llCommentList, false);
 
 			//Set user
 			TextView tvUser = (TextView) entry.findViewById(R.id.tv_row_comment_user);

+ 160 - 146
app/src/main/java/com/ivalentin/margolariak/PostComment.java

@@ -1,10 +1,7 @@
 package com.ivalentin.margolariak;
 
-import android.annotation.SuppressLint;
-import android.app.Activity;
 import android.content.Context;
 import android.content.SharedPreferences;
-import android.database.sqlite.SQLiteDatabase;
 import android.os.AsyncTask;
 import android.text.format.DateFormat;
 import android.util.Log;
@@ -25,178 +22,195 @@ import java.net.URL;
 import java.net.URLEncoder;
 import java.util.Date;
 
+
+/**
+ * Posts a comment for an entry.
+ */
 class PostComment extends AsyncTask<String, String, Integer> {
 
-    //Elements passed from fragments
-    private final String type, user, text, language;
-    private String userCode;
-    private final LinearLayout list, form;
-    private final int id;
-    private final Context context;
-
-    //Elements calculated here
-    private Button btSend;
-    private ProgressBar pb;
-
-    private int code = 404;
-
-    PostComment(String type, String user, String text, String language, int id, LinearLayout form, LinearLayout list, Context context) {
-        super();
-        this.type = type;
-        this.user = user;
-        this.text = text;
-        this.form = form;
-        this.list = list;
-        this.language = language;
-        this.id = id;
-        this.context = context;
-
-    }
-
-    /**
-     * Before starting background thread
-     * */
-    @Override
-    protected void onPreExecute() {
-        super.onPreExecute();
-        btSend = (Button) form.findViewById(R.id.bt_comment_send);
-        pb = (ProgressBar) form.findViewById(R.id.pb_comment);
-        btSend.setVisibility(View.GONE);
-        pb.setVisibility(View.VISIBLE);
-
-        //Get user code
-        SharedPreferences sharedData = context.getSharedPreferences(GM.DATA.DATA, Context.MODE_PRIVATE);
-        userCode = sharedData.getString(GM.DATA.KEY.USER, GM.DATA.DEFAULT.USER);
-    }
-
-    /**
-     * Downloading file in background thread
-     * */
-    @Override
-    @SuppressWarnings("deprecation")
-    protected Integer doInBackground(String... f_url) {
-        URL url;
-        String urlParams;
-        try {
-
-            urlParams = "username=" + URLEncoder.encode(user) + "&text=" + URLEncoder.encode(text);
-            urlParams = urlParams + "&id=" + id;
-            switch (type) {
-                case "blog":
-                    urlParams = urlParams + "&target=post";
-                    break;
-                case "galeria":
-                    urlParams = urlParams + "&target=photo";
-                    break;
-                case "actividades":
-                    urlParams = urlParams + "&target=activity";
-                    break;
-                default:
-                    Log.e("Comment error", "Unknown section: " + type);
-                    return -1;
-            }
-            switch (language) {
-                case "es":
-                    urlParams = urlParams + "&lang=es";
-                    break;
-                case "eu":
-                    urlParams = urlParams + "&lang=eu";
-                    break;
-                default:
-                    urlParams = urlParams + "&lang=en";
-            }
-            urlParams = urlParams + "&client=" + GM.API.CLIENT + "&user=" + userCode;
-
-            String uri = GM.API.SERVER + GM.API.COMMENT.PATH + "?" + urlParams;
-            url = new URL(uri);
+	//Elements passed from fragments
+	private final String type, user, text, language;
+	private String userCode;
+	private final LinearLayout list, form;
+	private final int id;
+	private final Context context;
+
+	//Elements calculated here
+	private Button btSend;
+	private ProgressBar pb;
+
+	private int code = 404;
+
+	/**
+	 * Post a comment for an entry.
+	 * @param type Type of the entry to comment. @see GM.COMMENT.TYPE
+	 * @param user Username.
+	 * @param text Comment text.
+	 * @param language Comment language.
+	 * @param id ID of the entry to post the comment on.
+	 * @param form Layout containing the comment form.
+	 * @param list Layout containing the list of comments for the entry.
+	 * @param context App context.
+	 */
+	PostComment(String type, String user, String text, String language, int id, LinearLayout form, LinearLayout list, Context context) {
+		super();
+		this.type = type;
+		this.user = user;
+		this.text = text;
+		this.form = form;
+		this.list = list;
+		this.language = language;
+		this.id = id;
+		this.context = context;
+
+	}
+
+
+	/**
+	 * Before starting background thread
+	 */
+	@Override
+	protected void onPreExecute() {
+		super.onPreExecute();
+		btSend = (Button) form.findViewById(R.id.bt_comment_send);
+		pb = (ProgressBar) form.findViewById(R.id.pb_comment);
+		btSend.setVisibility(View.GONE);
+		pb.setVisibility(View.VISIBLE);
+
+		//Get user code
+		SharedPreferences sharedData = context.getSharedPreferences(GM.DATA.DATA, Context.MODE_PRIVATE);
+		userCode = sharedData.getString(GM.DATA.KEY.USER, GM.DATA.DEFAULT.USER);
+	}
+
+
+	/**
+	 * Send request to the server
+	 * @param f_url API URL.
+	 * @return 0 for success, something else for error.
+	 */
+	@Override
+	protected Integer doInBackground(String... f_url) {
+		URL url;
+		String urlParams;
+		try {
+
+			urlParams = GM.API.COMMENT.KEY.USERNAME + "=" + URLEncoder.encode(user,GM.ENCODING) + "&" + GM.API.COMMENT.KEY.TEXT + "=" + URLEncoder.encode(text, GM.ENCODING);
+			urlParams = urlParams + "&id=" + id;
+			switch (type) {
+				case GM.API.COMMENT.TYPE.BLOG:
+					urlParams = urlParams + "&" + GM.API.COMMENT.KEY.TYPE + "=" + GM.API.COMMENT.TYPE.BLOG;
+					break;
+				case GM.API.COMMENT.TYPE.GALLERY:
+					urlParams = urlParams + "&" + GM.API.COMMENT.KEY.TYPE + "=" + GM.API.COMMENT.TYPE.GALLERY;
+					break;
+				case GM.API.COMMENT.TYPE.ACTIVITIES:
+					urlParams = urlParams + "&" + GM.API.COMMENT.KEY.TYPE + "=" + GM.API.COMMENT.TYPE.ACTIVITIES;
+					break;
+				default:
+					Log.e("POST_COMMENT", "Unknown section: " + type);
+					return -1;
+			}
+			switch (language) {
+				case GM.LANGUAGE.EN:
+					urlParams = urlParams + "&" + GM.API.COMMENT.KEY.LANGUAGE + "=" + GM.LANGUAGE.EN;
+					break;
+				case GM.LANGUAGE.EU:
+					urlParams = urlParams + "&" + GM.API.COMMENT.KEY.LANGUAGE + "=" + GM.LANGUAGE.EU;
+					break;
+				case GM.LANGUAGE.ES:
+					urlParams = urlParams + "&" + GM.API.COMMENT.KEY.LANGUAGE + "=" + GM.LANGUAGE.ES;
+					break;
+				default:
+					urlParams = urlParams + "&" + GM.API.COMMENT.KEY.LANGUAGE + "=" + GM.LANGUAGE.ES;
+			}
+			urlParams = urlParams + "&" + GM.API.COMMENT.KEY.CLIENT + "=" + GM.API.CLIENT + "&" + GM.API.COMMENT.KEY.USER + "=" + userCode;
+
+			String uri = GM.API.SERVER + GM.API.COMMENT.PATH + "?" + urlParams;
+			url = new URL(uri);
 			Log.e("URI", uri);
 
-            HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
+			HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
 
-            code = urlConnection.getResponseCode();
+			code = urlConnection.getResponseCode();
 
-            switch (code) {
-                case 400:    //Client error: Bad request
-                    Log.e("COMMENT", "The server returned a 400 code (Client Error: Bad request) for the url \"" + uri + "\"");
+			switch (code) {
+				case 400: //Client error: Bad request
+					Log.e("POST_COMMENT", "The server returned a 400 code (Client Error: Bad request) for the url \"" + uri + "\"");
 					return(-400);
-                case 403:    //Client error: Forbidden
-                    Log.e("COMMENT", "The server returned a 403 code (Client Error: Forbidden) for the url \"" + uri + "\"");
+				case 403: //Client error: Forbidden
+					Log.e("POST_COMMENT", "The server returned a 403 code (Client Error: Forbidden) for the url \"" + uri + "\"");
 					return(-403);
-                case 200:    //Success: OK
-                    Log.d("COMMENT", "The server returned a 200 code (Success: OK) for the url \"" + uri + "\".");
+				case 200: //Success: OK
+					Log.d("POST_COMMENT", "The server returned a 200 code (Success: OK) for the url \"" + uri + "\".");
 					break;
 				default:
-					Log.e("COMMENT", "The server returned a " + code + " code for the url \"" + uri + "\".");
+					Log.e("POST_COMMENT", "The server returned a " + code + " code for the url \"" + uri + "\".");
 					return(-6);
-            }
+			}
 
-        }
+		}
 		catch (UnsupportedEncodingException e) {
-            Log.e("COMMENT", "Unable to post comment (UnsupportedEncodingException): " + e.toString());
+			Log.e("POST_COMMENT", "Unable to post comment (UnsupportedEncodingException): " + e.toString());
 			return -2;
-        }
+		}
 		catch (ProtocolException e) {
-            Log.e("COMMENT", "Unable to post comment (ProtocolException): " + e.toString());
+			Log.e("POST_COMMENT", "Unable to post comment (ProtocolException): " + e.toString());
 			return -3;
-        }
+		}
 		catch (MalformedURLException e) {
-            Log.e("COMMENT", "Unable to post comment (MalformedURLException): " + e.toString());
+			Log.e("POST_COMMENT", "Unable to post comment (MalformedURLException): " + e.toString());
 			return -4;
-        }
+		}
 		catch (IOException e) {
-            Log.e("COMMENT", "Unable to post comment (IOException): " + e.toString());
+			Log.e("POST_COMMENT", "Unable to post comment (IOException): " + e.toString());
 			return -5;
-        }
+		}
 		catch (Exception e) {
-            Log.e("COMMENT", "Unable to post comment: " + e.toString());
+			Log.e("POST_COMMENT", "Unable to post comment: " + e.toString());
 			return -1;
-        }
+		}
 
 		return 0;
-    }
+	}
 
 
+	/**
+	 * When the comment is posted, update the comment list and clean the comment form.
+	 * @param a Unused.
+	 */
+	@Override
+	protected void onPostExecute(Integer a) {
 
-    /**
-     * After completing background task
-     */
-    @SuppressLint("InflateParams") //Throws unknown error when done properly.
-    @Override
-    protected void onPostExecute(Integer a) {
-
-        if (code == 200) {
-            //Clear form
-            EditText formText = (EditText) form.findViewById(R.id.et_comment_text);
-            EditText formUser = (EditText) form.findViewById(R.id.et_comment_name);
-            formUser.setText("");
-            formText.setText("");
-
-            //TODO: Update counter
+		if (code == 200) {
+			//Clear form
+			EditText formText = (EditText) form.findViewById(R.id.et_comment_text);
+			EditText formUser = (EditText) form.findViewById(R.id.et_comment_name);
+			formUser.setText("");
+			formText.setText("");
 
 			//Perform a sync
 			((MainActivity) context).bgSync();
 
-
-            //Insert comment in list
-            LayoutInflater factory = LayoutInflater.from(context);
-            LinearLayout entry = (LinearLayout) factory.inflate(R.layout.row_comment, null);
-
-            //Set user
-            TextView tvUser = (TextView) entry.findViewById(R.id.tv_row_comment_user);
-            tvUser.setText(user);
-            Date d = new Date();
-            String date = DateFormat.format("yyyy-MM-dd hh:mm:ss", d.getTime()).toString();
-            TextView tvCDate = (TextView) entry.findViewById(R.id.tv_row_comment_date);
-            tvCDate.setText(GM.formatDate(date, language, true, true, true));
-            TextView tvText = (TextView) entry.findViewById(R.id.tv_row_comment_text);
-            tvText.setText(text);
-
-            //Add to the list
-            list.addView(entry);
-        }
-
-        //Show button again
-        btSend.setVisibility(View.VISIBLE);
-        pb.setVisibility(View.GONE);
-    }
+			//Insert comment in list
+			LayoutInflater factory = LayoutInflater.from(context);
+			LinearLayout entry = (LinearLayout) factory.inflate(R.layout.row_comment, list, false);
+
+			//Set user
+			TextView tvUser = (TextView) entry.findViewById(R.id.tv_row_comment_user);
+			tvUser.setText(user);
+			Date d = new Date();
+			String date = DateFormat.format("yyyy-MM-dd hh:mm:ss", d.getTime()).toString();
+			TextView tvCDate = (TextView) entry.findViewById(R.id.tv_row_comment_date);
+			tvCDate.setText(GM.formatDate(date, language, true, true, true));
+			TextView tvText = (TextView) entry.findViewById(R.id.tv_row_comment_text);
+			tvText.setText(text);
+
+			//Add to the list
+			list.addView(entry);
+		}
+
+		//Show button again
+		btSend.setVisibility(View.VISIBLE);
+		pb.setVisibility(View.GONE);
+	}
 }

+ 135 - 143
app/src/main/java/com/ivalentin/margolariak/PostLayout.java

@@ -1,12 +1,10 @@
 package com.ivalentin.margolariak;
 
-import android.annotation.SuppressLint;
 import android.content.Context;
 import android.database.Cursor;
 import android.database.sqlite.SQLiteDatabase;
 import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
-import android.os.Build;
 import android.os.Bundle;
 import android.app.Fragment;
 import android.util.Log;
@@ -34,145 +32,139 @@ import java.io.File;
  */
 public class PostLayout extends Fragment {
 
-    //Main View
-    private View view;
-
-    private Context context;
-
-    @SuppressLint("InflateParams") //Throws unknown error when done properly.
-    @SuppressWarnings("ResultOfMethodCallIgnored")
-    @Override
-    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
-
-        //Load the layout
-        view = inflater.inflate(R.layout.fragment_layout_post, null);
-        context = view.getContext();
-
-        //Get bundled id
-        Bundle bundle = this.getArguments();
-        final int id = bundle.getInt("post", -1);
-        if (id == -1){
-            Log.e("Post error", "No such post: " + id);
-            this.getActivity().onBackPressed();
-        }
-
-        //Get data from database
-        SQLiteDatabase db = SQLiteDatabase.openDatabase(getActivity().getDatabasePath(GM.DB.NAME).getAbsolutePath(), null, SQLiteDatabase.NO_LOCALIZED_COLLATORS | SQLiteDatabase.OPEN_READONLY);
-        final Cursor cursor;
-        String lang = GM.getLang();
-        cursor = db.rawQuery("SELECT id, title_" + lang+ " AS title, text_" + lang + " AS text, dtime, permalink FROM post WHERE id = " + id + ";", null);
-        cursor.moveToFirst();
-
-        //Get display elements
-        ImageView images[] = new ImageView[5];
-        images[0] = (ImageView) view.findViewById(R.id.iv_post_0);
-        images[1] = (ImageView) view.findViewById(R.id.iv_post_1);
-        images[2] = (ImageView) view.findViewById(R.id.iv_post_2);
-        images[3] = (ImageView) view.findViewById(R.id.iv_post_3);
-        images[4] = (ImageView) view.findViewById(R.id.iv_post_4);
-
-        TextView tvTitle = (TextView) view.findViewById(R.id.tv_post_title);
-        TextView tvDate = (TextView) view.findViewById(R.id.tv_post_date);
-        final TextView tvComments = (TextView) view.findViewById(R.id.tv_comments);
-        WebView wvText = (WebView) view.findViewById(R.id.wv_post_text);
-
-        if (Build.VERSION.SDK_INT >= 19) {
-            wvText.setLayerType(View.LAYER_TYPE_HARDWARE, null);
-        }
-        else {
-            wvText.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
-        }
-
-        LinearLayout llCommentList = (LinearLayout) view.findViewById(R.id.ll_comment_list);
-
-        //Set fields
-        tvTitle.setText(cursor.getString(1));
-        ((MainActivity) getActivity()).setSectionTitle(cursor.getString(1));
-        ((MainActivity) getActivity()).setShareLink(String.format(getString(R.string.share_with_title), cursor.getString(1)), GM.SHARE.BLOG + cursor.getString(4));
-        wvText.loadDataWithBaseURL(null, cursor.getString(2), "text/html", "utf-8", null);
-        tvDate.setText(GM.formatDate(cursor.getString(3), lang, true, true, true));
-
-        //Get images
-        Cursor imageCursor = db.rawQuery("SELECT image, idx FROM post_image WHERE post = " + id + " ORDER BY idx LIMIT 5;", null);
-        int i = 0;
-        while (imageCursor.moveToNext()) {
-            String image = imageCursor.getString(0);
-
-            //Check if image exists
-            File f;
-            f = new File(this.getActivity().getFilesDir().toString() + "/img/blog/preview/" + image);
-            if (f.exists()){
-                //If the image exists, set it.
-                Bitmap myBitmap = BitmapFactory.decodeFile(this.getActivity().getFilesDir().toString() + "/img/blog/preview/" + image);
-                images[i].setImageBitmap(myBitmap);
-            }
-            else {
-                //If not, create directories and download asynchronously
-                File fpath;
-                fpath = new File(this.getActivity().getFilesDir().toString() + "/img/blog/preview/");
-                fpath.mkdirs();
-				new DownloadImage(GM.API.SERVER + "/img/blog/preview/" + image, this.getActivity().getFilesDir().toString() + "/img/blog/preview/" + image, images[i], GM.IMG.SIZE.PREVIEW).execute();
-            }
-            images[i].setVisibility(View.VISIBLE);
-            i ++;
-        }
-        imageCursor.close();
-
-        //Get comments
-        Cursor commentCursor = db.rawQuery("SELECT text, dtime, username FROM post_comment WHERE post = " + id + ";", null);
-        tvComments.setText(String.format(getResources().getQuantityString(R.plurals.comment_comments, commentCursor.getCount()), commentCursor.getCount()));
-        //final int commentCount = commentCursor.getCount();
-        cursor.moveToFirst();
-        LinearLayout entry;
-        LayoutInflater factory = LayoutInflater.from(getActivity());
-        while (commentCursor.moveToNext()) {
-            entry = (LinearLayout) factory.inflate(R.layout.row_comment, null);
-
-            //Set user
-            TextView tvUser = (TextView) entry.findViewById(R.id.tv_row_comment_user);
-            tvUser.setText(commentCursor.getString(2));
-            TextView tvCDate = (TextView) entry.findViewById(R.id.tv_row_comment_date);
-            tvCDate.setText(GM.formatDate(commentCursor.getString(1), lang, true, true, true));
-            TextView tvText = (TextView) entry.findViewById(R.id.tv_row_comment_text);
-            tvText.setText(commentCursor.getString(0));
-
-            //Add to the list
-            llCommentList.addView(entry);
-        }
-        commentCursor.close();
-
-        //Set up comment form
-        final EditText etCommentText = (EditText) view.findViewById(R.id.et_comment_text);
-        final EditText etCommentName = (EditText) view.findViewById(R.id.et_comment_name);
-        Button btSendComment = (Button) view.findViewById(R.id.bt_comment_send);
-
-        btSendComment.setOnClickListener(new View.OnClickListener(){
-            @Override
-            public void onClick(View v) {
-                String user = etCommentName.getText().toString();
-                String text = etCommentText.getText().toString();
-                if (user.length() < 1){
-                    Toast.makeText(getActivity(), getString(R.string.comment_toast_user), Toast.LENGTH_LONG).show();
-                    etCommentName.requestFocus();
-                    return;
-                }
-                if (text.length() < 1){
-                    Toast.makeText(getActivity(), getString(R.string.comment_toast_text), Toast.LENGTH_LONG).show();
-                    etCommentText.requestFocus();
-                    return;
-                }
-
-                //Start async task
-                LinearLayout form = (LinearLayout) view.findViewById(R.id.ll_new_comment);
-                LinearLayout list = (LinearLayout) view.findViewById(R.id.ll_comment_list);
-                String lang = GM.getLang();
-                new PostComment("blog", user, text, lang, id, form, list, context).execute();
-
-            }
-        });
-
-        cursor.close();
-        db.close();
-        return view;
-    }
+	//Main View
+	private View view;
+
+	private Context context;
+
+	@Override
+	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+
+		//Load the layout
+		view = inflater.inflate(R.layout.fragment_layout_post, container, false);
+		context = view.getContext();
+
+		//Get bundled id
+		Bundle bundle = this.getArguments();
+		final int id = bundle.getInt("post", -1);
+		if (id == -1){
+			Log.e("Post error", "No such post: " + id);
+			this.getActivity().onBackPressed();
+		}
+
+		//Get data from database
+		SQLiteDatabase db = SQLiteDatabase.openDatabase(getActivity().getDatabasePath(GM.DB.NAME).getAbsolutePath(), null, SQLiteDatabase.NO_LOCALIZED_COLLATORS | SQLiteDatabase.OPEN_READONLY);
+		final Cursor cursor;
+		String lang = GM.getLang();
+		cursor = db.rawQuery("SELECT id, title_" + lang+ " AS title, text_" + lang + " AS text, dtime, permalink FROM post WHERE id = " + id + ";", null);
+		cursor.moveToFirst();
+
+		//Get display elements
+		ImageView images[] = new ImageView[5];
+		images[0] = (ImageView) view.findViewById(R.id.iv_post_0);
+		images[1] = (ImageView) view.findViewById(R.id.iv_post_1);
+		images[2] = (ImageView) view.findViewById(R.id.iv_post_2);
+		images[3] = (ImageView) view.findViewById(R.id.iv_post_3);
+		images[4] = (ImageView) view.findViewById(R.id.iv_post_4);
+
+		TextView tvTitle = (TextView) view.findViewById(R.id.tv_post_title);
+		TextView tvDate = (TextView) view.findViewById(R.id.tv_post_date);
+		final TextView tvComments = (TextView) view.findViewById(R.id.tv_comments);
+		WebView wvText = (WebView) view.findViewById(R.id.wv_post_text);
+
+		wvText.setLayerType(View.LAYER_TYPE_HARDWARE, null);
+
+		LinearLayout llCommentList = (LinearLayout) view.findViewById(R.id.ll_comment_list);
+
+		//Set fields
+		tvTitle.setText(cursor.getString(1));
+		((MainActivity) getActivity()).setSectionTitle(cursor.getString(1));
+		((MainActivity) getActivity()).setShareLink(String.format(getString(R.string.share_with_title), cursor.getString(1)), GM.SHARE.BLOG + cursor.getString(4));
+		wvText.loadDataWithBaseURL(null, cursor.getString(2), "text/html", "utf-8", null);
+		tvDate.setText(GM.formatDate(cursor.getString(3), lang, true, true, true));
+
+		//Get images
+		Cursor imageCursor = db.rawQuery("SELECT image, idx FROM post_image WHERE post = " + id + " ORDER BY idx LIMIT 5;", null);
+		int i = 0;
+		while (imageCursor.moveToNext()) {
+			String image = imageCursor.getString(0);
+
+			//Check if image exists
+			File f;
+			f = new File(this.getActivity().getFilesDir().toString() + "/img/blog/preview/" + image);
+			if (f.exists()){
+				//If the image exists, set it.
+				Bitmap myBitmap = BitmapFactory.decodeFile(this.getActivity().getFilesDir().toString() + "/img/blog/preview/" + image);
+				images[i].setImageBitmap(myBitmap);
+			}
+			else {
+				//If not, create directories and download asynchronously
+				File fpath;
+				fpath = new File(this.getActivity().getFilesDir().toString() + "/img/blog/preview/");
+				if (fpath.mkdirs()) {
+					new DownloadImage(GM.API.SERVER + "/img/blog/preview/" + image, this.getActivity().getFilesDir().toString() + "/img/blog/preview/" + image, images[i], GM.IMG.SIZE.PREVIEW).execute();
+				}
+			}
+			images[i].setVisibility(View.VISIBLE);
+			i ++;
+		}
+		imageCursor.close();
+
+		//Get comments
+		Cursor commentCursor = db.rawQuery("SELECT text, dtime, username FROM post_comment WHERE post = " + id + ";", null);
+		tvComments.setText(String.format(getResources().getQuantityString(R.plurals.comment_comments, commentCursor.getCount()), commentCursor.getCount()));
+		//final int commentCount = commentCursor.getCount();
+		cursor.moveToFirst();
+		LinearLayout entry;
+		LayoutInflater factory = LayoutInflater.from(getActivity());
+		while (commentCursor.moveToNext()) {
+			entry = (LinearLayout) factory.inflate(R.layout.row_comment, llCommentList, false);
+
+			//Set user
+			TextView tvUser = (TextView) entry.findViewById(R.id.tv_row_comment_user);
+			tvUser.setText(commentCursor.getString(2));
+			TextView tvCDate = (TextView) entry.findViewById(R.id.tv_row_comment_date);
+			tvCDate.setText(GM.formatDate(commentCursor.getString(1), lang, true, true, true));
+			TextView tvText = (TextView) entry.findViewById(R.id.tv_row_comment_text);
+			tvText.setText(commentCursor.getString(0));
+
+			//Add to the list
+			llCommentList.addView(entry);
+		}
+		commentCursor.close();
+
+		//Set up comment form
+		final EditText etCommentText = (EditText) view.findViewById(R.id.et_comment_text);
+		final EditText etCommentName = (EditText) view.findViewById(R.id.et_comment_name);
+		Button btSendComment = (Button) view.findViewById(R.id.bt_comment_send);
+
+		btSendComment.setOnClickListener(new View.OnClickListener(){
+			@Override
+			public void onClick(View v) {
+				String user = etCommentName.getText().toString();
+				String text = etCommentText.getText().toString();
+				if (user.length() < 1){
+					Toast.makeText(getActivity(), getString(R.string.comment_toast_user), Toast.LENGTH_LONG).show();
+					etCommentName.requestFocus();
+					return;
+				}
+				if (text.length() < 1){
+					Toast.makeText(getActivity(), getString(R.string.comment_toast_text), Toast.LENGTH_LONG).show();
+					etCommentText.requestFocus();
+					return;
+				}
+
+				//Start async task
+				LinearLayout form = (LinearLayout) view.findViewById(R.id.ll_new_comment);
+				LinearLayout list = (LinearLayout) view.findViewById(R.id.ll_comment_list);
+				String lang = GM.getLang();
+				new PostComment("blog", user, text, lang, id, form, list, context).execute();
+
+			}
+		});
+
+		cursor.close();
+		db.close();
+		return view;
+	}
 }

+ 13 - 11
app/src/main/java/com/ivalentin/margolariak/ReceiveLocation.java

@@ -46,14 +46,14 @@ class ReceiveLocation extends AsyncTask<Void, Void, Void> {
 
 			int httpCode = urlConnection.getResponseCode();
 			switch (httpCode) {
-				case 400:	//Client error: Bad request
-					Log.e("LOCATION", "The server returned a 400 code (Client Error: Bad request) for the url \"" + uri + "\"");
+				case 400: //Client error: Bad request
+					Log.e("RECEIVE_LOCATION", "The server returned a 400 code (Client Error: Bad request) for the url \"" + uri + "\"");
 					break;
-				case 204:	//Success: No content
-					Log.d("LOCATION", "The server returned a 204 code (Success: No content) for the url \"" + uri + "\". Not getting location...");
+				case 204: //Success: No content
+					Log.d("RECEIVE_LOCATION", "The server returned a 204 code (Success: No content) for the url \"" + uri + "\". Not getting location...");
 					break;
-				case 200:	//Success: OK
-					Log.d("LOCATION", "The server returned a 200 code (Success: OK) for the url \"" + uri + "\". Now getting location...");
+				case 200: //Success: OK
+					Log.d("RECEIVE_LOCATION", "The server returned a 200 code (Success: OK) for the url \"" + uri + "\". Now getting location...");
 					BufferedReader br = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
 					StringBuilder sb = new StringBuilder();
 					String o;
@@ -66,7 +66,7 @@ class ReceiveLocation extends AsyncTask<Void, Void, Void> {
 					String lat = strLocation.substring(strLocation.indexOf("\"lat\":\"") + 7, strLocation.indexOf("\"", strLocation.indexOf("\"lat\":\"") + 8));
 					String lon = strLocation.substring(strLocation.indexOf("\"lon\":\"") + 7, strLocation.indexOf("\"", strLocation.indexOf("\"lon\":\"") + 8));
 					String dtime = strLocation.substring(strLocation.indexOf("\"dtime\":\"") + 9, strLocation.indexOf("\"", strLocation.indexOf("\"dtime\":\"") + 10));
-					Log.d("LOCATION", "Found location [" +lat + ", " + lon + "] sent " + dtime);
+					Log.d("RECEIVE_LOCATION", "Found location [" +lat + ", " + lon + "] sent " + dtime);
 
 					//Insert into the database
 					SQLiteDatabase db = activity.openOrCreateDatabase(GM.DB.NAME, Activity.MODE_PRIVATE, null);
@@ -78,10 +78,12 @@ class ReceiveLocation extends AsyncTask<Void, Void, Void> {
 			}
 
 
-		} catch (MalformedURLException e) {
-			Log.e("LOCATION", "Unable to get location, malformed URL: " + e.toString());
-		} catch (IOException e) {
-			Log.e("LOCATION", "Unable to get location, IO exception: " + e.toString());
+		}
+		catch (MalformedURLException e) {
+			Log.e("RECEIVE_LOCATION", "Unable to get location, malformed URL: " + e.toString());
+		}
+		catch (IOException e) {
+			Log.e("RECEIVE_LOCATION", "Unable to get location, IO exception: " + e.toString());
 		}
 
 

+ 17 - 31
app/src/main/java/com/ivalentin/margolariak/ScheduleLayout.java

@@ -8,16 +8,12 @@ import java.util.Calendar;
 import java.util.Date;
 import java.util.Locale;
 
-import android.annotation.SuppressLint;
 import android.app.Dialog;
 import android.content.DialogInterface;
 import android.content.DialogInterface.OnCancelListener;
-import android.content.DialogInterface.OnShowListener;
 import android.content.Intent;
-import android.content.pm.PackageManager;
 import android.database.Cursor;
 import android.database.sqlite.SQLiteDatabase;
-import android.graphics.Color;
 import android.graphics.drawable.Drawable;
 import android.net.Uri;
 import android.os.Bundle;
@@ -58,8 +54,6 @@ import org.osmdroid.views.overlay.Polyline;
  */
 public class ScheduleLayout extends Fragment{
 
-	private Bundle bund;
-
 	private final String dates[] = new String[40];
 	private int dateCount = 0;
 	private int selected = 0;
@@ -76,7 +70,6 @@ public class ScheduleLayout extends Fragment{
 	 *
 	 * @see Fragment#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)
 	 */
-	@SuppressLint("InflateParams") //Throws unknown error when done properly.
 	@Override
 	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
 
@@ -84,7 +77,7 @@ public class ScheduleLayout extends Fragment{
 		String year = Integer.toString(calendar.get(Calendar.YEAR));
 
 		//Load the layout
-		view = inflater.inflate(R.layout.fragment_layout_schedule, null);
+		view = inflater.inflate(R.layout.fragment_layout_schedule, container, false);
 		view.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
 			@Override
 			public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
@@ -184,7 +177,6 @@ public class ScheduleLayout extends Fragment{
 	 *
 	 * @param schedule GM.SCHEDULE.GM or GM.SCHEDULE.CITY
 	 */
-	@SuppressLint({"InflateParams", "SwitchIntDef"})
 	//Views are added from a loop: I can't specify the parent when inflating.
 	private int populateSchedule(final int schedule) {
 
@@ -240,13 +232,14 @@ public class ScheduleLayout extends Fragment{
 
 
 		tvDayNumber.setText(String.valueOf(calendar.get(Calendar.DAY_OF_MONTH)));
-		switch (calendar.get(Calendar.MONTH)) {
-			case 6:
-				tvDayMonth.setText(getString(R.string.schedule_month_july));
-				break;
-			case 7:
-				tvDayMonth.setText(getString(R.string.schedule_month_august));
-				break;
+		int i = calendar.get(Calendar.MONTH);
+		if (i == Calendar.JULY) {
+			tvDayMonth.setText(getString(R.string.schedule_month_july));
+
+		}
+		else if (i == Calendar.AUGUST) {
+			tvDayMonth.setText(getString(R.string.schedule_month_august));
+
 		}
 		if (schedule == GM.SCHEDULE.MARGOLARIAK) {
 			Cursor cursorDay = db.rawQuery("SELECT name_" + lang + " FROM festival_day WHERE date(date) = '" + dates[selected] + "';", null);
@@ -272,7 +265,7 @@ public class ScheduleLayout extends Fragment{
 		c.add(Calendar.DATE, 1);  // number of days to add
 		String endDate = sdf.format(c.getTime());
 
-		String query = "";;
+		String query;
 
 		if (schedule == GM.SCHEDULE.MARGOLARIAK) {
 			query = "SELECT festival_event_gm.id, title_" + lang + ", description_" + lang + ", place, start, end, name_" + lang + ", address_" + lang + ", lat, lon FROM festival_event_gm, place WHERE place = place.id AND start >= '" + dates[selected] + " 06:00:00' AND start < '" + endDate + " 05:59:59'";
@@ -293,7 +286,7 @@ public class ScheduleLayout extends Fragment{
 		while (cursor.moveToNext()) {
 			eventCount++;
 
-			entry = (LinearLayout) factory.inflate(R.layout.row_schedule, null);
+			entry = (LinearLayout) factory.inflate(R.layout.row_schedule, list, false);
 
 			//Set id
 			tvRowId = (TextView) entry.findViewById(R.id.tv_row_schedule_id);
@@ -558,7 +551,7 @@ public class ScheduleLayout extends Fragment{
 
 					// Read from route_point and draw the route on the map.
 					Cursor pointCursor = db.rawQuery("SELECT lat_o, lon_o, lat_d, lon_d FROM route_point WHERE route = " + routeId + " ORDER BY part;", null);
-					final ArrayList<GeoPoint> points = new ArrayList<GeoPoint>();
+					final ArrayList<GeoPoint> points = new ArrayList<>();
 					GeoPoint lastPoint = new GeoPoint(0.0, 0.0);
 					while (pointCursor.moveToNext()){
 
@@ -573,10 +566,11 @@ public class ScheduleLayout extends Fragment{
 					//Create path
 					Polyline line = new Polyline();
 					line.setPoints(points);
-					line.setColor(getResources().getColor(R.color.background_menu));
+					line.setColor(getResources().getColor(R.color.background_menu, null));
 					mapView.getOverlays().add(line);
 
 				}
+				routeCursor.close();
 
 			}
 			else{
@@ -590,11 +584,11 @@ public class ScheduleLayout extends Fragment{
 					GeoPoint center = new GeoPoint(placeCursor.getDouble(2), placeCursor.getDouble(3));
 					mapController.setCenter(center);
 					OverlayItem locationOverlayItem = new OverlayItem(title, placeCursor.getString(0), center);
-					Drawable locationMarker = this.getResources().getDrawable(R.drawable.pinpoint);
+					Drawable locationMarker = this.getResources().getDrawable(R.drawable.pinpoint, null);
 					locationOverlayItem.setMarker(locationMarker);
-					final ArrayList<OverlayItem> items = new ArrayList<OverlayItem>();
+					final ArrayList<OverlayItem> items = new ArrayList<>();
 					items.add(locationOverlayItem);
-					ItemizedIconOverlay locationOverlay = new ItemizedIconOverlay<OverlayItem>(items,
+					ItemizedIconOverlay locationOverlay = new ItemizedIconOverlay<>(items,
 							new ItemizedIconOverlay.OnItemGestureListener<OverlayItem>() {
 								public boolean onItemSingleTapUp(final int index, final OverlayItem item) {
 									return true;
@@ -666,12 +660,4 @@ public class ScheduleLayout extends Fragment{
 		super.onResume();
 	}
 
-
-	/**
-	 * Checks app permission to access the user location.
-	 * @return true if the permission has been granted, false otherwise.
-	 */
-	private boolean checkLocationPermission(){
-		return getContext().checkSelfPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED && getContext().checkSelfPermission(android.Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED;
-	}
 }

+ 8 - 2
app/src/main/java/com/ivalentin/margolariak/SettingsActivity.java

@@ -45,7 +45,7 @@ public class SettingsActivity extends Activity {
 	 *
 	 * @see Activity#onCreate(Bundle)
 	 */
-	@SuppressLint("CommitPrefEdits") // apply() is called in other methods
+	@SuppressLint("CommitPrefEdits")
 	@Override
 	public void onCreate(Bundle savedInstanceState) {
 		super.onCreate(savedInstanceState);
@@ -263,7 +263,13 @@ public class SettingsActivity extends Activity {
 
 		//Prep the dialog
 		WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
-		lp.copyFrom(dialog.getWindow().getAttributes());
+		try {
+			//noinspection ConstantConditions
+			lp.copyFrom(dialog.getWindow().getAttributes());
+		}
+		catch (NullPointerException e){
+			Log.e("SETTINGS_ACTIVITY", "Error setting the dialog attributes: " + e.toString());
+		}
 		lp.width = WindowManager.LayoutParams.MATCH_PARENT;
 		lp.height = WindowManager.LayoutParams.WRAP_CONTENT;
 		lp.gravity = Gravity.CENTER;

+ 0 - 179
app/src/main/java/com/ivalentin/margolariak/SettingsLayout.java

@@ -1,179 +0,0 @@
-package com.ivalentin.margolariak;
-
-import android.annotation.SuppressLint;
-import android.app.Dialog;
-import android.content.Context;
-import android.content.SharedPreferences;
-import android.os.Build;
-import android.os.Bundle;
-import android.app.Fragment;
-import android.view.Gravity;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.view.ViewGroup;
-import android.view.Window;
-import android.view.WindowManager;
-import android.webkit.WebView;
-import android.widget.Button;
-import android.widget.CheckBox;
-import android.widget.RelativeLayout;
-import android.widget.TextView;
-
-/**
- * Section that allow the user to change the app settings.
- * 
- * @author Inigo Valentin
- *
- */
-public class SettingsLayout extends Fragment{
-
-	/**
-	 * Run when the fragment is inflated.
-	 * Assigns the view and the click listeners. 
-	 * 
-	 * @param inflater A LayoutInflater to manage views
-	 * @param container The container View
-	 * @param savedInstanceState Bundle containing the state
-	 * 
-	 * @see android.support.v4.app.Fragment#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)
-	 */
-	@SuppressLint("InflateParams") //Throws unknown error when done properly.
-	@Override
-	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
-		
-		//Load the layout
-		final View view = inflater.inflate(R.layout.fragment_layout_settings, null);
-		
-		//Set the title
-		((MainActivity) getActivity()).setSectionTitle(view.getContext().getString(R.string.menu_settings));
-		
-		//Get views.
-		RelativeLayout rlNotification = (RelativeLayout) view.findViewById(R.id.rl_settings_notifications);
-		final CheckBox cbNotification = (CheckBox) view.findViewById(R.id.cb_settings_notifications);
-		final TextView tvNotification = (TextView) view.findViewById(R.id.tv_settings_notifications_summary);
-		TextView tvLicense = (TextView) view.findViewById(R.id.tv_setting_license);
-		TextView tvPrivacy = (TextView) view.findViewById(R.id.tv_setting_privacy);
-		TextView tvAbout = (TextView) view.findViewById(R.id.tv_setting_about);
-		TextView tvTransparency = (TextView) view.findViewById(R.id.tv_setting_transparency);
-
-
-		//Set initial state of the notification  settings
-		SharedPreferences settings = view.getContext().getSharedPreferences(GM.PREFERENCES.PREFERNCES, Context.MODE_PRIVATE);
-		if (settings.getBoolean(GM.PREFERENCES.KEY.NOTIFICATIONS, GM.PREFERENCES.DEFAULT.NOTIFICATIONS)){
-			cbNotification.setChecked(true);
-			tvNotification.setText(view.getContext().getString(R.string.settings_notification_on));
-		}
-		else{
-			cbNotification.setChecked(false);
-			tvNotification.setText(view.getContext().getString(R.string.settings_notification_off));
-		}
-
-		//Set click listener for "Notification" preference
-		rlNotification.setOnClickListener(new OnClickListener(){
-			@Override
-			public void onClick(View v) {
-				if (cbNotification.isChecked()){
-					cbNotification.setChecked(false);
-					tvNotification.setText(view.getContext().getString(R.string.settings_notification_off));
-					SharedPreferences preferences = view.getContext().getSharedPreferences(GM.PREFERENCES.PREFERNCES, Context.MODE_PRIVATE);
-					SharedPreferences.Editor editor = preferences.edit();
-					editor.putBoolean(GM.PREFERENCES.KEY.NOTIFICATIONS, false);
-					editor.apply();
-				}
-				else{
-					cbNotification.setChecked(true);
-					tvNotification.setText(view.getContext().getString(R.string.settings_notification_on));
-					SharedPreferences preferences = view.getContext().getSharedPreferences(GM.PREFERENCES.PREFERNCES, Context.MODE_PRIVATE);
-					SharedPreferences.Editor editor = preferences.edit();
-					editor.putBoolean(GM.PREFERENCES.KEY.NOTIFICATIONS, true);
-					editor.apply();
-				}
-			}
-			
-		});
-
-		//Set listener for the other buttons
-		tvLicense.setOnClickListener(new OnClickListener() {
-			@Override
-			public void onClick(View v) {
-				String title = v.getResources().getString(R.string.settings_license);
-				String text = v.getResources().getString(R.string.settings_license_content);
-				showDialog(title, text);
-			}
-		});
-		tvPrivacy.setOnClickListener(new OnClickListener() {
-			@Override
-			public void onClick(View v) {
-				String title = v.getResources().getString(R.string.settings_privacy);
-				String text = v.getResources().getString(R.string.settings_privacy_content);
-				showDialog(title, text);
-			}
-		});
-		tvAbout.setOnClickListener(new OnClickListener() {
-			@Override
-			public void onClick(View v) {
-				String title = v.getResources().getString(R.string.settings_about);
-				String text = v.getResources().getString(R.string.settings_about_content);
-				showDialog(title, text);
-			}
-		});
-		tvTransparency.setOnClickListener(new OnClickListener() {
-			@Override
-			public void onClick(View v) {
-				String title = v.getResources().getString(R.string.settings_transparency);
-				String text = v.getResources().getString(R.string.settings_transparency_content);
-				showDialog(title, text);
-			}
-		});
-
-		return view;
-	}
-
-	private void showDialog(String title, String text){
-		//Create the dialog
-		final Dialog dialog = new Dialog(getActivity());
-
-		//Set up dialog window
-		dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
-		dialog.setContentView(R.layout.dialog_settings);
-
-		//Set the custom dialog components - text, image and button
-		TextView tvTitle = (TextView) dialog.findViewById(R.id.tv_dialog_settings_title);
-		WebView wvText = (WebView) dialog.findViewById(R.id.wv_dialog_settings_text);
-
-		if (Build.VERSION.SDK_INT >= 19) {
-			wvText.setLayerType(View.LAYER_TYPE_HARDWARE, null);
-		}
-		else {
-			wvText.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
-		}
-
-		Button btClose = (Button) dialog.findViewById(R.id.bt_dialog_settings_close);
-
-		//Set text
-		tvTitle.setText(title);
-		wvText.loadDataWithBaseURL(null, text, "text/html", "utf-8", null);
-
-		//Set close button
-		btClose.setOnClickListener(new OnClickListener() {
-			@Override
-			public void onClick(View v) {
-				dialog.dismiss();
-			}
-		});
-
-		//Set parameters
-		WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
-		lp.copyFrom(dialog.getWindow().getAttributes());
-		lp.width = WindowManager.LayoutParams.MATCH_PARENT;
-		lp.height = WindowManager.LayoutParams.WRAP_CONTENT;
-		lp.gravity = Gravity.CENTER;
-		lp.dimAmount = 0.4f;
-		dialog.getWindow().setAttributes(lp);
-
-		//Show dialog
-		dialog.show();
-
-	}
-}

+ 2 - 4
app/src/main/java/com/ivalentin/margolariak/SponsorActivity.java

@@ -1,6 +1,5 @@
 package com.ivalentin.margolariak;
 
-import android.annotation.SuppressLint;
 import android.app.Activity;
 import android.app.Dialog;
 import android.content.Intent;
@@ -39,7 +38,6 @@ public class SponsorActivity extends Activity {
 	 * @param savedInstanceState Saved state of the activity.
 	 * @see Activity#onCreate(Bundle)
 	 */
-	@SuppressLint("InflateParams")
 	@Override
 	protected void onCreate(Bundle savedInstanceState) {
 
@@ -64,9 +62,9 @@ public class SponsorActivity extends Activity {
 
 		while (cursor.moveToNext()) {
 			//Create a new row
-			entry = (LinearLayout) factory.inflate(R.layout.row_sponsor, null);
+			entry = (LinearLayout) factory.inflate(R.layout.row_sponsor, llList, false);
 
-			//Set margins TODO: I don't know why it doesnt read margins from the xml
+			//Set margins
 			LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
 			int margin = (int) (9 * getResources().getDisplayMetrics().density);
 			layoutParams.setMargins(margin, margin, margin, margin);

+ 12 - 9
app/src/main/java/com/ivalentin/margolariak/UsActivity.java

@@ -1,10 +1,10 @@
 package com.ivalentin.margolariak;
 
-import android.annotation.SuppressLint;
 import android.app.Activity;
 import android.app.Dialog;
 import android.graphics.drawable.Drawable;
 import android.os.Bundle;
+import android.util.Log;
 import android.view.Gravity;
 import android.view.View;
 import android.view.Window;
@@ -14,7 +14,6 @@ import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.TextView;
 
-import java.io.File;
 
 /**
  * Activity with info about Gasteizko margolariak.
@@ -32,7 +31,6 @@ public class UsActivity extends Activity {
 	 * @param savedInstanceState Saved state of the activity.
 	 * @see Activity#onCreate(Bundle)
 	 */
-	@SuppressLint("InflateParams")
 	@Override
 	protected void onCreate(Bundle savedInstanceState) {
 
@@ -53,25 +51,25 @@ public class UsActivity extends Activity {
 		llCuadrilla.setOnClickListener(new View.OnClickListener() {
 			@Override
 			public void onClick(View v) {
-				openDialog(getString(R.string.us_cuadrilla), getString(R.string.us_cuadrilla_content), getResources().getDrawable(R.drawable.us_cuadrilla));
+				openDialog(getString(R.string.us_cuadrilla), getString(R.string.us_cuadrilla_content), getResources().getDrawable(R.drawable.us_cuadrilla, null));
 			}
 		});
 		llAssociation.setOnClickListener(new View.OnClickListener() {
 			@Override
 			public void onClick(View v) {
-				openDialog(getString(R.string.us_association), getString(R.string.us_association_content), getResources().getDrawable(R.drawable.us_asociacion));
+				openDialog(getString(R.string.us_association), getString(R.string.us_association_content), getResources().getDrawable(R.drawable.us_asociacion, null));
 			}
 		});
 		llActivities.setOnClickListener(new View.OnClickListener() {
 			@Override
 			public void onClick(View v) {
-				openDialog(getString(R.string.us_activities), getString(R.string.us_activities_content), getResources().getDrawable(R.drawable.us_activities));
+				openDialog(getString(R.string.us_activities), getString(R.string.us_activities_content), getResources().getDrawable(R.drawable.us_activities, null));
 			}
 		});
 		llTransparency.setOnClickListener(new View.OnClickListener() {
 			@Override
 			public void onClick(View v) {
-				openDialog(getString(R.string.us_transparency), getString(R.string.us_transparency_content), getResources().getDrawable(R.drawable.us_transparency));
+				openDialog(getString(R.string.us_transparency), getString(R.string.us_transparency_content), getResources().getDrawable(R.drawable.us_transparency, null));
 			}
 		});
 
@@ -84,7 +82,6 @@ public class UsActivity extends Activity {
 	 * @param text The dialog text.
 	 * @param img The dialog image.
 	 */
-	@SuppressWarnings("ConstantConditions")
 	private void openDialog(final String title, final String text, final Drawable img){
 
 		//Create the dialog
@@ -117,7 +114,13 @@ public class UsActivity extends Activity {
 
 		//Show the dialog
 		WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
-		lp.copyFrom(dialog.getWindow().getAttributes());
+		try {
+			//noinspection ConstantConditions
+			lp.copyFrom(dialog.getWindow().getAttributes());
+		}
+		catch (NullPointerException e){
+			Log.e("SETTINGS_ACTIVITY", "Error setting the dialog attributes: " + e.toString());
+		}
 		lp.width = WindowManager.LayoutParams.MATCH_PARENT;
 		lp.height = WindowManager.LayoutParams.WRAP_CONTENT;
 		lp.gravity = Gravity.CENTER;

+ 0 - 14
app/src/main/res/drawable/album.xml

@@ -1,14 +0,0 @@
-<shape xmlns:android="http://schemas.android.com/apk/res/android"
-    android:shape="rectangle" >
-
-    <stroke
-        android:width="2dp"
-        android:color="@color/album_border" />
-    <solid android:color="@color/album_background" />
-    <corners android:bottomRightRadius="7dp" android:bottomLeftRadius="7dp"
-        android:topLeftRadius="7dp" android:topRightRadius="7dp"/>
-    <padding android:left="8dp"
-        android:top="8dp"
-        android:right="8dp"
-        android:bottom="8dp" />
-</shape>

BIN
app/src/main/res/drawable/divider.png


BIN
app/src/main/res/drawable/ic_launcher_old.png


BIN
app/src/main/res/drawable/menu.png


BIN
app/src/main/res/drawable/photo_placeholder.png


+ 0 - 15
app/src/main/res/drawable/row_home_image.xml

@@ -1,15 +0,0 @@
-<shape
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:shape="rectangle" >
-
-    <stroke
-        android:width="1dp"
-        android:color="@color/image_border" />
-
-    <corners
-        android:bottomRightRadius="2dp"
-        android:bottomLeftRadius="2dp"
-        android:topLeftRadius="2dp"
-        android:topRightRadius="2dp"/>
-
-</shape>

+ 0 - 18
app/src/main/res/drawable/titlebar.xml

@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<!-- Shape for the title bar -->
-
-<selector
-    xmlns:android="http://schemas.android.com/apk/res/android">
-	<item>
-	    <shape>
-	        <gradient
-	            android:angle="90"
-	            android:centerY="10%"
-	            android:centerX="0.1"
-	            android:startColor="@color/background_bar_gradient"
-	            android:endColor="@color/background_bar"
-	            android:type="linear" />
-	    </shape>
-	</item>
-</selector>

BIN
app/src/main/res/drawable/tutorial_point.png


BIN
app/src/main/res/drawable/tutorial_slide.png


+ 1 - 14
app/src/main/res/layout/activity_main.xml

@@ -1,6 +1,5 @@
 <LinearLayout
 	xmlns:android="http://schemas.android.com/apk/res/android"
-	xmlns:app="http://schemas.android.com/apk/res-auto"
 	xmlns:tools="http://schemas.android.com/tools"
 	android:layout_width="match_parent"
 	android:layout_height="fill_parent"
@@ -70,7 +69,7 @@
 			android:layout_weight=".2"
 			android:adjustViewBounds="true"
 			android:background="#00000000"
-			android:contentDescription="@string/tutorial_menu"
+			android:contentDescription="@string/menu_settings"
 			android:cropToPadding="false"
 			android:maxHeight="45dp"
 			android:maxWidth="45dp"
@@ -132,8 +131,6 @@
 					android:layout_height="7dp"
 					android:layout_alignParentBottom="true"
 					android:layout_alignParentEnd="false"
-					android:layout_alignParentLeft="false"
-					android:layout_alignParentRight="false"
 					android:layout_alignParentStart="false"
 					android:layout_gravity="bottom"
 					android:alpha="1"
@@ -167,8 +164,6 @@
 					android:layout_height="3dp"
 					android:layout_alignParentBottom="true"
 					android:layout_alignParentEnd="false"
-					android:layout_alignParentLeft="false"
-					android:layout_alignParentRight="false"
 					android:layout_alignParentStart="false"
 					android:layout_gravity="bottom"
 					android:alpha="1"
@@ -201,8 +196,6 @@
 					android:layout_height="3dp"
 					android:layout_alignParentBottom="true"
 					android:layout_alignParentEnd="false"
-					android:layout_alignParentLeft="false"
-					android:layout_alignParentRight="false"
 					android:layout_alignParentStart="false"
 					android:layout_gravity="bottom"
 					android:alpha="1"
@@ -235,8 +228,6 @@
 					android:layout_height="3dp"
 					android:layout_alignParentBottom="true"
 					android:layout_alignParentEnd="false"
-					android:layout_alignParentLeft="false"
-					android:layout_alignParentRight="false"
 					android:layout_alignParentStart="false"
 					android:layout_gravity="bottom"
 					android:alpha="1"
@@ -269,8 +260,6 @@
 					android:layout_height="3dp"
 					android:layout_alignParentBottom="true"
 					android:layout_alignParentEnd="false"
-					android:layout_alignParentLeft="false"
-					android:layout_alignParentRight="false"
 					android:layout_alignParentStart="false"
 					android:layout_gravity="bottom"
 					android:alpha="1"
@@ -303,8 +292,6 @@
 					android:layout_height="3dp"
 					android:layout_alignParentBottom="true"
 					android:layout_alignParentEnd="false"
-					android:layout_alignParentLeft="false"
-					android:layout_alignParentRight="false"
 					android:layout_alignParentStart="false"
 					android:layout_gravity="bottom"
 					android:alpha="1"

+ 0 - 6
app/src/main/res/layout/activity_settings.xml

@@ -1,6 +1,5 @@
 <LinearLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="fill_parent"
@@ -125,7 +124,6 @@
                         android:textColor="@android:color/black"
                         android:layout_marginTop="4dp"
                         android:layout_marginStart="10dp"
-                        android:layout_marginLeft="10dp"
                         android:textStyle="italic"
                         android:alpha="0.8"/>
                 </LinearLayout>
@@ -184,7 +182,6 @@
                         android:textColor="@android:color/black"
                         android:layout_marginTop="4dp"
                         android:layout_marginStart="10dp"
-                        android:layout_marginLeft="10dp"
                         android:textStyle="italic"
                         android:alpha="0.8"/>
                 </LinearLayout>
@@ -241,7 +238,6 @@
                     android:textColor="@android:color/black"
                     android:layout_marginTop="4dp"
                     android:layout_marginStart="10dp"
-                    android:layout_marginLeft="10dp"
                     android:layout_weight=".15"
                     android:textStyle="italic"
                     android:alpha="0.8"/>
@@ -281,7 +277,6 @@
                     android:textColor="@android:color/black"
                     android:layout_marginTop="4dp"
                     android:layout_marginStart="10dp"
-                    android:layout_marginLeft="10dp"
                     android:layout_weight=".15"
                     android:textStyle="italic"
                     android:alpha="0.8"/>
@@ -323,7 +318,6 @@
                     android:textColor="@android:color/black"
                     android:layout_marginTop="4dp"
                     android:layout_marginStart="10dp"
-                    android:layout_marginLeft="10dp"
                     android:layout_weight=".15"
                     android:textStyle="italic"
                     android:alpha="0.8"/>

+ 0 - 3
app/src/main/res/layout/activity_sponsor.xml

@@ -1,6 +1,5 @@
 <LinearLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="fill_parent"
@@ -97,8 +96,6 @@
                 android:background="@drawable/section_title"
                 android:paddingBottom="4dp"
                 android:paddingEnd="10dp"
-                android:paddingLeft="20dp"
-                android:paddingRight="10dp"
                 android:paddingStart="20dp"
                 android:paddingTop="4dp"
                 android:textColor="@color/section_title"/>

+ 0 - 3
app/src/main/res/layout/activity_us.xml

@@ -1,6 +1,5 @@
 <LinearLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="fill_parent"
@@ -95,8 +94,6 @@
                 android:background="@drawable/section_title"
                 android:paddingBottom="4dp"
                 android:paddingEnd="10dp"
-                android:paddingLeft="20dp"
-                android:paddingRight="10dp"
                 android:paddingStart="20dp"
                 android:paddingTop="4dp"
                 android:textColor="@color/section_title"/>

+ 0 - 4
app/src/main/res/layout/dialog_changelog.xml

@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <RelativeLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
     android:orientation="vertical"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
@@ -24,8 +23,6 @@
         android:textColor="@color/section_title"
         android:paddingBottom="4dp"
         android:paddingEnd="10dp"
-        android:paddingLeft="20dp"
-        android:paddingRight="10dp"
         android:paddingStart="20dp"
         android:paddingTop="4dp"
         android:background="@drawable/section_title"
@@ -61,7 +58,6 @@
         android:layout_marginRight="25dp"
         android:layout_marginStart="25dp"
         android:layout_marginTop="5dp"
-        android:layout_weight=".5"
         android:background="@drawable/button_selector"
         android:minHeight="40dp"
         android:textColor="@color/input_button_color"

+ 0 - 2
app/src/main/res/layout/dialog_notification.xml

@@ -21,8 +21,6 @@
         android:background="@drawable/section_title"
         android:paddingBottom="4dp"
         android:paddingEnd="10dp"
-        android:paddingLeft="20dp"
-        android:paddingRight="10dp"
         android:paddingStart="20dp"
         android:paddingTop="4dp"
         android:textColor="@color/section_title"/>

+ 1 - 8
app/src/main/res/layout/dialog_schedule.xml

@@ -54,8 +54,6 @@
             android:background="@drawable/section_title"
             android:paddingBottom="4dp"
             android:paddingEnd="10dp"
-            android:paddingLeft="20dp"
-            android:paddingRight="10dp"
             android:paddingStart="20dp"
             android:paddingTop="4dp"
             android:textAppearance="?android:attr/textAppearanceLarge"
@@ -80,7 +78,6 @@
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:capitalize="sentences"
-                    android:text="AAA"
                     android:textAppearance="?android:attr/textAppearanceMedium"
                     android:textColor="@color/entry_title"
                     android:textStyle="bold"
@@ -90,7 +87,6 @@
                     android:id="@+id/tv_dialog_schedule_time"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:layout_marginLeft="10dp"
                     android:layout_marginStart="10dp"
                     android:textAppearance="?android:attr/textAppearanceMedium"
                     android:textColor="@color/entry_title"
@@ -109,7 +105,6 @@
                 android:id="@+id/tv_dialog_schedule_host"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:layout_marginLeft="15dp"
                 android:layout_marginStart="15dp"
                 android:textAppearance="@android:style/TextAppearance.Small"
                 android:textStyle="italic"
@@ -119,7 +114,6 @@
                 android:id="@+id/tv_dialog_schedule_sponsor"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:layout_marginLeft="15dp"
                 android:layout_marginStart="15dp"
                 android:textAppearance="@android:style/TextAppearance.Small"
                 android:textStyle="italic"
@@ -146,7 +140,6 @@
                 <LinearLayout
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    android:layout_marginLeft="10dp"
                     android:layout_marginStart="10dp"
                     android:orientation="vertical">
 
@@ -175,7 +168,7 @@
 
                 <LinearLayout
                     android:layout_width="match_parent"
-                    android:layout_height="match_parent"
+                    android:layout_height="0dp"
                     android:layout_weight=".95"
                     android:background="@drawable/map"
                     android:padding="3dp">

+ 0 - 50
app/src/main/res/layout/dialog_settings.xml

@@ -1,50 +0,0 @@
-<LinearLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="fill_parent"
-    android:layout_height="wrap_content"
-    android:background="@drawable/section"
-    android:orientation="vertical"
-    android:padding="7dp" >
-
-    <TextView
-        android:id="@+id/tv_dialog_settings_title"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:ellipsize="end"
-        android:maxLines="2"
-        android:textAppearance="@android:style/TextAppearance.Large"
-        android:textStyle="bold"/>
-
-    <ScrollView
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content">
-
-        <LinearLayout
-            android:layout_width="fill_parent"
-            android:layout_height="match_parent"
-            android:orientation="vertical"
-            android:background="@drawable/entry"
-            android:padding="7dp"
-            tools:ignore="ScrollViewSize">
-
-            <WebView
-                android:layout_width="fill_parent"
-                android:layout_height="wrap_content"
-                android:id="@+id/wv_dialog_settings_text"/>
-
-        </LinearLayout>
-    </ScrollView>
-
-    <Button
-        android:id="@+id/bt_dialog_settings_close"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_margin="10dp"
-        android:background="@drawable/button_selector"
-        android:text="@string/notification_close"
-        android:textColor="@color/input_text_color"
-        android:textStyle="bold"
-        android:layout_gravity="center_horizontal"/>
-
-</LinearLayout>

+ 13 - 13
app/src/main/res/layout/dialog_sponsor.xml

@@ -1,6 +1,6 @@
 <LinearLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:orientation="vertical"
@@ -16,12 +16,9 @@
         android:background="@drawable/section_title"
         android:paddingBottom="4dp"
         android:paddingEnd="10dp"
-        android:paddingLeft="20dp"
-        android:paddingRight="10dp"
         android:paddingStart="20dp"
         android:paddingTop="4dp"
-        android:textColor="@color/section_title"
-        android:layout_alignParentTop="true"/>
+        android:textColor="@color/section_title"/>
 
     <LinearLayout
         android:layout_width="match_parent"
@@ -29,8 +26,7 @@
         android:orientation="vertical"
         android:background="@drawable/entry"
         android:layout_margin="8dp"
-        android:padding="7dp"
-        >
+        android:padding="7dp">
 
         <ImageView
             android:layout_width="match_parent"
@@ -38,7 +34,8 @@
             android:src="@drawable/photo_placeholder_thumb"
             android:id="@+id/iv_dialog_sponsor_image"
             android:maxHeight="140dp"
-            android:adjustViewBounds="true"/>
+            android:adjustViewBounds="true"
+            android:contentDescription="@string/pop_menu_sponsors"/>
 
         <TextView
             android:id="@+id/tv_dialog_sponsor_text"
@@ -56,7 +53,8 @@
                 android:orientation="horizontal"
                 android:layout_width="wrap_content"
                 android:layout_height="match_parent"
-                android:id="@+id/ll_dialog_sponsor_url">
+                android:id="@+id/ll_dialog_sponsor_url"
+                tools:ignore="UseCompoundDrawables">
 
                 <ImageView
                     android:layout_width="30dp"
@@ -68,6 +66,7 @@
                     android:layout_marginEnd="15dp"
                     android:layout_marginTop="20dp"
                     android:adjustViewBounds="true"
+                    android:contentDescription="@string/sponsors_url"
                     android:src="@drawable/web"/>
 
                 <TextView
@@ -76,7 +75,7 @@
                     android:id="@+id/tv_dialog_sponsor_url"
                     android:layout_weight="1"
                     android:gravity="center_vertical"
-                    android:layout_width="match_parent"
+                    android:layout_width="0dp"
                     android:textColor="@color/background_menu"
                     android:textSize="16sp"
                     android:textStyle="normal|bold"/>
@@ -86,7 +85,8 @@
                 android:orientation="horizontal"
                 android:layout_width="wrap_content"
                 android:layout_height="match_parent"
-                android:id="@+id/ll_dialog_sponsor_address">
+                android:id="@+id/ll_dialog_sponsor_address"
+                tools:ignore="UseCompoundDrawables">
 
                 <ImageView
                     android:layout_width="30dp"
@@ -98,6 +98,7 @@
                     android:layout_marginLeft="15dp"
                     android:layout_marginEnd="15dp"
                     android:layout_marginTop="20dp"
+                    android:contentDescription="@string/sponsors_url"
                     android:src="@drawable/pinpoint"/>
 
                 <TextView
@@ -105,7 +106,7 @@
                     android:id="@+id/tv_dialog_sponsor_address"
                     android:layout_weight="1"
                     android:gravity="center_vertical"
-                    android:layout_width="match_parent"
+                    android:layout_width="0dp"
                     android:textStyle="normal|bold"
                     android:textSize="16sp"
                     android:textColor="@color/background_menu"/>
@@ -122,7 +123,6 @@
         android:text="@string/notification_close"
         android:textColor="@color/input_text_color"
         android:textStyle="bold"
-        android:layout_alignParentBottom="true"
         android:layout_height="50dp"/>
 
 </LinearLayout>

+ 0 - 2
app/src/main/res/layout/dialog_sync.xml

@@ -16,8 +16,6 @@
         android:background="@drawable/section_title"
         android:paddingBottom="4dp"
         android:paddingEnd="10dp"
-        android:paddingLeft="20dp"
-        android:paddingRight="10dp"
         android:paddingStart="20dp"
         android:paddingTop="4dp"
         android:textColor="@color/section_title"/>

+ 0 - 2
app/src/main/res/layout/dialog_sync_failed.xml

@@ -17,8 +17,6 @@
         android:background="@drawable/section_title"
         android:paddingBottom="4dp"
         android:paddingEnd="10dp"
-        android:paddingLeft="20dp"
-        android:paddingRight="10dp"
         android:paddingStart="20dp"
         android:paddingTop="4dp"
         android:textColor="@color/section_title"/>

+ 4 - 8
app/src/main/res/layout/dialog_us.xml

@@ -16,12 +16,9 @@
         android:background="@drawable/section_title"
         android:paddingBottom="4dp"
         android:paddingEnd="10dp"
-        android:paddingLeft="20dp"
-        android:paddingRight="10dp"
         android:paddingStart="20dp"
         android:paddingTop="4dp"
-        android:textColor="@color/section_title"
-        android:layout_alignParentTop="true"/>
+        android:textColor="@color/section_title"/>
 
     <LinearLayout
         android:layout_width="match_parent"
@@ -29,8 +26,7 @@
         android:orientation="vertical"
         android:background="@drawable/entry"
         android:layout_margin="8dp"
-        android:padding="7dp"
-        >
+        android:padding="7dp">
 
         <ImageView
             android:id="@+id/iv_dialog_us_image"
@@ -39,7 +35,8 @@
             android:adjustViewBounds="true"
             android:maxHeight="140dp"
             android:minHeight="100dp"
-            android:src="@drawable/photo_placeholder_thumb"/>
+            android:src="@drawable/photo_placeholder_thumb"
+            android:contentDescription="@string/app_name"/>
 
         <TextView
             android:id="@+id/tv_dialog_us_text"
@@ -58,7 +55,6 @@
         android:text="@string/notification_close"
         android:textColor="@color/input_text_color"
         android:textStyle="bold"
-        android:layout_alignParentBottom="true"
         android:layout_height="50dp"/>
 
 </LinearLayout>

+ 0 - 4
app/src/main/res/layout/fragment_layout_activities.xml

@@ -29,8 +29,6 @@
                 android:background="@drawable/section_title"
                 android:paddingBottom="4dp"
                 android:paddingEnd="10dp"
-                android:paddingLeft="20dp"
-                android:paddingRight="10dp"
                 android:paddingStart="20dp"
                 android:paddingTop="4dp"
                 android:textColor="@color/section_title"/>
@@ -62,8 +60,6 @@
             android:background="@drawable/section_title"
             android:paddingBottom="4dp"
             android:paddingEnd="10dp"
-            android:paddingLeft="20dp"
-            android:paddingRight="10dp"
             android:paddingStart="20dp"
             android:paddingTop="4dp"
             android:textColor="@color/section_title"

+ 0 - 2
app/src/main/res/layout/fragment_layout_activity_future.xml

@@ -30,8 +30,6 @@
                 android:background="@drawable/section_title"
                 android:paddingBottom="4dp"
                 android:paddingEnd="10dp"
-                android:paddingLeft="20dp"
-                android:paddingRight="10dp"
                 android:paddingStart="20dp"
                 android:paddingTop="4dp"
                 android:textColor="@color/section_title"/>

+ 0 - 2
app/src/main/res/layout/fragment_layout_activity_past.xml

@@ -30,8 +30,6 @@
                 android:background="@drawable/section_title"
                 android:paddingBottom="4dp"
                 android:paddingEnd="10dp"
-                android:paddingLeft="20dp"
-                android:paddingRight="10dp"
                 android:paddingStart="20dp"
                 android:paddingTop="4dp"
                 android:textColor="@color/section_title"/>

+ 0 - 2
app/src/main/res/layout/fragment_layout_album.xml

@@ -22,8 +22,6 @@
             android:background="@drawable/section_title"
             android:paddingBottom="4dp"
             android:paddingEnd="10dp"
-            android:paddingLeft="20dp"
-            android:paddingRight="10dp"
             android:paddingStart="20dp"
             android:paddingTop="4dp"
             android:textColor="@color/section_title"

+ 0 - 2
app/src/main/res/layout/fragment_layout_blog.xml

@@ -29,8 +29,6 @@
                 android:background="@drawable/section_title"
                 android:paddingBottom="4dp"
                 android:paddingEnd="10dp"
-                android:paddingLeft="20dp"
-                android:paddingRight="10dp"
                 android:paddingStart="20dp"
                 android:paddingTop="4dp"
                 android:textColor="@color/section_title"/>

+ 0 - 2
app/src/main/res/layout/fragment_layout_gallery.xml

@@ -65,8 +65,6 @@
             android:background="@drawable/section_title"
             android:paddingBottom="4dp"
             android:paddingEnd="10dp"
-            android:paddingLeft="20dp"
-            android:paddingRight="10dp"
             android:paddingStart="20dp"
             android:paddingTop="4dp"
             android:textColor="@color/section_title"

+ 726 - 747
app/src/main/res/layout/fragment_layout_home.xml

@@ -1,772 +1,751 @@
 <com.ivalentin.margolariak.CustomScrollView
-	xmlns:android="http://schemas.android.com/apk/res/android"
-	xmlns:app="http://schemas.android.com/apk/res-auto"
-	xmlns:tools="http://schemas.android.com/tools"
-	android:id="@+id/sh_home_layout"
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:id="@+id/sh_home_layout"
     android:layout_width="fill_parent"
     android:layout_height="wrap_content" >
 
     <LinearLayout
-		android:layout_width="fill_parent"
-		android:layout_height="wrap_content"
-		android:orientation="vertical"
-		android:background="@color/background_app">
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:orientation="vertical"
+        android:background="@color/background_app">
     
-	    <LinearLayout
-			android:id="@+id/ll_home_section_location"
-			android:layout_width="match_parent"
-			android:layout_height="wrap_content"
-			android:orientation="vertical"
-			android:background="@drawable/section"
-			android:layout_margin="10dp"
-			android:visibility="gone">
-
-			<TextView
-				android:layout_width="match_parent"
-				android:layout_height="wrap_content"
-				android:text="@string/home_section_location"
-				android:textAppearance="?android:attr/textAppearanceLarge"
-				android:textStyle="bold"
-				tools:layout_width="match_parent"
-				android:background="@drawable/section_title"
-				android:paddingBottom="4dp"
-				android:paddingEnd="10dp"
-				android:paddingLeft="20dp"
-				android:paddingRight="10dp"
-				android:paddingStart="20dp"
-				android:paddingTop="4dp"
-				android:textColor="@color/section_title"/>
-
-			<LinearLayout
-				android:id="@+id/ll_home_section_location_content"
-				android:layout_width="match_parent"
-				android:layout_height="wrap_content"
-				android:orientation="vertical"
-				android:background="@drawable/entry"
-				android:padding="7dp"
-				android:layout_margin="8dp">
-
-				<TextView
-					android:layout_width="match_parent"
-					android:layout_height="wrap_content"
-					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:textColor="@color/entry_title"
-					android:textStyle="bold"
-					android:text="@string/home_section_location_text_0"/>
-
-				<LinearLayout
-					android:orientation="horizontal"
-					android:layout_width="match_parent"
-					android:layout_height="match_parent"
-					android:gravity="center_horizontal"
-					android:layout_marginTop="10dp"
-					android:layout_marginBottom="10dp"
-					tools:ignore="UseCompoundDrawables">
-
-					<ImageView
-						android:layout_width="wrap_content"
-						android:layout_height="wrap_content"
-						android:contentDescription="@string/app_cdesc"
-						android:src="@drawable/pinpoint_gm"
-						android:layout_margin="7dp"
-						android:layout_gravity="center_vertical"/>
-
-					<TextView
-						android:layout_width="wrap_content"
-						android:layout_height="wrap_content"
-						android:textAppearance="@android:style/TextAppearance.Medium"
-						android:text="@string/home_section_location_text_calculating"
-						android:id="@+id/tv_home_section_location_distance"
-						android:layout_gravity="center_vertical"
-						android:layout_margin="7dp"/>
-				</LinearLayout>
-			</LinearLayout>
-
-		</LinearLayout>
-
-		<LinearLayout
-			android:id="@+id/ll_home_section_lablanca"
-			android:layout_width="match_parent"
-			android:layout_height="wrap_content"
-			android:layout_margin="10dp"
-			android:background="@drawable/section"
-			android:orientation="vertical"
-			android:visibility="gone">
-
-			<TextView
-				android:layout_width="match_parent"
-				android:layout_height="wrap_content"
-				android:background="@drawable/section_title"
-				android:paddingBottom="4dp"
-				android:paddingEnd="10dp"
-				android:paddingLeft="20dp"
-				android:paddingRight="10dp"
-				android:paddingStart="20dp"
-				android:paddingTop="4dp"
-				android:text="@string/lablanca_title"
-				android:textAppearance="?android:attr/textAppearanceLarge"
-				android:textColor="@color/section_title"
-				android:textStyle="bold"/>
-
-			<LinearLayout
-				android:layout_width="match_parent"
-				android:layout_height="match_parent"
-				android:layout_margin="8dp"
-				android:background="@drawable/entry"
-				android:minHeight="175dp"
-				android:orientation="horizontal"
-				android:padding="7dp">
-
-				<ImageView
-					android:id="@+id/iv_home_section_lablanca_image"
-					android:layout_width="match_parent"
-					android:layout_height="wrap_content"
-					android:layout_margin="3dp"
-					android:layout_weight=".7"
-					android:adjustViewBounds="true"
-					android:contentDescription="@string/app_cdesc"
-					android:maxWidth="130dp"
-					android:minHeight="105dp"/>
-
-				<LinearLayout
-					android:layout_width="match_parent"
-					android:layout_height="match_parent"
-					android:layout_weight=".3"
-					android:orientation="vertical"
-					>
-
-					<TextView
-						android:id="@+id/tv_home_section_lablanca_text"
-						android:layout_width="match_parent"
-						android:layout_height="80dp"
-						android:maxLines="4"
-						android:padding="7dp"
-						android:textAppearance="@android:style/TextAppearance.Medium"/>
-
-					<ImageView
-						android:id="@+id/imageView6"
-						android:layout_width="match_parent"
-						android:layout_height="40dp"
-						android:layout_marginTop="-40dp"
-						android:background="@drawable/gradient_v_white"/>
-
-					<Button
-						android:id="@+id/bt_home_gm"
-						android:layout_width="match_parent"
-						android:layout_height="50dp"
-						android:layout_marginBottom="40dp"
-						android:layout_marginLeft="7dp"
-						android:layout_marginStart="7dp"
-						android:layout_marginTop="10dp"
-						android:background="@drawable/button_selector"
-						android:text="@string/lablanca_schedule_gm"
-						android:textColor="@color/input_button_color"
-						android:textStyle="bold"/>
-				</LinearLayout>
-
-			</LinearLayout>
-
-		</LinearLayout>
-
-		<LinearLayout
-			android:id="@+id/ll_home_section_gmschedule"
-			android:layout_width="fill_parent"
-			android:layout_height="wrap_content"
-			android:orientation="vertical"
-			android:background="@drawable/section"
-			android:layout_margin="10dp"
-			android:visibility="gone">
-
-			<TextView
-				android:layout_width="match_parent"
-				android:layout_height="wrap_content"
-				android:text="@string/home_section_gmschedule"
-				android:textAppearance="?android:attr/textAppearanceLarge"
-				android:textStyle="bold"
-				tools:layout_width="match_parent"
-				android:background="@drawable/section_title"
-				android:paddingBottom="4dp"
-				android:paddingEnd="10dp"
-				android:paddingLeft="20dp"
-				android:paddingRight="10dp"
-				android:paddingStart="20dp"
-				android:paddingTop="4dp"
-				android:textColor="@color/section_title"/>
-
-			<LinearLayout
-				android:orientation="vertical"
-				android:layout_width="match_parent"
-				android:layout_height="match_parent"
-				android:background="@drawable/entry"
-				android:id="@+id/ll_home_section_gmschedule_now_content"
-				android:padding="7dp"
-				android:layout_margin="8dp">
-
-				<TextView
-					android:layout_width="match_parent"
-					android:layout_height="wrap_content"
-					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:textColor="@color/entry_title"
-					android:textStyle="bold"
-					android:text="@string/schedule_now"/>
-
-				<LinearLayout
-					android:id="@+id/ll_home_section_gmschedule_now_list"
-					android:layout_width="match_parent"
-					android:layout_height="wrap_content"
-					android:orientation="vertical"
-					android:padding="7dp">
-
-				</LinearLayout>
-
-			</LinearLayout>
-
-			<LinearLayout
-				android:orientation="vertical"
-				android:layout_width="match_parent"
-				android:layout_height="match_parent"
-				android:background="@drawable/entry"
-				android:id="@+id/ll_home_section_gmschedule_later_content"
-				android:padding="7dp"
-				android:layout_margin="8dp">
-
-				<TextView
-					android:layout_width="match_parent"
-					android:layout_height="wrap_content"
-					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:textColor="@color/entry_title"
-					android:textStyle="bold"
-					android:text="@string/schedule_later"/>
-
-				<LinearLayout
-					android:id="@+id/ll_home_section_gmschedule_later_list"
-					android:layout_width="match_parent"
-					android:layout_height="wrap_content"
-					android:orientation="vertical"
-					android:padding="7dp">
-
-				</LinearLayout>
-
-			</LinearLayout>
-
-		</LinearLayout>
-
-		<LinearLayout
-			android:id="@+id/ll_home_section_cityschedule"
-			android:layout_width="fill_parent"
-			android:layout_height="wrap_content"
-			android:orientation="vertical"
-			android:background="@drawable/section"
-			android:layout_margin="10dp"
-			android:visibility="gone">
-
-			<TextView
-				android:layout_width="match_parent"
-				android:layout_height="wrap_content"
-				android:text="@string/home_section_cityschedule"
-				android:textAppearance="?android:attr/textAppearanceLarge"
-				android:textStyle="bold"
-				tools:layout_width="match_parent"
-				android:background="@drawable/section_title"
-				android:paddingBottom="4dp"
-				android:paddingEnd="10dp"
-				android:paddingLeft="20dp"
-				android:paddingRight="10dp"
-				android:paddingStart="20dp"
-				android:paddingTop="4dp"
-				android:textColor="@color/section_title"/>
-
-			<LinearLayout
-				android:orientation="vertical"
-				android:layout_width="match_parent"
-				android:layout_height="match_parent"
-				android:background="@drawable/entry"
-				android:id="@+id/ll_home_section_cityschedule_now_content"
-				android:padding="7dp"
-				android:layout_margin="8dp">
-
-				<TextView
-					android:layout_width="match_parent"
-					android:layout_height="wrap_content"
-					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:textColor="@color/entry_title"
-					android:textStyle="bold"
+        <LinearLayout
+            android:id="@+id/ll_home_section_location"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical"
+            android:background="@drawable/section"
+            android:layout_margin="10dp"
+            android:visibility="gone">
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:text="@string/home_section_location"
+                android:textAppearance="?android:attr/textAppearanceLarge"
+                android:textStyle="bold"
+                tools:layout_width="match_parent"
+                android:background="@drawable/section_title"
+                android:paddingBottom="4dp"
+                android:paddingEnd="10dp"
+                android:paddingStart="20dp"
+                android:paddingTop="4dp"
+                android:textColor="@color/section_title"/>
+
+            <LinearLayout
+                android:id="@+id/ll_home_section_location_content"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:orientation="vertical"
+                android:background="@drawable/entry"
+                android:padding="7dp"
+                android:layout_margin="8dp">
+
+                <TextView
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:textAppearance="?android:attr/textAppearanceMedium"
+                    android:textColor="@color/entry_title"
+                    android:textStyle="bold"
+                    android:text="@string/home_section_location_text_0"/>
+
+                <LinearLayout
+                    android:orientation="horizontal"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:gravity="center_horizontal"
+                    android:layout_marginTop="10dp"
+                    android:layout_marginBottom="10dp"
+                    tools:ignore="UseCompoundDrawables">
+
+                    <ImageView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:contentDescription="@string/app_cdesc"
+                        android:src="@drawable/pinpoint_gm"
+                        android:layout_margin="7dp"
+                        android:layout_gravity="center_vertical"/>
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:textAppearance="@android:style/TextAppearance.Medium"
+                        android:text="@string/home_section_location_text_calculating"
+                        android:id="@+id/tv_home_section_location_distance"
+                        android:layout_gravity="center_vertical"
+                        android:layout_margin="7dp"/>
+                </LinearLayout>
+            </LinearLayout>
+
+        </LinearLayout>
+
+        <LinearLayout
+            android:id="@+id/ll_home_section_lablanca"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_margin="10dp"
+            android:background="@drawable/section"
+            android:orientation="vertical"
+            android:visibility="gone">
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:background="@drawable/section_title"
+                android:paddingBottom="4dp"
+                android:paddingEnd="10dp"
+                android:paddingStart="20dp"
+                android:paddingTop="4dp"
+                android:text="@string/lablanca_title"
+                android:textAppearance="?android:attr/textAppearanceLarge"
+                android:textColor="@color/section_title"
+                android:textStyle="bold"/>
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_margin="8dp"
+                android:background="@drawable/entry"
+                android:minHeight="175dp"
+                android:orientation="horizontal"
+                android:padding="7dp">
+
+                <ImageView
+                    android:id="@+id/iv_home_section_lablanca_image"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_margin="3dp"
+                    android:layout_weight=".7"
+                    android:adjustViewBounds="true"
+                    android:contentDescription="@string/app_cdesc"
+                    android:maxWidth="130dp"
+                    android:minHeight="105dp"/>
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:layout_weight=".3"
+                    android:orientation="vertical"
+                    >
+
+                    <TextView
+                        android:id="@+id/tv_home_section_lablanca_text"
+                        android:layout_width="match_parent"
+                        android:layout_height="80dp"
+                        android:maxLines="4"
+                        android:padding="7dp"
+                        android:textAppearance="@android:style/TextAppearance.Medium"/>
+
+                    <ImageView
+                        android:id="@+id/imageView6"
+                        android:layout_width="match_parent"
+                        android:layout_height="40dp"
+                        android:layout_marginTop="-40dp"
+                        android:importantForAccessibility="no"
+                        android:background="@drawable/gradient_v_white"/>
+
+                    <Button
+                        android:id="@+id/bt_home_gm"
+                        android:layout_width="match_parent"
+                        android:layout_height="50dp"
+                        android:layout_marginBottom="40dp"
+                        android:layout_marginStart="7dp"
+                        android:layout_marginTop="10dp"
+                        android:background="@drawable/button_selector"
+                        android:text="@string/lablanca_schedule_gm"
+                        android:textColor="@color/input_button_color"
+                        android:textStyle="bold"/>
+                </LinearLayout>
+
+            </LinearLayout>
+
+        </LinearLayout>
+
+        <LinearLayout
+            android:id="@+id/ll_home_section_gmschedule"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical"
+            android:background="@drawable/section"
+            android:layout_margin="10dp"
+            android:visibility="gone">
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:text="@string/home_section_gmschedule"
+                android:textAppearance="?android:attr/textAppearanceLarge"
+                android:textStyle="bold"
+                tools:layout_width="match_parent"
+                android:background="@drawable/section_title"
+                android:paddingBottom="4dp"
+                android:paddingEnd="10dp"
+                android:paddingStart="20dp"
+                android:paddingTop="4dp"
+                android:textColor="@color/section_title"/>
+
+            <LinearLayout
+                android:orientation="vertical"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:background="@drawable/entry"
+                android:id="@+id/ll_home_section_gmschedule_now_content"
+                android:padding="7dp"
+                android:layout_margin="8dp">
+
+                <TextView
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:textAppearance="?android:attr/textAppearanceMedium"
+                    android:textColor="@color/entry_title"
+                    android:textStyle="bold"
                     android:text="@string/schedule_now"/>
 
-				<LinearLayout
+                <LinearLayout
+                    android:id="@+id/ll_home_section_gmschedule_now_list"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="vertical"
+                    android:padding="7dp">
+
+                </LinearLayout>
+
+            </LinearLayout>
+
+            <LinearLayout
+                android:orientation="vertical"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:background="@drawable/entry"
+                android:id="@+id/ll_home_section_gmschedule_later_content"
+                android:padding="7dp"
+                android:layout_margin="8dp">
+
+                <TextView
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:textAppearance="?android:attr/textAppearanceMedium"
+                    android:textColor="@color/entry_title"
+                    android:textStyle="bold"
+                    android:text="@string/schedule_later"/>
+
+                <LinearLayout
+                    android:id="@+id/ll_home_section_gmschedule_later_list"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="vertical"
+                    android:padding="7dp">
+
+                </LinearLayout>
+
+            </LinearLayout>
+
+        </LinearLayout>
+
+        <LinearLayout
+            android:id="@+id/ll_home_section_cityschedule"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical"
+            android:background="@drawable/section"
+            android:layout_margin="10dp"
+            android:visibility="gone">
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:text="@string/home_section_cityschedule"
+                android:textAppearance="?android:attr/textAppearanceLarge"
+                android:textStyle="bold"
+                tools:layout_width="match_parent"
+                android:background="@drawable/section_title"
+                android:paddingBottom="4dp"
+                android:paddingEnd="10dp"
+                android:paddingStart="20dp"
+                android:paddingTop="4dp"
+                android:textColor="@color/section_title"/>
+
+            <LinearLayout
+                android:orientation="vertical"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:background="@drawable/entry"
+                android:id="@+id/ll_home_section_cityschedule_now_content"
+                android:padding="7dp"
+                android:layout_margin="8dp">
+
+                <TextView
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:textAppearance="?android:attr/textAppearanceMedium"
+                    android:textColor="@color/entry_title"
+                    android:textStyle="bold"
+                    android:text="@string/schedule_now"/>
+
+                <LinearLayout
                     android:id="@+id/ll_home_section_cityschedule_now_list"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-					android:orientation="vertical"
-					android:padding="7dp">
+                    android:orientation="vertical"
+                    android:padding="7dp">
 
                 </LinearLayout>
 
-			</LinearLayout>
-
-			<LinearLayout
-				android:orientation="vertical"
-				android:layout_width="match_parent"
-				android:layout_height="match_parent"
-				android:background="@drawable/entry"
-				android:id="@+id/ll_home_section_cityschedule_later_content"
-				android:padding="7dp"
-				android:layout_margin="8dp">
-
-				<TextView
-					android:layout_width="match_parent"
-					android:layout_height="wrap_content"
-					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:textColor="@color/entry_title"
-					android:textStyle="bold"
-					android:text="@string/schedule_later"/>
-
-				<LinearLayout
-					android:id="@+id/ll_home_section_cityschedule_later_list"
-					android:layout_width="match_parent"
-					android:layout_height="wrap_content"
-					android:orientation="vertical"
-					android:padding="7dp">
-
-				</LinearLayout>
-
-			</LinearLayout>
-
-		</LinearLayout>
-
-		<LinearLayout
-			android:id="@+id/ll_home_section_around"
-			android:layout_width="fill_parent"
-			android:layout_height="wrap_content"
-			android:orientation="vertical"
-			android:background="@drawable/section"
-			android:layout_margin="10dp"
-			android:visibility="gone">
-
-			<TextView
-				android:layout_width="match_parent"
-				android:layout_height="wrap_content"
-				android:text="@string/home_section_around"
-				android:textAppearance="?android:attr/textAppearanceLarge"
-				android:textStyle="bold"
-				tools:layout_width="match_parent"
-				android:background="@drawable/section_title"
-				android:paddingBottom="4dp"
-				android:paddingEnd="10dp"
-				android:paddingLeft="20dp"
-				android:paddingRight="10dp"
-				android:paddingStart="20dp"
-				android:paddingTop="4dp"
-				android:textColor="@color/section_title"/>
-
-			<LinearLayout
-				android:id="@+id/ll_home_section_around_content"
-				android:layout_width="match_parent"
-				android:layout_height="wrap_content"
-				android:layout_margin="8dp"
-				android:orientation="vertical"
-				android:background="@drawable/entry"
-				>
-
-			</LinearLayout>
-
-		</LinearLayout>
-
-		<LinearLayout
-			android:id="@+id/ll_home_section_activities_future"
-			android:layout_width="fill_parent"
-			android:layout_height="wrap_content"
-			android:orientation="vertical"
-			android:background="@drawable/section"
-			android:layout_margin="10dp"
-			android:visibility="gone">
-
-			<TextView
-				android:layout_width="match_parent"
-				android:layout_height="wrap_content"
-				android:text="@string/home_section_activities_future"
-				android:textAppearance="?android:attr/textAppearanceLarge"
-				android:textStyle="bold"
-				tools:layout_width="match_parent"
-				android:background="@drawable/section_title"
-				android:paddingBottom="4dp"
-				android:paddingEnd="10dp"
-				android:paddingLeft="20dp"
-				android:paddingRight="10dp"
-				android:paddingStart="20dp"
-				android:paddingTop="4dp"
-				android:textColor="@color/section_title"/>
-
-			<LinearLayout
-				android:id="@+id/ll_home_section_activities_future_content"
-				android:layout_width="match_parent"
-				android:layout_height="wrap_content"
-				android:layout_margin="8dp"
-				android:orientation="vertical">
-
-			</LinearLayout>
-
-		</LinearLayout>
-
-		<LinearLayout
-			android:id="@+id/ll_home_section_blog"
-			android:layout_width="fill_parent"
-			android:layout_height="wrap_content"
-			android:orientation="vertical"
-			android:background="@drawable/section"
-			android:layout_margin="10dp">
-
-			<TextView
-				android:layout_width="match_parent"
-				android:layout_height="wrap_content"
-				android:text="@string/home_section_blog"
-				android:textAppearance="?android:attr/textAppearanceLarge"
-				android:textStyle="bold"
-				tools:layout_width="match_parent"
-				android:background="@drawable/section_title"
-				android:paddingBottom="4dp"
-				android:paddingEnd="10dp"
-				android:paddingLeft="20dp"
-				android:paddingRight="10dp"
-				android:paddingStart="20dp"
-				android:paddingTop="4dp"
-				android:textColor="@color/section_title"/>
-
-			<LinearLayout
-				android:id="@+id/ll_home_section_blog_content"
-				android:layout_width="match_parent"
-				android:layout_height="wrap_content"
-				android:orientation="vertical"
-				android:layout_margin="8dp">
-
-			</LinearLayout>
-
-		</LinearLayout>
-
-		<LinearLayout
-			android:id="@+id/ll_home_section_gallery"
-			android:layout_width="fill_parent"
-			android:layout_height="wrap_content"
-			android:orientation="vertical"
-			android:background="@drawable/section"
-			android:layout_margin="10dp">
-
-			<TextView
-				android:layout_width="match_parent"
-				android:layout_height="wrap_content"
-				android:text="@string/home_section_gallery"
-				android:textAppearance="?android:attr/textAppearanceLarge"
-				android:textStyle="bold"
-				tools:layout_width="match_parent"
-				android:background="@drawable/section_title"
-				android:paddingBottom="4dp"
-				android:paddingEnd="10dp"
-				android:paddingLeft="20dp"
-				android:paddingRight="10dp"
-				android:paddingStart="20dp"
-				android:paddingTop="4dp"
-				android:textColor="@color/section_title"/>
-
-			<LinearLayout
-				android:id="@+id/ll_home_section_gallery_content"
-				android:layout_width="match_parent"
-				android:layout_height="wrap_content"
-				android:layout_margin="10dp"
-				android:orientation="vertical"
-				android:background="@drawable/entry"
-				android:padding="7dp">
-
-				<LinearLayout
-					android:baselineAligned="true"
+            </LinearLayout>
+
+            <LinearLayout
+                android:orientation="vertical"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:background="@drawable/entry"
+                android:id="@+id/ll_home_section_cityschedule_later_content"
+                android:padding="7dp"
+                android:layout_margin="8dp">
+
+                <TextView
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:textAppearance="?android:attr/textAppearanceMedium"
+                    android:textColor="@color/entry_title"
+                    android:textStyle="bold"
+                    android:text="@string/schedule_later"/>
+
+                <LinearLayout
+                    android:id="@+id/ll_home_section_cityschedule_later_list"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="vertical"
+                    android:padding="7dp">
+
+                </LinearLayout>
+
+            </LinearLayout>
+
+        </LinearLayout>
+
+        <LinearLayout
+            android:id="@+id/ll_home_section_around"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical"
+            android:background="@drawable/section"
+            android:layout_margin="10dp"
+            android:visibility="gone">
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:text="@string/home_section_around"
+                android:textAppearance="?android:attr/textAppearanceLarge"
+                android:textStyle="bold"
+                tools:layout_width="match_parent"
+                android:background="@drawable/section_title"
+                android:paddingBottom="4dp"
+                android:paddingEnd="10dp"
+                android:paddingStart="20dp"
+                android:paddingTop="4dp"
+                android:textColor="@color/section_title"/>
+
+            <LinearLayout
+                android:id="@+id/ll_home_section_around_content"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_margin="8dp"
+                android:orientation="vertical"
+                android:background="@drawable/entry"
+                >
+
+            </LinearLayout>
+
+        </LinearLayout>
+
+        <LinearLayout
+            android:id="@+id/ll_home_section_activities_future"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical"
+            android:background="@drawable/section"
+            android:layout_margin="10dp"
+            android:visibility="gone">
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:text="@string/home_section_activities_future"
+                android:textAppearance="?android:attr/textAppearanceLarge"
+                android:textStyle="bold"
+                tools:layout_width="match_parent"
+                android:background="@drawable/section_title"
+                android:paddingBottom="4dp"
+                android:paddingEnd="10dp"
+                android:paddingStart="20dp"
+                android:paddingTop="4dp"
+                android:textColor="@color/section_title"/>
+
+            <LinearLayout
+                android:id="@+id/ll_home_section_activities_future_content"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_margin="8dp"
+                android:orientation="vertical">
+
+            </LinearLayout>
+
+        </LinearLayout>
+
+        <LinearLayout
+            android:id="@+id/ll_home_section_blog"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical"
+            android:background="@drawable/section"
+            android:layout_margin="10dp">
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:text="@string/home_section_blog"
+                android:textAppearance="?android:attr/textAppearanceLarge"
+                android:textStyle="bold"
+                tools:layout_width="match_parent"
+                android:background="@drawable/section_title"
+                android:paddingBottom="4dp"
+                android:paddingEnd="10dp"
+                android:paddingStart="20dp"
+                android:paddingTop="4dp"
+                android:textColor="@color/section_title"/>
+
+            <LinearLayout
+                android:id="@+id/ll_home_section_blog_content"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:orientation="vertical"
+                android:layout_margin="8dp">
+
+            </LinearLayout>
+
+        </LinearLayout>
+
+        <LinearLayout
+            android:id="@+id/ll_home_section_gallery"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical"
+            android:background="@drawable/section"
+            android:layout_margin="10dp">
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:text="@string/home_section_gallery"
+                android:textAppearance="?android:attr/textAppearanceLarge"
+                android:textStyle="bold"
+                tools:layout_width="match_parent"
+                android:background="@drawable/section_title"
+                android:paddingBottom="4dp"
+                android:paddingEnd="10dp"
+                android:paddingStart="20dp"
+                android:paddingTop="4dp"
+                android:textColor="@color/section_title"/>
+
+            <LinearLayout
+                android:id="@+id/ll_home_section_gallery_content"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_margin="10dp"
+                android:orientation="vertical"
+                android:background="@drawable/entry"
+                android:padding="7dp">
+
+                <LinearLayout
+                    android:baselineAligned="true"
                     android:orientation="horizontal"
                     android:layout_width="match_parent"
                     android:layout_height="match_parent">
 
-					<LinearLayout
-						android:orientation="horizontal"
-						android:layout_width="fill_parent"
-						android:layout_height="match_parent"
-						android:layout_weight=".5"
-						android:gravity="center_vertical|center_horizontal">
-
-						<ImageView
-							android:layout_width="wrap_content"
-							android:layout_height="wrap_content"
-							android:id="@+id/iv_home_section_gallery_0"
-							android:contentDescription="@string/app_cdesc"
-							android:layout_margin="3dp"
-							android:padding="0.5dp"
-							android:background="@color/image_border"
-							android:adjustViewBounds="true"
-							/>
-					</LinearLayout>
-
-					<LinearLayout
-						android:orientation="horizontal"
-						android:layout_width="fill_parent"
-						android:layout_height="match_parent"
-						android:layout_weight=".5"
-						android:gravity="center_vertical|center_horizontal">
-
-						<ImageView
-							android:layout_width="wrap_content"
-							android:layout_height="wrap_content"
-							android:id="@+id/iv_home_section_gallery_1"
-							android:contentDescription="@string/app_cdesc"
-							android:layout_margin="3dp"
-							android:background="@color/image_border"
-							android:padding="0.5dp"
-							android:adjustViewBounds="true"
-							/>
-					</LinearLayout>
-
-				</LinearLayout>
-
-				<LinearLayout
-					android:baselineAligned="false"
-					android:orientation="horizontal"
-					android:layout_width="match_parent"
-					android:layout_height="match_parent" >
-
-					<LinearLayout
-						android:orientation="horizontal"
-						android:layout_width="fill_parent"
-						android:layout_height="match_parent"
-						android:layout_weight=".5"
-						android:gravity="center_vertical|center_horizontal">
-
-						<ImageView
-							android:layout_width="wrap_content"
-							android:layout_height="wrap_content"
-							android:id="@+id/iv_home_section_gallery_2"
-							android:contentDescription="@string/app_cdesc"
-							android:layout_margin="3dp"
-							android:padding="0.5dp"
-							android:background="@color/image_border"
-							android:adjustViewBounds="true"
-							/>
-					</LinearLayout>
-
-					<LinearLayout
-						android:orientation="horizontal"
-						android:layout_width="fill_parent"
-						android:layout_height="match_parent"
-						android:layout_weight=".5"
-						android:gravity="center_vertical|center_horizontal">
-
-						<ImageView
-							android:layout_width="wrap_content"
-							android:layout_height="wrap_content"
-							android:id="@+id/iv_home_section_gallery_3"
-							android:contentDescription="@string/app_cdesc"
-							android:layout_margin="3dp"
-							android:background="@color/image_border"
-							android:padding="0.5dp"
-							android:adjustViewBounds="true"
-							/>
-					</LinearLayout>
-
-				</LinearLayout>
-
-				<TextView
+                    <LinearLayout
+                        android:orientation="horizontal"
+                        android:layout_width="fill_parent"
+                        android:layout_height="match_parent"
+                        android:layout_weight=".5"
+                        android:gravity="center_vertical|center_horizontal">
+
+                        <ImageView
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:id="@+id/iv_home_section_gallery_0"
+                            android:contentDescription="@string/app_cdesc"
+                            android:layout_margin="3dp"
+                            android:padding="0.5dp"
+                            android:background="@color/image_border"
+                            android:adjustViewBounds="true"
+                            />
+                    </LinearLayout>
+
+                    <LinearLayout
+                        android:orientation="horizontal"
+                        android:layout_width="fill_parent"
+                        android:layout_height="match_parent"
+                        android:layout_weight=".5"
+                        android:gravity="center_vertical|center_horizontal">
+
+                        <ImageView
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:id="@+id/iv_home_section_gallery_1"
+                            android:contentDescription="@string/app_cdesc"
+                            android:layout_margin="3dp"
+                            android:background="@color/image_border"
+                            android:padding="0.5dp"
+                            android:adjustViewBounds="true"
+                            />
+                    </LinearLayout>
+
+                </LinearLayout>
+
+                <LinearLayout
+                    android:baselineAligned="false"
+                    android:orientation="horizontal"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent" >
+
+                    <LinearLayout
+                        android:orientation="horizontal"
+                        android:layout_width="fill_parent"
+                        android:layout_height="match_parent"
+                        android:layout_weight=".5"
+                        android:gravity="center_vertical|center_horizontal">
+
+                        <ImageView
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:id="@+id/iv_home_section_gallery_2"
+                            android:contentDescription="@string/app_cdesc"
+                            android:layout_margin="3dp"
+                            android:padding="0.5dp"
+                            android:background="@color/image_border"
+                            android:adjustViewBounds="true"
+                            />
+                    </LinearLayout>
+
+                    <LinearLayout
+                        android:orientation="horizontal"
+                        android:layout_width="fill_parent"
+                        android:layout_height="match_parent"
+                        android:layout_weight=".5"
+                        android:gravity="center_vertical|center_horizontal">
+
+                        <ImageView
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:id="@+id/iv_home_section_gallery_3"
+                            android:contentDescription="@string/app_cdesc"
+                            android:layout_margin="3dp"
+                            android:background="@color/image_border"
+                            android:padding="0.5dp"
+                            android:adjustViewBounds="true"
+                            />
+                    </LinearLayout>
+
+                </LinearLayout>
+
+                <TextView
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:textAppearance="?android:attr/textAppearanceMedium"
                     android:text="Medium Text"
                     android:id="@+id/tv_home_section_gallery_hidden_0"
-					android:visibility="gone" />
-				<TextView
-					android:layout_width="wrap_content"
-					android:layout_height="wrap_content"
-					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:text="Medium Text"
-					android:id="@+id/tv_home_section_gallery_hidden_1"
-					android:visibility="gone" />
-				<TextView
-					android:layout_width="wrap_content"
-					android:layout_height="wrap_content"
-					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:text="Medium Text"
-					android:id="@+id/tv_home_section_gallery_hidden_2"
-					android:visibility="gone" />
-				<TextView
-					android:layout_width="wrap_content"
-					android:layout_height="wrap_content"
-					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:text="Medium Text"
-					android:id="@+id/tv_home_section_gallery_hidden_3"
-					android:visibility="gone" />
-			</LinearLayout>
-
-		</LinearLayout>
-
-		<LinearLayout
-			android:id="@+id/ll_home_section_activities_past"
-			android:layout_width="fill_parent"
-			android:layout_height="wrap_content"
-			android:orientation="vertical"
-			android:background="@drawable/section"
-			android:layout_margin="10dp"
-			android:visibility="gone">
-
-			<TextView
-				android:layout_width="match_parent"
-				android:layout_height="wrap_content"
-				android:text="@string/home_section_activities_past"
-				android:textAppearance="?android:attr/textAppearanceLarge"
-				android:textStyle="bold"
-				tools:layout_width="match_parent"
-				android:background="@drawable/section_title"
-				android:paddingBottom="4dp"
-				android:paddingEnd="10dp"
-				android:paddingLeft="20dp"
-				android:paddingRight="10dp"
-				android:paddingStart="20dp"
-				android:paddingTop="4dp"
-				android:textColor="@color/section_title"/>
-
-			<LinearLayout
-				android:id="@+id/ll_home_section_activities_past_content"
-				android:layout_width="match_parent"
-				android:layout_height="wrap_content"
-				android:orientation="vertical"
-				android:layout_margin="8dp">
-
-			</LinearLayout>
-
-		</LinearLayout>
-
-		<LinearLayout
-			android:id="@+id/ll_home_section_social"
-			android:layout_width="fill_parent"
-			android:layout_height="wrap_content"
-			android:orientation="vertical"
-			android:background="@drawable/section"
-			android:layout_margin="10dp">
-
-			<TextView
-				android:layout_width="match_parent"
-				android:layout_height="wrap_content"
-				android:text="@string/home_section_social"
-				android:textAppearance="?android:attr/textAppearanceLarge"
-				android:textStyle="bold"
-				tools:layout_width="match_parent"
-				android:background="@drawable/section_title"
-				android:paddingBottom="4dp"
-				android:paddingEnd="10dp"
-				android:paddingLeft="20dp"
-				android:paddingRight="10dp"
-				android:paddingStart="20dp"
-				android:paddingTop="4dp"
-				android:textColor="@color/section_title"/>
-
-			<LinearLayout
-				android:id="@+id/ll_home_section_social_content"
-				android:layout_width="match_parent"
-				android:layout_height="wrap_content"
-				android:layout_margin="8dp"
-				android:orientation="vertical"
-				android:background="@drawable/entry"
-				android:padding="7dp">
-
-				<LinearLayout
-					android:layout_width="fill_parent"
-					android:layout_height="wrap_content"
-					android:gravity="center_horizontal" >
-
-					<ImageView
-						android:id="@+id/iv_home_section_social_phone"
-						android:layout_width="wrap_content"
-						android:layout_height="wrap_content"
-						android:layout_margin="5dp"
-						android:adjustViewBounds="true"
-						android:contentDescription="@string/social_phone"
-						android:maxWidth="60dp"
-						android:src="@drawable/social_phone"/>
-
-					<ImageView
-						android:id="@+id/iv_home_section_social_mail"
-						android:layout_width="wrap_content"
-						android:layout_height="wrap_content"
-						android:layout_margin="5dp"
-						android:adjustViewBounds="true"
-						android:contentDescription="@string/social_mail"
-						android:maxWidth="60dp"
-						android:src="@drawable/social_mail" />
-
-					<ImageView
-						android:id="@+id/iv_home_section_social_whatsapp"
-						android:layout_width="wrap_content"
-						android:layout_height="wrap_content"
-						android:layout_margin="5dp"
-						android:adjustViewBounds="true"
-						android:contentDescription="@string/social_whatsapp"
-						android:maxWidth="60dp"
-						android:src="@drawable/social_whatsapp" />
-
-					<ImageView
-						android:id="@+id/iv_home_section_social_facebook"
-						android:layout_width="wrap_content"
-						android:layout_height="wrap_content"
-						android:layout_margin="5dp"
-						android:adjustViewBounds="true"
-						android:contentDescription="@string/social_facebook"
-						android:maxWidth="60dp"
-						android:src="@drawable/social_facebook" />
-				</LinearLayout>
-
-				<LinearLayout
-					android:layout_width="fill_parent"
-					android:layout_height="wrap_content"
-					android:gravity="center_horizontal" >
-
-					<ImageView
-						android:id="@+id/iv_home_section_social_twitter"
-						android:layout_width="wrap_content"
-						android:layout_height="wrap_content"
-						android:layout_margin="5dp"
-						android:adjustViewBounds="true"
-						android:contentDescription="@string/social_twitter"
-						android:maxWidth="60dp"
-						android:src="@drawable/social_twitter" />
-
-					<ImageView
-						android:id="@+id/iv_home_section_social_googleplus"
-						android:layout_width="wrap_content"
-						android:layout_height="wrap_content"
-						android:layout_margin="5dp"
-						android:adjustViewBounds="true"
-						android:contentDescription="@string/social_googleplus"
-						android:maxWidth="60dp"
-						android:src="@drawable/social_googleplus" />
-
-					<ImageView
-						android:id="@+id/iv_home_section_social_youtube"
-						android:layout_width="wrap_content"
-						android:layout_height="wrap_content"
-						android:layout_margin="5dp"
-						android:adjustViewBounds="true"
-						android:contentDescription="@string/social_youtube"
-						android:maxWidth="60dp"
-						android:src="@drawable/social_youtube" />
-
-					<ImageView
-						android:id="@+id/iv_home_section_social_instagram"
-						android:layout_width="wrap_content"
-						android:layout_height="wrap_content"
-						android:layout_margin="5dp"
-						android:adjustViewBounds="true"
-						android:contentDescription="@string/social_instagram"
-						android:maxWidth="60dp"
-						android:src="@drawable/social_instagram" />
-
-				</LinearLayout>
-
-			</LinearLayout>
-
-		</LinearLayout>
-
-
-	</LinearLayout>
+                    android:visibility="gone" />
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:textAppearance="?android:attr/textAppearanceMedium"
+                    android:text="Medium Text"
+                    android:id="@+id/tv_home_section_gallery_hidden_1"
+                    android:visibility="gone" />
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:textAppearance="?android:attr/textAppearanceMedium"
+                    android:text="Medium Text"
+                    android:id="@+id/tv_home_section_gallery_hidden_2"
+                    android:visibility="gone" />
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:textAppearance="?android:attr/textAppearanceMedium"
+                    android:text="Medium Text"
+                    android:id="@+id/tv_home_section_gallery_hidden_3"
+                    android:visibility="gone" />
+            </LinearLayout>
+
+        </LinearLayout>
+
+        <LinearLayout
+            android:id="@+id/ll_home_section_activities_past"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical"
+            android:background="@drawable/section"
+            android:layout_margin="10dp"
+            android:visibility="gone">
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:text="@string/home_section_activities_past"
+                android:textAppearance="?android:attr/textAppearanceLarge"
+                android:textStyle="bold"
+                tools:layout_width="match_parent"
+                android:background="@drawable/section_title"
+                android:paddingBottom="4dp"
+                android:paddingEnd="10dp"
+                android:paddingStart="20dp"
+                android:paddingTop="4dp"
+                android:textColor="@color/section_title"/>
+
+            <LinearLayout
+                android:id="@+id/ll_home_section_activities_past_content"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:orientation="vertical"
+                android:layout_margin="8dp">
+
+            </LinearLayout>
+
+        </LinearLayout>
+
+        <LinearLayout
+            android:id="@+id/ll_home_section_social"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical"
+            android:background="@drawable/section"
+            android:layout_margin="10dp">
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:text="@string/home_section_social"
+                android:textAppearance="?android:attr/textAppearanceLarge"
+                android:textStyle="bold"
+                tools:layout_width="match_parent"
+                android:background="@drawable/section_title"
+                android:paddingBottom="4dp"
+                android:paddingEnd="10dp"
+                android:paddingStart="20dp"
+                android:paddingTop="4dp"
+                android:textColor="@color/section_title"/>
+
+            <LinearLayout
+                android:id="@+id/ll_home_section_social_content"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_margin="8dp"
+                android:orientation="vertical"
+                android:background="@drawable/entry"
+                android:padding="7dp">
+
+                <LinearLayout
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:gravity="center_horizontal" >
+
+                    <ImageView
+                        android:id="@+id/iv_home_section_social_phone"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_margin="5dp"
+                        android:adjustViewBounds="true"
+                        android:contentDescription="@string/social_phone"
+                        android:maxWidth="60dp"
+                        android:src="@drawable/social_phone"/>
+
+                    <ImageView
+                        android:id="@+id/iv_home_section_social_mail"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_margin="5dp"
+                        android:adjustViewBounds="true"
+                        android:contentDescription="@string/social_mail"
+                        android:maxWidth="60dp"
+                        android:src="@drawable/social_mail" />
+
+                    <ImageView
+                        android:id="@+id/iv_home_section_social_whatsapp"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_margin="5dp"
+                        android:adjustViewBounds="true"
+                        android:contentDescription="@string/social_whatsapp"
+                        android:maxWidth="60dp"
+                        android:src="@drawable/social_whatsapp" />
+
+                    <ImageView
+                        android:id="@+id/iv_home_section_social_facebook"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_margin="5dp"
+                        android:adjustViewBounds="true"
+                        android:contentDescription="@string/social_facebook"
+                        android:maxWidth="60dp"
+                        android:src="@drawable/social_facebook" />
+                </LinearLayout>
+
+                <LinearLayout
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:gravity="center_horizontal" >
+
+                    <ImageView
+                        android:id="@+id/iv_home_section_social_twitter"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_margin="5dp"
+                        android:adjustViewBounds="true"
+                        android:contentDescription="@string/social_twitter"
+                        android:maxWidth="60dp"
+                        android:src="@drawable/social_twitter" />
+
+                    <ImageView
+                        android:id="@+id/iv_home_section_social_googleplus"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_margin="5dp"
+                        android:adjustViewBounds="true"
+                        android:contentDescription="@string/social_googleplus"
+                        android:maxWidth="60dp"
+                        android:src="@drawable/social_googleplus" />
+
+                    <ImageView
+                        android:id="@+id/iv_home_section_social_youtube"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_margin="5dp"
+                        android:adjustViewBounds="true"
+                        android:contentDescription="@string/social_youtube"
+                        android:maxWidth="60dp"
+                        android:src="@drawable/social_youtube" />
+
+                    <ImageView
+                        android:id="@+id/iv_home_section_social_instagram"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_margin="5dp"
+                        android:adjustViewBounds="true"
+                        android:contentDescription="@string/social_instagram"
+                        android:maxWidth="60dp"
+                        android:src="@drawable/social_instagram" />
+
+                </LinearLayout>
+
+            </LinearLayout>
+
+        </LinearLayout>
+
+
+    </LinearLayout>
 
 </com.ivalentin.margolariak.CustomScrollView>

+ 1 - 8
app/src/main/res/layout/fragment_layout_lablanca.xml

@@ -11,8 +11,7 @@
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:layout_margin="10dp"
-        android:orientation="vertical"
-        >
+        android:orientation="vertical">
 
         <LinearLayout
             android:layout_width="match_parent"
@@ -26,8 +25,6 @@
                 android:background="@drawable/section_title"
                 android:paddingBottom="4dp"
                 android:paddingEnd="10dp"
-                android:paddingLeft="20dp"
-                android:paddingRight="10dp"
                 android:paddingStart="20dp"
                 android:paddingTop="4dp"
                 android:text="@string/lablanca_title"
@@ -79,8 +76,6 @@
                 android:background="@drawable/section_title"
                 android:paddingBottom="4dp"
                 android:paddingEnd="10dp"
-                android:paddingLeft="20dp"
-                android:paddingRight="10dp"
                 android:paddingStart="20dp"
                 android:paddingTop="4dp"
                 android:text="@string/lablanca_schedule"
@@ -139,8 +134,6 @@
                 android:background="@drawable/section_title"
                 android:paddingBottom="4dp"
                 android:paddingEnd="10dp"
-                android:paddingLeft="20dp"
-                android:paddingRight="10dp"
                 android:paddingStart="20dp"
                 android:paddingTop="4dp"
                 android:text="@string/lablanca_prices"

+ 9 - 36
app/src/main/res/layout/fragment_layout_lablanca_nofestivals.xml

@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <com.ivalentin.margolariak.CustomScrollView
     xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
@@ -19,7 +18,7 @@
             android:layout_height="wrap_content"
             android:background="@drawable/section"
             android:orientation="vertical"
-            >
+            tools:ignore="UselessParent">
 
             <TextView
                 android:id="@+id/textView4"
@@ -28,8 +27,6 @@
                 android:background="@drawable/section_title"
                 android:paddingBottom="4dp"
                 android:paddingEnd="10dp"
-                android:paddingLeft="20dp"
-                android:paddingRight="10dp"
                 android:paddingStart="20dp"
                 android:paddingTop="4dp"
                 android:text="@string/lablanca_title"
@@ -61,7 +58,6 @@
                     android:orientation="horizontal">
 
                     <ImageView
-                        android:id="@+id/imageView4"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_marginEnd="10dp"
@@ -73,6 +69,7 @@
                         android:baselineAlignBottom="true"
                         android:minHeight="15dp"
                         android:minWidth="15dp"
+                        android:importantForAccessibility="no"
                         android:src="@drawable/ul"/>
 
                     <LinearLayout
@@ -81,7 +78,6 @@
                         android:orientation="vertical">
 
                         <TextView
-                            android:id="@+id/textView2"
                             android:layout_width="match_parent"
                             android:layout_height="wrap_content"
                             android:text="@string/lablanca_nofestivals_1_title"
@@ -90,10 +86,8 @@
                             android:textStyle="bold"/>
 
                         <TextView
-                            android:id="@+id/textView3"
                             android:layout_width="match_parent"
                             android:layout_height="wrap_content"
-                            android:layout_marginLeft="10dp"
                             android:layout_marginStart="10dp"
                             android:text="@string/lablanca_nofestivals_1"
                             android:textAppearance="@android:style/TextAppearance.Medium"/>
@@ -107,7 +101,6 @@
                     android:orientation="horizontal">
 
                     <ImageView
-                        android:id="@+id/imageView4"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_marginEnd="10dp"
@@ -117,6 +110,7 @@
                         android:layout_marginTop="5dp"
                         android:adjustViewBounds="false"
                         android:baselineAlignBottom="false"
+                        android:importantForAccessibility="no"
                         android:minHeight="15dp"
                         android:minWidth="15dp"
                         android:src="@drawable/ul"/>
@@ -127,7 +121,6 @@
                         android:orientation="vertical">
 
                         <TextView
-                            android:id="@+id/textView2"
                             android:layout_width="match_parent"
                             android:layout_height="wrap_content"
                             android:text="@string/lablanca_nofestivals_2_title"
@@ -136,10 +129,8 @@
                             android:textStyle="bold"/>
 
                         <TextView
-                            android:id="@+id/textView3"
                             android:layout_width="match_parent"
                             android:layout_height="wrap_content"
-                            android:layout_marginLeft="10dp"
                             android:layout_marginStart="10dp"
                             android:text="@string/lablanca_nofestivals_2"
                             android:textAppearance="@android:style/TextAppearance.Medium"/>
@@ -154,7 +145,6 @@
                     android:orientation="horizontal">
 
                     <ImageView
-                        android:id="@+id/imageView4"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_marginEnd="10dp"
@@ -164,6 +154,7 @@
                         android:layout_marginTop="5dp"
                         android:adjustViewBounds="false"
                         android:baselineAlignBottom="false"
+                        android:importantForAccessibility="no"
                         android:minHeight="15dp"
                         android:minWidth="15dp"
                         android:src="@drawable/ul"/>
@@ -174,7 +165,6 @@
                         android:orientation="vertical">
 
                         <TextView
-                            android:id="@+id/textView2"
                             android:layout_width="match_parent"
                             android:layout_height="wrap_content"
                             android:text="@string/lablanca_nofestivals_3_title"
@@ -183,10 +173,8 @@
                             android:textStyle="bold"/>
 
                         <TextView
-                            android:id="@+id/textView3"
                             android:layout_width="match_parent"
                             android:layout_height="wrap_content"
-                            android:layout_marginLeft="10dp"
                             android:layout_marginStart="10dp"
                             android:text="@string/lablanca_nofestivals_3"
                             android:textAppearance="@android:style/TextAppearance.Medium"/>
@@ -200,7 +188,6 @@
                     android:orientation="horizontal">
 
                     <ImageView
-                        android:id="@+id/imageView4"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_marginEnd="10dp"
@@ -210,6 +197,7 @@
                         android:layout_marginTop="5dp"
                         android:adjustViewBounds="false"
                         android:baselineAlignBottom="false"
+                        android:importantForAccessibility="no"
                         android:minHeight="15dp"
                         android:minWidth="15dp"
                         android:src="@drawable/ul"/>
@@ -220,7 +208,6 @@
                         android:orientation="vertical">
 
                         <TextView
-                            android:id="@+id/textView2"
                             android:layout_width="match_parent"
                             android:layout_height="wrap_content"
                             android:text="@string/lablanca_nofestivals_4_title"
@@ -229,10 +216,8 @@
                             android:textStyle="bold"/>
 
                         <TextView
-                            android:id="@+id/textView3"
                             android:layout_width="match_parent"
                             android:layout_height="wrap_content"
-                            android:layout_marginLeft="10dp"
                             android:layout_marginStart="10dp"
                             android:text="@string/lablanca_nofestivals_4"
                             android:textAppearance="@android:style/TextAppearance.Medium"/>
@@ -246,7 +231,6 @@
                     android:orientation="horizontal">
 
                     <ImageView
-                        android:id="@+id/imageView4"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_marginEnd="10dp"
@@ -256,6 +240,7 @@
                         android:layout_marginTop="5dp"
                         android:adjustViewBounds="false"
                         android:baselineAlignBottom="false"
+                        android:importantForAccessibility="no"
                         android:minHeight="15dp"
                         android:minWidth="15dp"
                         android:src="@drawable/ul"/>
@@ -266,7 +251,6 @@
                         android:orientation="vertical">
 
                         <TextView
-                            android:id="@+id/textView2"
                             android:layout_width="match_parent"
                             android:layout_height="wrap_content"
                             android:text="@string/lablanca_nofestivals_5_title"
@@ -275,10 +259,8 @@
                             android:textStyle="bold"/>
 
                         <TextView
-                            android:id="@+id/textView3"
                             android:layout_width="match_parent"
                             android:layout_height="wrap_content"
-                            android:layout_marginLeft="10dp"
                             android:layout_marginStart="10dp"
                             android:text="@string/lablanca_nofestivals_5"
                             android:textAppearance="@android:style/TextAppearance.Medium"/>
@@ -292,7 +274,6 @@
                     android:orientation="horizontal">
 
                     <ImageView
-                        android:id="@+id/imageView4"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_marginEnd="10dp"
@@ -302,6 +283,7 @@
                         android:layout_marginTop="5dp"
                         android:adjustViewBounds="false"
                         android:baselineAlignBottom="false"
+                        android:importantForAccessibility="no"
                         android:minHeight="15dp"
                         android:minWidth="15dp"
                         android:src="@drawable/ul"/>
@@ -312,7 +294,6 @@
                         android:orientation="vertical">
 
                         <TextView
-                            android:id="@+id/textView2"
                             android:layout_width="match_parent"
                             android:layout_height="wrap_content"
                             android:text="@string/lablanca_nofestivals_6_title"
@@ -321,10 +302,8 @@
                             android:textStyle="bold"/>
 
                         <TextView
-                            android:id="@+id/textView3"
                             android:layout_width="match_parent"
                             android:layout_height="wrap_content"
-                            android:layout_marginLeft="10dp"
                             android:layout_marginStart="10dp"
                             android:text="@string/lablanca_nofestivals_6"
                             android:textAppearance="@android:style/TextAppearance.Medium"/>
@@ -338,7 +317,6 @@
                     android:orientation="horizontal">
 
                     <ImageView
-                        android:id="@+id/imageView4"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_marginEnd="10dp"
@@ -348,6 +326,7 @@
                         android:layout_marginTop="5dp"
                         android:adjustViewBounds="false"
                         android:baselineAlignBottom="false"
+                        android:importantForAccessibility="no"
                         android:minHeight="15dp"
                         android:minWidth="15dp"
                         android:src="@drawable/ul"/>
@@ -358,7 +337,6 @@
                         android:orientation="vertical">
 
                         <TextView
-                            android:id="@+id/textView2"
                             android:layout_width="match_parent"
                             android:layout_height="wrap_content"
                             android:text="@string/lablanca_nofestivals_7_title"
@@ -367,10 +345,8 @@
                             android:textStyle="bold"/>
 
                         <TextView
-                            android:id="@+id/textView3"
                             android:layout_width="match_parent"
                             android:layout_height="wrap_content"
-                            android:layout_marginLeft="10dp"
                             android:layout_marginStart="10dp"
                             android:text="@string/lablanca_nofestivals_7"
                             android:textAppearance="@android:style/TextAppearance.Medium"/>
@@ -384,7 +360,6 @@
                     android:orientation="horizontal">
 
                     <ImageView
-                        android:id="@+id/imageView4"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_marginEnd="10dp"
@@ -394,6 +369,7 @@
                         android:layout_marginTop="5dp"
                         android:adjustViewBounds="false"
                         android:baselineAlignBottom="false"
+                        android:importantForAccessibility="no"
                         android:minHeight="15dp"
                         android:minWidth="15dp"
                         android:src="@drawable/ul"/>
@@ -404,7 +380,6 @@
                         android:orientation="vertical">
 
                         <TextView
-                            android:id="@+id/textView2"
                             android:layout_width="match_parent"
                             android:layout_height="wrap_content"
                             android:text="@string/lablanca_nofestivals_8_title"
@@ -413,10 +388,8 @@
                             android:textStyle="bold"/>
 
                         <TextView
-                            android:id="@+id/textView3"
                             android:layout_width="match_parent"
                             android:layout_height="wrap_content"
-                            android:layout_marginLeft="10dp"
                             android:layout_marginStart="10dp"
                             android:text="@string/lablanca_nofestivals_8"
                             android:textAppearance="@android:style/TextAppearance.Medium"/>

+ 1 - 3
app/src/main/res/layout/fragment_layout_location.xml

@@ -20,8 +20,6 @@
 			android:background="@drawable/section_title"
 			android:paddingBottom="4dp"
 			android:paddingEnd="10dp"
-			android:paddingLeft="20dp"
-			android:paddingRight="10dp"
 			android:paddingStart="20dp"
 			android:paddingTop="4dp"
 			android:text="@string/menu_location"
@@ -56,7 +54,7 @@
 
 			<LinearLayout
 				android:layout_width="match_parent"
-				android:layout_height="match_parent"
+				android:layout_height="0dp"
 				android:layout_weight=".95"
 				android:background="@drawable/map"
 				android:padding="3dp">

+ 0 - 2
app/src/main/res/layout/fragment_layout_photo.xml

@@ -28,8 +28,6 @@
                 android:background="@drawable/section_title"
                 android:paddingBottom="4dp"
                 android:paddingEnd="10dp"
-                android:paddingLeft="20dp"
-                android:paddingRight="10dp"
                 android:paddingStart="20dp"
                 android:paddingTop="4dp"
                 android:textColor="@color/section_title"/>

+ 0 - 2
app/src/main/res/layout/fragment_layout_post.xml

@@ -32,8 +32,6 @@
                 android:background="@drawable/section_title"
                 android:paddingBottom="4dp"
                 android:paddingEnd="10dp"
-                android:paddingLeft="20dp"
-                android:paddingRight="10dp"
                 android:paddingStart="20dp"
                 android:paddingTop="4dp"
                 android:textColor="@color/section_title"/>

+ 2 - 7
app/src/main/res/layout/fragment_layout_schedule.xml

@@ -23,8 +23,6 @@
             android:background="@drawable/section_title"
             android:paddingBottom="4dp"
             android:paddingEnd="10dp"
-            android:paddingLeft="20dp"
-            android:paddingRight="10dp"
             android:paddingStart="20dp"
             android:paddingTop="4dp"
             android:text="@string/lablanca_schedule_gm"
@@ -80,8 +78,6 @@
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:paddingEnd="0dp"
-                            android:paddingLeft="13dp"
-                            android:paddingRight="0dp"
                             android:paddingStart="13dp"
                             android:textSize="20sp"
                             android:textStyle="italic"/>
@@ -109,7 +105,7 @@
             <EditText
                 android:id="@+id/et_schedule_filter"
                 android:layout_width="fill_parent"
-                android:layout_height="wrap_content"
+                android:layout_height="0dp"
                 android:layout_marginEnd="10dp"
                 android:layout_marginLeft="10dp"
                 android:layout_marginRight="10dp"
@@ -140,8 +136,7 @@
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
                 android:layout_margin="0dp"
-                android:orientation="vertical"
-                >
+                android:orientation="vertical">
 
                 <LinearLayout
                     android:id="@+id/ll_schedule_list"

+ 0 - 149
app/src/main/res/layout/fragment_layout_settings.xml

@@ -1,149 +0,0 @@
-<LinearLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:orientation="vertical"
-    android:layout_width="fill_parent"
-    android:background="@color/background_app"
-    android:layout_height="fill_parent"
-    tools:ignore="Overdraw">
-
-    <com.ivalentin.margolariak.CustomScrollView
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content">
-
-        <LinearLayout
-            android:orientation="vertical"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content">
-
-            <RelativeLayout
-                android:id="@+id/rl_settings_notifications"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:paddingLeft="10dp"
-                android:paddingTop="15dp"
-                android:paddingRight="10dp"
-                android:paddingBottom="15dp">
-
-                <TextView
-                    android:id="@+id/tv_settings_notifications"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_alignParentLeft="true"
-                    android:layout_alignParentStart="true"
-                    android:layout_alignParentTop="true"
-                    android:text="@string/settings_notification"
-                    android:textAppearance="@android:style/TextAppearance.Large"
-                    tools:ignore="RelativeOverlap"/>
-
-                <TextView
-                    android:id="@+id/tv_settings_notifications_summary"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_alignParentLeft="true"
-                    android:layout_alignParentStart="true"
-                    android:layout_below="@id/tv_settings_notifications"
-                    android:text="@string/settings_notification_off"
-                    android:textAppearance="@android:style/TextAppearance.Small" />
-
-                <CheckBox
-                    android:id="@+id/cb_settings_notifications"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_alignParentEnd="true"
-                    android:layout_alignParentRight="true"
-                    android:layout_centerVertical="true"
-                    android:clickable="false" />
-
-            </RelativeLayout>
-
-            <TextView
-                android:layout_width="fill_parent"
-                android:layout_height="1dp"
-                android:background="@color/background_separator"
-                android:textAppearance="?android:attr/textAppearanceSmall"
-                android:layout_marginLeft="15dp"
-                android:layout_marginRight="15dp"/>
-
-            <TextView
-                android:layout_width="fill_parent"
-                android:layout_height="wrap_content"
-                android:textAppearance="?android:attr/textAppearanceLarge"
-                android:text="@string/settings_license"
-                android:id="@+id/tv_setting_license"
-                android:paddingLeft="10dp"
-                android:paddingTop="20dp"
-                android:paddingRight="10dp"
-                android:paddingBottom="20dp"/>
-
-            <TextView
-                android:layout_width="fill_parent"
-                android:layout_height="1dp"
-                android:background="@color/background_separator"
-                android:textAppearance="?android:attr/textAppearanceSmall"
-                android:layout_marginLeft="15dp"
-                android:layout_marginRight="15dp"/>
-
-            <TextView
-                android:layout_width="fill_parent"
-                android:layout_height="wrap_content"
-                android:textAppearance="?android:attr/textAppearanceLarge"
-                android:text="@string/settings_privacy"
-                android:id="@+id/tv_setting_privacy"
-                android:paddingLeft="10dp"
-                android:paddingTop="20dp"
-                android:paddingRight="10dp"
-                android:paddingBottom="20dp"/>
-
-            <TextView
-                android:layout_width="fill_parent"
-                android:layout_height="1dp"
-                android:background="@color/background_separator"
-                android:textAppearance="?android:attr/textAppearanceSmall"
-                android:layout_marginLeft="15dp"
-                android:layout_marginRight="15dp"
-                />
-
-            <TextView
-                android:layout_width="fill_parent"
-                android:layout_height="wrap_content"
-                android:textAppearance="?android:attr/textAppearanceLarge"
-                android:text="@string/settings_about"
-                android:id="@+id/tv_setting_about"
-                android:paddingLeft="10dp"
-                android:paddingTop="20dp"
-                android:paddingRight="10dp"
-                android:paddingBottom="20dp"/>
-
-            <TextView
-                android:layout_width="fill_parent"
-                android:layout_height="1dp"
-                android:background="@color/background_separator"
-                android:textAppearance="?android:attr/textAppearanceSmall"
-                android:layout_marginLeft="15dp"
-                android:layout_marginRight="15dp"
-                />
-
-            <TextView
-                android:layout_width="fill_parent"
-                android:layout_height="wrap_content"
-                android:textAppearance="?android:attr/textAppearanceLarge"
-                android:text="@string/settings_transparency"
-                android:id="@+id/tv_setting_transparency"
-                android:paddingLeft="10dp"
-                android:paddingTop="20dp"
-                android:paddingRight="10dp"
-                android:paddingBottom="20dp"/>
-
-            <TextView
-                android:layout_width="fill_parent"
-                android:layout_height="1dp"
-                android:background="@color/background_separator"
-                android:textAppearance="?android:attr/textAppearanceSmall"
-                android:layout_marginLeft="15dp"
-                android:layout_marginRight="15dp"
-                />
-
-        </LinearLayout>
-    </com.ivalentin.margolariak.CustomScrollView>
-</LinearLayout>

+ 8 - 9
app/src/main/res/layout/row_activity_future.xml

@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical" android:layout_width="match_parent"
+              xmlns:tools="http://schemas.android.com/tools"
+              android:orientation="vertical" android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:background="@drawable/entry"
     android:padding="7dp">
@@ -46,8 +47,7 @@
                 android:textAppearance="?android:attr/textAppearanceMedium"
                 android:textStyle="italic"
                 android:layout_marginTop="4dp"
-                android:layout_marginStart="8dp"
-                android:layout_marginLeft="8dp" />
+                android:layout_marginStart="8dp"/>
 
             <TextView
                 android:id="@+id/tv_row_activity_future_city"
@@ -56,8 +56,7 @@
                 android:textAppearance="?android:attr/textAppearanceMedium"
                 android:textStyle="italic"
                 android:layout_marginTop="4dp"
-                android:layout_marginStart="8dp"
-                android:layout_marginLeft="8dp" />
+                android:layout_marginStart="8dp"/>
 
             <TextView
                 android:id="@+id/tv_row_activity_future_price"
@@ -66,8 +65,7 @@
                 android:textAppearance="?android:attr/textAppearanceMedium"
                 android:textStyle="italic"
                 android:layout_marginTop="4dp"
-                android:layout_marginStart="8dp"
-                android:layout_marginLeft="8dp" />
+                android:layout_marginStart="8dp"/>
         </LinearLayout>
 
     </LinearLayout>
@@ -86,12 +84,13 @@
         android:layout_weight="1"
         android:layout_height="40dp"
         android:layout_marginTop="-40dp"
-        android:background="@drawable/gradient_v_white"/>
+        android:importantForAccessibility="no"
+        android:background="@drawable/gradient_v_white"
+        tools:ignore="InefficientWeight"/>
 
     <TextView
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:text="New Text"
         android:id="@+id/tv_row_activity_future_hidden"
         android:visibility="gone" />
 </LinearLayout>

+ 4 - 2
app/src/main/res/layout/row_activity_past.xml

@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+              xmlns:tools="http://schemas.android.com/tools"
               android:orientation="vertical" android:layout_width="match_parent"
               android:layout_height="wrap_content"
               android:background="@drawable/entry"
@@ -53,7 +54,6 @@
                 android:id="@+id/tv_row_activity_past_date"
                 android:layout_marginStart="10dp"
                 android:textStyle="italic"
-                android:layout_marginLeft="10dp"
                 android:layout_marginTop="10dp"/>
 
             <TextView
@@ -70,7 +70,9 @@
                 android:layout_weight="1"
                 android:layout_height="40dp"
                 android:layout_marginTop="-40dp"
-                android:background="@drawable/gradient_v_white"/>
+                android:background="@drawable/gradient_v_white"
+                android:importantForAccessibility="no"
+                tools:ignore="InefficientWeight"/>
 
         </LinearLayout>
 

+ 0 - 4
app/src/main/res/layout/row_album.xml

@@ -17,8 +17,6 @@
         android:id="@+id/ll_row_album_left"
         android:layout_marginBottom="8dp"
         android:layout_marginEnd="8dp"
-        android:layout_marginLeft="0dp"
-        android:layout_marginRight="8dp"
         android:layout_marginStart="0dp"
         android:layout_marginTop="8dp">
 
@@ -85,8 +83,6 @@
         android:id="@+id/ll_row_album_right"
         android:layout_marginBottom="8dp"
         android:layout_marginEnd="8dp"
-        android:layout_marginLeft="0dp"
-        android:layout_marginRight="8dp"
         android:layout_marginStart="0dp"
         android:layout_marginTop="8dp"
         android:visibility="invisible">

+ 0 - 1
app/src/main/res/layout/row_comment.xml

@@ -28,7 +28,6 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:id="@+id/tv_row_comment_date"
-            android:layout_marginLeft="15dp"
             android:layout_marginStart="15dp"
             android:layout_gravity="bottom"
             android:textAppearance="@android:style/TextAppearance.Small" />

+ 0 - 1
app/src/main/res/layout/row_festival_price_day.xml

@@ -28,7 +28,6 @@
                 android:id="@+id/tv_row_festival_price_day_name"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:layout_marginLeft="5dp"
                 android:layout_marginStart="5dp"
                 android:textAppearance="@android:style/TextAppearance.Medium"
                 android:textStyle="italic"/>

+ 0 - 1
app/src/main/res/layout/row_festival_price_pack.xml

@@ -29,7 +29,6 @@
                 android:id="@+id/tv_row_festival_price_pack_text"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:layout_marginLeft="5dp"
                 android:layout_marginStart="5dp"
                 android:textAppearance="@android:style/TextAppearance.Medium"
                 android:textStyle="italic"/>

+ 0 - 5
app/src/main/res/layout/row_gallery.xml

@@ -28,8 +28,6 @@
             android:id="@+id/iv_row_gallery_0"
             android:background="@color/album_border"
             android:layout_alignParentTop="false"
-            android:layout_alignParentLeft="false"
-            android:layout_alignParentRight="false"
             android:layout_alignParentBottom="false"
             android:layout_marginEnd="110dp"
             android:layout_marginBottom="110dp"
@@ -51,7 +49,6 @@
             android:id="@+id/iv_row_gallery_1"
             android:background="@color/album_border"
             android:layout_alignParentTop="false"
-            android:layout_alignParentLeft="false"
             android:layout_alignParentEnd="false"
             android:layout_alignParentBottom="false"
             android:layout_marginEnd="80dp"
@@ -73,7 +70,6 @@
             android:id="@+id/iv_row_gallery_2"
             android:background="@color/album_border"
             android:layout_alignParentTop="false"
-            android:layout_alignParentLeft="false"
             android:layout_alignParentEnd="false"
             android:layout_alignParentBottom="false"
             android:layout_marginStart="80dp"
@@ -95,7 +91,6 @@
             android:id="@+id/iv_row_gallery_3"
             android:background="@color/album_border"
             android:layout_alignParentTop="false"
-            android:layout_alignParentLeft="false"
             android:layout_alignParentEnd="false"
             android:layout_alignParentBottom="false"
             android:layout_marginStart="110dp"

+ 7 - 6
app/src/main/res/layout/row_home_activities.xml

@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
     android:orientation="vertical" android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:background="@drawable/entry"
@@ -54,8 +55,7 @@
                 android:textAppearance="?android:attr/textAppearanceSmall"
                 android:textStyle="italic"
                 android:layout_marginTop="4dp"
-                android:layout_marginStart="8dp"
-                android:layout_marginLeft="8dp"/>
+                android:layout_marginStart="8dp"/>
 
             <TextView
                 android:id="@+id/tv_row_home_activity_city"
@@ -64,8 +64,7 @@
                 android:textAppearance="?android:attr/textAppearanceSmall"
                 android:textStyle="italic"
                 android:layout_marginTop="4dp"
-                android:layout_marginStart="8dp"
-                android:layout_marginLeft="8dp"/>
+                android:layout_marginStart="8dp"/>
 
             <TextView
                 android:layout_width="fill_parent"
@@ -77,19 +76,21 @@
                 android:minHeight="30dp"/>
 
             <ImageView
+                android:importantForAccessibility="no"
                 android:layout_width="match_parent"
                 android:layout_weight="1"
                 android:layout_height="40dp"
                 android:layout_marginTop="-40dp"
-                android:background="@drawable/gradient_v_white"/>
+                android:background="@drawable/gradient_v_white"
+                tools:ignore="NestedWeights"/>
 
             <TextView
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:textAppearance="?android:attr/textAppearanceSmall"
                 android:id="@+id/tv_row_home_activity_price"
+                android:importantForAccessibility="no"
                 android:layout_weight="1"
-                android:layout_marginLeft="35dp"
                 android:layout_marginStart="35dp"/>
         </LinearLayout>
 

+ 3 - 1
app/src/main/res/layout/row_home_blog.xml

@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+              xmlns:tools="http://schemas.android.com/tools"
               android:orientation="vertical" android:layout_width="match_parent"
               android:layout_height="wrap_content"
               android:background="@drawable/entry"
@@ -54,7 +55,7 @@
                 android:textStyle="italic"
                 android:layout_marginTop="4dp"
                 android:layout_marginStart="8dp"
-                android:layout_marginLeft="8dp"/>
+                tools:ignore="NestedWeights"/>
 
             <TextView
                 android:layout_width="match_parent"
@@ -70,6 +71,7 @@
                 android:layout_weight="1"
                 android:layout_height="40dp"
                 android:layout_marginTop="-40dp"
+                android:importantForAccessibility="no"
                 android:background="@drawable/gradient_v_white"/>
 
         </LinearLayout>

+ 1 - 6
app/src/main/res/layout/row_home_schedule.xml

@@ -1,6 +1,5 @@
 <LinearLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
@@ -9,8 +8,6 @@
     android:padding="7dp"
     android:paddingBottom="7dp"
     android:paddingEnd="7dp"
-    android:paddingLeft="25dp"
-    android:paddingRight="7dp"
     android:paddingStart="25dp"
     android:paddingTop="7dp">
 
@@ -30,15 +27,14 @@
             android:layout_width="75dp"
             android:layout_height="wrap_content"
             android:minWidth="75dp"
-            android:text="0000"
             android:textAlignment="textEnd"
             android:textAppearance="@android:style/TextAppearance.Medium"
             android:textStyle="bold"/>
 
         <ImageView
-            android:id="@+id/imageView5"
             android:layout_width="15dp"
             android:layout_height="match_parent"
+            android:importantForAccessibility="no"
             android:layout_marginEnd="8dp"
             android:layout_marginLeft="8dp"
             android:layout_marginRight="8dp"
@@ -59,7 +55,6 @@
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_marginBottom="10dp"
-        android:layout_marginLeft="55dp"
         android:layout_marginStart="55dp"
         android:layout_marginTop="5dp"
         android:gravity="center_vertical"

+ 0 - 2
app/src/main/res/layout/row_schedule.xml

@@ -20,7 +20,6 @@
             android:layout_width="20dp"
             android:layout_height="fill_parent"
             android:layout_alignParentEnd="true"
-            android:layout_alignParentRight="true"
             android:orientation="vertical" >
 
             <ImageView
@@ -47,7 +46,6 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_alignParentTop="true"
-            android:layout_toLeftOf="@id/schedule_timeline"
             android:layout_toStartOf="@id/schedule_timeline"
             android:textAppearance="?android:attr/textAppearanceMedium"
             android:textColor="@color/entry_title"

+ 11 - 43
app/src/main/res/values-en/strings.xml

@@ -19,16 +19,11 @@
 	<string name="menu_blog">Blog</string>
 	<string name="menu_gallery">Gallery</string>
 	<string name="menu_settings">Settings</string>
-
-	<string name="tutorial_menu">Touch the Margolariak icon or slide the screen to the right to toggle the menu.</string>
-	<string name="tutorial_content">Toca the content to navigate between sections.</string>
-	<string name="tutorial_button">Understood</string>
-
 	<!-- Schedule strings -->
 	<string name="schedule_filter">Search&#8230;</string>
 	<string name="schedule_close">Close</string>
 	<string name="schedule_host">Host: %1$s</string>
-        <string name="schedule_osm">® OpenStreetMap contributors</string>
+	<string name="schedule_osm">® OpenStreetMap contributors</string>
 
 
 	<!-- Day strings -->
@@ -39,7 +34,6 @@
 	<!-- Home section strings -->
 
 	<string name="home_section_location">Find us</string>
-	<string name="home_section_lablanca">La Blanca</string>
 	<string name="home_section_gmschedule">Margolari Schedule</string>
 	<string name="home_section_cityschedule">City Schedule</string>
 	<string name="home_section_around">Around me</string>
@@ -53,26 +47,7 @@
 	<string name="home_section_location_text_short" tools:ignore="PluralsCandidate">They are just %1$d meters away from you!\n(About %2$d minutes walking)</string>
 	<string name="home_section_location_text_long">They are just %1$s kilometers away from you!</string>
 
-
-
-	<!-- Settings section strings -->
-
-	<string name="settings_notification">Receive notifications</string>
-	<string name="settings_notification_on">You will receive notifications</string>
-	<string name="settings_notification_off">You won\'t receive notifications</string>
-	<string name="settings_license">License</string>
-	<string name="settings_privacy">Privacy</string>
-	<string name="settings_about">About us</string>
-	<string name="settings_transparency">Transparency</string>
-	<string name="settings_license_content">Copyright 2016 Iñigo Valentin&lt;br/>&lt;br/>This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation.&lt;br/>&lt;br/>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details at http://www.gnu.org/licenses/.&lt;br/>&lt;br/>The name "Gasteizko Margolariak" and its logotype are property of Gasteizko Margolariak.&lt;br/>&lt;br/>&lt;br/>&lt;div style="background-color:#bbbbbb;padding:6px;border-radius:5px;border-style:solid;border-width:2px;border-color:#333333;text-align:center;">You can get the source code for this project at &lt;a href="https://github.com/Seavenois/GM">Github&lt;/a>&lt;/div></string>
-	<string name="settings_privacy_content"><![CDATA[In Gasteizko Margolariak we respect your privacy. We don\'t collect ANY data from our users, including personal information, location, shopping habits, sexual preferences, favourite colour, first love\'s name… ANY.<br/><br/>In order of making you believe us, we\'ll explain what we DO store:<br/><br/><ul><li>A randomly generated user code, unique to your device. This is necessary to sync content with aur database, so you can get info about our post, activities… But it\'s done in a way that won\'t allow un to identify you as a person with that number.</li><li>When commenting on a photo ar an entry, we store your current IP address. This is incredibly useful for us to know how many actual people are posting comments, and it also makes imposible for us to identify you as a person.</li></ul>]]></string>
-	<string name="settings_about_content">La Asociación Cultural Gasteizko Margolariak nace en el año 2013 con la idea de estimular la participación ciudadana y fortalecer la cultura y las tradiciones de Vitoria-Gasteiz.&lt;br/>&lt;br/>En nuestro nombre se refleja un barrio en el que las calles nos recuerdan a grandes pintores: el barrio de San Martín. Estamos representados en los barrios, y creemos que son la esencia de esta ciudad.&lt;br/>&lt;br/>Nos convertimos en Cuadrilla de Blusas y Neskas en 2013, y en ese mismo año, miembros de la Comisión de Blusas y Neskas.&lt;br/>&lt;br/>Desde entonces no hemos hecho más que crecer junto con todos los que han decidido, año tras año, apostar por nosotros.</string>
-	<string name="settings_transparency_content">¿Te preocupa saber dónde va tu dinero? En Gasteizko Margolariak queremos que estés tranquilo.&lt;br/>&lt;br/>Muchas de nuestras actividades son gratuitas. Otras, como las fiestas de La Blanca, tienen una cuota de inscripción. Gasteizko Margolariak no es una empresa, es una Asociación Cultural, y como tal, no tenemos beneficios.&lt;br/>&lt;br/>Queremos ser transparentes, y por eso, empezando en 2016, pondremos a tu disposición nuestras cuentas de manera online, para que sepas que cada euro se reinvierte en tí.</string>
-
-	
-
 	<!-- Activity section strings -->
-	<string name="activity_city">City:</string>
 	<string name="activity_price">Price:</string>
 	<string name="activity_no_future">There are no upcaming activities for now. We\'ll tell you when there is something planned!</string>
 	<string name="activity_schedule">Schedule</string>
@@ -98,8 +73,6 @@
 	<string name="lablanca_schedule">Schedule</string>
 	<string name="lablanca_schedule_city">City schedule</string>
 	<string name="lablanca_schedule_gm">Margolariak schedule</string>
-	<string name="lablanca_date_july">July %1$s</string>
-	<string name="lablanca_date_august">August %1$s</string>
 
 	<!--Schedule section strings-->
 	<string name="schedule_month_july">July</string>
@@ -138,7 +111,6 @@
 	<string name="notification_action_lablanca"> Open La Blanca </string>
 	<string name="notification_action_gmschedule"> Open Margolari schedule </string>
 	<string name="notification_action_cityschedule"> Open city schedule </string>
-	<string name="notification_action_location"> Show location </string>
 	<string name="notification_action_blog"> Open blog </string>
 	<string name="notification_action_activities"> Open activities </string>
 	<string name="notification_action_gallery"> Open gallery </string>
@@ -153,14 +125,14 @@
 	<string name="dialog_sync_text_3">Tú eres el piloto</string>
 	<string name="dialog_sync_text_4">Afinando la tuba&#8230;</string>
 	<string name="dialog_sync_text_5">Margolari camina pa\'lante, margolari camina pa\'trás.</string>
-	<string name="dialog_sync_text_6">Ari ari ari!</string>
+	<string name="dialog_sync_text_6" tools:ignore="Typos">Ari ari ari!</string>
 	<string name="dialog_sync_text_7">Llegando tarde…</string>
 	<string name="dialog_sync_text_8">¿Cabe más gente en el Foro Margolari?</string>
-	<string name="dialog_sync_text_9">Arreglando el tirador de cerveza...</string>
-	<string name="dialog_sync_text_10">Descorchando botellas...</string>
-	<string name="dialog_sync_text_11">Repartiendo pulseras...</string>
-	<string name="dialog_sync_text_12">Pintando las fiestas...</string>
-	<string name="dialog_sync_text_13">Desplegando pancarta...</string>
+	<string name="dialog_sync_text_9">Arreglando el tirador de cerveza</string>
+	<string name="dialog_sync_text_10">Descorchando botellas</string>
+	<string name="dialog_sync_text_11">Repartiendo pulseras</string>
+	<string name="dialog_sync_text_12">Pintando las fiestas</string>
+	<string name="dialog_sync_text_13">Desplegando pancarta</string>
 	<string name="dialog_sync_failed_title">Synchronization failed</string>
 	<string name="dialog_sync_failed_text">Couldn\'t download content.\n\nMake sure you have a network connection and try again.</string>
 	<string name="dialog_sync_failed_close">Close</string>
@@ -170,15 +142,15 @@
 	<string name="lablanca_nofestivals_2_title">Dormir es de cobardes:</string>
 	<string name="lablanca_nofestivals_2"><![CDATA[Casi todos los días organizamos actividades desde la mañana, ya sean almuerzos, actividades para el público general o competiciones en los Herri Kirolak. Después solemos ir a comer juntos, antes de los paseillos, y después, siempre cenamos juntos. Y por la noche, hasta que el cuerpo aguante!]]></string>
 	<string name="lablanca_nofestivals_3_title">Especialistas en paseillos:</string>
-	<string name="lablanca_nofestivals_3"><![CDATA[A la hora de hacer paseillos, no hay quien nos gane. Con nuestra furgoneta siempre abierta a la cabeza, y la txaranga El Postín animando desde atrás, es imposible aburrirse. Y entre paseillos tampoco descansamos, siempre estamos organizando cosas: juegos, carreras, bingos, música, ida a las barracas...]]></string>
+	<string name="lablanca_nofestivals_3"><![CDATA[A la hora de hacer paseillos, no hay quien nos gane. Con nuestra furgoneta siempre abierta a la cabeza, y la txaranga El Postín animando desde atrás, es imposible aburrirse. Y entre paseillos tampoco descansamos, siempre estamos organizando cosas: juegos, carreras, bingos, música, ida a las barracas]]></string>
 	<string name="lablanca_nofestivals_4_title">Nos gusta comer:</string>
 	<string name="lablanca_nofestivals_4"><![CDATA[No queremos que un Margolari pase hambre. Las comidas en Gasteizko Margolariak son en restaurante, con un buen men&ú, que nos den fuerzas para aguantar el resto del día. Las cenas las hacemos bien en la calle o bien en restaurante, pero siempre con comida buena y caliente. Los mismo que los almuerzos.]]></string>
 	<string name="lablanca_nofestivals_5_title">Y beber:</string>
 	<string name="lablanca_nofestivals_5"><![CDATA[Sea cual sea tu veneno, lo tenemos: Ron, vodka, kalimotxo, cerveza, whiskey, agua, refrescos Durante los paseillos (y varias veces m&aacute;s a lo largo del d&iacute;a) en la furgoneta tendr&aacute;s barra libre de todo lo que quieras.]]></string>
 	<string name="lablanca_nofestivals_6_title">Nos apuntamos a un bombardeo:</string>
-	<string name="lablanca_nofestivals_6"><![CDATA[Carrera de Barricas, Herri Kirolak... Nunca hemos faltado a nada. Ganar, lo que es ganar, aún lo tenemos pendiente, pero lo pasamos bien. Así que ya sabes, si quieres representar a Gasteizko Margolariak, avísanos!]]></string>
+	<string name="lablanca_nofestivals_6"><![CDATA[Carrera de Barricas, Herri Kirolak Nunca hemos faltado a nada. Ganar, lo que es ganar, aún lo tenemos pendiente, pero lo pasamos bien. Así que ya sabes, si quieres representar a Gasteizko Margolariak, avísanos!]]></string>
 	<string name="lablanca_nofestivals_7_title">Por la ciudad, para la ciudad:</string>
-	<string name="lablanca_nofestivals_7"><![CDATA[No nos gusta mirarnos el ombligo. Aunque la mayor parte de actividades que organizamos son para los miembros de Gasteizko Margolariak, hay otras que son para todo el público. Hasta ahora hemos organizado talleres de Cesta Punta para txikis, Margotxef (un concurso de cocina infantil), visitas a residencias de ancianos...]]></string>
+	<string name="lablanca_nofestivals_7"><![CDATA[No nos gusta mirarnos el ombligo. Aunque la mayor parte de actividades que organizamos son para los miembros de Gasteizko Margolariak, hay otras que son para todo el público. Hasta ahora hemos organizado talleres de Cesta Punta para txikis, Margotxef (un concurso de cocina infantil), visitas a residencias de ancianos]]></string>
 	<string name="lablanca_nofestivals_8_title">Margolaris:</string>
 	<string name="lablanca_nofestivals_8"><![CDATA[Todo lo demás no sirve de nada si en una cuadrilla no hay buen ambiente. En Gasteizko Margolariak podemos presumir de gente cercana, participativa, capaz de hacer que desde el primer día ya te sientas como en casa. Además, los organizadores son gente cercana, que escucha y está siempre abierta a nuevas propuestas. Por esto, quien prueba, repite.]]></string>
 	<string name="home_section_location_text_calculating">Calculating distance…</string>
@@ -189,18 +161,16 @@
 	<string name="sponsors_url">Open web site</string>
 
 	<!-- Us -->
-	<string name="us_title">Nosotros</string>
 	<string name="us_association">La asociación</string>
 	<string name="us_association_content">La Asociación Cultural Gasteizko Margolariak nace en el año 2013 con la idea de estimular la participación ciudadana y fortalecer la cultura y las tradiciones de Vitoria-Gasteiz.\n\nEn nuestro nombre se refleja un barrio en el que las calles nos recuerdan a grandes pintores: el barrio de San Martín. Estamos representados en los barrios, y creemos que son la esencia de esta ciudad.</string>
 	<string name="us_cuadrilla">La cuadrilla</string>
 	<string name="us_cuadrilla_content">Nos convertimos en Cuadrilla de Blusas y Neskas en 2013, y en ese mismo año, miembros de la Comisión de Blusas y Neskas.\n\nDesde entonces no hemos hecho mas que crecer junto con todos los que han decidido, año tras año, apostar por nosotros.</string>
 	<string name="us_activities">Lo que hacemos</string>
-	<string name="us_activities_content">Excursiones, partidos, causas benéficas... No solo se nos ve en fiestas.\n\nCreemos que, como Cuadrilla de Blusas y Neskas, existimos por y para la ciudad, y por eso organizamos actividades durante todo el año, para todo aquel que quiera acompañarnos.</string>
+	<string name="us_activities_content">Excursiones, partidos, causas benéficas No solo se nos ve en fiestas.\n\nCreemos que, como Cuadrilla de Blusas y Neskas, existimos por y para la ciudad, y por eso organizamos actividades durante todo el año, para todo aquel que quiera acompañarnos.</string>
 	<string name="us_transparency">Transparencia</string>
 	<string name="us_transparency_content">¿Te preocupa saber dónde va tu dinero? En Gasteizko Margolariak queremos que estés tranquilo.\n\nMuchas de nuestras actividades son gratuitas. Otras, como las fiestas de La Blanca, tienen una cuota de inscripción. Gasteizko Margolariak no es una empresa, es una Asociación Cultural, y como tal, no tenemos beneficios.\n\nQueremos ser transparentes, y por eso, empezando en 2017, pondremos a tu disposición nuestras cuentas de manera online, para que sepas que cada euro se reinvierte en ti.</string>
 
 
-	<string name="preferences">Preferences</string>
 	<string name="preferences_info">Information</string>
 	<string name="preferences_info_feedback">Feedback</string>
 	<string name="preferences_info_feedback_summary">Send anonymous feedback to the developer</string>
@@ -209,7 +179,6 @@
 	<string name="preferences_info_version">App version</string>
 	<string name="preferences_sync">Sync</string>
 	<string name="preferences_sync_notifications">Notifications</string>
-	<string name="preferences_sync_usage">Background data usage</string>
 	<string name="preferences_sync_sync_on">Background sync is enabled</string>
 	<string name="preferences_sync_notifications_on">Notifications will be received</string>
 	<string name="preferences_sync_notifications_off">Notifications will not be received</string>
@@ -219,7 +188,6 @@
 	<string name="changelog">Changelog</string>
 
 	<!-- Share menu -->
-	<string name="share">Share</string>
 	<string name="share_with">Share using…</string>
 	<string name="share_home">Gasteizko Margolariak</string>
 	<string name="share_lablanca">La Blanca - Gasteizko Margolariak</string>

+ 9 - 37
app/src/main/res/values-eu-rES/strings.xml

@@ -26,10 +26,6 @@
 	<string name="menu_gallery">Galeria</string>
 	<string name="menu_settings">Ezarpenak</string>
 
-	<string name="tutorial_menu">Toca el icono de Margolariak o desliza la pantalla hacia la derecha para ver el menú.</string>
-	<string name="tutorial_content">Toca cualquier entrada para ir a la sección correspondiente.</string>
-	<string name="tutorial_button">Entendido</string>
-
 	<!-- Schedule strings -->
 
 	<string name="schedule_filter">Bilatu…</string>
@@ -47,7 +43,6 @@
 	<!-- Home section strings -->
 
 	<string name="home_section_location">Aurkitu Gasteizko Margolariak</string>
-	<string name="home_section_lablanca">Andre Zuria</string>
 	<string name="home_section_gmschedule">Margolari Programa</string>
 	<string name="home_section_cityschedule">Jaiako programa</string>
 	<string name="home_section_around">Nire ondoan</string>
@@ -62,13 +57,7 @@
 	<string name="home_section_location_text_long">Zure inguruan %1$s kilometrokoan daude!</string>
 
 
-	<!-- Settings section strings -->
-
-	<string name="settings_notification">Notifikazioiak</string>
-
-
 	<!-- Activity section strings -->
-	<string name="activity_city">Hiria:</string>
 	<string name="activity_price">Prezioa:</string>
 	<string name="activity_no_future">Oraindik ex dira datozen jarduerak. Bat prestatzen dugunean, hemen agertzeko da.</string>
 	<string name="activity_schedule">Ordutegia</string>
@@ -94,8 +83,6 @@
 	<string name="lablanca_schedule">Programa</string>
 	<string name="lablanca_schedule_city">Jaiako programa</string>
 	<string name="lablanca_schedule_gm">Margolari programa</string>
-	<string name="lablanca_date_july">Uztalaren %1$san</string>
-	<string name="lablanca_date_august">Abuztuaren %1$san</string>
 
 	<!--Schedule section strings-->
 	<string name="schedule_month_july">Uztaila</string>
@@ -133,7 +120,6 @@
 	<string name="notification_action_lablanca">Ireki Andre Zuria</string>
 	<string name="notification_action_gmschedule">Ikusi Margolari programa</string>
 	<string name="notification_action_cityschedule">Ireki jaiako programa</string>
-	<string name="notification_action_location">Ikus lokalizazioia</string>
 	<string name="notification_action_blog">Ireki blog</string>
 	<string name="notification_action_activities">Ireki ekitaldiak</string>
 	<string name="notification_action_gallery">Ireki galeria</string>
@@ -145,14 +131,6 @@
 	<string name="dialog_sync_failed_title">Sinkronizazioko errakuntza</string>
 	<string name="dialog_sync_failed_close">Itxali</string>
 	<string name="price">Prezioa: %1$d €</string>
-	<string name="settings_about">Gu</string>
-	<string name="settings_about_content"><![CDATA[La Asociación Cultural Gasteizko Margolariak nace en el año 2013 con la idea de estimular la participación ciudadana y fortalecer la cultura y las tradiciones de Vitoria-Gasteiz.<br/><br/>En nuestro nombre se refleja un barrio en el que las calles nos recuerdan a grandes pintores: el barrio de San Martín. Estamos representados en los barrios, y creemos que son la esencia de esta ciudad.<br/><br/>Nos convertimos en Cuadrilla de Blusas y Neskas en 2013, y en ese mismo año, miembros de la Comisión de Blusas y Neskas.<br/><br/>Desde entonces no hemos hecho más que crecer junto con todos los que han decidido, año tras año, apostar por nosotros.]]></string>
-	<string name="settings_license">Lizentzia</string>
-	<string name="settings_license_content"><![CDATA[Copyright 2016 Iñigo Valentin<br/><br/>This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation.<br/><br/>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details at http://www.gnu.org/licenses/.<br/><br/>The name "Gasteizko Margolariak" and its logotype are property of Gasteizko Margolariak.<br/><br/><br/><div style="background-color:#bbbbbb;padding:6px;border-radius:5px;border-style:solid;border-width:2px;border-color:#333333;text-align:center;">You can get the source code for this project at <a href="https://github.com/Seavenois/GM">Github</a></div>]]></string>
-	<string name="settings_privacy">Pribazitatea</string>
-	<string name="settings_transparency">Transparentzia</string>
-	<string name="settings_privacy_content"><![CDATA[En Gasteizko Margolariak respetamos tu privacidad. No guardamos NINGÚN dato de nuestros usuarios, incluyendo información personal, localización, hábitos de compra, preferencias sexuales, color favorito, nombre de su primer amor… NINGUNO.<br/><br/>Para que nos creas, te explicamos lo que sí almacenamos:<br/><br/><ul><li>Un código de usuario, generado aleatoriamente, único para tu dispositivo. Esto es necesario para sincronizar la aplicación con nuestra base de datos y poder descargar los últimos posts, actividades… Pero esta hecho de tal manera que no podamos identificarte como persona a través de ese código.</li><li>Al publicar un comentario en una entrada o una foto, guardaremos temporalmente (120 minutos, lo justo para procesar información) tu dirección IP. Esto nos es súper útil para saber cuántas personas diferentes publican comentarios, y tampoco nos permite identificarte como persona.</li></ul>]]></string>
-	<string name="settings_transparency_content"><![CDATA[¿Te preocupa saber dónde va tu dinero? En Gasteizko Margolariak queremos que estés tranquilo.<br/><br/>Muchas de nuestras actividades son gratuitas. Otras, como las fiestas de La Blanca, tienen una cuota de inscripción. Gasteizko Margolariak no es una empresa, es una Asociación Cultural, y como tal, no tenemos beneficios.<br/><br/>Queremos ser transparentes, y por eso, empezando en 2016, pondremos a tu disposición nuestras cuentas de manera online, para que sepas que cada euro se reinvierte en tí.]]></string>
 	<string name="dialog_sync_text_0">Locating Don Margolo&#8230;</string>
 	<string name="dialog_sync_text_1">Starting up the van&#8230;</string>
 	<string name="dialog_sync_text_2">Serving kalimotxos&#8230;</string>
@@ -162,11 +140,11 @@
 	<string name="dialog_sync_text_6">Ari ari ari!</string>
 	<string name="dialog_sync_text_7">Llegando tarde…</string>
 	<string name="dialog_sync_text_8">¿Cabe más gente en el Foro Margolari?</string>
-	<string name="dialog_sync_text_9">Arreglando el tirador de cerveza...</string>
-	<string name="dialog_sync_text_10">Descorchando botellas...</string>
-	<string name="dialog_sync_text_11">Repartiendo pulseras...</string>
-	<string name="dialog_sync_text_12">Pintando las fiestas...</string>
-	<string name="dialog_sync_text_13">Desplegando pancarta...</string>
+	<string name="dialog_sync_text_9">Arreglando el tirador de cerveza</string>
+	<string name="dialog_sync_text_10">Descorchando botellas</string>
+	<string name="dialog_sync_text_11">Repartiendo pulseras</string>
+	<string name="dialog_sync_text_12">Pintando las fiestas</string>
+	<string name="dialog_sync_text_13">Desplegando pancarta</string>
 	<string name="dialog_sync_failed_text">No se pudierdon descargar los contenidos\n\nAsegúrate de que dispones de conexión a internet e inténtalo de nuevo.</string>
 	<string name="lablanca_nofestivals"><![CDATA[Las Fiestas de La Blanca. Esos días, del 4 al 9 de agosto, en los que Vitoria-Gasteiz se transforma. Se llena de color y alegría, y en cada esquina puedes encontrar actividades y espectáculos. Todos las estamos esperando.\n\nPor desgracia, aún hay que esperar más.\n\nNosotros ya estamos trabajando en ello. Tan pronto como vayamos sabiendo más, aquí iremos publicando nuestro programa y otra información sobre las fiestas. Para ir abriendo boca, dejanos contarte algunas de las claves del plan Margolari de fiestas:]]></string>
 	<string name="lablanca_nofestivals_1_title">Planes que se adaptan a tí:</string>
@@ -174,19 +152,17 @@
 	<string name="lablanca_nofestivals_2_title">Dormir es de cobardes:</string>
 	<string name="lablanca_nofestivals_2"><![CDATA[Casi todos los días organizamos actividades desde la mañana, ya sean almuerzos, actividades para el público general o competiciones en los Herri Kirolak. Después solemos ir a comer juntos, antes de los paseillos, y después, siempre cenamos juntos. Y por la noche, hasta que el cuerpo aguante!]]></string>
 	<string name="lablanca_nofestivals_3_title">Especialistas en paseillos:</string>
-	<string name="lablanca_nofestivals_3"><![CDATA[A la hora de hacer paseillos, no hay quien nos gane. Con nuestra furgoneta siempre abierta a la cabeza, y la txaranga El Postín animando desde atrás, es imposible aburrirse. Y entre paseillos tampoco descansamos, siempre estamos organizando cosas: juegos, carreras, bingos, música, ida a las barracas...]]></string>
+	<string name="lablanca_nofestivals_3"><![CDATA[A la hora de hacer paseillos, no hay quien nos gane. Con nuestra furgoneta siempre abierta a la cabeza, y la txaranga El Postín animando desde atrás, es imposible aburrirse. Y entre paseillos tampoco descansamos, siempre estamos organizando cosas: juegos, carreras, bingos, música, ida a las barracas]]></string>
 	<string name="lablanca_nofestivals_4_title">Nos gusta comer:</string>
 	<string name="lablanca_nofestivals_4"><![CDATA[No queremos que un Margolari pase hambre. Las comidas en Gasteizko Margolariak son en restaurante, con un buen men&ú, que nos den fuerzas para aguantar el resto del día. Las cenas las hacemos bien en la calle o bien en restaurante, pero siempre con comida buena y caliente. Los mismo que los almuerzos.]]></string>
 	<string name="lablanca_nofestivals_5_title">Y beber:</string>
 	<string name="lablanca_nofestivals_5"><![CDATA[Sea cual sea tu veneno, lo tenemos: Ron, vodka, kalimotxo, cerveza, whiskey, agua, refrescos Durante los paseillos (y varias veces m&aacute;s a lo largo del d&iacute;a) en la furgoneta tendr&aacute;s barra libre de todo lo que quieras.]]></string>
 	<string name="lablanca_nofestivals_6_title">Nos apuntamos a un bombardeo:</string>
-	<string name="lablanca_nofestivals_6"><![CDATA[Carrera de Barricas, Herri Kirolak... Nunca hemos faltado a nada. Ganar, lo que es ganar, aún lo tenemos pendiente, pero lo pasamos bien. Así que ya sabes, si quieres representar a Gasteizko Margolariak, avísanos!]]></string>
+	<string name="lablanca_nofestivals_6"><![CDATA[Carrera de Barricas, Herri Kirolak Nunca hemos faltado a nada. Ganar, lo que es ganar, aún lo tenemos pendiente, pero lo pasamos bien. Así que ya sabes, si quieres representar a Gasteizko Margolariak, avísanos!]]></string>
 	<string name="lablanca_nofestivals_7_title">Por la ciudad, para la ciudad:</string>
-	<string name="lablanca_nofestivals_7"><![CDATA[No nos gusta mirarnos el ombligo. Aunque la mayor parte de actividades que organizamos son para los miembros de Gasteizko Margolariak, hay otras que son para todo el público. Hasta ahora hemos organizado talleres de Cesta Punta para txikis, Margotxef (un concurso de cocina infantil), visitas a residencias de ancianos...]]></string>
+	<string name="lablanca_nofestivals_7"><![CDATA[No nos gusta mirarnos el ombligo. Aunque la mayor parte de actividades que organizamos son para los miembros de Gasteizko Margolariak, hay otras que son para todo el público. Hasta ahora hemos organizado talleres de Cesta Punta para txikis, Margotxef (un concurso de cocina infantil), visitas a residencias de ancianos]]></string>
 	<string name="lablanca_nofestivals_8_title">Margolaris:</string>
 	<string name="lablanca_nofestivals_8"><![CDATA[Todo lo demás no sirve de nada si en una cuadrilla no hay buen ambiente. En Gasteizko Margolariak podemos presumir de gente cercana, participativa, capaz de hacer que desde el primer día ya te sientas como en casa. Además, los organizadores son gente cercana, que escucha y está siempre abierta a nuevas propuestas. Por esto, quien prueba, repite.]]></string>
-	<string name="settings_notification_off">No recibir notificaciones</string>
-	<string name="settings_notification_on">Recibir notificaciones</string>
 	<string name="home_section_location_text_calculating">Calculando distancia…</string>
 	<string name="pop_menu_share">Bitarte</string>
 	<string name="pop_menu_about">Gu</string>
@@ -195,13 +171,12 @@
 	<string name="sponsors_url">Web horria</string>
 
 	<!-- Us -->
-	<string name="us_title">Nosotros</string>
 	<string name="us_association">La asociación</string>
 	<string name="us_association_content">La Asociación Cultural Gasteizko Margolariak nace en el año 2013 con la idea de estimular la participación ciudadana y fortalecer la cultura y las tradiciones de Vitoria-Gasteiz.\n\nEn nuestro nombre se refleja un barrio en el que las calles nos recuerdan a grandes pintores: el barrio de San Martín. Estamos representados en los barrios, y creemos que son la esencia de esta ciudad.</string>
 	<string name="us_cuadrilla">La cuadrilla</string>
 	<string name="us_cuadrilla_content">Nos convertimos en Cuadrilla de Blusas y Neskas en 2013, y en ese mismo año, miembros de la Comisión de Blusas y Neskas.\n\nDesde entonces no hemos hecho mas que crecer junto con todos los que han decidido, año tras año, apostar por nosotros.</string>
 	<string name="us_activities">Lo que hacemos</string>
-	<string name="us_activities_content">Excursiones, partidos, causas benéficas... No solo se nos ve en fiestas.\n\nCreemos que, como Cuadrilla de Blusas y Neskas, existimos por y para la ciudad, y por eso organizamos actividades durante todo el año, para todo aquel que quiera acompañarnos.</string>
+	<string name="us_activities_content">Excursiones, partidos, causas benéficas No solo se nos ve en fiestas.\n\nCreemos que, como Cuadrilla de Blusas y Neskas, existimos por y para la ciudad, y por eso organizamos actividades durante todo el año, para todo aquel que quiera acompañarnos.</string>
 	<string name="us_transparency">Transparencia</string>
 	<string name="us_transparency_content">¿Te preocupa saber dónde va tu dinero? En Gasteizko Margolariak queremos que estés tranquilo.\n\nMuchas de nuestras actividades son gratuitas. Otras, como las fiestas de La Blanca, tienen una cuota de inscripción. Gasteizko Margolariak no es una empresa, es una Asociación Cultural, y como tal, no tenemos beneficios.\n\nQueremos ser transparentes, y por eso, empezando en 2017, pondremos a tu disposición nuestras cuentas de manera online, para que sepas que cada euro se reinvierte en ti.</string>
 
@@ -217,15 +192,12 @@
 	<string name="preferences_sync_notifications_off">No se recibirán notificaciones</string>
 	<string name="preferences_sync_notifications_on">Se recibirán notificaciones</string>
 	<string name="preferences_sync_sync_on">Sincronización activada</string>
-	<string name="preferences_sync_usage">Uso de datos</string>
-	<string name="preferences">Preferences</string>
 	<string name="preferences_info_feedback">Feedback</string>
 	<string name="preferences_sync_sync">Sincronización en segundo plano</string>
 	<string name="preferences_sync_sync_off">Sincronización desactivada</string>
 	<string name="changelog">Changelog</string>
 
 	<!-- Share menu -->
-	<string name="share">Compartir</string>
 	<string name="share_with">Enviar con…</string>
 	<string name="share_home">Gasteizko Margolariak</string>
 	<string name="share_lablanca">Andre Zuria - Gasteizko Margolariak</string>

+ 0 - 4
app/src/main/res/values-v14/styles.xml

@@ -1,4 +0,0 @@
-<resources>
-
-
-</resources>

+ 0 - 10
app/src/main/res/values-v21/styles.xml

@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
-    <style name="Theme.AppBaseTheme" parent="android:Theme.Material.Light">
-        <item name="android:colorPrimary">@color/background_menu</item>
-        <item name="android:colorPrimaryDark">@color/background_menu</item>
-        <item name="android:colorAccent">@color/background_menu</item>
-        <item name="android:colorBackground">@color/background_app</item>
-    </style>
-</resources>

+ 0 - 5
app/src/main/res/values-v24/styles.xml

@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources xmlns:tools="http://schemas.android.com/tools">
-    <style name="Base.TextAppearance.AppCompat.Widget.Button.Borderless.Colored" parent="android:TextAppearance.Material.Widget.Button" tools:override="true" />
-    <style name="Base.TextAppearance.AppCompat.Widget.Button.Colored" parent="android:TextAppearance.Material.Widget.Button" tools:override="true" />
-</resources>

+ 14 - 48
app/src/main/res/values/strings.xml

@@ -30,10 +30,6 @@
 	<string name="menu_gallery">Galería</string>
 	<string name="menu_settings">Preferencias</string>
 
-	<string name="tutorial_menu">Toca el icono de Margolariak o desliza la pantalla hacia la derecha para ver el menú.</string>
-	<string name="tutorial_content">Toca cualquier entrada para ir a la sección correspondiente.</string>
-	<string name="tutorial_button">Entendido</string>
-
 	<!-- Schedule strings -->
 
 	<string name="schedule_filter">Buscar&#8230;</string>
@@ -60,16 +56,6 @@
 	<string name="home_section_social">Síguenos</string>
 
 
-	<!-- Prices dialog strings -->
-
-
-	<!-- Settings section strings -->
-
-	<string name="settings_notification">Notificaciones</string>
-	<string name="settings_notification_on">Recibir notificaciones</string>
-	<string name="settings_notification_off">No recibir notificaciones</string>
-
-
 	<!-- Social networks strings -->
 
 	<string name="social_phone" translatable="false">Phone</string>
@@ -103,7 +89,6 @@
 	<string name="dialog_sync_failed_title">Error de sincronización</string>
 	<string name="dialog_sync_failed_text">No se pudierdon descargar los contenidos\n\nAsegúrate de que dispones de conexión a internet e inténtalo de nuevo.</string>
 	<string name="dialog_sync_failed_close">Cerrar</string>
-	<string name="activity_city">Cudad:</string>
 	<string name="activity_future">Próximas actividades</string>
 	<string name="activity_no_future">No hay actividades planeadas proximamanete. Cuando organicemos algo, aparecera aquí.</string>
 	<string name="activity_past">Actividades pasadas</string>
@@ -119,20 +104,20 @@
 		<item quantity="one">%1$d comentario</item>
 		<item quantity="other">%1$d comentarios</item>
 	</plurals>
-	<string name="dialog_sync_text_0">Contactando con Don Margolo&#8230;</string>
-	<string name="dialog_sync_text_1">Arrancando la furgo&#8230;</string>
-	<string name="dialog_sync_text_2">Preparando kalimotxos&#8230;</string>
+	<string name="dialog_sync_text_0">Contactando con Don Margolo</string>
+	<string name="dialog_sync_text_1">Arrancando la furgo</string>
+	<string name="dialog_sync_text_2">Preparando kalimotxos</string>
 	<string name="dialog_sync_text_3">Tú eres el piloto</string>
-	<string name="dialog_sync_text_4">Afinando la tuba&#8230;</string>
+	<string name="dialog_sync_text_4">Afinando la tuba</string>
 	<string name="dialog_sync_text_5">Margolari camina pa\'lante, margolari camina pa\'trás.</string>
-	<string name="dialog_sync_text_6">Ari ari ari!</string>
+	<string name="dialog_sync_text_6" tools:ignore="Typos">Ari ari ari!</string>
 	<string name="dialog_sync_text_7">Llegando tarde…</string>
 	<string name="dialog_sync_text_8">¿Cabe más gente en el Foro Margolari?</string>
-	<string name="dialog_sync_text_9">Arreglando el tirador de cerveza...</string>
-	<string name="dialog_sync_text_10">Descorchando botellas...</string>
-	<string name="dialog_sync_text_11">Repartiendo pulseras...</string>
-	<string name="dialog_sync_text_12">Pintando las fiestas...</string>
-	<string name="dialog_sync_text_13">Desplegando pancarta...</string>
+	<string name="dialog_sync_text_9">Arreglando el tirador de cerveza</string>
+	<string name="dialog_sync_text_10">Descorchando botellas</string>
+	<string name="dialog_sync_text_11">Repartiendo pulseras</string>
+	<string name="dialog_sync_text_12">Pintando las fiestas</string>
+	<string name="dialog_sync_text_13">Desplegando pancarta</string>
 	<string name="gallery_albums">Albums</string>
 	<string name="gallery_upload">Subir fotos</string>
 	<string name="gallery_upload_button">Subir</string>
@@ -146,8 +131,6 @@
 	<string name="home_section_location_text_short" tools:ignore="PluralsCandidate">¡Están a solo %1$d metros de ti! (Unos %2$d minutos andando)</string>
 	<string name="home_section_location_text_long">¡Están a solo %1$s kilometros de ti!</string>
 	<string name="home_section_location_text_calculating">Calculando distancia…</string>
-	<string name="lablanca_date_august">%1$s de agosto</string>
-	<string name="lablanca_date_july">%1$s de julio</string>
 	<string name="lablanca_prices">Precios</string>
 	<string name="lablanca_prices_days">Días sueltos</string>
 	<string name="lablanca_prices_pack">Packs</string>
@@ -165,40 +148,30 @@
 	<string name="home_section_blog">Últimos posts</string>
 	<string name="home_section_cityschedule">Programa de fiestas</string>
 	<string name="home_section_gallery">Últimas fotos</string>
-	<string name="home_section_lablanca">La Blanca</string>
 	<string name="home_section_activities_past">Últimas actividades</string>
 	<string name="notification_action_activities">Ver actividades</string>
 	<string name="notification_action_blog">Abrir blog</string>
 	<string name="notification_action_cityschedule">Programa de fiestas</string>
 	<string name="notification_action_gallery">Abrir galería</string>
 	<string name="notification_action_lablanca">Abrir La Blanca</string>
-	<string name="notification_action_location">Ver localización</string>
 	<string name="price">Precio: %1$d €</string>
-	<string name="settings_about">Sobre nosotros</string>
-	<string name="settings_license">Licencia</string>
-	<string name="settings_license_content"><![CDATA[Copyright 2016 Iñigo Valentin<br/><br/>This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation.<br/><br/>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details at http://www.gnu.org/licenses/.<br/><br/>The name "Gasteizko Margolariak" and its logotype are property of Gasteizko Margolariak.<br/><br/><br/><div style="background-color:#bbbbbb;padding:6px;border-radius:5px;border-style:solid;border-width:2px;border-color:#333333;text-align:center;">You can get the source code for this project at <a href="https://github.com/Seavenois/GM">Github</a></div>]]></string>
-	<string name="settings_privacy">Privacidad</string>
-	<string name="settings_privacy_content"><![CDATA[En Gasteizko Margolariak respetamos tu privacidad. No guardamos NINGÚN dato de nuestros usuarios, incluyendo información personal, localización, hábitos de compra, preferencias sexuales, color favorito, nombre de su primer amor… NINGUNO.<br/><br/>Para que nos creas, te explicamos lo que sí almacenamos:<br/><br/><ul><li>Un código de usuario, generado aleatoriamente, único para tu dispositivo. Esto es necesario para sincronizar la aplicación con nuestra base de datos y poder descargar los últimos posts, actividades… Pero esta hecho de tal manera que no podamos identificarte como persona a través de ese código.</li><li>Al publicar un comentario en una entrada o una foto, guardaremos temporalmente (120 minutos, lo justo para procesar información) tu dirección IP. Esto nos es súper útil para saber cuántas personas diferentes publican comentarios, y tampoco nos permite identificarte como persona.</li></ul>]]></string>
-	<string name="settings_transparency">Transparencia</string>
-	<string name="settings_transparency_content"><![CDATA[¿Te preocupa saber dónde va tu dinero? En Gasteizko Margolariak queremos que estés tranquilo.<br/><br/>Muchas de nuestras actividades son gratuitas. Otras, como las fiestas de La Blanca, tienen una cuota de inscripción. Gasteizko Margolariak no es una empresa, es una Asociación Cultural, y como tal, no tenemos beneficios.<br/><br/>Queremos ser transparentes, y por eso, empezando en 2016, pondremos a tu disposición nuestras cuentas de manera online, para que sepas que cada euro se reinvierte en tí.]]></string>
 	<string name="lablanca_nofestivals"><![CDATA[Las Fiestas de La Blanca. Esos días, del 4 al 9 de agosto, en los que Vitoria-Gasteiz se transforma. Se llena de color y alegría, y en cada esquina puedes encontrar actividades y espectáculos. Todos las estamos esperando.\n\nPor desgracia, aún hay que esperar más.\n\nNosotros ya estamos trabajando en ello. Tan pronto como vayamos sabiendo más, aquí iremos publicando nuestro programa y otra información sobre las fiestas. Para ir abriendo boca, dejanos contarte algunas de las claves del plan Margolari de fiestas:]]></string>
 	<string name="lablanca_nofestivals_1_title">Planes que se adaptan a tí:</string>
 	<string name="lablanca_nofestivals_1"><![CDATA[Puedes apuntarte días sueltos, o elegir entre las varias ofertas por varios días para conseguir descuentos.]]></string>
 	<string name="lablanca_nofestivals_2_title">Dormir es de cobardes:</string>
 	<string name="lablanca_nofestivals_2"><![CDATA[Casi todos los días organizamos actividades desde la mañana, ya sean almuerzos, actividades para el público general o competiciones en los Herri Kirolak. Después solemos ir a comer juntos, antes de los paseillos, y después, siempre cenamos juntos. Y por la noche, hasta que el cuerpo aguante!]]></string>
 	<string name="lablanca_nofestivals_3_title">Especialistas en paseillos:</string>
-	<string name="lablanca_nofestivals_3"><![CDATA[A la hora de hacer paseillos, no hay quien nos gane. Con nuestra furgoneta siempre abierta a la cabeza, y la txaranga El Postín animando desde atrás, es imposible aburrirse. Y entre paseillos tampoco descansamos, siempre estamos organizando cosas: juegos, carreras, bingos, música, ida a las barracas...]]></string>
+	<string name="lablanca_nofestivals_3"><![CDATA[A la hora de hacer paseillos, no hay quien nos gane. Con nuestra furgoneta siempre abierta a la cabeza, y la txaranga El Postín animando desde atrás, es imposible aburrirse. Y entre paseillos tampoco descansamos, siempre estamos organizando cosas: juegos, carreras, bingos, música, ida a las barracas…]]></string>
 	<string name="lablanca_nofestivals_4_title">Nos gusta comer:</string>
 	<string name="lablanca_nofestivals_4"><![CDATA[No queremos que un Margolari pase hambre. Las comidas en Gasteizko Margolariak son en restaurante, con un buen men&ú, que nos den fuerzas para aguantar el resto del día. Las cenas las hacemos bien en la calle o bien en restaurante, pero siempre con comida buena y caliente. Los mismo que los almuerzos.]]></string>
 	<string name="lablanca_nofestivals_5_title">Y beber:</string>
 	<string name="lablanca_nofestivals_5"><![CDATA[Sea cual sea tu veneno, lo tenemos: Ron, vodka, kalimotxo, cerveza, whiskey, agua, refrescos Durante los paseillos (y varias veces m&aacute;s a lo largo del d&iacute;a) en la furgoneta tendr&aacute;s barra libre de todo lo que quieras.]]></string>
 	<string name="lablanca_nofestivals_6_title">Nos apuntamos a un bombardeo:</string>
-	<string name="lablanca_nofestivals_6"><![CDATA[Carrera de Barricas, Herri Kirolak... Nunca hemos faltado a nada. Ganar, lo que es ganar, aún lo tenemos pendiente, pero lo pasamos bien. Así que ya sabes, si quieres representar a Gasteizko Margolariak, avísanos!]]></string>
+	<string name="lablanca_nofestivals_6"><![CDATA[Carrera de Barricas, Herri Kirolak Nunca hemos faltado a nada. Ganar, lo que es ganar, aún lo tenemos pendiente, pero lo pasamos bien. Así que ya sabes, si quieres representar a Gasteizko Margolariak, avísanos!]]></string>
 	<string name="lablanca_nofestivals_7_title">Por la ciudad, para la ciudad:</string>
-	<string name="lablanca_nofestivals_7"><![CDATA[No nos gusta mirarnos el ombligo. Aunque la mayor parte de actividades que organizamos son para los miembros de Gasteizko Margolariak, hay otras que son para todo el público. Hasta ahora hemos organizado talleres de Cesta Punta para txikis, Margotxef (un concurso de cocina infantil), visitas a residencias de ancianos...]]></string>
+	<string name="lablanca_nofestivals_7"><![CDATA[No nos gusta mirarnos el ombligo. Aunque la mayor parte de actividades que organizamos son para los miembros de Gasteizko Margolariak, hay otras que son para todo el público. Hasta ahora hemos organizado talleres de Cesta Punta para txikis, Margotxef (un concurso de cocina infantil), visitas a residencias de ancianos]]></string>
 	<string name="lablanca_nofestivals_8_title">Margolaris:</string>
 	<string name="lablanca_nofestivals_8"><![CDATA[Todo lo demás no sirve de nada si en una cuadrilla no hay buen ambiente. En Gasteizko Margolariak podemos presumir de gente cercana, participativa, capaz de hacer que desde el primer día ya te sientas como en casa. Además, los organizadores son gente cercana, que escucha y está siempre abierta a nuevas propuestas. Por esto, quien prueba, repite.]]></string>
-	<string name="settings_about_content"><![CDATA[La Asociación Cultural Gasteizko Margolariak nace en el año 2013 con la idea de estimular la participación ciudadana y fortalecer la cultura y las tradiciones de Vitoria-Gasteiz.<br/><br/>En nuestro nombre se refleja un barrio en el que las calles nos recuerdan a grandes pintores: el barrio de San Martín. Estamos representados en los barrios, y creemos que son la esencia de esta ciudad.<br/><br/>Nos convertimos en Cuadrilla de Blusas y Neskas en 2013, y en ese mismo año, miembros de la Comisión de Blusas y Neskas.<br/><br/>Desde entonces no hemos hecho más que crecer junto con todos los que han decidido, año tras año, apostar por nosotros.]]></string>
 
 	<!-- Misc strings -->
 
@@ -213,19 +186,16 @@
 	<string name="sponsors_url">Sitio web</string>
 
 	<!-- Us -->
-	<string name="us_title">Nosotros</string>
 	<string name="us_association">La asociación</string>
 	<string name="us_association_content">La Asociación Cultural Gasteizko Margolariak nace en el año 2013 con la idea de estimular la participación ciudadana y fortalecer la cultura y las tradiciones de Vitoria-Gasteiz.\n\nEn nuestro nombre se refleja un barrio en el que las calles nos recuerdan a grandes pintores: el barrio de San Martín. Estamos representados en los barrios, y creemos que son la esencia de esta ciudad.</string>
 	<string name="us_cuadrilla">La cuadrilla</string>
 	<string name="us_cuadrilla_content">Nos convertimos en Cuadrilla de Blusas y Neskas en 2013, y en ese mismo año, miembros de la Comisión de Blusas y Neskas.\n\nDesde entonces no hemos hecho mas que crecer junto con todos los que han decidido, año tras año, apostar por nosotros.</string>
 	<string name="us_activities">Lo que hacemos</string>
-	<string name="us_activities_content">Excursiones, partidos, causas benéficas... No solo se nos ve en fiestas.\n\nCreemos que, como Cuadrilla de Blusas y Neskas, existimos por y para la ciudad, y por eso organizamos actividades durante todo el año, para todo aquel que quiera acompañarnos.</string>
+	<string name="us_activities_content">Excursiones, partidos, causas benéficas No solo se nos ve en fiestas.\n\nCreemos que, como Cuadrilla de Blusas y Neskas, existimos por y para la ciudad, y por eso organizamos actividades durante todo el año, para todo aquel que quiera acompañarnos.</string>
 	<string name="us_transparency">Transparencia</string>
 	<string name="us_transparency_content">¿Te preocupa saber dónde va tu dinero? En Gasteizko Margolariak queremos que estés tranquilo.\n\nMuchas de nuestras actividades son gratuitas. Otras, como las fiestas de La Blanca, tienen una cuota de inscripción. Gasteizko Margolariak no es una empresa, es una Asociación Cultural, y como tal, no tenemos beneficios.\n\nQueremos ser transparentes, y por eso, empezando en 2017, pondremos a tu disposición nuestras cuentas de manera online, para que sepas que cada euro se reinvierte en ti.</string>
 
 	<!--Preferences screen-->
-	<string name="preferences">Preferencias</string>
-	<string name="preferences_sync">Sincronización</string>
 	<string name="preferences_sync_sync">Sincronización en segundo plano</string>
 	<string name="preferences_sync_sync_on">Sincronización activada</string>
 	<string name="preferences_sync_sync_off">Sincronización desactivada</string>
@@ -233,7 +203,6 @@
 	<string name="preferences_sync_notifications_on">Se recibirán notificaciones</string>
 	<string name="preferences_sync_notifications_off">No se recibirán notificaciones</string>
 	<string name="preferences_sync_notifications_disabled">Activa la sincronización en segundo plano para recibir notificaciones</string>
-	<string name="preferences_sync_usage">Uso de datos</string>
 	<string name="preferences_info">Informacion</string>
 	<string name="preferences_info_version">Versión de la aplicación</string>
 	<string name="preferences_info_source_summary">Ojear el código fuente en Github</string>
@@ -241,7 +210,6 @@
 	<string name="preferences_info_feedback_summary">Enviar información anónima al desarrollador</string>
 
 	<!-- Share menu -->
-	<string name="share">Comartir</string>
 	<string name="share_with">Enviar con…</string>
 	<string name="share_home">Gasteizko Margolariak</string>
 	<string name="share_lablanca">La Blanca - Gasteizko Margolariak</string>
@@ -251,8 +219,6 @@
 	<string name="share_with_title">%s - Gasteizko Margolariak</string>
 
 	<string name="eur" translatable="false">€</string>
-	<string name="Kb" translatable="false"> Kb</string>
-	<string name="Mb" translatable="false"> Mb</string>
 	<string name="preferences_info_source">Código fuente</string>
 	<string name="changelog">Changelog</string>
 	<string name="empty" translatable="false"> </string>

+ 0 - 38
app/src/main/res/xml/preferences.xml

@@ -1,38 +0,0 @@
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
-    <PreferenceCategory
-        android:title="@string/preferences_sync">
-
-        <CheckBoxPreference
-            android:key="preference_key_sync"
-            android:title="@string/preferences_sync_sync"
-            android:summary="@string/preferences_sync_sync_on"
-            android:defaultValue="true" />
-        <CheckBoxPreference
-            android:key="preference_key_notification"
-            android:title="@string/preferences_sync_notifications"
-            android:summary="@string/preferences_sync_notifications_on"
-            android:defaultValue="true" />
-
-    </PreferenceCategory>
-
-    <PreferenceCategory
-        android:title="@string/preferences_info">
-
-        <Preference
-            android:key="preference_key_version"
-            android:title="@string/preferences_info_version"
-            android:summary="_" />
-
-        <Preference
-            android:key="preference_key_source"
-            android:title="@string/preferences_info_source"
-            android:summary="@string/preferences_info_source_summary" />
-
-        <Preference
-            android:key="preference_key_feedback"
-            android:title="@string/preferences_info_feedback"
-            android:summary="@string/preferences_info_feedback_summary" />
-
-    </PreferenceCategory>
-
-</PreferenceScreen>

+ 1 - 1
build/intermediates/dex-cache/cache.xml

@@ -34,7 +34,7 @@
         jumboMode="true"
         optimize="true"
         revision="25.0.0"
-        sha1="8c6c81ed286c468f8041ef12410a060168e00e77">
+        sha1="8c3ada7df5c2d03a27b2e5eab3562d125aa10d81">
         <dex dex="/home/seavenois/Workspace/Programming/GM_APP/app/build/intermediates/transforms/dex/debug/folders/1000/10000/instant-run-bootstrap_a321d4fbe81ae9628438e81e6dd58311e68d4265/classes.dex" />
     </item>