Browse Source

Code improvements.
Comments and Javadoc.
Deleted several unused files.

seavenois 10 năm trước cách đây
mục cha
commit
32dc3fc2b5
66 tập tin đã thay đổi với 366 bổ sung911 xóa
  1. 3 1
      app/src/main/java/com/ivalentin/gm/ActivityFutureLayout.java
  2. 2 0
      app/src/main/java/com/ivalentin/gm/ActivityLayout.java
  3. 3 9
      app/src/main/java/com/ivalentin/gm/ActivityPastLayout.java
  4. 5 30
      app/src/main/java/com/ivalentin/gm/AlarmReceiver.java
  5. 3 8
      app/src/main/java/com/ivalentin/gm/AlbumLayout.java
  6. 21 13
      app/src/main/java/com/ivalentin/gm/BlogLayout.java
  7. 4 5
      app/src/main/java/com/ivalentin/gm/BootReceiver.java
  8. 1 6
      app/src/main/java/com/ivalentin/gm/CustomScrollView.java
  9. 3 3
      app/src/main/java/com/ivalentin/gm/Distance.java
  10. 0 2
      app/src/main/java/com/ivalentin/gm/DownloadImage.java
  11. 0 97
      app/src/main/java/com/ivalentin/gm/FakeLinkTextView.java
  12. 2 2
      app/src/main/java/com/ivalentin/gm/FetchURL.java
  13. 16 79
      app/src/main/java/com/ivalentin/gm/GM.java
  14. 1 0
      app/src/main/java/com/ivalentin/gm/GalleryLayout.java
  15. 11 217
      app/src/main/java/com/ivalentin/gm/HomeLayout.java
  16. 2 10
      app/src/main/java/com/ivalentin/gm/HomeSectionLocation.java
  17. 3 2
      app/src/main/java/com/ivalentin/gm/LablancaLayout.java
  18. 2 0
      app/src/main/java/com/ivalentin/gm/LablancaNoFestivalsLayout.java
  19. 6 15
      app/src/main/java/com/ivalentin/gm/MainActivity.java
  20. 6 26
      app/src/main/java/com/ivalentin/gm/MainLayout.java
  21. 1 0
      app/src/main/java/com/ivalentin/gm/PhotoLayout.java
  22. 1 0
      app/src/main/java/com/ivalentin/gm/PostComment.java
  23. 1 0
      app/src/main/java/com/ivalentin/gm/PostLayout.java
  24. 14 21
      app/src/main/java/com/ivalentin/gm/ScheduleLayout.java
  25. 2 2
      app/src/main/java/com/ivalentin/gm/SettingsLayout.java
  26. 15 10
      app/src/main/java/com/ivalentin/gm/Sync.java
  27. 0 14
      app/src/main/res/drawable/dialog_schedule.xml
  28. 0 11
      app/src/main/res/drawable/dialog_schedule_map.xml
  29. 0 11
      app/src/main/res/drawable/home_section_title.xml
  30. 0 11
      app/src/main/res/drawable/location_map.xml
  31. 0 13
      app/src/main/res/drawable/schedule_entry.xml
  32. BIN
      app/src/main/res/drawable/social_phone.png
  33. 1 10
      app/src/main/res/layout/dialog_around.xml
  34. 2 5
      app/src/main/res/layout/dialog_notification.xml
  35. 7 7
      app/src/main/res/layout/dialog_schedule.xml
  36. 1 2
      app/src/main/res/layout/dialog_settings.xml
  37. 4 4
      app/src/main/res/layout/dialog_sync_failed.xml
  38. 1 1
      app/src/main/res/layout/fragment_layout_activities.xml
  39. 12 8
      app/src/main/res/layout/fragment_layout_activity_future.xml
  40. 6 3
      app/src/main/res/layout/fragment_layout_activity_past.xml
  41. 7 6
      app/src/main/res/layout/fragment_layout_around.xml
  42. 1 1
      app/src/main/res/layout/fragment_layout_blog.xml
  43. 1 1
      app/src/main/res/layout/fragment_layout_gallery.xml
  44. 7 1
      app/src/main/res/layout/fragment_layout_home.xml
  45. 2 1
      app/src/main/res/layout/fragment_layout_lablanca.xml
  46. 17 24
      app/src/main/res/layout/fragment_layout_lablanca_nofestivals.xml
  47. 0 1
      app/src/main/res/layout/fragment_layout_location.xml
  48. 6 5
      app/src/main/res/layout/fragment_layout_photo.xml
  49. 11 6
      app/src/main/res/layout/fragment_layout_post.xml
  50. 7 8
      app/src/main/res/layout/row_activity_future.xml
  51. 3 2
      app/src/main/res/layout/row_activity_past.xml
  52. 5 5
      app/src/main/res/layout/row_activity_schedule.xml
  53. 15 10
      app/src/main/res/layout/row_album.xml
  54. 61 67
      app/src/main/res/layout/row_around.xml
  55. 9 5
      app/src/main/res/layout/row_blog.xml
  56. 2 4
      app/src/main/res/layout/row_comment.xml
  57. 6 8
      app/src/main/res/layout/row_festival_price_day.xml
  58. 7 10
      app/src/main/res/layout/row_festival_price_pack.xml
  59. 13 9
      app/src/main/res/layout/row_gallery.xml
  60. 3 7
      app/src/main/res/layout/row_home_activities.xml
  61. 2 1
      app/src/main/res/layout/row_home_around.xml
  62. 2 1
      app/src/main/res/layout/row_home_blog.xml
  63. 11 14
      app/src/main/res/layout/row_home_schedule.xml
  64. 2 1
      app/src/main/res/layout/row_schedule.xml
  65. 3 55
      app/src/main/res/values/color.xml
  66. 1 0
      app/src/main/res/values/strings.xml

+ 3 - 1
app/src/main/java/com/ivalentin/gm/ActivityFutureLayout.java

@@ -32,7 +32,8 @@ import java.util.Locale;
  */
 public class ActivityFutureLayout extends Fragment {
 
-    @SuppressLint("InflateParams") //Throws unknown error when done properly.
+	@SuppressWarnings("ResultOfMethodCallIgnored")
+    @SuppressLint("InflateParams")
     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
 
@@ -98,6 +99,7 @@ public class ActivityFutureLayout extends Fragment {
                 //If not, create directories and download asynchronously
                 File fpath;
                 fpath = new File(this.getActivity().getFilesDir().toString() + "/img/actividades/preview/");
+                //noinspection ResultOfMethodCallIgnored
                 fpath.mkdirs();
                 new DownloadImage(GM.SERVER + "/img/actividades/preview/" + image, this.getActivity().getFilesDir().toString() + "/img/actividades/preview/" + image, images[i]).execute();
             }

+ 2 - 0
app/src/main/java/com/ivalentin/gm/ActivityLayout.java

@@ -30,6 +30,7 @@ import java.util.Locale;
  * @see Fragment
  *
  */
+@SuppressLint("ResultOfMethodCallIgnored")
 public class ActivityLayout extends Fragment{
 
     /**
@@ -62,6 +63,7 @@ public class ActivityLayout extends Fragment{
      * Populates the list of activities.
      * It uses the default layout as parent.
      */
+    @SuppressWarnings("ResultOfMethodCallIgnored")
     @SuppressLint("InflateParams") //Throws unknown error when done properly.
     public void populate(View view){
         LinearLayout llListFuture = (LinearLayout) view.findViewById(R.id.ll_activities_future_list);

+ 3 - 9
app/src/main/java/com/ivalentin/gm/ActivityPastLayout.java

@@ -28,16 +28,11 @@ import java.util.Locale;
  * @see Fragment
  *
  */
-public class ActivityPastLayout extends Fragment {
-
-    //Main View
-    //private View view;
 
-    //String currLang;
-
-    //Context context;
+public class ActivityPastLayout extends Fragment {
 
-    @SuppressLint("InflateParams") //Throws unknown error when done properly.
+	@SuppressWarnings("ResultOfMethodCallIgnored")
+    @SuppressLint("InflateParams")
     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
 
@@ -89,7 +84,6 @@ public class ActivityPastLayout extends Fragment {
 
         //Get images
         Cursor imageCursor = db.rawQuery("SELECT image, idx FROM activity_image WHERE activity = " + id + " ORDER BY idx LIMIT 5;", null);
-        //imageCursor.moveToFirst();
         int i = 0;
         while (imageCursor.moveToNext()) {
             String image = imageCursor.getString(0);

+ 5 - 30
app/src/main/java/com/ivalentin/gm/AlarmReceiver.java

@@ -1,9 +1,7 @@
 package com.ivalentin.gm;
 
-import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 import java.util.Calendar;
-import java.util.Date;
 import java.util.Locale;
 
 import android.app.AlarmManager;
@@ -30,13 +28,7 @@ import android.util.Log;
  *
  */
 public class AlarmReceiver extends BroadcastReceiver {
-	
-    // The app's AlarmManager, which provides access to the system alarm services.
-    private AlarmManager alarmMgr;
-    
-    // The pending intent that is triggered when the alarm fires.
-    private PendingIntent alarmIntent;
-  
+
     /**
      * Actions to be performed when an alarm is received. 
      * Performs a full sync, and gets the pending notifications.
@@ -47,6 +39,7 @@ public class AlarmReceiver extends BroadcastReceiver {
      * @see android.content.BroadcastReceiver#onReceive(android.content.Context, android.content.Intent)
      */
     @Override
+	@SuppressWarnings("deprecation")
     public void onReceive(Context context, Intent intent) {
         
     	Log.d("Alarm", "Received");
@@ -152,7 +145,7 @@ public class AlarmReceiver extends BroadcastReceiver {
 			SharedPreferences.Editor editor = settings.edit();
 	    	editor.putLong(GM.PREF_GM_LATITUDE, Double.doubleToLongBits(Double.parseDouble(lat)));
 			editor.putLong(GM.PREF_GM_LONGITUDE, Double.doubleToLongBits(Double.parseDouble(lon)));
-			editor.putString(GM.PREF_GM_LOCATION, new SimpleDateFormat("yyyyMMddHHmmss").format(Calendar.getInstance().getTime()));
+			editor.putString(GM.PREF_GM_LOCATION, new SimpleDateFormat("yyyyMMddHHmmss", Locale.US).format(Calendar.getInstance().getTime()));
 	    	editor.apply();
 		}
 
@@ -166,9 +159,9 @@ public class AlarmReceiver extends BroadcastReceiver {
      * @param context The context of the app
      */
     public void setAlarm(Context context) {
-        alarmMgr = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
+        AlarmManager alarmMgr = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
         Intent intent = new Intent(context, AlarmReceiver.class);
-        alarmIntent = PendingIntent.getBroadcast(context, 0, intent, 0);
+        PendingIntent alarmIntent = PendingIntent.getBroadcast(context, 0, intent, 0);
         
         //Set the alarm cycle.
         alarmMgr.setInexactRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, GM.PERIOD_SYNC, GM.PERIOD_SYNC, alarmIntent);
@@ -178,22 +171,4 @@ public class AlarmReceiver extends BroadcastReceiver {
         PackageManager pm = context.getPackageManager();
         pm.setComponentEnabledSetting(receiver, PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP);           
     }
-
-    /**
-     * Cancels the alarm.
-     * @param context The application context
-     */
-    public void cancelAlarm(Context context) {
-    	
-        // If the alarm has been set, cancel it.
-        if (alarmMgr!= null) 
-            alarmMgr.cancel(alarmIntent);
-        
-        //Disable SampleBootReceiver so that it doesn't automatically restart the alarm when the device is rebooted.
-        ComponentName receiver = new ComponentName(context, BootReceiver.class);
-        PackageManager pm = context.getPackageManager();
-
-        pm.setComponentEnabledSetting(receiver, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
-    }
-    
 }

+ 3 - 8
app/src/main/java/com/ivalentin/gm/AlbumLayout.java

@@ -35,12 +35,7 @@ import java.util.Locale;
  */
 public class AlbumLayout extends Fragment {
 
-    //Main View
-    //private View view;
-
-    //private String currLang;
-	//private String albumName;
-
+	@SuppressWarnings("ResultOfMethodCallIgnored")
     @SuppressLint("InflateParams") //Throws unknown error when done properly.
     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
@@ -132,7 +127,7 @@ public class AlbumLayout extends Fragment {
 			//Count comments
 			Cursor cursorComments = db.rawQuery("SELECT id FROM photo_comment WHERE photo = " + imageCursor.getString(0) + ";", null);
 			TextView tvCommentsLeft = (TextView) entry.findViewById(R.id.tv_row_album_comments_left);
-			tvCommentsLeft.setText(Integer.toString(cursorComments.getCount()));
+			tvCommentsLeft.setText(String.valueOf(cursorComments.getCount()));
 			cursorComments.close();
 
 			//Set onClickListener
@@ -197,7 +192,7 @@ public class AlbumLayout extends Fragment {
 				//Count comments
 				cursorComments = db.rawQuery("SELECT id FROM photo_comment WHERE photo = " + imageCursor.getString(0) + ";", null);
 				TextView tvCommentsRight = (TextView) entry.findViewById(R.id.tv_row_album_comments_right);
-				tvCommentsRight.setText(Integer.toString(cursorComments.getCount()));
+				tvCommentsRight.setText(String.valueOf(cursorComments.getCount()));
 				cursorComments.close();
 
 				//Set onClickListener

+ 21 - 13
app/src/main/java/com/ivalentin/gm/BlogLayout.java

@@ -12,7 +12,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.widget.Button;
@@ -25,7 +24,12 @@ import java.io.File;
 import java.util.Locale;
 
 /**
- * Created by seavenois on 09/06/16.
+ * Fragment to display the blog entries, paginated.
+ *
+ * @author Iñigo Valentin
+ *
+ * @see Fragment
+ *
  */
 public class BlogLayout extends Fragment{
 
@@ -47,7 +51,7 @@ public class BlogLayout extends Fragment{
      *
      * @see android.support.v4.app.Fragment#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)
      */
-    @SuppressLint("InflateParams") //Throws unknown error when done properly.
+    @SuppressLint("InflateParams")
     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
 
@@ -99,14 +103,14 @@ public class BlogLayout extends Fragment{
 
     /**
      * Called when the fragment is brought back into the foreground.
-     * Resumes the map and the location manager.
+     * Shows or hides the pager buttons.
      *
-     * @see android.support.v4.app.Fragment#onResume()
+     * @see android.app.Fragment#onResume()
      */
     @Override
+    @SuppressLint("InflateParams")
+    @SuppressWarnings("ResultOfMethodCallIgnored")
     public void onResume(){
-        Log.e("offset", "" + offset);
-        Log.e("total", "" + totalPost);
         //Assign pager buttons
         Button btnPrevious = (Button) view.findViewById(R.id.bt_blog_previous);
         Button btnNext = (Button) view.findViewById(R.id.bt_blog_next);
@@ -125,15 +129,13 @@ public class BlogLayout extends Fragment{
         super.onResume();
     }
 
-    public void populate(){
-        populate(0);
-    }
-
     /**
      * Populates the list of activities around.
      * It uses the default layout as parent.
      */
-    public void populate(int offset){
+    @SuppressLint("InflateParams")
+    @SuppressWarnings("ResultOfMethodCallIgnored")
+    private void populate(int offset){
 
         //Assign elements
         LinearLayout llList = (LinearLayout) view.findViewById(R.id.ll_blog_list);
@@ -209,11 +211,13 @@ public class BlogLayout extends Fragment{
                     new DownloadImage(GM.SERVER + "/img/blog/miniature/" + image, this.getActivity().getFilesDir().toString() + "/img/blog/miniature/" + image, iv).execute();
                 }
             }
+            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(" " + cursorComment.getCount());
+            tvDetails.setText(String.valueOf(cursorComment.getCount()));
+            cursorComment.close();
 
             //Set onCLickListener
             entry.setOnClickListener(new View.OnClickListener(){
@@ -240,5 +244,9 @@ public class BlogLayout extends Fragment{
             llList.addView(entry);
         }
 
+        //Close the database
+        cursor.close();
+        db.close();
+
     }
 }

+ 4 - 5
app/src/main/java/com/ivalentin/gm/BootReceiver.java

@@ -13,10 +13,7 @@ import android.content.Intent;
  *
  */
 public class BootReceiver extends BroadcastReceiver {
-	
-	//The AlarmReceiver
-	private AlarmReceiver alarm = new AlarmReceiver();
-	
+
 	/**
 	 * Called when the BroadCasteReceiver is receiving an Intent broadcast. 
 	 * Starts an alarm. 
@@ -29,8 +26,10 @@ public class BootReceiver extends BroadcastReceiver {
 	@Override
 	public void onReceive(Context context, Intent intent) {
 		//If the event is BOOT_COMPLETED...
-		if (intent.getAction().equals("android.intent.action.BOOT_COMPLETED"))
+		if (intent.getAction().equals("android.intent.action.BOOT_COMPLETED")) {
 			//... set the alarm.
+			AlarmReceiver alarm = new AlarmReceiver();
 			alarm.setAlarm(context);
+		}
 	}
 }

+ 1 - 6
app/src/main/java/com/ivalentin/gm/CustomScrollView.java

@@ -64,12 +64,7 @@ public class CustomScrollView extends ScrollView{
     public boolean onTouchEvent(MotionEvent ev) {
 		int width = this.getWidth();
 		super.onTouchEvent(ev);
-		if (ev.getX() <  (float) width / 10){
-						return false;
-		}
-		else{
-			return true;
-		}				
+		return ev.getX() >= (float) width / 10;
 	}
 
 }

+ 3 - 3
app/src/main/java/com/ivalentin/gm/Distance.java

@@ -23,7 +23,7 @@ public final class Distance {
 	 * 
 	 * @return The distance between the points
 	 */
-	public static final double calculateDistance(double lat1, double lon1, double lat2, double lon2, char unit) {
+	public static double calculateDistance(double lat1, double lon1, double lat2, double lon2, char unit) {
 		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);
@@ -45,7 +45,7 @@ public final class Distance {
 	 * 
 	 * @return Radians.
 	 */
-	private static final double deg2rad(double deg) {
+	private static double deg2rad(double deg) {
 		return (deg * Math.PI / 180.0);
 	}
 	
@@ -56,7 +56,7 @@ public final class Distance {
 	 * 
 	 * @return Decimal degrees.
 	 */
-	private static final double rad2deg(double rad) {
+	private static double rad2deg(double rad) {
 		return (rad * 180 / Math.PI);
 	}
 	

+ 0 - 2
app/src/main/java/com/ivalentin/gm/DownloadImage.java

@@ -70,9 +70,7 @@ class DownloadImage extends AsyncTask<Void, Void, Void> {
             OutputStream output = new FileOutputStream(path);
             byte data[] = new byte[1024];
 
-            long total = 0;
             while ((count = input.read(data)) != -1) {
-                total += count;
 
                 // writing data to file
                 output.write(data, 0, count);

+ 0 - 97
app/src/main/java/com/ivalentin/gm/FakeLinkTextView.java

@@ -1,97 +0,0 @@
-//TODO: Delete this file
-
-package com.ivalentin.gm;
-
-import android.content.Context;
-import android.text.Editable;
-import android.text.SpannableString;
-import android.text.TextWatcher;
-import android.text.style.UnderlineSpan;
-import android.util.AttributeSet;
-import android.widget.TextView;
-
-/**
- * Extension of TextView to make some text look like links.
- * 
- * Although the click function s not implemented here, the text is given
- * the appearance of a link: blue and underlined.
- * 
- * @author Iñigo Valentin
- *
- * @see TextView
- */
-public class FakeLinkTextView extends TextView{
-
-	//Indicates if the text is being modified
-	private boolean modifyingText = false;
-
-	/**
-     * Constructor.
-     * 
-     * @param context The context of the app or Activity.
-     */
-	public FakeLinkTextView(Context context){
-		super(context);
-		init();
-	}
-
-	/**
-     * Constructor.
-     * 
-     * @param context The context of the app or Activity.
-     * @param attrs Attributes.
-     */
-	public FakeLinkTextView(Context context, AttributeSet attrs){
-		super(context, attrs);
-		init();
-	}
-
-	/**
-     * Constructor.
-     * 
-     * @param context The context of the app or Activity.
-     * @param attrs Attributes.
-     * @param defStyle Default style.
-     */
-	public FakeLinkTextView(Context context, AttributeSet attrs, int defStyle){
-		super(context, attrs, defStyle);
-		init();
-	}
-
-	/**
-	 * Sets a TextWatcher for the FakeLinkTextView that sets it's color and calls 
-	 * a function to underline it. 
-	 */
-	private void init(){
-		addTextChangedListener(new TextWatcher(){
-			@Override
-			public void beforeTextChanged(CharSequence s, int start, int count, int after){ }
-
-			@Override
-			public void onTextChanged(CharSequence s, int start, int before, int count){ }
-
-			@Override
-			public void afterTextChanged(Editable s){
-				if (modifyingText == false){
-					underlineText();
-					setTextColor(getResources().getColor(R.color.link));
-				}
-			}
-		});
-		underlineText();
-	}
-
-	/**
-	 * Underlines the text.
-	 */
-	private void underlineText(){
-		if (modifyingText == false){
-			modifyingText = true;
-			SpannableString content = new SpannableString(getText());
-			content.setSpan(new UnderlineSpan(), 0, content.length(), 0);
-			setText(content);
-			modifyingText = false;
-		}
-	}
-	
-}

+ 2 - 2
app/src/main/java/com/ivalentin/gm/FetchURL.java

@@ -22,7 +22,7 @@ public class FetchURL {
 	 * Constructor.
 	 */
 	public FetchURL(){
-		output = new ArrayList<String>();
+		output = new ArrayList<>();
 	}
   
 	/**
@@ -49,7 +49,7 @@ public class FetchURL {
 					textUrl = new URL(url);
 					BufferedReader bufferReader = new BufferedReader(new InputStreamReader(textUrl.openStream()));
 					String StringBuffer;
-					List<String> lines = new ArrayList<String>();
+					List<String> lines = new ArrayList<>();
 					while ((StringBuffer = bufferReader.readLine()) != null) {
 						lines.add(StringBuffer);
 					}

+ 16 - 79
app/src/main/java/com/ivalentin/gm/GM.java

@@ -66,11 +66,6 @@ public final class GM {
 	 */
 	static final String EXTRA_ACTION = "action";
 
-	/**
-	 * Value for {@see GM.EXTRA_ACTION} that opens a notification as text.
-	 */
-	static final String EXTRA_ACTION_TEXT = "text";
-
 	/**
 	 * Value for {@see GM.EXTRA_ACTION} that opens the lablanca section.
 	 */
@@ -156,15 +151,10 @@ public final class GM {
 	 */
 	static final byte SECTION_GALLERY = 5;
 
-	/**
-	 * Constant for section "About".
-	 */
-	static final byte SECTION_ABOUT = 6;
-
 	/**
 	 * Constant for section "Settings".
 	 */
-	static final byte SECTION_SETTINGS = 7;
+	static final byte SECTION_SETTINGS = 6;
 
 	/**
 	 * Name of the preference group for the app.
@@ -196,31 +186,6 @@ public final class GM {
 	 */
 	static final int DEFAULT_PREF_NOTIFICATION = 1;
 	
-	/**
-	 * Name of the preference indicating if the user wants to to receive notifications intended for margolari people.
-	 */
-	static final String PREF_NOTIFICATION_GM = "prefNotificationGm";
-	
-	/**
-	 * Default value of the preference indicating if the user wants to to receive notifications intended for margolari people.
-	 */
-	static final int DEFAULT_PREF_NOTIFICATION_GM = 1;
-	
-	/**
-	 * Name of the preference indicating if the user is Margolari.
-	 */
-	static final String PREF_GM = "prefGM";
-	
-	/**
-	 * Default value of the preference indicating if the user is Margolari.
-	 */
-	static final int DEFAULT_PREF_GM = 0;
-
-	/**
-	 * Default value of the preference indicating the user name.
-	 */
-	static final String DEFAULT_PREF_USERNAME = "";
-	
 	/**
 	 * Header of a preference to indicate received notifications.
 	 */
@@ -245,47 +210,7 @@ public final class GM {
 	 * Name of the preference to store GM last location timestamp.
 	 */
 	static final String PREF_GM_LOCATION = "gmlocationtime";
-	
-	/**
-	 * Day constant. Refers to July the 25.
-	 */
-	static final int DAY_25 = 0;
-	
-	/**
-	 * Day constant. Refers to August the 4.
-	 */
-	static final int DAY_4 = 1;
-	
-	/**
-	 * Day constant. Refers to August the 5.
-	 */
-	static final int DAY_5 = 2;
-	
-	/**
-	 * Day constant. Refers to August the 6.
-	 */
-	static final int DAY_6 = 3;
-	
-	/**
-	 * Day constant. Refers to August the 7.
-	 */
-	static final int DAY_7 = 4;
-	
-	/**
-	 * Day constant. Refers to August the 8.
-	 */
-	static final int DAY_8 = 5;
-	
-	/**
-	 * Day constant. Refers to August the 9.
-	 */
-	static final int DAY_9 = 6;
-	
-	/**
-	 * Total number of days of the festivals.
-	 */
-	static final int TOTAL_DAYS = 7;
-	
+
 	/**
 	 * Name of the database
 	 */
@@ -294,9 +219,21 @@ public final class GM {
 	/**
 	 * The desired accuracy of the GPS coordinates, used to provide location updates, in meters.
 	 */
-	static final int LOCATION_ACCURACY = 20;
+	static final int LOCATION_ACCURACY_SPACE = 10;
 
-	public static final String getLang(){
+	/**
+	 * The desired accuracy of the GPS coordinates, used to provide location updates, in milliseconds.
+	 */
+	static final int LOCATION_ACCURACY_TIME = 10000;
+
+	/**
+	 * Gets the language code for sql queries.
+	 * Only three values can be returned: es, eu, en.
+	 * Defaults to es.
+	 *
+	 * @return Language two-letter code
+	 */
+	public static String getLang(){
 		String currLang = Locale.getDefault().getISO3Language();//getDisplayLanguage();
 		switch (currLang){
 			case "spa":

+ 1 - 0
app/src/main/java/com/ivalentin/gm/GalleryLayout.java

@@ -63,6 +63,7 @@ public class GalleryLayout extends Fragment{
      * It uses the default layout as parent.
      */
     @SuppressLint("InflateParams") //Throws unknown error when done properly.
+    @SuppressWarnings("ResultOfMethodCallIgnored")
     private void populate(View view){
 
         //Assign elements

+ 11 - 217
app/src/main/java/com/ivalentin/gm/HomeLayout.java

@@ -6,15 +6,6 @@ import java.text.SimpleDateFormat;
 import java.util.Calendar;
 import java.util.Locale;
 
-import com.google.android.gms.maps.CameraUpdate;
-import com.google.android.gms.maps.CameraUpdateFactory;
-import com.google.android.gms.maps.GoogleMap;
-import com.google.android.gms.maps.MapView;
-import com.google.android.gms.maps.MapsInitializer;
-import com.google.android.gms.maps.OnMapReadyCallback;
-import com.google.android.gms.maps.model.LatLng;
-import com.google.android.gms.maps.model.MarkerOptions;
-
 import android.annotation.SuppressLint;
 import android.content.Context;
 import android.content.Intent;
@@ -33,7 +24,6 @@ import android.os.Bundle;
 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.View.OnClickListener;
@@ -52,17 +42,11 @@ import android.widget.Toast;
  * @see Fragment
  *
  */
-public class HomeLayout extends Fragment implements LocationListener, OnMapReadyCallback{
+public class HomeLayout extends Fragment implements LocationListener{
 
 	//The location manager
 	LocationManager locationManager;
 
-	//Map stuff for the dialog
-	private MapView mapView;
-	private Bundle bund;
-	private GoogleMap map;
-	private LatLng location;
-	private String markerName = "";
 	private View view;
 	
 	/**
@@ -87,7 +71,7 @@ public class HomeLayout extends Fragment implements LocationListener, OnMapReady
 		//Set Location manager
 		//TODO: Only do this if location is required
 		locationManager = (LocationManager) view.getContext().getSystemService(Context.LOCATION_SERVICE);
-		locationManager.requestLocationUpdates(locationManager.getBestProvider(new Criteria(), true), 1000, 0, this);
+		locationManager.requestLocationUpdates(locationManager.getBestProvider(new Criteria(), true), GM.LOCATION_ACCURACY_TIME, GM.LOCATION_ACCURACY_SPACE, this);
 		onLocationChanged(locationManager.getLastKnownLocation(LocationManager.PASSIVE_PROVIDER));
 		//locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 10000, 5, this);
 		
@@ -96,8 +80,6 @@ public class HomeLayout extends Fragment implements LocationListener, OnMapReady
 
 		//TODO: These methods are empty yet
 		setUpLablanca(view);
-		setUpGmschedule(view);
-		setUpCityschedule(view);
 		setUpAround(view);
 
 		//Set up the blog section
@@ -112,8 +94,8 @@ public class HomeLayout extends Fragment implements LocationListener, OnMapReady
 		setUpGallery(view);
 
 		//Asynchronously set up location section
+		//This will trigger onLocationChanged, that will trigger setUpLocation
 		new HomeSectionLocation(view, this.getActivity()).execute();
-		setUpLocation(view);
 
 		//Set up schedule sections
 		setUpSchedule(1, view);
@@ -131,6 +113,7 @@ public class HomeLayout extends Fragment implements LocationListener, OnMapReady
 	 *
 	 * @return The number of entries shown.
 	 */
+	@SuppressLint("InflateParams")
 	private int setUpSchedule(int gm, View view){
 		int count = 0;
 
@@ -290,8 +273,6 @@ public class HomeLayout extends Fragment implements LocationListener, OnMapReady
 
 	/**
 	 * Populates the Social section of the home screen.
-	 *
-	 * @return The number of entries shown.
 	 */
 	private void setUpSocial(View view) {
 		ImageView phone = (ImageView) view.findViewById(R.id.iv_home_section_social_phone);
@@ -377,8 +358,6 @@ public class HomeLayout extends Fragment implements LocationListener, OnMapReady
 				startActivity(i);
 			}
 		});
-
-		return;
 	}
 
 	/**
@@ -391,26 +370,6 @@ public class HomeLayout extends Fragment implements LocationListener, OnMapReady
 		return 0;
 	}
 
-	/**
-	 * Populates the GM Schedule section of the home screen.
-	 *
-	 * @return The number of entries shown.
-	 */
-	private int setUpGmschedule(View view) {
-		//TODO: setUpGMschedule(View view)
-		return 0;
-	}
-
-	/**
-	 * Populates the City Schedule section of the home screen.
-	 *
-	 * @return The number of entries shown.
-	 */
-	private int setUpCityschedule(View view) {
-		//TODO: setUpCitySchedule(View view)
-		return 0;
-	}
-
 	/**
 	 * Populates the La Blanca section of the home screen.
 	 *
@@ -421,16 +380,6 @@ public class HomeLayout extends Fragment implements LocationListener, OnMapReady
 		return false;
 	}
 
-	/**
-	 * Populates the Location section of the home screen.
-	 *
-	 * @return True if the section has been shown, false otherwise.
-	 */
-	private boolean setUpLocation(View view) {
-		//TODO: setUpLocation(View view)
-		return false;
-	}
-
 	/**
 	 * Populates the Location section of the home screen.
 	 *
@@ -448,7 +397,7 @@ public class HomeLayout extends Fragment implements LocationListener, OnMapReady
 				text.setText(String.format(getString(R.string.home_section_location_text_short), distance.intValue(), (int) (0.012 * distance.intValue())));
 			}
 			else{
-				text.setText(String.format(getString(R.string.home_section_location_text_long), String.format("%.02f", distance)));
+				text.setText(String.format(getString(R.string.home_section_location_text_long), String.format(Locale.US, "%.02f", distance)));
 			}
 
 		}
@@ -462,6 +411,7 @@ public class HomeLayout extends Fragment implements LocationListener, OnMapReady
 	 *
 	 * @return The number of entries shown
 	 */
+	@SuppressWarnings("ResultOfMethodCallIgnored")
 	private int setUpGallery(View view) {
 		int counter = 0;
 
@@ -551,6 +501,7 @@ public class HomeLayout extends Fragment implements LocationListener, OnMapReady
 	 * @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();
@@ -688,6 +639,7 @@ public class HomeLayout extends Fragment implements LocationListener, OnMapReady
 	 * @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();
@@ -820,6 +772,7 @@ public class HomeLayout extends Fragment implements LocationListener, OnMapReady
 	 * @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();
@@ -935,123 +888,6 @@ public class HomeLayout extends Fragment implements LocationListener, OnMapReady
 		return counter;
 	}
 
-	/**
-	 * Calculates the total prize in the prices dialog and shows the total.
-	 * 
-	 * @param v A view to be able to get a context.
-	 * 
-	 * @return The total price
-	 */
-	/*private int calculatePrice(Dialog v){
-		
-		//Locate views
-		CheckBox[] cbDayName = new CheckBox[6];
-		cbDayName[0] = (CheckBox) v.findViewById(R.id.cb_dialog_prices_0);
-		cbDayName[1] = (CheckBox) v.findViewById(R.id.cb_dialog_prices_1);
-		cbDayName[2] = (CheckBox) v.findViewById(R.id.cb_dialog_prices_2);
-		cbDayName[3] = (CheckBox) v.findViewById(R.id.cb_dialog_prices_3);
-		cbDayName[4] = (CheckBox) v.findViewById(R.id.cb_dialog_prices_4);
-		cbDayName[5] = (CheckBox) v.findViewById(R.id.cb_dialog_prices_5);
-		TextView tvTotal = (TextView) v.findViewById(R.id.tv_dialog_prices_total);
-		
-		//Open database
-		SQLiteDatabase db = getActivity().openOrCreateDatabase(GM.DB_NAME, Context.MODE_PRIVATE, null);
-		Cursor cursor = db.rawQuery("SELECT price FROM day ORDER BY id;", null);
-		
-		//Loop simultaneously the db entries and the checkboxes
-		ArrayList<Integer> price = new ArrayList<Integer>();
-		int i = 0;
-		int total = 0;
-		int selected = 0;
-		while (cursor.moveToNext() && i < 6){
-			if (cbDayName[i].isChecked()){
-				price.add(cursor.getInt(0));
-				selected ++;
-				total = total + cursor.getInt(0);
-			}
-			i ++;
-		}
-		cursor.close();
-		
-		//Get offers
-		cursor = db.rawQuery("SELECT price, days FROM offer ORDER BY id;", null);
-		boolean offerApplied = false;
-		while (cursor.moveToNext()){
-			
-			//If selected days equal the days in the ofer, fix the price
-			if (cursor.getInt(1) == selected){
-				total = cursor.getInt(0);
-				offerApplied = true;
-			}
-		}
-		
-		//Offer + single days
-		if (offerApplied == false){
-			Collections.sort(price);
-			Cursor closestOffer = db.rawQuery("SELECT price, days FROM offer WHERE days < " + Integer.toString(selected) + " ORDER BY days DESC LIMIT 1;", null);
-			if (closestOffer.getCount() == 1){
-				closestOffer.moveToNext();
-				total = closestOffer.getInt(0);
-				int difference = selected - closestOffer.getInt(1);
-				i = 0;
-				while (i < difference && price.size() > i){
-					total = total + price.get(i);
-					i ++;
-				}
-			}
-			closestOffer.close();
-		}
-		
-		//Set text
-		tvTotal.setText(v.getContext().getResources().getString(R.string.prices_total) + " " + total + v.getContext().getResources().getString(R.string.eur));
-
-
-		cursor.close();
-		db.close();
-		//Return the total price
-		return total;
-	}*/
-
-	/**
-	 * Starts the map in the dialogs.
-	 */
-	public void startMap(){
-		mapView.getMapAsync(this);
-	}
-	
-	
-	/**
-	 * Called when the map is ready to be displayed. 
-	 * Sets the map options and a marker for the map.
-	 * 
-	 * @param googleMap The map to be shown
-	 * 
-	 * @see com.google.android.gms.maps.OnMapReadyCallback#onMapReady(com.google.android.gms.maps.GoogleMap)
-	 */
-	@Override
-	public void onMapReady(GoogleMap googleMap) {
-		this.map = googleMap;
-		map.setMyLocationEnabled(true);
-		
-		map.getUiSettings().setMyLocationButtonEnabled(false);
-		map.setMyLocationEnabled(true);
-		// Needs to call MapsInitializer before doing any CameraUpdateFactory calls
-		try {
-			MapsInitializer.initialize(this.getActivity());
-			CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngZoom(location, 14);
-			map.animateCamera(cameraUpdate);
-		}
-		catch (Exception e) {
-			Log.e("Error initializing maps", e.toString());
-		}
-		//Set GM marker
-		MarkerOptions mo = new MarkerOptions();
-		mo.title(markerName);
-		mo.position(location);
-		map.addMarker(mo);
-		
-	}
-	
 	/**
 	 * Called when the user location changes. 
 	 * Recalculates the list of around events and calls updateLocation() to 
@@ -1106,23 +942,17 @@ public class HomeLayout extends Fragment implements LocationListener, OnMapReady
 	@Override
 	public void onProviderDisabled(String provider) {
 		//populateAround();
-		
 	}
 	
 	/**
 	 * Called when the fragment is paused. 
 	 * Stops the location manager
-	 * @see android.support.v4.app.Fragment#onPause()
+	 * @see android.app.Fragment#onPause()
 	 */
 	@Override
 	public void onPause(){
 		//TODO: Only do this if location is required
 		locationManager.removeUpdates(this);
-		if (map != null)
-			map.setMyLocationEnabled(false);
-		if (mapView != null){
-			mapView.onPause();
-		}
 		super.onPause();
 	}
 	
@@ -1130,48 +960,12 @@ public class HomeLayout extends Fragment implements LocationListener, OnMapReady
 	 * Called when the fragment is brought back into the foreground. 
 	 * Resumes the map and the location manager.
 	 * 
-	 * @see android.support.v4.app.Fragment#onResume()
+	 * @see android.app.Fragment#onResume()
 	 */
 	@Override
 	public void onResume(){
-		if (mapView != null)
-			mapView.onResume();
-		if (map != null)
-			map.setMyLocationEnabled(true);
 		//TODO: Only do this if location is required
 		locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000, 0, this);
 		super.onResume();
 	}
-	
-	/**
-	 * Called when the fragment is destroyed. 
-	 * Finishes the map. 
-	 * 
-	 * @see android.support.v4.app.Fragment#onDestroy()
-	 */
-	@Override
-	public void onDestroy() {
-		super.onDestroy();
-		if (map != null)
-			map.setMyLocationEnabled(false);
-		if (mapView != null){
-			mapView.onResume();
-			mapView.onDestroy();
-		}
-	}
-
-	/**
-	 * Called in a situation of low memory.
-	 * Lets the map handle this situation.
-	 * 
-	 * @see android.support.v4.app.Fragment#onLowMemory()
-	 */
-	@Override
-	public void onLowMemory() {
-		super.onLowMemory();
-		if (mapView != null){
-			mapView.onResume();
-			mapView.onLowMemory();
-		}
-	}
 }

+ 2 - 10
app/src/main/java/com/ivalentin/gm/HomeSectionLocation.java

@@ -3,24 +3,16 @@ package com.ivalentin.gm;
 import android.app.Activity;
 import android.content.Context;
 import android.content.SharedPreferences;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
 import android.os.AsyncTask;
 import android.util.Log;
 import android.view.View;
-import android.widget.ImageView;
 import android.widget.LinearLayout;
 
 import com.google.android.gms.maps.model.LatLng;
 
-import java.io.BufferedInputStream;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.URL;
-import java.net.URLConnection;
 import java.text.SimpleDateFormat;
 import java.util.Calendar;
+import java.util.Locale;
 
 /**
  * Async task to download images on the fly.
@@ -99,7 +91,7 @@ class HomeSectionLocation extends AsyncTask<Void, Void, Void> {
 			SharedPreferences.Editor editor = preferences.edit();
 			editor.putLong(GM.PREF_GM_LATITUDE, Double.doubleToLongBits(coord.latitude));
 			editor.putLong(GM.PREF_GM_LONGITUDE, Double.doubleToLongBits(coord.longitude));
-			editor.putString(GM.PREF_GM_LOCATION, new SimpleDateFormat("yyyyMMddHHmmss").format(Calendar.getInstance().getTime()));
+			editor.putString(GM.PREF_GM_LOCATION, new SimpleDateFormat("yyyyMMddHHmmss", Locale.US).format(Calendar.getInstance().getTime()));
 			editor.apply();
 
 			//Show menu entry

+ 3 - 2
app/src/main/java/com/ivalentin/gm/LablancaLayout.java

@@ -1,8 +1,7 @@
 package com.ivalentin.gm;
 
+import android.annotation.SuppressLint;
 import android.app.Fragment;
-import android.app.FragmentManager;
-import android.app.FragmentTransaction;
 import android.content.Context;
 import android.database.Cursor;
 import android.database.sqlite.SQLiteDatabase;
@@ -46,6 +45,8 @@ public class LablancaLayout extends Fragment {
 	 * @see android.app.Fragment#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)
 	 */
 	@Override
+	@SuppressLint("InflateParams")
+	@SuppressWarnings("ResultOfMethodCallIgnored")
 	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
 
 		//Load the layout

+ 2 - 0
app/src/main/java/com/ivalentin/gm/LablancaNoFestivalsLayout.java

@@ -1,5 +1,6 @@
 package com.ivalentin.gm;
 
+import android.annotation.SuppressLint;
 import android.app.Fragment;
 import android.os.Bundle;
 import android.view.LayoutInflater;
@@ -26,6 +27,7 @@ public class LablancaNoFestivalsLayout extends Fragment {
 	 * @see android.app.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

+ 6 - 15
app/src/main/java/com/ivalentin/gm/MainActivity.java

@@ -4,7 +4,6 @@ import java.io.File;
 import java.math.BigInteger;
 import java.security.SecureRandom;
 
-import android.annotation.SuppressLint;
 import android.app.Activity;
 import android.app.Fragment;
 import android.app.FragmentManager;
@@ -41,15 +40,6 @@ public class MainActivity extends Activity{//} implements LocationListener{
 	//Alarm to get location and notifications.
 	AlarmReceiver alarm;
 
-	/**
-	 * Getter for the activity top view.
-	 *
-	 * @return The activity top view.
-	 */
-	public View getMainView(){
-		return getWindow().getDecorView().getRootView();
-	}
-		
 	/**
 	 * Loads a section in the main screen.
 	 * 
@@ -151,9 +141,9 @@ public class MainActivity extends Activity{//} implements LocationListener{
 	 * 
 	 * @param savedInstanceState Saved state of the activity.
 	 * 
-	 * @see android.support.v7.app.AppCompatActivity#onCreate(android.os.Bundle)
+	 * @see android.app.Activity#onCreate(android.os.Bundle)
 	 */
-	@SuppressLint("TrulyRandom") //I don't care about getting "potentially unsecured numbers" here
+	@SuppressWarnings("deprecation")
 	@Override
 	protected void onCreate(Bundle savedInstanceState) {
 
@@ -182,6 +172,7 @@ public class MainActivity extends Activity{//} implements LocationListener{
 						}
 					});
 				} catch (InterruptedException e) {
+					Log.e("Sleep interrupted", e.toString());
 				}
 			}
 		};
@@ -219,8 +210,6 @@ public class MainActivity extends Activity{//} implements LocationListener{
 		menuLablancaItem[1] = (TextView) findViewById(R.id.menu_lablanca_gm_schedule);
 		menuLablancaItem[2] = (TextView) findViewById(R.id.menu_lablanca_around);
 
-		//Todo: Read settings and display needed menu entries
-
 		//Set click listers for menu items
 		menuItem[0].setOnClickListener(new OnClickListener() {
 			@Override
@@ -342,7 +331,9 @@ public class MainActivity extends Activity{//} implements LocationListener{
 
 					//Set the icon
 					dialogIcon = getResources().getDrawable(R.drawable.ic_launcher);
-					dialogIcon.setBounds(0, 0, (int) (tvDialogTitle.getTextSize() * 1.4), (int) (tvDialogTitle.getTextSize() * 1.4));
+					if (dialogIcon != null) {
+						dialogIcon.setBounds(0, 0, (int) (tvDialogTitle.getTextSize() * 1.4), (int) (tvDialogTitle.getTextSize() * 1.4));
+					}
 					tvDialogTitle.setCompoundDrawables(dialogIcon, null, null, null);
 					tvDialogTitle.setCompoundDrawablePadding(20);
 

+ 6 - 26
app/src/main/java/com/ivalentin/gm/MainLayout.java

@@ -30,20 +30,12 @@ public class MainLayout extends LinearLayout {
 	//The margin of the menu
 	private static int menuRightMargin = 25;
 
-	/**
-	 * Gets the menu's view.
-	 * @return The menu view
-	 */
-	public View getMenuView(){
-		return menu;
-	}
-	
 	/**
 	 * Possible states of the menu
 	 */
 	private enum MenuState {
 		HIDING, HIDDEN, SHOWING, SHOWN,
-	};
+	}
 
 	private int contentXOffset;
 	private MenuState currentMenuState = MenuState.HIDDEN;
@@ -91,7 +83,7 @@ public class MainLayout extends LinearLayout {
 		content.setOnTouchListener(new OnTouchListener() {
 			@Override
 			public boolean onTouch(View v, MotionEvent event) {
-				return MainLayout.this.onContentTouch(v, event);
+				return MainLayout.this.onContentTouch(event);
 			}
 		});
 		menu.setVisibility(View.GONE);
@@ -185,8 +177,6 @@ public class MainLayout extends LinearLayout {
 				currentMenuState = MenuState.HIDDEN;
 				menu.setVisibility(View.GONE);
 				break;
-			default:
-				return;
 		}
 	}
 	
@@ -203,29 +193,19 @@ public class MainLayout extends LinearLayout {
 		}
 	
 	}
-	
-	/**
-	 * Indicates if the menu is currently shown.
-	 * 
-	 * @return true if the menu is shown, false otherwise.
-	 */
-	public boolean isMenuShown() {
-		return currentMenuState == MenuState.SHOWN;
-	}
-	
+
 	/**
 	 * Register touch events. 
 	 * Used to show and hide the menu.
 	 * 
-	 * @param v The touched view.
 	 * @param event The MotionEvent triggering it.
-	 * @return
+	 * @return True if the menu is fully opened or closed and a touch event is happening
 	 */
-	public boolean onContentTouch(View v, MotionEvent event) {
+	public boolean onContentTouch(MotionEvent event) {
 		if (currentMenuState == MenuState.HIDING || currentMenuState == MenuState.SHOWING)
 			return false;
 		int curX = (int) event.getRawX();
-		int diffX = 0;
+		int diffX;
 		
 		switch (event.getAction()) {
 			case MotionEvent.ACTION_DOWN:

+ 1 - 0
app/src/main/java/com/ivalentin/gm/PhotoLayout.java

@@ -151,6 +151,7 @@ public class PhotoLayout extends Fragment {
 	}
 
 	@SuppressLint("InflateParams") //Throws unknown error when done properly.
+	@SuppressWarnings("ResultOfMethodCallIgnored")
 	private void populate(int id, View v){
 
 		final int photoId = id;

+ 1 - 0
app/src/main/java/com/ivalentin/gm/PostComment.java

@@ -65,6 +65,7 @@ class PostComment extends AsyncTask<String, String, Integer> {
      * Downloading file in background thread
      * */
     @Override
+    @SuppressWarnings("deprecation")
     protected Integer doInBackground(String... f_url) {
         URL url;
         String urlParams;

+ 1 - 0
app/src/main/java/com/ivalentin/gm/PostLayout.java

@@ -42,6 +42,7 @@ public class PostLayout extends Fragment {
     Context context;
 
     @SuppressLint("InflateParams") //Throws unknown error when done properly.
+    @SuppressWarnings("ResultOfMethodCallIgnored")
     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
 

+ 14 - 21
app/src/main/java/com/ivalentin/gm/ScheduleLayout.java

@@ -1,5 +1,3 @@
-//TODO: Rework this file
-
 package com.ivalentin.gm;
 
 import java.text.DateFormat;
@@ -26,10 +24,8 @@ import android.content.DialogInterface.OnCancelListener;
 import android.content.DialogInterface.OnShowListener;
 import android.database.Cursor;
 import android.database.sqlite.SQLiteDatabase;
-import android.graphics.drawable.Drawable;
 import android.os.Bundle;
 import android.app.Fragment;
-//import android.content.res.ResourcesCompat;
 import android.text.Editable;
 import android.text.TextWatcher;
 import android.util.Log;
@@ -55,9 +51,6 @@ import android.widget.TextView;
  */
 public class ScheduleLayout extends Fragment implements OnMapReadyCallback{
 
-	
-	//Array with data about the days of the festival
-	//private String[][] days = new String[GM.TOTAL_DAYS][4];
 	Bundle bund;
 
 	private String dates[] = new String[20];
@@ -124,6 +117,8 @@ public class ScheduleLayout extends Fragment implements OnMapReadyCallback{
 			dateCount ++;
 			//TODO: Check if some date is of today, and set selected
 		}
+		cursor.close();
+		db.close();
 
 		//Assign buttons
 		Button btL = (Button) view.findViewById(R.id.bt_schedule_l);
@@ -220,17 +215,13 @@ public class ScheduleLayout extends Fragment implements OnMapReadyCallback{
 		//Views in each row
 		TextView tvRowTitle, tvRowTime, tvRowDesc, tvRowPlace, tvRowId, tvRowAddress;
 
-		//Icon next to the location text
-		Drawable icon = getResources().getDrawable(R.drawable.pinpoint);
-		//icon.setBounds(0, 0, 80, 80);
-
 		//Set date selector texts
 		TextView tvDayNumber = (TextView) view.findViewById(R.id.tv_schedule_day_number);
 		TextView tvDayMonth = (TextView) view.findViewById(R.id.tv_schedule_day_month);
 		TextView tvDayTitle = (TextView) view.findViewById(R.id.tv_schedule_day_title);
 
 
-		tvDayNumber.setText(Integer.toString(calendar.get(Calendar.DAY_OF_MONTH)));
+		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));
@@ -252,7 +243,7 @@ public class ScheduleLayout extends Fragment implements OnMapReadyCallback{
 
 
 		//Get day end date
-		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd", Locale.US);
 		Calendar c = Calendar.getInstance();
 		try {
 			c.setTime(sdf.parse(dates[selected]));
@@ -267,10 +258,8 @@ public class ScheduleLayout extends Fragment implements OnMapReadyCallback{
 
 		if (schedule == GM.SECTION_LABLANCA_GM_SCHEDULE) {
 			query = query + "gm = 1 ";
-			//cursor= db.rawQuery("SELECT festival_event.id, title_" + lang + ", description_" + lang + ", place, start, end, name_" + lang + ", address_" + lang + ", lat, lon FROM festival_event, place WHERE gm = 1 AND place = place.id AND start >= '" + dates[selected] + " 06:00:00' AND start < '" + endDate + " 05:59:59' ORDER BY start;", null);
 		} else {
 			query = query + "gm = 0 ";
-			//cursor= db.rawQuery("SELECT festival_event.id, title_" + lang + ", description_" + lang + ", place, start, end, name_" + lang + ", address_" + lang + ", lat, lon FROM festival_event, place WHERE gm = 0 AND place = place.id AND start >= '" + dates[selected] + " 06:00:00' AND start < '" + endDate + " 05:59:59' ORDER BY start;", null);
 		}
 		if (filter.length() > 0) {
 			query = query + "AND (title_" + lang + " like '%" + filter + "%' OR description_" + lang + " like '%" + filter + "%' OR name_" + lang + " like '%" + filter + "%' OR address_" + lang + " like '%" + filter + "%') ";
@@ -436,10 +425,13 @@ public class ScheduleLayout extends Fragment implements OnMapReadyCallback{
 			
 			//Set time
 			try{
-				if (cursor.getString(5).length() == 0)
+				if (cursor.getString(5).length() == 0) {
 					tvTime.setText(timeFormat.format(dateFormat.parse(cursor.getString(4))));
-				else
-					tvTime.setText(timeFormat.format(dateFormat.parse(cursor.getString(4))) + " - " + timeFormat.format(dateFormat.parse(cursor.getString(5))));
+				}
+				else {
+					String time = timeFormat.format(dateFormat.parse(cursor.getString(4))) + " - " + timeFormat.format(dateFormat.parse(cursor.getString(5)));
+					tvTime.setText(time);
+				}
 			}
 			catch (ParseException ex){
 				Log.e("Error parsing time", ex.toString());
@@ -555,11 +547,12 @@ public class ScheduleLayout extends Fragment implements OnMapReadyCallback{
 	@Override
 	public void onPause() {
 		super.onDestroy();
-		if (map != null)
+		if (map != null) {
 			map.setMyLocationEnabled(false);
-		if (mapView != null){
-			//mapView.onPause();
 		}
+		//if (mapView != null){
+			//mapView.onPause();
+		//}
 	}
 
 	/**

+ 2 - 2
app/src/main/java/com/ivalentin/gm/SettingsLayout.java

@@ -78,7 +78,7 @@ public class SettingsLayout extends Fragment{
 					SharedPreferences preferences = view.getContext().getSharedPreferences(GM.PREF, Context.MODE_PRIVATE);
 					SharedPreferences.Editor editor = preferences.edit();
 					editor.putInt(GM.PREF_NOTIFICATION, 0);
-					editor.commit();
+					editor.apply();
 				}
 				else{
 					cbNotification.setChecked(true);
@@ -86,7 +86,7 @@ public class SettingsLayout extends Fragment{
 					SharedPreferences preferences = view.getContext().getSharedPreferences(GM.PREF, Context.MODE_PRIVATE);
 					SharedPreferences.Editor editor = preferences.edit();
 					editor.putInt(GM.PREF_NOTIFICATION, 1);
-					editor.commit();
+					editor.apply();
 				}
 			}
 			

+ 15 - 10
app/src/main/java/com/ivalentin/gm/Sync.java

@@ -35,7 +35,7 @@ public class Sync extends AsyncTask<Void, Void, Void> {
 	private String strings[];
 	private boolean doProgress = false;
 	private long millis = 0;
-	TextView tv;
+	private TextView tv;
 	
 	
 	/**
@@ -55,7 +55,7 @@ public class Sync extends AsyncTask<Void, Void, Void> {
 			strings[3] = myContextRef.getString(R.string.dialog_sync_text_3);
 			strings[4] = myContextRef.getString(R.string.dialog_sync_text_4);
 			tv = (TextView) dialog.findViewById(R.id.tv_dialog_sync_text);
-			int idx = 0 + (int) (Math.random() * ((4) + 1));
+			int idx = (int) (Math.random() * ((4) + 1));
 			tv.setText(strings[idx]);
 			doProgress = true;
 		}
@@ -103,6 +103,11 @@ public class Sync extends AsyncTask<Void, Void, Void> {
 		Log.d("Sync", "Full sync finished");
 	}
 
+	/**
+	 * Called when the AsyncTask is created.
+	 *
+	 * @param myContextRef The Context of the calling activity.
+	 */
 	public Sync(Activity myContextRef){
 		this.myContextRef = myContextRef;
 	}
@@ -150,13 +155,16 @@ public class Sync extends AsyncTask<Void, Void, Void> {
     }
 
 	@Override
+	/**
+	 * Called when the AsyncTask is updated.
+	 * Used to change text in the sync window.
+	 *
+	 */
 	protected void onProgressUpdate(Void...progress) {
-		//Log.e("UPDATE", "UP");
 		if (doProgress){
 			if (millis + 500 < System.currentTimeMillis()) {
 				millis = System.currentTimeMillis();
-				int idx = 0 + (int) (Math.random() * ((4) + 1));
-				//Log.e("String", strings[idx]);
+				int idx = (int) (Math.random() * ((4) + 1));
 				tv.setText(strings[idx]);
 			}
 		}
@@ -233,12 +241,13 @@ public class Sync extends AsyncTask<Void, Void, Void> {
 				int prefFestivals = Integer.parseInt(o.substring(o.indexOf("<festivals>") + 11, o.indexOf("</festivals>")));
 				prefEditor.putInt(GM.PREF_DB_PHOTOS, prefPhotos);
 				prefEditor.putInt(GM.PREF_DB_FESTIVALS, prefFestivals);
-				//prefEditor.commit();
 				prefEditor.apply();
 
 
 				while (o.contains("<table>")){
 
+					publishProgress();
+
 					try {
 						table = o.substring(o.indexOf("<table>"), o.indexOf("</table>") + 8);
 						tableName = table.substring(table.indexOf("<name>") + 6, table.indexOf("</name>"));
@@ -255,8 +264,6 @@ public class Sync extends AsyncTask<Void, Void, Void> {
 								queryValues = "(";
 								while (row.contains(">,")) {
 
-										publishProgress();
-
 										try {
 											if (row.length() < 5) {
 												break;
@@ -327,14 +334,12 @@ public class Sync extends AsyncTask<Void, Void, Void> {
 			//Set current database version in preferences.
 			if (errorCount == 0){
 				prefEditor.putInt(GM.PREF_DB_VERSION, newVersion);
-				//prefEditor.commit();
 				prefEditor.apply();
 			}
 			else{
 				Log.e("DB UPDATE", "Not updating db version because there were errors");
 				if (preferences.getInt(GM.PREF_DB_VERSION, GM.DEFAULT_PREF_DB_VERSION) == GM.DEFAULT_PREF_DB_VERSION) {
 					prefEditor.putInt(GM.PREF_DB_VERSION, GM.DEFAULT_PREF_DB_VERSION + 1);
-					//prefEditor.commit();
 					prefEditor.apply();
 				}
 			}

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

@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<shape xmlns:android="http://schemas.android.com/apk/res/android"
-	android:shape="rectangle">
-	<gradient
-		android:angle="90"
-		android:centerY="10%"
-		android:centerX="0.1"
-		android:startColor="@color/background_app_gradient"
-		android:endColor="@color/background_app"
-		android:type="linear" />
-	<stroke 
-		android:width="2px"
-		android:color="@color/black" />
-</shape>

+ 0 - 11
app/src/main/res/drawable/dialog_schedule_map.xml

@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<shape xmlns:android="http://schemas.android.com/apk/res/android"
-	android:shape="rectangle">
-	<corners
-		android:radius="5dp"/>
-	<stroke 
-		android:width="5px"
-		android:color="@color/black" />
-	<solid 
-	    android:color="@color/white" />
-</shape>

+ 0 - 11
app/src/main/res/drawable/home_section_title.xml

@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<shape xmlns:android="http://schemas.android.com/apk/res/android"
-  android:shape="rectangle">
-  <gradient
-	android:startColor="@color/home_section_background"
-    android:endColor="#00ffffff"
-    android:angle="270" />
-  <corners
-      android:topLeftRadius="12dp"
-      android:topRightRadius="12dp" />
-</shape>

+ 0 - 11
app/src/main/res/drawable/location_map.xml

@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<shape xmlns:android="http://schemas.android.com/apk/res/android"
-	android:shape="rectangle">
-	<corners
-		android:radius="5dp"/>
-	<stroke 
-		android:width="5px"
-		android:color="@color/black" />
-	<solid 
-	    android:color="@color/white" />
-</shape>

+ 0 - 13
app/src/main/res/drawable/schedule_entry.xml

@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<shape
-    xmlns:android="http://schemas.android.com/apk/res/android"
-	android:shape="rectangle">
-	<solid
-		android:color="@color/around_background"/>
-	<corners
-	    android:radius="2dp" />
-	<stroke
-	    android:width="2px"
-	    android:color="@color/around_border" />
-</shape>

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


+ 1 - 10
app/src/main/res/layout/dialog_around.xml

@@ -1,7 +1,6 @@
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent"
-    android:background="@drawable/dialog_schedule"
     android:orientation="vertical" >
 
     <LinearLayout
@@ -41,15 +40,13 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_margin="5dp"
-            android:textColor="@color/text_dialog"
             android:textSize="25sp"
             android:textStyle="bold" />
         
         <TextView
             android:layout_width="fill_parent"
             android:layout_height="1dp"
-            android:layout_margin="5dp"
-            android:background="@color/black" />
+            android:layout_margin="5dp"/>
 
         <TextView
             android:id="@+id/tv_dialog_around_description"
@@ -57,7 +54,6 @@
             android:layout_height="wrap_content"
             android:layout_margin="10dp"
             android:layout_marginBottom="10dp"
-            android:textColor="@color/text_dialog"
             android:textSize="14sp" />
 
         <LinearLayout
@@ -68,7 +64,6 @@
                 android:id="@+id/tv_dialog_around_date"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:textColor="@color/text_dialog"
                 android:textSize="14sp" />
 
             <TextView
@@ -77,7 +72,6 @@
                 android:layout_height="wrap_content"
                 android:layout_marginLeft="10dp"
                 android:layout_marginStart="10dp"
-                android:textColor="@color/text_dialog"
                 android:textSize="14sp" />
 
         </LinearLayout>
@@ -108,14 +102,12 @@
                     android:id="@+id/tv_dialog_around_place"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:textColor="@color/text_dialog"
                     android:textSize="14sp" />
 
                 <TextView
                     android:id="@+id/tv_dialog_around_address"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:textColor="@color/text_dialog"
                     android:textSize="12sp" />
 
             </LinearLayout>
@@ -125,7 +117,6 @@
             android:layout_width="fill_parent"
             android:layout_height="fill_parent"
             android:layout_margin="20dp"
-            android:background="@drawable/dialog_schedule_map"
             android:padding="3dp" >
 
             <com.google.android.gms.maps.MapView

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

@@ -12,8 +12,7 @@
         android:layout_alignParentTop="true"
         android:ellipsize="end"
         android:maxLines="2"
-        android:textAppearance="@android:style/TextAppearance.Large"
-        android:text="Title"/>
+        android:textAppearance="@android:style/TextAppearance.Large"/>
 
     <LinearLayout
         android:id="@+id/ll_dialog_notification_buttons"
@@ -29,7 +28,6 @@
             android:layout_height="wrap_content"
             android:layout_margin="5dp"
             android:background="@drawable/button_selector"
-            android:text="Action"
             android:textColor="@color/input_text_color"
             android:textStyle="bold"/>
 
@@ -64,8 +62,7 @@
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_margin="7dp"
-                android:textAppearance="@android:style/TextAppearance.Medium"
-                android:text="Text"/>
+                android:textAppearance="@android:style/TextAppearance.Medium"/>
 
         </LinearLayout>
     </ScrollView>

+ 7 - 7
app/src/main/res/layout/dialog_schedule.xml

@@ -1,9 +1,10 @@
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                android:layout_width="fill_parent"
-                android:layout_height="fill_parent"
-                android:background="@drawable/section"
-                android:orientation="vertical"
-                android:padding="7dp">
+<RelativeLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
+    android:background="@drawable/section"
+    android:orientation="vertical"
+    android:padding="7dp">
 
     <LinearLayout
         android:id="@+id/ll_dialog_schedule_buttons"
@@ -132,7 +133,6 @@
                 android:layout_width="fill_parent"
                 android:layout_height="fill_parent"
                 android:layout_margin="20dp"
-                android:background="@drawable/dialog_schedule_map"
                 android:padding="3dp" >
 
                 <com.google.android.gms.maps.MapView

+ 1 - 2
app/src/main/res/layout/dialog_settings.xml

@@ -12,8 +12,7 @@
         android:layout_height="wrap_content"
         android:ellipsize="end"
         android:maxLines="2"
-        android:textAppearance="@android:style/TextAppearance.Large"
-        android:text="Title"/>
+        android:textAppearance="@android:style/TextAppearance.Large"/>
 
     <ScrollView
         android:layout_width="fill_parent"

+ 4 - 4
app/src/main/res/layout/dialog_sync_failed.xml

@@ -1,15 +1,15 @@
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:android1="http://schemas.android.com/apk/res/android"
+<RelativeLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent"
     android:background="@drawable/section"
     android:orientation="vertical"
-    android1:paddingBottom="10dp" >
+    android:paddingBottom="10dp" >
 
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android1:layout_alignParentTop="true"
+        android:layout_alignParentTop="true"
         android:orientation="vertical"
         android:padding="7dp">
 

+ 1 - 1
app/src/main/res/layout/fragment_layout_activities.xml

@@ -64,7 +64,7 @@
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
                 android:layout_margin="7dp"
-                android:id="@+id/ll_activities_past_list"></LinearLayout>
+                android:id="@+id/ll_activities_past_list"/>
         </LinearLayout>
     </LinearLayout>
 </com.ivalentin.gm.CustomScrollView>

+ 12 - 8
app/src/main/res/layout/fragment_layout_activity_future.xml

@@ -33,8 +33,8 @@
                 android:textAppearance="?android:attr/textAppearanceLarge"
                 android:text="Large Text"
                 android:id="@+id/tv_activity_future_date"
-                android:layout_gravity="right"
-                android:gravity="right" />
+                android:layout_gravity="end"
+                android:gravity="end" />
         </LinearLayout>
 
         <LinearLayout
@@ -49,8 +49,10 @@
                 android:layout_height="wrap_content"
                 android:id="@+id/iv_activity_future_0"
                 android:layout_gravity="center_horizontal"
+                android:contentDescription="@string/app_cdesc"
                 android:visibility="gone"
-                android:maxHeight="70dp" />
+                android:maxHeight="70dp"
+                />
 
             <WebView
                 android:layout_width="wrap_content"
@@ -68,6 +70,7 @@
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:id="@+id/iv_activity_future_1"
+                    android:contentDescription="@string/app_cdesc"
                     android:visibility="gone"
                     android:layout_gravity="center_horizontal"
                     android:maxHeight="50dp" />
@@ -76,6 +79,7 @@
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:id="@+id/iv_activity_future_2"
+                    android:contentDescription="@string/app_cdesc"
                     android:visibility="gone"
                     android:maxHeight="50dp" />
 
@@ -83,6 +87,7 @@
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:id="@+id/iv_activity_future_3"
+                    android:contentDescription="@string/app_cdesc"
                     android:visibility="gone"
                     android:maxHeight="50dp" />
 
@@ -90,6 +95,7 @@
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:id="@+id/iv_activity_future_4"
+                    android:contentDescription="@string/app_cdesc"
                     android:visibility="gone"
                     android:maxHeight="50dp" />
             </LinearLayout>
@@ -110,13 +116,12 @@
                         android:textAppearance="?android:attr/textAppearanceMedium"
                         android:text="@string/activity_city"
                         android:layout_margin="5dp"
-                        android:textAlignment="textEnd" />
+                        android:gravity="end"/>
 
                     <TextView
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:textAppearance="?android:attr/textAppearanceMedium"
-                        android:text="Medium Text"
                         android:id="@+id/tv_activity_future_city"
                         android:layout_margin="5dp" />
                 </TableRow>
@@ -131,13 +136,12 @@
                         android:textAppearance="?android:attr/textAppearanceMedium"
                         android:text="@string/activity_price"
                         android:layout_margin="5dp"
-                        android:textAlignment="textEnd" />
+                        android:gravity="end" />
 
                     <TextView
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:textAppearance="?android:attr/textAppearanceMedium"
-                        android:text="Medium Text"
                         android:id="@+id/tv_activity_future_price"
                         android:layout_margin="5dp" />
                 </TableRow>
@@ -160,7 +164,7 @@
                     android:orientation="vertical"
                     android:layout_width="match_parent"
                     android:layout_height="match_parent"
-                    android:id="@+id/ll_activity_future_schedule_list"></LinearLayout>
+                    android:id="@+id/ll_activity_future_schedule_list"/>
             </LinearLayout>
 
         </LinearLayout>

+ 6 - 3
app/src/main/res/layout/fragment_layout_activity_past.xml

@@ -39,7 +39,6 @@
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:textAppearance="?android:attr/textAppearanceMedium"
-                    android:text="Medium Text"
                     android:id="@+id/tv_activity_past_city"
                     android:layout_margin="5dp" />
 
@@ -47,10 +46,9 @@
                     android:layout_width="fill_parent"
                     android:layout_height="wrap_content"
                     android:textAppearance="?android:attr/textAppearanceMedium"
-                    android:text="Medium Text"
                     android:id="@+id/tv_activity_past_date"
                     android:layout_margin="5dp"
-                    android:textAlignment="textEnd" />
+                    android:gravity="end" />
 
             </LinearLayout>
 
@@ -58,6 +56,7 @@
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:id="@+id/iv_activity_past_0"
+                android:contentDescription="@string/app_cdesc"
                 android:layout_gravity="center_horizontal"
                 android:visibility="gone"
                 android:maxHeight="70dp" />
@@ -81,6 +80,7 @@
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:id="@+id/iv_activity_past_1"
+                    android:contentDescription="@string/app_cdesc"
                     android:visibility="gone"
                     android:layout_gravity="center_horizontal"
                     android:maxHeight="50dp" />
@@ -89,6 +89,7 @@
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:id="@+id/iv_activity_past_2"
+                    android:contentDescription="@string/app_cdesc"
                     android:visibility="gone"
                     android:maxHeight="50dp" />
 
@@ -96,6 +97,7 @@
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:id="@+id/iv_activity_past_3"
+                    android:contentDescription="@string/app_cdesc"
                     android:visibility="gone"
                     android:maxHeight="50dp" />
 
@@ -103,6 +105,7 @@
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:id="@+id/iv_activity_past_4"
+                    android:contentDescription="@string/app_cdesc"
                     android:visibility="gone"
                     android:maxHeight="50dp" />
             </LinearLayout>

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

@@ -1,9 +1,10 @@
-<com.ivalentin.gm.CustomScrollView xmlns:android="http://schemas.android.com/apk/res/android"
-								   android:layout_width="fill_parent"
-								   android:layout_height="fill_parent"
-								   android:orientation="vertical"
-								   android:background="@color/background_app"
-								   android:padding="7dp">
+<com.ivalentin.gm.CustomScrollView
+	xmlns:android="http://schemas.android.com/apk/res/android"
+	android:layout_width="fill_parent"
+	android:layout_height="fill_parent"
+	android:orientation="vertical"
+	android:background="@color/background_app"
+	android:padding="7dp">
 
     <LinearLayout
 		android:layout_width="match_parent"

+ 1 - 1
app/src/main/res/layout/fragment_layout_blog.xml

@@ -28,7 +28,7 @@
             android:orientation="vertical"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
-            android:id="@+id/ll_blog_list"></LinearLayout>
+            android:id="@+id/ll_blog_list"/>
 
         <LinearLayout
             android:orientation="horizontal"

+ 1 - 1
app/src/main/res/layout/fragment_layout_gallery.xml

@@ -73,7 +73,7 @@
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
                 android:layout_marginBottom="10dp"
-                android:id="@+id/ll_gallery_album_list"></LinearLayout>
+                android:id="@+id/ll_gallery_album_list"/>
         </LinearLayout>
     </LinearLayout>
 </com.ivalentin.gm.CustomScrollView>

+ 7 - 1
app/src/main/res/layout/fragment_layout_home.xml

@@ -52,7 +52,7 @@
 					<ImageView
 						android:layout_width="wrap_content"
 						android:layout_height="wrap_content"
-						android:id="@+id/imageView12"
+						android:contentDescription="@string/app_cdesc"
 						android:src="@drawable/pinpoint_gm"
 						android:layout_margin="7dp"
 						android:layout_gravity="center_vertical"/>
@@ -352,6 +352,7 @@
 				android:padding="7dp">
 
 				<LinearLayout
+					android:baselineAligned="true"
                     android:orientation="horizontal"
                     android:layout_width="match_parent"
                     android:layout_height="match_parent">
@@ -367,6 +368,7 @@
                             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="7dp"
                             android:padding="1dp"
                             android:background="@color/album_border" />
@@ -383,6 +385,7 @@
                             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="7dp"
                             android:background="@color/album_border"
                             android:padding="1dp" />
@@ -391,6 +394,7 @@
 				</LinearLayout>
 
 				<LinearLayout
+					android:baselineAligned="false"
 					android:orientation="horizontal"
 					android:layout_width="match_parent"
 					android:layout_height="match_parent" >
@@ -406,6 +410,7 @@
 							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="7dp"
 							android:padding="1dp"
 							android:background="@color/album_border" />
@@ -422,6 +427,7 @@
 							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="7dp"
 							android:background="@color/album_border"
 							android:padding="1dp" />

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

@@ -37,12 +37,13 @@
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:id="@+id/iv_lablanca_header"
+                    android:contentDescription="@string/app_cdesc"
                     android:layout_weight=".4"
                     android:layout_margin="3dp"
                     android:background="@color/album_border"
                     android:padding="1dp"/>
 
-                <WebtView
+                <WebView
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:textAppearance="?android:attr/textAppearanceMedium"

+ 17 - 24
app/src/main/res/layout/fragment_layout_lablanca_nofestivals.xml

@@ -11,32 +11,25 @@
         android:orientation="vertical"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:paddingBottom="20dp">
+        android:background="@drawable/section"
+        android:padding="7dp">
 
-        <LinearLayout
-            android:orientation="vertical"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:background="@drawable/section"
-            android:padding="7dp">
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:textAppearance="?android:attr/textAppearanceLarge"
-                android:text="@string/lablanca_title"
-                android:id="@+id/textView10"/>
-
-            <TextView
-                android:layout_width="fill_parent"
-                android:layout_height="wrap_content"
-                android:textAppearance="@android:style/TextAppearance.Medium"
-                android:text="@string/lablanca_nofestivals"
-                android:id="@+id/textView11"
-                android:background="@drawable/entry"
-                android:padding="7dp"/>
-        </LinearLayout>
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:textAppearance="?android:attr/textAppearanceLarge"
+            android:text="@string/lablanca_title"
+            android:id="@+id/textView10"/>
 
+        <TextView
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:textAppearance="@android:style/TextAppearance.Medium"
+            android:text="@string/lablanca_nofestivals"
+            android:id="@+id/textView11"
+            android:background="@drawable/entry"
+            android:padding="7dp"/>
     </LinearLayout>
 
+
 </com.ivalentin.gm.CustomScrollView>

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

@@ -10,7 +10,6 @@
         android:layout_width="fill_parent"
         android:layout_height="fill_parent"
         android:layout_margin="25dp"
-        android:background="@drawable/location_map"
         android:padding="3dp" >
 	    
 		<com.google.android.gms.maps.MapView

+ 6 - 5
app/src/main/res/layout/fragment_layout_photo.xml

@@ -33,6 +33,7 @@
                 android:layout_width="fill_parent"
                 android:layout_height="wrap_content"
                 android:id="@+id/iv_photo"
+                android:contentDescription="@string/app_cdesc"
                 android:padding="2dp"
                 android:background="@color/album_border"/>
 
@@ -49,7 +50,7 @@
                 android:textAppearance="?android:attr/textAppearanceSmall"
                 android:text="Small Text"
                 android:id="@+id/tv_photo_date"
-                android:layout_marginLeft="15dp"
+                android:layout_marginStart="15dp"
                 android:layout_marginBottom="15dp"/>
 
             <LinearLayout
@@ -137,12 +138,12 @@
                     android:id="@+id/et_comment_text"
                     android:minLines="2"
                     android:hint="@string/comment_text"
-                    android:capitalize="sentences"
                     android:background="@drawable/input"
                     android:textColor="@color/input_text_color"
                     android:textColorHint="@color/input_hint_color"
                     android:gravity="top"
-                    android:layout_margin="4dp" />
+                    android:layout_margin="4dp"
+                    android:inputType="textCapSentences|textMultiLine"/>
 
                 <EditText
                     android:layout_width="fill_parent"
@@ -151,12 +152,12 @@
                     android:layout_marginLeft="20dp"
                     android:layout_marginRight="20dp"
                     android:hint="@string/comment_name"
-                    android:capitalize="words"
                     android:background="@drawable/input"
                     android:textColor="@color/input_text_color"
                     android:textColorHint="@color/input_hint_color"
                     android:layout_marginTop="5dp"
-                    android:layout_marginBottom="5dp" />
+                    android:layout_marginBottom="5dp"
+                    android:inputType="textCapWords"/>
 
                 <LinearLayout
                     android:orientation="horizontal"

+ 11 - 6
app/src/main/res/layout/fragment_layout_post.xml

@@ -33,6 +33,7 @@
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:id="@+id/iv_post_0"
+                android:contentDescription="@string/app_cdesc"
                 android:layout_gravity="center_horizontal"
                 android:visibility="gone"
                 android:maxHeight="70dp" />
@@ -53,6 +54,7 @@
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:id="@+id/iv_post_1"
+                    android:contentDescription="@string/app_cdesc"
                     android:visibility="gone"
                     android:layout_gravity="center_horizontal"
                     android:maxHeight="50dp" />
@@ -61,6 +63,7 @@
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:id="@+id/iv_post_2"
+                    android:contentDescription="@string/app_cdesc"
                     android:visibility="gone"
                     android:maxHeight="50dp" />
 
@@ -68,6 +71,7 @@
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:id="@+id/iv_post_3"
+                    android:contentDescription="@string/app_cdesc"
                     android:visibility="gone"
                     android:maxHeight="50dp" />
 
@@ -75,6 +79,7 @@
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:id="@+id/iv_post_4"
+                    android:contentDescription="@string/app_cdesc"
                     android:visibility="gone"
                     android:maxHeight="50dp" />
             </LinearLayout>
@@ -84,14 +89,14 @@
                 android:layout_width="match_parent"
                 android:layout_height="1dp"
                 android:background="@color/background_separator"
-                android:layout_margin="6dp"></LinearLayout>
+                android:layout_margin="6dp"/>
 
             <TextView
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:text="New Text"
                 android:id="@+id/tv_post_date"
-                android:layout_gravity="right" />
+                android:layout_gravity="end" />
         </LinearLayout>
 
         <LinearLayout
@@ -147,12 +152,12 @@
                     android:id="@+id/et_comment_text"
                     android:minLines="2"
                     android:hint="@string/comment_text"
-                    android:capitalize="sentences"
                     android:background="@drawable/input"
                     android:textColor="@color/input_text_color"
                     android:textColorHint="@color/input_hint_color"
                     android:gravity="top"
-                    android:layout_margin="4dp" />
+                    android:layout_margin="4dp"
+                    android:inputType="textCapSentences|textMultiLine"/>
 
                 <EditText
                     android:layout_width="fill_parent"
@@ -161,12 +166,12 @@
                     android:layout_marginLeft="20dp"
                     android:layout_marginRight="20dp"
                     android:hint="@string/comment_name"
-                    android:capitalize="words"
                     android:background="@drawable/input"
                     android:textColor="@color/input_text_color"
                     android:textColorHint="@color/input_hint_color"
                     android:layout_marginTop="5dp"
-                    android:layout_marginBottom="5dp" />
+                    android:layout_marginBottom="5dp"
+                    android:inputType="textCapSentences"/>
 
                 <LinearLayout
                     android:orientation="horizontal"

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

@@ -25,13 +25,14 @@
         android:orientation="horizontal"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:gravity="right"
+        android:gravity="end"
         android:layout_gravity="center_vertical">
 
         <ImageView
             android:layout_width="fill_parent"
             android:layout_height="wrap_content"
             android:id="@+id/iv_row_activity_future"
+            android:contentDescription="@string/app_cdesc"
             android:minHeight="30dp"
             android:minWidth="30dp"
             android:layout_gravity="center_vertical"
@@ -40,10 +41,10 @@
         <TableLayout
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:gravity="right"
+            android:gravity="end"
             android:stretchColumns="1"
-            android:layout_gravity="center_vertical|right"
-            android:layout_marginRight="15dp"
+            android:layout_gravity="center_vertical|end"
+            android:layout_marginEnd="15dp"
             android:layout_weight=".3">
 
             <TableRow
@@ -55,14 +56,13 @@
                     android:layout_height="wrap_content"
                     android:textAppearance="?android:attr/textAppearanceMedium"
                     android:text="@string/activity_city"
-                    android:textAlignment="textEnd"
+                    android:gravity="end"
                     android:padding="4dp" />
 
                 <TextView
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:textAppearance="?android:attr/textAppearanceMedium"
-                    android:text="Medium Text"
                     android:id="@+id/tv_row_activity_future_city"
                     android:padding="4dp" />
             </TableRow>
@@ -76,14 +76,13 @@
                     android:layout_height="wrap_content"
                     android:textAppearance="?android:attr/textAppearanceMedium"
                     android:text="@string/activity_price"
-                    android:textAlignment="textEnd"
+                    android:gravity="end"
                     android:padding="4dp" />
 
                 <TextView
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:textAppearance="?android:attr/textAppearanceMedium"
-                    android:text="Medium Text"
                     android:id="@+id/tv_row_activity_future_price"
                     android:padding="4dp" />
             </TableRow>

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

@@ -23,8 +23,8 @@
             android:textAppearance="?android:attr/textAppearanceSmall"
             android:text="Small Text"
             android:id="@+id/tv_row_activity_past_date"
-            android:gravity="right"
-            android:layout_marginLeft="20dp"
+            android:gravity="end"
+            android:layout_marginStart="20dp"
             android:textStyle="italic" />
     </LinearLayout>
 
@@ -44,6 +44,7 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:id="@+id/iv_row_activity_past"
+            android:contentDescription="@string/app_cdesc"
             android:maxWidth="10dp"
             android:layout_weight=".3"
             android:layout_margin="3dp" />

+ 5 - 5
app/src/main/res/layout/row_activity_schedule.xml

@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
     android:orientation="horizontal" android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:paddingLeft="7dp"
@@ -13,14 +14,12 @@
         android:id="@+id/tv_row_activity_itinerary_time"
         android:layout_weight=".8"
         android:textStyle="bold"
-        android:textAlignment="textEnd" />
+        android:gravity="end" />
 
     <RelativeLayout
         android:id="@+id/relativeLayout"
         android:layout_width="20dp"
         android:layout_height="fill_parent"
-        android:layout_alignParentEnd="true"
-        android:layout_alignParentRight="true"
         android:orientation="vertical"
         android:layout_marginLeft="4dp"
         android:layout_marginRight="4dp">
@@ -67,7 +66,7 @@
             android:orientation="horizontal"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
-            android:layout_marginLeft="10dp"
+            android:layout_marginStart="10dp"
             android:id="@+id/ll_row_activity_itinerary_location"
             android:layout_marginTop="10dp"
             android:layout_marginBottom="10dp">
@@ -76,6 +75,7 @@
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:id="@+id/iv_row_activity_itinerary_pinpoint"
+                android:contentDescription="@string/app_cdesc"
                 android:src="@drawable/pinpoint_map"
                 android:layout_gravity="center_vertical" />
 

+ 15 - 10
app/src/main/res/layout/row_album.xml

@@ -1,6 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="horizontal" android:layout_width="fill_parent"
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:baselineAligned="false"
+    android:orientation="horizontal"
+    android:layout_width="fill_parent"
     android:layout_height="match_parent">
 
     <LinearLayout
@@ -25,6 +28,7 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:id="@+id/iv_row_album_left"
+            android:contentDescription="@string/app_cdesc"
             android:layout_gravity="center_horizontal"
             android:padding="2dp"
             android:background="@color/album_border" />
@@ -33,22 +37,20 @@
             android:layout_width="fill_parent"
             android:layout_height="wrap_content"
             android:textAppearance="?android:attr/textAppearanceMedium"
-            android:text="Medium Text"
             android:id="@+id/tv_row_album_title_left"
-            android:textAlignment="center" />
+            android:gravity="center_horizontal" />
 
         <LinearLayout
             android:orientation="horizontal"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
-            android:gravity="right"
+            android:gravity="end"
             android:layout_marginTop="5dp">
 
             <TextView
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:textAppearance="?android:attr/textAppearanceSmall"
-                android:text="Small Text"
                 android:id="@+id/tv_row_album_comments_left"
                 android:layout_gravity="center_vertical" />
 
@@ -56,7 +58,8 @@
                 android:layout_width="15dp"
                 android:layout_height="15dp"
                 android:src="@drawable/comment"
-                android:layout_marginLeft="5dp"
+                android:contentDescription="@string/app_cdesc"
+                android:layout_marginStart="5dp"
                 android:layout_gravity="center_vertical" />
         </LinearLayout>
 
@@ -86,6 +89,7 @@
             android:layout_height="wrap_content"
             android:id="@+id/iv_row_album_right"
             android:layout_gravity="center_horizontal"
+            android:contentDescription="@string/app_cdesc"
             android:padding="2dp"
             android:background="@color/album_border" />
 
@@ -95,13 +99,13 @@
             android:textAppearance="?android:attr/textAppearanceMedium"
             android:text="Medium Text"
             android:id="@+id/tv_row_album_title_right"
-            android:textAlignment="center" />
+            android:gravity="center_horizontal" />
 
         <LinearLayout
             android:orientation="horizontal"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
-            android:gravity="right"
+            android:gravity="end"
             android:layout_marginTop="5dp">
 
             <TextView
@@ -116,7 +120,8 @@
                 android:layout_width="15dp"
                 android:layout_height="15dp"
                 android:src="@drawable/comment"
-                android:layout_marginLeft="5dp"
+                android:contentDescription="@string/app_cdesc"
+                android:layout_marginStart="5dp"
                 android:layout_gravity="center_vertical" />
         </LinearLayout>
     </LinearLayout>

+ 61 - 67
app/src/main/res/layout/row_around.xml

@@ -1,70 +1,64 @@
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-	    android:layout_width="fill_parent"
-	    android:layout_height="wrap_content"
-	    android:padding="5dp" >
-	    
+<LinearLayout
+	xmlns:android="http://schemas.android.com/apk/res/android"
+	android:layout_width="fill_parent"
+	android:layout_height="wrap_content"
+	android:padding="5dp" >
+
+	<ImageView
+		android:id="@+id/imageView1"
+		android:layout_width="wrap_content"
+		android:layout_height="fill_parent"
+		android:adjustViewBounds="true"
+		android:contentDescription="@string/accesibility_event"
+		android:maxHeight="50dp"
+		android:maxWidth="50dp"
+		android:scaleType="centerInside"
+		android:src="@drawable/pinpoint" />
+
 	<LinearLayout
-	    android:layout_width="fill_parent"
-	    android:layout_height="wrap_content"
-	    android:background="@drawable/schedule_entry"
-	    android:padding="5dp" >
-	
-	    <ImageView
-	        android:id="@+id/imageView1"
-	        android:layout_width="wrap_content"
-	        android:layout_height="fill_parent"
-	        android:adjustViewBounds="true"
-	        android:contentDescription="@string/accesibility_event"
-	        android:maxHeight="50dp"
-	        android:maxWidth="50dp"
-	        android:scaleType="centerInside"
-	        android:src="@drawable/pinpoint" />
-	
-	    <LinearLayout
-	        android:id="@+id/ll_row_around_content"
-	        android:layout_width="wrap_content"
-	        android:layout_height="wrap_content"
-	        android:orientation="vertical" >
+		android:id="@+id/ll_row_around_content"
+		android:layout_width="wrap_content"
+		android:layout_height="wrap_content"
+		android:orientation="vertical" >
+
+		<TextView
+			android:id="@+id/tv_row_around_id"
+			android:layout_width="wrap_content"
+			android:layout_height="wrap_content"
+			android:visibility="gone" />
+
+		<TextView
+			android:id="@+id/tv_row_around_title"
+			android:layout_width="wrap_content"
+			android:layout_height="wrap_content"
+			android:textAppearance="?android:attr/textAppearanceLarge" />
+
+		<TextView
+			android:id="@+id/tv_row_around_description"
+			android:layout_width="wrap_content"
+			android:layout_height="wrap_content"
+			android:layout_marginTop="5dp"
+			android:ellipsize="end"
+			android:maxLines="2" />
+
+		<TextView
+			android:id="@+id/tv_row_around_time"
+			android:layout_width="wrap_content"
+			android:layout_height="wrap_content"
+			android:layout_marginTop="5dp" />
+
+		<TextView
+			android:id="@+id/tv_row_around_address"
+			android:layout_width="wrap_content"
+			android:layout_height="wrap_content"
+			android:layout_marginTop="5dp" />
+
+		<TextView
+			android:id="@+id/tv_row_around_distance"
+			android:layout_width="wrap_content"
+			android:layout_height="wrap_content"
+			android:layout_marginTop="5dp" />
 
-	        <TextView
-	            android:id="@+id/tv_row_around_id"
-	            android:layout_width="wrap_content"
-	            android:layout_height="wrap_content"
-	            android:visibility="gone" />
-	
-	        <TextView
-	            android:id="@+id/tv_row_around_title"
-	            android:layout_width="wrap_content"
-	            android:layout_height="wrap_content"
-	            android:textAppearance="?android:attr/textAppearanceLarge" />
-	
-	        <TextView
-	            android:id="@+id/tv_row_around_description"
-	            android:layout_width="wrap_content"
-	            android:layout_height="wrap_content"
-	            android:layout_marginTop="5dp"
-	            android:ellipsize="end"
-	            android:maxLines="2" />
-	
-	        <TextView
-	            android:id="@+id/tv_row_around_time"
-	            android:layout_width="wrap_content"
-	            android:layout_height="wrap_content"
-	            android:layout_marginTop="5dp" />
-	
-	        <TextView
-	            android:id="@+id/tv_row_around_address"
-	            android:layout_width="wrap_content"
-	            android:layout_height="wrap_content"
-	            android:layout_marginTop="5dp" />
-	
-	        <TextView
-	            android:id="@+id/tv_row_around_distance"
-	            android:layout_width="wrap_content"
-	            android:layout_height="wrap_content"
-	            android:layout_marginTop="5dp" />
-	
-	    </LinearLayout>
-	
 	</LinearLayout>
-</LinearLayout>
+
+</LinearLayout>

+ 9 - 5
app/src/main/res/layout/row_blog.xml

@@ -1,6 +1,8 @@
 <?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"
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:background="@drawable/entry"
     android:padding="4dp">
@@ -29,6 +31,7 @@
             android:layout_height="wrap_content"
             android:id="@+id/iv_row_blog_image"
             android:maxWidth="10dp"
+            android:contentDescription="@string/app_cdesc"
             android:layout_weight=".3"
             android:layout_margin="3dp" />
 
@@ -47,7 +50,7 @@
         android:layout_width="match_parent"
         android:layout_height="2dp"
         android:background="@color/background_separator"
-        android:layout_margin="10dp"></LinearLayout>
+        android:layout_margin="10dp"/>
 
     <LinearLayout
         android:orientation="horizontal"
@@ -72,13 +75,14 @@
             android:text="Small Text"
             android:id="@+id/tv_row_blog_details"
             android:layout_weight=".5"
-            android:textAlignment="textEnd" />
+            android:gravity="end" />
 
         <ImageView
             android:layout_width="10dp"
             android:layout_height="10dp"
             android:id="@+id/imageView"
             android:src="@drawable/comment"
-            android:layout_marginLeft="5dp" />
+            android:contentDescription="@string/app_cdesc"
+            android:layout_marginStart="5dp" />
     </LinearLayout>
 </LinearLayout>

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

@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
     android:orientation="vertical" android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:padding="7dp">
@@ -20,14 +21,12 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:textAppearance="@android:style/TextAppearance.Medium"
-            android:text="Medium Text"
             android:id="@+id/tv_row_comment_user"
             android:layout_gravity="bottom" />
 
         <TextView
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:text="New Text"
             android:id="@+id/tv_row_comment_date"
             android:layout_marginLeft="15dp"
             android:layout_gravity="bottom"
@@ -38,7 +37,6 @@
     <TextView
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:text="New Text"
         android:id="@+id/tv_row_comment_text"
         android:textAppearance="@android:style/TextAppearance.Medium"
         android:layout_marginLeft="10dp"

+ 6 - 8
app/src/main/res/layout/row_festival_price_day.xml

@@ -1,8 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-              android:orientation="vertical"
-              android:layout_width="fill_parent"
-              android:layout_height="wrap_content">
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_width="fill_parent"
+    android:layout_height="wrap_content">
 
     <LinearLayout
         android:orientation="horizontal"
@@ -20,14 +21,12 @@
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:textAppearance="@android:style/TextAppearance.Small"
-                android:text="Small Text"
                 android:id="@+id/tv_row_festival_price_day_date"/>
 
             <TextView
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:textAppearance="@android:style/TextAppearance.Medium"
-                android:text="Medium Text"
                 android:id="@+id/tv_row_festival_price_day_name"/>
 
         </LinearLayout>
@@ -36,9 +35,8 @@
             android:layout_width="fill_parent"
             android:layout_height="wrap_content"
             android:textAppearance="@android:style/TextAppearance.Medium"
-            android:text="Medium Text"
             android:id="@+id/tv_row_festival_price_day_price"
-            android:textAlignment="textEnd"
+            android:gravity="end"
             android:layout_gravity="bottom"/>
     </LinearLayout>
 

+ 7 - 10
app/src/main/res/layout/row_festival_price_pack.xml

@@ -1,8 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-              android:orientation="vertical"
-              android:layout_width="fill_parent"
-              android:layout_height="wrap_content">
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_width="fill_parent"
+    android:layout_height="wrap_content">
 
     <LinearLayout
         android:orientation="horizontal"
@@ -21,16 +22,14 @@
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:textAppearance="@android:style/TextAppearance.Medium"
-                android:text="Medium Text"
                 android:id="@+id/tv_row_festival_price_pack_name"/>
 
             <TextView
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:textAppearance="@android:style/TextAppearance.Small"
-                android:text="Small Text"
                 android:id="@+id/tv_row_festival_price_pack_text"
-                android:layout_marginLeft="10dp"/>
+                android:layout_marginStart="10dp"/>
 
         </LinearLayout>
 
@@ -38,11 +37,9 @@
             android:layout_width="fill_parent"
             android:layout_height="wrap_content"
             android:textAppearance="@android:style/TextAppearance.Medium"
-            android:text="Medium Text"
             android:id="@+id/tv_row_festival_price_pack_price"
-            android:textAlignment="textEnd"
+            android:gravity="end"
             android:layout_gravity="bottom"
-            android:gravity="right"
             android:minWidth="70dp"
             android:layout_weight=".7"/>
     </LinearLayout>

+ 13 - 9
app/src/main/res/layout/row_gallery.xml

@@ -14,6 +14,7 @@
         android:layout_margin="15dp">
 
         <ImageView
+            android:contentDescription="@string/app_cdesc"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:id="@+id/iv_row_gallery_0"
@@ -22,7 +23,7 @@
             android:layout_alignParentLeft="false"
             android:layout_alignParentRight="false"
             android:layout_alignParentBottom="false"
-            android:layout_marginRight="90dp"
+            android:layout_marginEnd="90dp"
             android:layout_marginBottom="90dp"
             android:padding="3dp"
             android:layout_alignParentEnd="false"
@@ -30,49 +31,52 @@
             android:maxHeight="120dp" />
 
         <ImageView
+            android:contentDescription="@string/app_cdesc"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:id="@+id/iv_row_gallery_1"
             android:background="@color/album_border"
             android:layout_alignParentTop="false"
             android:layout_alignParentLeft="false"
-            android:layout_alignParentRight="false"
+            android:layout_alignParentEnd="false"
             android:layout_alignParentBottom="false"
-            android:layout_marginRight="60dp"
+            android:layout_marginEnd="60dp"
             android:layout_marginBottom="60dp"
-            android:layout_marginLeft="30dp"
+            android:layout_marginStart="30dp"
             android:layout_marginTop="30dp"
             android:padding="3dp"
             android:layout_alignParentStart="false"
             android:maxHeight="120dp" />
 
         <ImageView
+            android:contentDescription="@string/app_cdesc"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:id="@+id/iv_row_gallery_2"
             android:background="@color/album_border"
             android:layout_alignParentTop="false"
             android:layout_alignParentLeft="false"
-            android:layout_alignParentRight="false"
+            android:layout_alignParentEnd="false"
             android:layout_alignParentBottom="false"
-            android:layout_marginLeft="60dp"
+            android:layout_marginStart="60dp"
             android:layout_marginTop="60dp"
             android:padding="3dp"
             android:layout_alignParentStart="false"
             android:maxHeight="120dp"
-            android:layout_marginRight="30dp"
+            android:layout_marginEnd="30dp"
             android:layout_marginBottom="30dp" />
 
         <ImageView
+            android:contentDescription="@string/app_cdesc"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:id="@+id/iv_row_gallery_3"
             android:background="@color/album_border"
             android:layout_alignParentTop="false"
             android:layout_alignParentLeft="false"
-            android:layout_alignParentRight="false"
+            android:layout_alignParentEnd="false"
             android:layout_alignParentBottom="false"
-            android:layout_marginLeft="90dp"
+            android:layout_marginStart="90dp"
             android:layout_marginTop="90dp"
             android:padding="3dp"
             android:layout_alignParentStart="false"

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

@@ -9,16 +9,14 @@
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:textAppearance="?android:attr/textAppearanceLarge"
-        android:text="Large Text"
         android:id="@+id/tv_row_home_activity_title" />
 
     <TextView
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:textAppearance="?android:attr/textAppearanceSmall"
-        android:text="Small Text"
         android:id="@+id/tv_row_home_activity_date"
-        android:gravity="right"
+        android:gravity="end"
         android:textStyle="italic" />
 
     <TextView
@@ -34,6 +32,7 @@
         android:layout_height="match_parent">
 
         <ImageView
+            android:contentDescription="@string/app_cdesc"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:id="@+id/iv_row_home_activity"
@@ -44,7 +43,6 @@
         <TextView
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:text="New Text"
             android:id="@+id/tv_row_home_activity_text"
             android:layout_weight=".7"
             android:textAppearance="@android:style/TextAppearance.Medium"
@@ -60,16 +58,14 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:textAppearance="?android:attr/textAppearanceSmall"
-            android:text="Small Text"
             android:id="@+id/tv_row_home_activity_city" />
 
         <TextView
             android:layout_width="fill_parent"
             android:layout_height="wrap_content"
             android:textAppearance="?android:attr/textAppearanceSmall"
-            android:text="Small Text"
             android:id="@+id/tv_row_home_activity_price"
-            android:textAlignment="textEnd" />
+            android:gravity="right" />
     </LinearLayout>
 
 </LinearLayout>

+ 2 - 1
app/src/main/res/layout/row_home_around.xml

@@ -1,4 +1,5 @@
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:orientation="vertical"

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

@@ -14,7 +14,7 @@
 
     <TextView
         android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
+        android:layout_height="0dp"
         android:textAppearance="?android:attr/textAppearanceSmall"
         android:text="Small Text"
         android:id="@+id/tv_row_home_blog_date"
@@ -33,6 +33,7 @@
         android:layout_height="match_parent">
 
         <ImageView
+            android:contentDescription="@string/app_cdesc"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:id="@+id/iv_row_home_blog_image"

+ 11 - 14
app/src/main/res/layout/row_home_schedule.xml

@@ -1,17 +1,17 @@
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-              android:layout_width="fill_parent"
-              android:layout_height="wrap_content"
-              android:orientation="vertical"
-              android:paddingLeft="15dp"
-              android:paddingTop="5dp"
-    >
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="fill_parent"
+    android:layout_height="wrap_content"
+    android:orientation="vertical"
+    android:paddingStart="15dp"
+    android:paddingEnd="15dp"
+    android:paddingTop="5dp">
 
     <TextView
         android:id="@+id/tv_row_home_schedule_id"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:visibility="gone"
-        android:text="ID"/>
+        android:visibility="gone"/>
 
     <LinearLayout
         android:orientation="horizontal"
@@ -22,15 +22,13 @@
             android:id="@+id/tv_row_home_schedule_title"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:text="Title"
             android:textAppearance="@android:style/TextAppearance.Large"/>
 
         <TextView
             android:id="@+id/tv_row_home_schedule_time"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:text="Tme"
-            android:layout_marginLeft="20dp"
+            android:layout_marginStart="20dp"
             android:textAppearance="@android:style/TextAppearance.Medium"/>
     </LinearLayout>
 
@@ -49,7 +47,7 @@
             android:layout_height="30dp"
             android:layout_gravity="center_vertical"
             android:adjustViewBounds="true"
-            android:contentDescription="@string/arrow_right"
+            android:contentDescription="@string/app_cdesc"
             android:maxHeight="30dp"
             android:maxWidth="30dp"
             android:src="@drawable/pinpoint" />
@@ -59,7 +57,6 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_marginBottom="3dp"
-            android:text="Place"
             android:textAppearance="@android:style/TextAppearance.Small"/>
 
     </LinearLayout>

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

@@ -80,11 +80,12 @@
             android:layout_height="wrap_content">
 
             <ImageView
+                android:contentDescription="@string/app_cdesc"
                 android:layout_width="40dp"
                 android:layout_height="40dp"
                 android:id="@+id/iv_row_schedule_pinpoint"
                 android:src="@drawable/pinpoint"
-                android:layout_marginLeft="10dp"/>
+                android:layout_marginStart="10dp"/>
 
             <LinearLayout
                 android:orientation="vertical"

+ 3 - 55
app/src/main/res/values/color.xml

@@ -1,78 +1,26 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
-    
-    
-    <!-- Color for text that looks like a link -->
-    
-    <color name="link">#0000ff</color>
-    
-    
-    <!-- Basic colors -->
-    
-    <color name="black">#000000</color>
-    <color name="white">#ffffff</color>
-    
-    
-    <!-- Text colors -->
-    
-	<color name="text_dialog">#333333</color>
-    
-	
+
     <!-- Backgrounds for several sections -->
     
     <color name="background_app">#c6e4f6</color>
-    <color name="background_app_gradient">#ffffff</color>
     <color name="background_menu">#4c9ed8</color>
-    <color name="background_menu_gradient">#99ff77</color>
     <color name="background_notification">#000000</color>
     <color name="background_separator">#000000</color>
 
 
     <color name="section_background">#9bc1da</color>
     <color name="section_border">#9cd3d9</color>
-
     <color name="entry_background">#ffffff</color>
     <color name="entry_border">#9cd3d9</color>
     
     <!--Color for the menu entries-->
     <color name="menu_entry">#ffffff</color>
 
-    <!-- Color for the "About Section" -->
-    
-    <color name="about_code_background">#999999</color>
-    
-    
-    <!-- Colors for the "Home" section -->
-    
-    <color name="home_section_background">#66bb66</color>
-    
-    
-    <!-- Color for the entres in the Around me section -->
-    <color name="around_background">#11000000</color>
-    <color name="around_border">#55337733</color>
-    
-    <!-- Colors for settings section -->
-    
-    <color name="settings_header">#aaaaaa</color>
-    <color name="settings_header_background">#444444</color>
-    <color name="settings_disabled">#55000000</color>
-    
-    
-    <!-- Colors for gradients -->
-    
+    <!-- Colors for top bar -->
+
     <color name="background_bar">#9bc1da</color>
     <color name="background_bar_gradient">#bdf8fd</color>
-    <color name="background_date">#cccccc</color>
-    <color name="background_date_gradient">#888888</color>
-    
-    
-    <!-- Color for the arrow buttons -->
-    
-    <color name="arrow_button_start">#aaaaee</color>
-    <color name="arrow_button_center">#eeeeff</color>
-    <color name="arrow_button_start_pressed">#7777bb</color>
-    <color name="arrow_button_center_pressed">#bbbbcc</color>
-    <color name="arrow_button_border">#222290</color>
 
     <!--Color for input fields-->
     <color name="input_background">#223344</color>

+ 1 - 0
app/src/main/res/values/strings.xml

@@ -12,6 +12,7 @@
 	<string name="app_name" translatable="false">Gasteizko Margolariak</string>
 	<string name="app_name_software" translatable="false">Gasteizko Margolariak App</string>
 	<string name="app_email">gasteizkomargolariak@gmail.com</string>
+	<string name="app_cdesc"> </string>
 
 
 	<!-- Common strings -->