Ver código fonte

Applied OutOfMemoryError fixes to newui branch

seavenois 10 anos atrás
pai
commit
f3e8590dff

+ 10 - 2
app/src/main/AndroidManifest.xml

@@ -50,10 +50,18 @@
             
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
-				
-                <category android:name="android.intent.category.LAUNCHER" />
+				<category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
         </activity>
+
+        <activity
+            android:name=".SettingsActivity"
+            android:theme="@style/Theme.NoTitle"
+            android:windowSoftInputMode="stateHidden|adjustResize"
+            android:configChanges="orientation"
+            android:screenOrientation="portrait"
+            android:label="@string/app_name">
+        </activity>
         
         <receiver
             android:process=":remote"

+ 9 - 0
app/src/main/java/com/ivalentin/margolariak/AboutActivity.java

@@ -0,0 +1,9 @@
+package com.ivalentin.margolariak;
+
+import android.app.Activity;
+
+/**
+ * Created by seavenois on 26/09/16.
+ */
+public class AboutActivity extends Activity{
+}

+ 54 - 22
app/src/main/java/com/ivalentin/margolariak/GM.java

@@ -27,16 +27,6 @@ final class GM {
 	 * Code for the location permission request
 	 */
 	static final int PERMISSION_LOCATION = 1;
-
-	/**
-	 * Duration of the menu sliding animation.
-	 */
-	static final int MENU_SLIDING_DURATION = 500;
-	
-	/**
-	 * Interval between menu sliding queries. 
-	 */
-	static final int MENU_QUERY_INTERVAL = 16;
 	
 	/**
 	 * Period of time (in seconds) at the end of witch the app will perform a sync.
@@ -143,11 +133,6 @@ final class GM {
 	 */
 	static final byte SECTION_GALLERY = 5;
 
-	/**
-	 * Constant for section "Settings".
-	 */
-	static final byte SECTION_SETTINGS = 6;
-
 	/**
 	 * Name of the preference group for the app.
 	 */
@@ -167,22 +152,17 @@ final class GM {
 	 * Name of the preference that indicates if we are on festivals.
 	 */
 	static final String PREF_DB_FESTIVALS = "prefDbFestivals";
-	
+
 	/**
 	 * Name of the preference indicating if the user wants to to receive notifications intended for the general public.
 	 */
 	static final String PREF_NOTIFICATION = "prefNotification";
 
-	/**
-	 * Name of the preference indicating if the tutorial has been seen.
-	 */
-	static final String PREF_TUTORIAL = "prefTutorial";
-	
 	/**
 	 * Default value of the preference indicating if the user wants to to receive notifications intended for the general public.
 	 */
 	static final int DEFAULT_PREF_NOTIFICATION = 1;
-	
+
 	/**
 	 * Header of a preference to indicate received notifications.
 	 */
@@ -213,6 +193,58 @@ final class GM {
 	 */
 	static final String DEFAULT_PREF_GM_LOCATION = "19700101000000";
 
+	/**
+	 * Name of the preference indicating if the user wants to perform background syncs.
+	 */
+	static final String PREFERENCE_SYNC_SYNC = "pref_sync_sync";
+
+	/**
+	 * Default value for PREFERENCE_SYNC_SYNC.
+	 */
+	static final boolean DEFAULT_PREFERENCE_SYNC_SYNC = true;
+
+	/**
+	 * Name of the preference indicating if the user wants to to receive notifications intended for the general public.
+	 */
+	static final String PREFERENCE_SYNC_NOTIFICATIONS = "pref_sync_notifications";
+
+	/**
+	 * Default value for PREFERENCE_SYNC_NOTIFICATIONS.
+	 */
+	static final boolean DEFAULT_PREFERENCE_SYNC_NOTIFICATIONS = true;
+
+	/**
+	 * Name of the SharedPreference that stores how many kb have been sent in the foreground.
+	 */
+	static final String STORAGE_TRAFFIC_FG_SENT = "storage_traffic_fg_sent";
+
+	/**
+	 * Name of the SharedPreference that stores how many kb have been received in the foreground.
+	 */
+	static final String STORAGE_TRAFFIC_FG_RECEIVED = "storage_traffic_fg_received";
+
+	/**
+	 * Name of the SharedPreference that stores how many kb have been sent in the background.
+	 */
+	static final String STORAGE_TRAFFIC_BG_SENT = "storage_traffic_bg_received";
+
+	/**
+	 * Name of the SharedPreference that stores how many kb have been received in the background.
+	 */
+	static final String STORAGE_TRAFFIC_BG_RECEIVED = "storage_traffic_bg_received";
+
+	static final String KEY_PREFERENCE_SYNC = "preference_key_sync";
+
+	static final String KEY_PREFERENCE_NOTIFICATION = "preference_key_notification";
+
+	static final String KEY_PREFERENCE_DATA = "preference_key_data";
+
+	static final String KEY_PREFERENCE_VERSION = "preference_key_version";
+
+	static final String KEY_PREFERENCE_SOURCE = "preference_key_source";
+
+	static final String KEY_PREFERENCE_FEEDBACK = "preference_key_feedback";
+
 	/**
 	 * Name of the database
 	 */

+ 12 - 4
app/src/main/java/com/ivalentin/margolariak/HomeLayout.java

@@ -29,6 +29,7 @@ import android.support.v4.app.ActivityCompat;
 import android.text.Html;
 import android.util.Log;
 import android.view.LayoutInflater;
+import android.view.MenuItem;
 import android.view.MotionEvent;
 import android.view.View;
 import android.view.View.OnClickListener;
@@ -55,6 +56,13 @@ public class HomeLayout extends Fragment implements LocationListener {
 	//The location manager
 	private LocationManager locationManager;
 
+	@Override
+	public boolean onOptionsItemSelected(MenuItem item) {
+		// TODO Auto-generated method stub
+		Log.e("MENU", "FROM HOME");
+		return false;
+	}
+
 	private View view;
 
 	/**
@@ -80,7 +88,7 @@ public class HomeLayout extends Fragment implements LocationListener {
 		//boolean requestLocation = false;
 
 		//Show tutorial if its the first time
-		final SharedPreferences preferences = view.getContext().getSharedPreferences(GM.PREF, Context.MODE_PRIVATE);
+		/*final SharedPreferences preferences = view.getContext().getSharedPreferences(GM.PREF, Context.MODE_PRIVATE);
 		if (!preferences.getBoolean(GM.PREF_TUTORIAL, false)) {
 			final RelativeLayout llTutorial = (RelativeLayout) getActivity().findViewById(R.id.rl_tutorial);
 			llTutorial.setVisibility(View.VISIBLE);
@@ -100,7 +108,7 @@ public class HomeLayout extends Fragment implements LocationListener {
 					editor.apply();
 				}
 			});
-		}
+		}*/
 
 		//Request location permissions if not set
 		if (ActivityCompat.checkSelfPermission(view.getContext(), android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(view.getContext(), android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
@@ -438,8 +446,8 @@ public class HomeLayout extends Fragment implements LocationListener {
 				llSection.setVisibility(View.VISIBLE);
 
 				//Enable menu entries
-				this.getActivity().findViewById(R.id.menu_lablanca_gm_schedule).setVisibility(View.VISIBLE);
-				this.getActivity().findViewById(R.id.menu_lablanca_schedule).setVisibility(View.VISIBLE);
+				//this.getActivity().findViewById(R.id.menu_lablanca_gm_schedule).setVisibility(View.VISIBLE);
+				//this.getActivity().findViewById(R.id.menu_lablanca_schedule).setVisibility(View.VISIBLE);
 
 				//Set text
 				String text = Html.fromHtml(cursor.getString(0)).toString();

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

@@ -87,8 +87,8 @@ class HomeSectionLocation extends AsyncTask<Void, Void, Void> {
 			editor.apply();
 
 			//Show menu entry
-			LinearLayout menuEntry = (LinearLayout) activity.findViewById(R.id.ll_menu_location);
-			menuEntry.setVisibility(View.VISIBLE);
+			//LinearLayout menuEntry = (LinearLayout) activity.findViewById(R.id.rl_menu_location);
+			//menuEntry.setVisibility(View.VISIBLE);
 
 			//Set up home view section
 			LinearLayout section = (LinearLayout) view.findViewById(R.id.ll_home_section_location);

+ 119 - 66
app/src/main/java/com/ivalentin/margolariak/MainActivity.java

@@ -13,21 +13,24 @@ import android.content.Context;
 import android.content.Intent;
 import android.content.SharedPreferences;
 import android.database.sqlite.SQLiteDatabase;
+import android.graphics.Typeface;
 import android.graphics.drawable.Drawable;
 import android.os.Bundle;
 import android.util.Log;
 import android.view.Gravity;
 import android.view.KeyEvent;
+import android.view.MenuInflater;
+import android.view.MenuItem;
 import android.view.View;
 import android.view.Window;
 import android.view.View.OnClickListener;
 import android.view.WindowManager;
 import android.widget.Button;
-import android.widget.ImageButton;
+import android.widget.HorizontalScrollView;
 import android.widget.ImageView;
-import android.widget.LinearLayout;
+import android.widget.PopupMenu;
 import android.widget.ProgressBar;
-import android.widget.ScrollView;
+import android.widget.RelativeLayout;
 import android.widget.TextView;
 
 /**
@@ -38,12 +41,52 @@ import android.widget.TextView;
  */
 public class MainActivity extends Activity{
 
-	//The main layout of the app
-	private MainLayout mLayout;
-
 	//Alarm to get location and notifications.
 	private AlarmReceiver alarm;
 
+	//The menu entries
+	RelativeLayout menuItem[];
+	TextView menuText[];
+	ImageView menuImage[];
+
+	//Not referenced in code.
+	public void showMenu(View v) {
+		PopupMenu popup = new PopupMenu(this, v);
+		MenuInflater inflater = popup.getMenuInflater();
+		inflater.inflate(R.menu.menu, popup.getMenu());
+
+		popup.getMenu().getItem(0).setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
+			@Override
+			public boolean onMenuItemClick(MenuItem item) {
+				Intent intent = new Intent(MainActivity.this, AboutActivity.class);
+				startActivity(intent);
+				return true;
+			}
+		});
+
+		popup.getMenu().getItem(1).setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
+			@Override
+			public boolean onMenuItemClick(MenuItem item) {
+				Intent intent = new Intent(MainActivity.this, SponsorActivity.class);
+				startActivity(intent);
+				return true;
+			}
+		});
+
+		popup.getMenu().getItem(2).setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
+			@Override
+			public boolean onMenuItemClick(MenuItem item) {
+				Intent intent = new Intent(MainActivity.this, SettingsActivity.class);
+				startActivity(intent);
+				return true;
+			}
+		});
+
+		popup.show();
+	}
+
+
+
 	/**
 	 * Loads a section in the main screen.
 	 * 
@@ -56,15 +99,27 @@ public class MainActivity extends Activity{
 		Fragment fragment = null;
 		String title = "";
 		Bundle bundle = new Bundle();
+
+		//Reset all tabs to it's original state
+		for (int i = 0; i < 6; i ++){
+			menuText[i].setTypeface(null, Typeface.NORMAL);
+			menuImage[i].requestLayout();
+			menuImage[i].getLayoutParams().height = 2;
+		}
+
 		switch (section){
 			case GM.SECTION_HOME:
 				fragment = new HomeLayout();
 				title = getString(R.string.menu_home);
+				menuText[0].setTypeface(null, Typeface.BOLD);
+				menuImage[0].getLayoutParams().height = 8;
 				break;
 
 			case GM.SECTION_LOCATION:
 				fragment = new LocationLayout();
 				title = getString(R.string.menu_location);
+				menuText[1].setTypeface(null, Typeface.BOLD);
+				menuImage[1].getLayoutParams().height = 8;
 				break;
 
 			case GM.SECTION_LABLANCA:
@@ -77,6 +132,8 @@ public class MainActivity extends Activity{
 					fragment = new LablancaNoFestivalsLayout();
 				}
 				title = getString(R.string.menu_lablanca);
+				menuText[2].setTypeface(null, Typeface.BOLD);
+				menuImage[2].getLayoutParams().height = 8;
 				break;
 
 			case GM.SECTION_LABLANCA_SCHEDULE:
@@ -84,6 +141,8 @@ public class MainActivity extends Activity{
 				bundle.putInt(GM.SCHEDULE, GM.SECTION_LABLANCA_SCHEDULE);
 				fragment.setArguments(bundle);
 				title = getString(R.string.menu_lablanca_schedule);
+				menuText[2].setTypeface(null, Typeface.BOLD);
+				menuImage[2].getLayoutParams().height = 8;
 				break;
 
 			case GM.SECTION_LABLANCA_GM_SCHEDULE:
@@ -91,38 +150,37 @@ public class MainActivity extends Activity{
 				bundle.putInt(GM.SCHEDULE, GM.SECTION_LABLANCA_GM_SCHEDULE);
 				fragment.setArguments(bundle);
 				title = getString(R.string.menu_lablanca_gm_schedule);
+				menuText[2].setTypeface(null, Typeface.BOLD);
+				menuImage[2].getLayoutParams().height = 8;
 				break;
 
 			case GM.SECTION_ACTIVITIES:
 				fragment = new ActivityLayout();
 				title = getString(R.string.menu_activities);
+				menuText[3].setTypeface(null, Typeface.BOLD);
+				menuImage[3].getLayoutParams().height = 8;
 				break;
 
 			case GM.SECTION_BLOG:
 				fragment = new BlogLayout();
 				title = getString(R.string.menu_blog);
+				menuText[4].setTypeface(null, Typeface.BOLD);
+				menuImage[4].getLayoutParams().height = 8;
 				break;
 
 			case GM.SECTION_GALLERY:
 				fragment = new GalleryLayout();
 				title = getString(R.string.menu_blog);
-				break;
-
-			case GM.SECTION_SETTINGS:
-				fragment = new SettingsLayout();
-				title = getString(R.string.menu_settings);
+				menuText[5].setTypeface(null, Typeface.BOLD);
+				menuImage[5].getLayoutParams().height = 8;
 				break;
 		}
 		
 		//Replace the fragment.
 		ft.replace(R.id.activity_main_content_fragment, fragment);
-		ft.addToBackStack(title);
+		//ft.addToBackStack(title);
 		ft.commit();
 		setSectionTitle(title);
-		
-		//If calling from the menu, close it.
-		if (fromSliderMenu)
-			mLayout.toggleMenu();
 	}
 
 	/**
@@ -181,35 +239,41 @@ public class MainActivity extends Activity{
 		//Remove title bar.
 	    this.requestWindowFeature(Window.FEATURE_NO_TITLE);
 	    super.onCreate(savedInstanceState);
-	    
+
 	    //Set layout.
 		setContentView(R.layout.activity_main);
-		mLayout = (MainLayout) findViewById(R.id.main_layout);
 
-
-		
-		//Assign menu button
-		ImageButton btMenu = (ImageButton) findViewById(R.id.bt_menu); 
-		btMenu.setOnClickListener(new OnClickListener() {
-			@Override
-			public void onClick(View v) { mLayout.toggleMenu(); }
-		});
-		
 		//Assign menu items
-		TextView menuItem[] = new TextView[7];
-		menuItem[0] = (TextView) findViewById(R.id.menu_home);
-		menuItem[1] = (TextView) findViewById(R.id.menu_location);
-		menuItem[2] = (TextView) findViewById(R.id.menu_lablanca);
-		menuItem[3] = (TextView) findViewById(R.id.menu_activities);
-		menuItem[4] = (TextView) findViewById(R.id.menu_blog);
-		menuItem[5] = (TextView) findViewById(R.id.menu_gallery);
-		menuItem[6] = (TextView) findViewById(R.id.menu_settings);
-		TextView menuSpacer = (TextView) findViewById(R.id.menu_space);
+		menuItem = new RelativeLayout[6];
+		menuItem[0] = (RelativeLayout) findViewById(R.id.rl_menu_home);
+		menuItem[1] = (RelativeLayout) findViewById(R.id.rl_menu_location);
+		menuItem[2] = (RelativeLayout) findViewById(R.id.rl_menu_lablanca);
+		menuItem[3] = (RelativeLayout) findViewById(R.id.rl_menu_activities);
+		menuItem[4] = (RelativeLayout) findViewById(R.id.rl_menu_blog);
+		menuItem[5] = (RelativeLayout) findViewById(R.id.rl_menu_gallery);
+		menuText = new TextView[6];
+		menuText[0] = (TextView) menuItem[0].findViewById(R.id.tv_menu_home);
+		menuText[1] = (TextView) menuItem[1].findViewById(R.id.tv_menu_location);
+		menuText[2] = (TextView) menuItem[2].findViewById(R.id.tv_menu_lablanca);
+		menuText[3] = (TextView) menuItem[3].findViewById(R.id.tv_menu_activities);
+		menuText[4] = (TextView) menuItem[4].findViewById(R.id.tv_menu_blog);
+		menuText[5] = (TextView) menuItem[5].findViewById(R.id.tv_menu_gallery);
+		menuImage = new ImageView[6];
+		menuImage[0] = (ImageView) menuItem[0].findViewById(R.id.iv_menu_home);
+		menuImage[1] = (ImageView) menuItem[1].findViewById(R.id.iv_menu_location);
+		menuImage[2] = (ImageView) menuItem[2].findViewById(R.id.iv_menu_lablanca);
+		menuImage[3] = (ImageView) menuItem[3].findViewById(R.id.iv_menu_activities);
+		menuImage[4] = (ImageView) menuItem[4].findViewById(R.id.iv_menu_blog);
+		menuImage[5] = (ImageView) menuItem[5].findViewById(R.id.iv_menu_gallery);
+
+		//Remove sscrollbars from the sections menu
+		HorizontalScrollView svMenu = (HorizontalScrollView) findViewById(R.id.sv_menu);
+		svMenu.setHorizontalScrollBarEnabled(false);
 
 		//Assign buttons for la blanca submenu
 		TextView menuLablancaItem[] = new TextView[2];
-		menuLablancaItem[0] = (TextView) findViewById(R.id.menu_lablanca_schedule);
-		menuLablancaItem[1] = (TextView) findViewById(R.id.menu_lablanca_gm_schedule);
+		//menuLablancaItem[0] = (TextView) findViewById(R.id.menu_lablanca_schedule);
+		//menuLablancaItem[1] = (TextView) findViewById(R.id.menu_lablanca_gm_schedule);
 
 		//Set click listers for menu items
 		menuItem[0].setOnClickListener(new OnClickListener() {
@@ -236,39 +300,28 @@ public class MainActivity extends Activity{
 			@Override
 			public void onClick(View v) { loadSection(GM.SECTION_GALLERY, true); }
 		});
-		menuItem[6].setOnClickListener(new OnClickListener() {
-			@Override
-			public void onClick(View v) { loadSection(GM.SECTION_SETTINGS, true); }
-		});
 
 
 		SharedPreferences preferences = getSharedPreferences(GM.PREF, Context.MODE_PRIVATE);
 		if (preferences.getInt(GM.PREF_DB_FESTIVALS, 0) == 1) {
 			//Show the entries
-			for (int i = 0; i < 2; i ++){
-				menuLablancaItem[i].setVisibility(View.VISIBLE);
-			}
+			//for (int i = 0; i < 2; i ++){
+			//	menuLablancaItem[i].setVisibility(View.VISIBLE);
+			//}
 		}
-		menuLablancaItem[0].setOnClickListener(new OnClickListener() {
-			@Override
-			public void onClick(View v) {
-				loadSection(GM.SECTION_LABLANCA_SCHEDULE, true);
-			}
-		});
-
-		menuLablancaItem[1].setOnClickListener(new OnClickListener() {
-			@Override
-			public void onClick(View v) {
-				loadSection(GM.SECTION_LABLANCA_GM_SCHEDULE, true);
-			}
-		});
-
-		menuSpacer.setOnClickListener(new OnClickListener() {
-			@Override
-			public void onClick(View v) {
-				mLayout.toggleMenu();
-			}
-		});
+//		menuLablancaItem[0].setOnClickListener(new OnClickListener() {
+//			@Override
+//			public void onClick(View v) {
+//				loadSection(GM.SECTION_LABLANCA_SCHEDULE, true);
+//			}
+//		});
+//
+//		menuLablancaItem[1].setOnClickListener(new OnClickListener() {
+//			@Override
+//			public void onClick(View v) {
+//				loadSection(GM.SECTION_LABLANCA_GM_SCHEDULE, true);
+//			}
+//		});
 
 		//If the user code is not set, generate one
 		if (preferences.getString(GM.USER_CODE, "").length() == 0){
@@ -595,7 +648,7 @@ public class MainActivity extends Activity{
 	@Override
 	public boolean onKeyUp(int keyCode, KeyEvent event) {
 		if (keyCode == KeyEvent.KEYCODE_MENU) {
-			mLayout.toggleMenu();
+			showMenu(this.findViewById(R.id.bt_menu));
 			return true;
 		}
 		return super.onKeyUp(keyCode, event);

+ 0 - 265
app/src/main/java/com/ivalentin/margolariak/MainLayout.java

@@ -1,265 +0,0 @@
-package com.ivalentin.margolariak;
-
-import android.annotation.SuppressLint;
-import android.content.Context;
-import android.os.Handler;
-import android.util.AttributeSet;
-import android.view.MotionEvent;
-import android.view.View;
-import android.view.animation.Interpolator;
-import android.widget.LinearLayout;
-import android.widget.Scroller;
-
-/**
- * Extension of LinearLayout to be used in the app. Contains the slider menu.
- *
- * @author Iñigo Valentin
- *
- */
-public class MainLayout extends LinearLayout {
-
-	//The width of the view
-	private int mainLayoutWidth;
-
-	//The menu view
-	private View menu;
-
-	//The content view
-	private View content;
-
-	//The margin of the menu
-	private static int menuRightMargin = 25;
-
-	/**
-	 * Possible states of the menu
-	 */
-	private enum MenuState {
-		HIDING, HIDDEN, SHOWING, SHOWN,
-	}
-
-	private int contentXOffset;
-	private MenuState currentMenuState = MenuState.HIDDEN;
-	private final Scroller menuScroller = new Scroller(this.getContext(), new EaseInInterpolator());
-	private final Runnable menuRunnable = new MenuRunnable();
-	private final Handler menuHandler = new Handler();
-	private int prevX = 0;
-	private boolean isDragging = false;
-	private int initialX = 0;
-
-	/**
-	 * Constructor.
-	 *
-	 * @param context Context of the app.
-	 * @param attrs Atributes.
-	 */
-	public MainLayout(Context context, AttributeSet attrs) {
-		super(context, attrs);
-	}
-
-	/**
-	 * Constructor.
-	 *
-	 * @param context Context of the app.
-	 */
-	public MainLayout(Context context) {
-		super(context);
-	}
-
-	@Override
-	protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
-		super.onMeasure(widthMeasureSpec, heightMeasureSpec);
-
-		mainLayoutWidth = MeasureSpec.getSize(widthMeasureSpec);
-		menuRightMargin = mainLayoutWidth * 25 / 100;
-	}
-
-	@SuppressLint("ClickableViewAccessibility") //I don't need it.
-	@Override
-	protected void onAttachedToWindow() {
-		super.onAttachedToWindow();
-
-		menu = this.getChildAt(0);
-		content = this.getChildAt(1);
-		content.setOnTouchListener(new OnTouchListener() {
-			@Override
-			public boolean onTouch(View v, MotionEvent event) {
-				return MainLayout.this.onContentTouch(event);
-			}
-		});
-		menu.setVisibility(View.GONE);
-	}
-
-	@Override
-	protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
-		if (changed) {
-			LayoutParams contentLayoutParams = (LayoutParams) content.getLayoutParams();
-			contentLayoutParams.height = this.getHeight();
-			contentLayoutParams.width = this.getWidth();
-			LayoutParams menuLayoutParams = (LayoutParams) menu.getLayoutParams();
-			menuLayoutParams.height = this.getHeight();
-			menuLayoutParams.width = this.getWidth() - menuRightMargin;
-		}
-		this.requestDisallowInterceptTouchEvent(true);
-		menu.layout(left, top, right - menuRightMargin, bottom);
-		content.layout(left + contentXOffset, top, right + contentXOffset, bottom);
-
-	}
-
-	/**
-	 * Changes the menu state.
-	 * Closes it if it's open. Opens it if it's closed.
-	 */
-	public void toggleMenu() {
-		if (currentMenuState == MenuState.HIDING || currentMenuState == MenuState.SHOWING)
-			return;
-
-		switch (currentMenuState) {
-			case HIDDEN:
-				currentMenuState = MenuState.SHOWING;
-				menu.setVisibility(View.VISIBLE);
-				menuScroller.startScroll(0, 0, menu.getLayoutParams().width, 0, GM.MENU_SLIDING_DURATION);
-				break;
-			case SHOWN:
-				currentMenuState = MenuState.HIDING;
-				menuScroller.startScroll(contentXOffset, 0, -contentXOffset, 0, GM.MENU_SLIDING_DURATION);
-				break;
-			default:
-				break;
-		}
-		menuHandler.postDelayed(menuRunnable, GM.MENU_QUERY_INTERVAL);
-		this.invalidate();
-	}
-
-	/**
-	 * Handles the animation of the sliding menu.
-	 *
-	 * @author seavenois
-	 *
-	 * @see Runnable
-	 *
-	 */
-	private class MenuRunnable implements Runnable {
-		@Override
-		public void run() {
-			boolean isScrolling = menuScroller.computeScrollOffset();
-			adjustContentPosition(isScrolling);
-		}
-	}
-
-	/**
-	 * Moves the content view when the menu is slided.
-	 *
-	 * @param isScrolling Indicates if the menu is being slided.
-	 */
-	private void adjustContentPosition(boolean isScrolling) {
-		int scrollerXOffset = menuScroller.getCurrX();
-
-		content.offsetLeftAndRight(scrollerXOffset - contentXOffset);
-
-		contentXOffset = scrollerXOffset;
-		this.invalidate();
-		if (isScrolling)
-			menuHandler.postDelayed(menuRunnable, GM.MENU_QUERY_INTERVAL);
-		else
-			this.onMenuSlidingComplete();
-	}
-
-	/**
-	 * Called when the menu has been slided completely.
-	 * Fixes the position.
-	 */
-	private void onMenuSlidingComplete() {
-		switch (currentMenuState) {
-			case SHOWING:
-				currentMenuState = MenuState.SHOWN;
-				break;
-			case HIDING:
-				currentMenuState = MenuState.HIDDEN;
-				menu.setVisibility(View.GONE);
-				break;
-		}
-	}
-
-	/**
-	 * Defines the menu animation frame rate.
-	 *
-	 * @author Iñigo Valentin
-	 *
-	 */
-	private class EaseInInterpolator implements Interpolator {
-		@Override
-		public float getInterpolation(float t) {
-			return (float) Math.pow(t - 1, 5) + 1;
-		}
-
-	}
-
-	/**
-	 * Register touch events.
-	 * Used to show and hide the menu.
-	 *
-	 * @param event The MotionEvent triggering it.
-	 * @return True if the menu is fully opened or closed and a touch event is happening
-	 */
-	private boolean onContentTouch(MotionEvent event) {
-		if (currentMenuState == MenuState.HIDING || currentMenuState == MenuState.SHOWING)
-			return false;
-		int curX = (int) event.getRawX();
-		int diffX;
-
-		switch (event.getAction()) {
-			case MotionEvent.ACTION_DOWN:
-				prevX = curX;
-				initialX = curX;
-				return true;
-
-			case MotionEvent.ACTION_MOVE:
-				//int width = this.getWidth();
-				//if (event.getX() <  (float) width / 4){
-
-				if (!isDragging) {
-
-					isDragging = true;
-					menu.setVisibility(View.VISIBLE);
-				}
-				diffX = curX - prevX;
-				if (contentXOffset + diffX <= 0) {
-					diffX = -contentXOffset;
-				}
-				else if (contentXOffset + diffX > mainLayoutWidth - menuRightMargin) {
-					diffX = mainLayoutWidth - menuRightMargin - contentXOffset;
-				}
-				content.offsetLeftAndRight(diffX);
-				contentXOffset += diffX;
-				this.invalidate();
-
-				prevX = curX;
-				//}
-				return true;
-
-			case MotionEvent.ACTION_UP:
-				if (initialX != curX && currentMenuState == MenuState.HIDDEN) {
-					currentMenuState = MenuState.SHOWING;
-					menuScroller.startScroll(contentXOffset, 0,	menu.getLayoutParams().width - contentXOffset, 0, GM.MENU_SLIDING_DURATION);
-				}
-				else if (initialX != curX && currentMenuState == MenuState.SHOWN) {
-
-					currentMenuState = MenuState.HIDING;
-					menuScroller.startScroll(contentXOffset, 0, -contentXOffset, 0, GM.MENU_SLIDING_DURATION);
-				}
-				menuHandler.postDelayed(menuRunnable, GM.MENU_QUERY_INTERVAL);
-				this.invalidate();
-				isDragging = false;
-				prevX = 0;
-				return true;
-
-			default:
-				break;
-		}
-
-
-
-		return false;
-	}
-}
-

+ 122 - 0
app/src/main/java/com/ivalentin/margolariak/SettingsActivity.java

@@ -0,0 +1,122 @@
+package com.ivalentin.margolariak;
+
+import android.app.Notification;
+import android.content.SharedPreferences;
+import android.os.Bundle;
+import android.preference.CheckBoxPreference;
+import android.preference.Preference;
+import android.preference.PreferenceActivity;
+import android.util.Log;
+import android.widget.Toast;
+
+import java.text.DecimalFormat;
+import java.text.NumberFormat;
+
+public class SettingsActivity extends PreferenceActivity {
+	@Override
+	public void onCreate(Bundle savedInstanceState) {
+		super.onCreate(savedInstanceState);
+
+		// Load the preferences from an XML resource
+		addPreferencesFromResource(R.xml.preferences);
+
+		SharedPreferences sp = getPreferenceScreen().getSharedPreferences();
+
+		//Set up Sync preference
+		CheckBoxPreference prefSync = (CheckBoxPreference) getPreferenceManager().findPreference(GM.KEY_PREFERENCE_SYNC);
+		if (prefSync.isChecked()){
+			prefSync.setSummary(getString(R.string.preferences_sync_sync_on));
+		}
+		else{
+			prefSync.setSummary(getString(R.string.preferences_sync_sync_off));
+		}
+		prefSync.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+
+			public boolean onPreferenceChange(Preference preference, Object newValue) {
+				CheckBoxPreference prefNotification = (CheckBoxPreference) getPreferenceManager().findPreference(GM.KEY_PREFERENCE_NOTIFICATION);
+				if (newValue.toString().equals("true")) {
+					preference.setSummary(getString(R.string.preferences_sync_sync_on));
+					if (prefNotification.isChecked()){
+						prefNotification.setSummary(getString(R.string.preferences_sync_notifications_on));
+					}
+					else{
+						prefNotification.setSummary(getString(R.string.preferences_sync_notifications_off));
+					}
+					prefNotification.setEnabled(true);
+				} else {
+					prefNotification.setEnabled(false);
+					prefNotification.setSummary(getString(R.string.preferences_sync_notifications_disabled));
+					preference.setSummary(getString(R.string.preferences_sync_sync_off));
+				}
+				return true;
+			}
+		});
+
+		//Set up Notification preference
+		CheckBoxPreference prefNotification = (CheckBoxPreference) getPreferenceManager().findPreference(GM.KEY_PREFERENCE_NOTIFICATION);
+		if (prefSync.isChecked() == false){
+			prefNotification.setEnabled(false);
+		}
+		else {
+			prefNotification.setEnabled(true);
+			if(prefSync.isChecked() == false){
+
+			}
+			if (prefNotification.isChecked()) {
+				prefNotification.setSummary(getString(R.string.preferences_sync_notifications_on));
+			} else {
+				prefNotification.setSummary(getString(R.string.preferences_sync_notifications_off));
+			}
+		}
+
+		prefNotification.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+
+			public boolean onPreferenceChange(Preference preference, Object newValue) {
+				if (newValue.toString().equals("true")) {
+					preference.setSummary(getString(R.string.preferences_sync_notifications_on));
+				} else {
+					preference.setSummary(getString(R.string.preferences_sync_notifications_off));
+				}
+				return true;
+			}
+		});
+
+
+		//Set up data preference
+		long bgData = sp.getLong(GM.STORAGE_TRAFFIC_BG_RECEIVED, 0) + sp.getLong(GM.STORAGE_TRAFFIC_BG_SENT, 0);
+		long fgData = sp.getLong(GM.STORAGE_TRAFFIC_FG_RECEIVED, 0) + sp.getLong(GM.STORAGE_TRAFFIC_FG_SENT, 0);
+		String value = "";
+		if (bgData < 1500){
+			value = bgData + getString(R.string.Kb);
+		}
+		else if(bgData < 5 * 1024){
+			NumberFormat formatter = new DecimalFormat("#0.00");
+			value = (formatter.format(((float) bgData) / 1024.0)) + getString(R.string.Mb);
+		}
+		else{
+			value = String.valueOf((int) (((float) bgData) / 1024.0)) + getString(R.string.Mb);
+		}
+		Preference prefData = getPreferenceManager().findPreference(GM.KEY_PREFERENCE_DATA);
+		prefData.setSummary(value);
+
+
+
+		//Set up version preference
+		Preference prefVersion = getPreferenceManager().findPreference(GM.KEY_PREFERENCE_VERSION);
+		prefVersion.setSummary(com.ivalentin.margolariak.BuildConfig.VERSION_NAME);
+		prefNotification.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
+			@Override
+			public boolean onPreferenceClick(Preference preference) {
+				//TODO
+				return false;
+			}
+		});
+
+		//Set up source preference
+		//TODO
+
+		//Set up feedback preference
+		//TODO
+
+	}
+}

+ 9 - 0
app/src/main/java/com/ivalentin/margolariak/SponsorActivity.java

@@ -0,0 +1,9 @@
+package com.ivalentin.margolariak;
+
+import android.app.Activity;
+
+/**
+ * Created by seavenois on 26/09/16.
+ */
+public class SponsorActivity extends Activity {
+}

+ 1 - 1
app/src/main/res/drawable/entry.xml

@@ -2,7 +2,7 @@
     android:shape="rectangle" >
 
     <stroke
-        android:width="2dp"
+        android:width="1dp"
         android:color="@color/entry_border" />
     <solid android:color="@color/entry_background" />
 

+ 3 - 3
app/src/main/res/drawable/section.xml

@@ -1,9 +1,9 @@
 <shape xmlns:android="http://schemas.android.com/apk/res/android"
     android:shape="rectangle" >
 
-    <stroke
-        android:width="4dp"
-        android:color="@color/section_border" />
+    <!--<stroke-->
+        <!--android:width="2dp"-->
+        <!--android:color="@color/section_border" />-->
     <solid android:color="@color/section_background" />
 
 </shape>

+ 260 - 344
app/src/main/res/layout/activity_main.xml

@@ -1,392 +1,308 @@
-<FrameLayout
+<LinearLayout
 	xmlns:android="http://schemas.android.com/apk/res/android"
-	xmlns:tools="http://schemas.android.com/tools"
 	android:layout_width="match_parent"
-	android:layout_height="match_parent"
-	tools:ignore="MergeRootFrame">
+	android:layout_height="fill_parent"
+	android:orientation="vertical">
 
-	<com.ivalentin.margolariak.MainLayout
-		android:id="@+id/main_layout"
-		android:layout_width="match_parent"
-		android:layout_height="match_parent"
-		android:fitsSystemWindows="true"
-		android:background="@color/background_menu">
+	<LinearLayout
+		android:layout_width="fill_parent"
+		android:layout_height="wrap_content"
+		android:background="@drawable/titlebar"
+		android:gravity="center_vertical"
+		android:orientation="horizontal"
+		android:padding="2dp">
 
+		<!-- Button to open slider menu -->
 
-		<!-- Slider menu -->
+		<ImageView
+			android:contentDescription="@string/app_name"
+			android:layout_width="40dp"
+			android:layout_height="40dp"
+			android:id="@+id/iv_logo"
+			android:src="@drawable/ic_launcher"
+			android:adjustViewBounds="true"
+			android:layout_weight=".2"
+			android:maxHeight="45dp"
+			android:maxWidth="45dp"
+			android:padding="1dp"/>
+
+		<!-- Layout with the app title and current section -->
 
-		<ScrollView
+		<LinearLayout
 			android:layout_width="wrap_content"
-			android:layout_height="fill_parent"
-			android:nestedScrollingEnabled="false"
-			tools:ignore="UnusedAttribute"
-			android:id="@+id/sv_menu">
+			android:layout_height="wrap_content"
+			android:layout_gravity="center"
+			android:layout_weight=".8"
+			android:gravity="center"
+			android:orientation="vertical" >
+
+			<!-- App name. Remains unchanged -->
+
+			<TextView
+				android:layout_width="wrap_content"
+				android:layout_height="wrap_content"
+				android:gravity="center"
+				android:text="@string/app_name"
+				android:textSize="18sp"
+				android:textStyle="bold" />
 
-			<LinearLayout
-				android:layout_width="match_parent"
+			<!-- Section title -->
+
+			<TextView
+				android:id="@+id/activity_main_content_title"
+				android:layout_width="wrap_content"
 				android:layout_height="wrap_content"
-				android:divider="@drawable/divider"
+				android:gravity="center"
+				android:text="@string/menu_home"
+				android:textSize="20sp" />
+
+		</LinearLayout>
+
+		<ImageButton
+			android:layout_width="wrap_content"
+			android:layout_height="wrap_content"
+			android:src="@drawable/abc_ic_menu_moreoverflow_mtrl_alpha"
+			android:contentDescription="@string/tutorial_menu"
+			android:onClick="showMenu"
+			android:layout_weight=".2"
+			android:id="@+id/bt_menu"/>
+
+		<ProgressBar
+			android:id="@+id/pb_sync"
+			android:layout_width="40dp"
+			android:layout_height="40dp"
+			android:layout_weight=".2"
+			android:visibility="gone"
+			android:maxHeight="40dp"
+			android:maxWidth="40dp"/>
+
+	</LinearLayout>
+
+	<!-- The part where the fragments will be loaded -->
+
+	<HorizontalScrollView
+		android:layout_width="wrap_content"
+		android:layout_height="50dp"
+		android:id="@+id/sv_menu"
+		android:scrollIndicators="none"
+		android:requiresFadingEdge="horizontal"
+		android:fadingEdgeLength="125dp"
+		android:background="@color/background_bar_gradient">
+
+		<LinearLayout
+			android:orientation="horizontal"
+			android:layout_width="wrap_content"
+			android:layout_height="match_parent"
+			>
+
+			<RelativeLayout
 				android:orientation="vertical"
-				android:padding="10dp"
-				android:baselineAligned="false"
-				android:id="@+id/ll_menu">
+				android:layout_width="100dp"
+				android:layout_height="match_parent"
+				android:id="@+id/rl_menu_home"
+				android:layout_marginRight="0.5dp"
+				android:layout_marginLeft="0.5dp">
 
 				<TextView
-					android:id="@+id/menu_home"
-					android:layout_width="fill_parent"
+					android:layout_width="wrap_content"
 					android:layout_height="wrap_content"
-					android:layout_marginBottom="10dp"
-					android:layout_marginTop="10dp"
-					android:gravity="center_vertical"
+					android:textAppearance="?android:attr/textAppearanceMedium"
 					android:text="@string/menu_home"
-					android:textAppearance="?android:attr/textAppearanceLarge"
+					android:layout_gravity="top"
+					android:textSize="15sp"
+					android:layout_centerInParent="true"
 					android:textStyle="bold"
-					android:textColor="@color/menu_entry"
-					android:paddingTop="4dp"
-					android:paddingBottom="4dp"/>
+					android:id="@+id/tv_menu_home"/>
 
-				<LinearLayout
-					android:orientation="vertical"
-					android:layout_width="fill_parent"
-					android:layout_height="wrap_content"
-					android:id="@+id/ll_menu_location"
-					android:visibility="gone">
-
-					<View
-						android:layout_width="fill_parent"
-						android:layout_height="1dp"
-						android:background="@color/background_separator"/>
-
-					<TextView
-						android:id="@+id/menu_location"
-						android:layout_width="fill_parent"
-						android:layout_height="wrap_content"
-						android:layout_marginBottom="10dp"
-						android:layout_marginTop="10dp"
-						android:gravity="center_vertical"
-						android:text="@string/menu_location"
-						android:textAppearance="?android:attr/textAppearanceLarge"
-						android:textStyle="bold"
-						android:textColor="@color/menu_entry"
-						android:paddingBottom="4dp"
-						android:paddingTop="4dp"/>
-				</LinearLayout>
-
-				<View
-					android:layout_width="fill_parent"
-					android:layout_height="1dp"
-					android:background="@color/background_separator"/>
-
-				<TextView
-					android:id="@+id/menu_lablanca"
-					android:layout_width="fill_parent"
-					android:layout_height="wrap_content"
-					android:layout_marginBottom="10dp"
-					android:layout_marginTop="10dp"
-					android:gravity="center_vertical"
-					android:text="@string/menu_lablanca"
-					android:textAppearance="?android:attr/textAppearanceLarge"
-					android:textStyle="bold"
-					android:textColor="@color/menu_entry"
-					android:paddingTop="4dp"
-					android:paddingBottom="4dp"/>
+				<ImageView
+					android:layout_width="match_parent"
+					android:layout_height="8dp"
+					android:id="@+id/iv_menu_home"
+					android:background="@color/menu_selected"
+					android:alpha="1"
+					android:layout_gravity="bottom"
+					android:layout_alignParentStart="false"
+					android:layout_alignParentEnd="false"
+					android:layout_alignParentLeft="false"
+					android:layout_alignParentRight="false"
+					android:layout_alignParentBottom="true"/>
+			</RelativeLayout>
+
+			<RelativeLayout
+				android:orientation="vertical"
+				android:layout_width="100dp"
+				android:layout_height="match_parent"
+				android:id="@+id/rl_menu_location"
+				android:layout_marginLeft="1dp"
+				android:layout_marginRight="1dp">
 
 				<TextView
-					android:id="@+id/menu_lablanca_schedule"
-					android:layout_width="fill_parent"
+					android:layout_width="wrap_content"
 					android:layout_height="wrap_content"
-					android:layout_marginBottom="10dp"
-					android:layout_marginTop="10dp"
-					android:layout_marginStart="20dp"
-					android:layout_marginLeft="20dp"
-					android:gravity="center_vertical"
-					android:text="@string/menu_lablanca_schedule"
 					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:textColor="@color/menu_entry"
-					android:visibility="gone"
-					android:paddingTop="2dp"
-					android:paddingBottom="2dp"/>
+					android:text="@string/menu_location"
+					android:layout_gravity="top"
+					android:textSize="15sp"
+					android:layout_centerInParent="true"
+					android:id="@+id/tv_menu_location"/>
+
+				<ImageView
+					android:layout_width="match_parent"
+					android:layout_height="2dp"
+					android:id="@+id/iv_menu_location"
+					android:background="@color/menu_selected"
+					android:alpha="1"
+					android:layout_gravity="bottom"
+					android:layout_alignParentStart="false"
+					android:layout_alignParentEnd="false"
+					android:layout_alignParentLeft="false"
+					android:layout_alignParentRight="false"
+					android:layout_alignParentBottom="true"/>
+			</RelativeLayout>
+
+			<RelativeLayout
+				android:orientation="vertical"
+				android:layout_width="100dp"
+				android:layout_height="match_parent"
+				android:id="@+id/rl_menu_lablanca"
+				android:layout_marginLeft="1dp"
+				android:layout_marginRight="1dp">
 
 				<TextView
-					android:id="@+id/menu_lablanca_gm_schedule"
-					android:layout_width="fill_parent"
+					android:layout_width="wrap_content"
 					android:layout_height="wrap_content"
-					android:layout_marginBottom="10dp"
-					android:layout_marginTop="10dp"
-					android:layout_marginStart="20dp"
-					android:layout_marginLeft="20dp"
-					android:gravity="center_vertical"
-					android:text="@string/menu_lablanca_gm_schedule"
 					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:textColor="@color/menu_entry"
-					android:visibility="gone"
-					android:paddingBottom="2dp"
-					android:paddingTop="2dp"/>
+					android:text="@string/menu_lablanca"
+					android:layout_gravity="top"
+					android:textSize="15sp"
+					android:layout_centerInParent="true"
+					android:id="@+id/tv_menu_lablanca"/>
 
-				<View
-					android:layout_width="fill_parent"
-					android:layout_height="1dp"
-					android:background="@color/background_separator"/>
+				<ImageView
+					android:layout_width="match_parent"
+					android:layout_height="2dp"
+					android:id="@+id/iv_menu_lablanca"
+					android:background="@color/menu_selected"
+					android:alpha="1"
+					android:layout_gravity="bottom"
+					android:layout_alignParentStart="false"
+					android:layout_alignParentEnd="false"
+					android:layout_alignParentLeft="false"
+					android:layout_alignParentRight="false"
+					android:layout_alignParentBottom="true"/>
+			</RelativeLayout>
+
+			<RelativeLayout
+				android:orientation="vertical"
+				android:layout_width="100dp"
+				android:layout_height="match_parent"
+				android:id="@+id/rl_menu_activities"
+				android:layout_marginLeft="1dp"
+				android:layout_marginRight="1dp">
 
 				<TextView
-					android:id="@+id/menu_activities"
-					android:layout_width="fill_parent"
+					android:layout_width="wrap_content"
 					android:layout_height="wrap_content"
-					android:layout_marginBottom="10dp"
-					android:layout_marginTop="10dp"
-					android:gravity="center_vertical"
+					android:textAppearance="?android:attr/textAppearanceMedium"
 					android:text="@string/menu_activities"
-					android:textAppearance="?android:attr/textAppearanceLarge"
-					android:textStyle="bold"
-					android:textColor="@color/menu_entry"
-					android:paddingTop="4dp"
-					android:paddingBottom="4dp"/>
+					android:layout_gravity="top"
+					android:textSize="15sp"
+					android:layout_centerInParent="true"
+					android:id="@+id/tv_menu_activities"/>
 
-				<View
-					android:layout_width="fill_parent"
-					android:layout_height="1dp"
-					android:background="@color/background_separator"/>
+				<ImageView
+					android:layout_width="match_parent"
+					android:layout_height="2dp"
+					android:id="@+id/iv_menu_activities"
+					android:background="@color/menu_selected"
+					android:alpha="1"
+					android:layout_gravity="bottom"
+					android:layout_alignParentStart="false"
+					android:layout_alignParentEnd="false"
+					android:layout_alignParentLeft="false"
+					android:layout_alignParentRight="false"
+					android:layout_alignParentBottom="true"/>
+			</RelativeLayout>
+
+			<RelativeLayout
+				android:orientation="vertical"
+				android:layout_width="100dp"
+				android:layout_height="match_parent"
+				android:id="@+id/rl_menu_blog"
+				android:layout_marginLeft="1dp"
+				android:layout_marginRight="1dp">
 
 				<TextView
-					android:id="@+id/menu_blog"
-					android:layout_width="fill_parent"
+					android:layout_width="wrap_content"
 					android:layout_height="wrap_content"
-					android:layout_marginBottom="10dp"
-					android:layout_marginTop="10dp"
-					android:gravity="center_vertical"
+					android:textAppearance="?android:attr/textAppearanceMedium"
 					android:text="@string/menu_blog"
-					android:textAppearance="?android:attr/textAppearanceLarge"
-					android:textStyle="bold"
-					android:textColor="@color/menu_entry"
-					android:paddingBottom="4dp"
-					android:paddingTop="4dp"/>
-
-				<View
-					android:layout_width="fill_parent"
-					android:layout_height="1dp"
-					android:background="@color/background_separator"/>
-
-				<TextView
-					android:id="@+id/menu_gallery"
-					android:layout_width="fill_parent"
-					android:layout_height="wrap_content"
-					android:layout_marginBottom="10dp"
-					android:layout_marginTop="10dp"
-					android:gravity="center_vertical"
-					android:text="@string/menu_gallery"
-					android:textAppearance="?android:attr/textAppearanceLarge"
-					android:textStyle="bold"
-					android:textColor="@color/menu_entry"
-					android:paddingTop="4dp"
-					android:paddingBottom="4dp"/>
-
-				<View
-					android:layout_width="fill_parent"
-					android:layout_height="1dp"
-					android:background="@color/background_separator"/>
+					android:layout_gravity="top"
+					android:textSize="15sp"
+					android:layout_centerInParent="true"
+					android:id="@+id/tv_menu_blog"/>
 
-				<TextView
-					android:id="@+id/menu_settings"
-					android:layout_width="fill_parent"
-					android:layout_height="wrap_content"
-					android:layout_marginBottom="10dp"
-					android:layout_marginTop="10dp"
-					android:gravity="center_vertical"
-					android:text="@string/menu_settings"
-					android:textAppearance="?android:attr/textAppearanceLarge"
-					android:textStyle="bold"
-					android:textColor="@color/menu_entry"
-					android:paddingBottom="4dp"
-					android:paddingTop="4dp"/>
+				<ImageView
+					android:layout_width="match_parent"
+					android:layout_height="2dp"
+					android:id="@+id/iv_menu_blog"
+					android:background="@color/menu_selected"
+					android:alpha="1"
+					android:layout_gravity="bottom"
+					android:layout_alignParentStart="false"
+					android:layout_alignParentEnd="false"
+					android:layout_alignParentLeft="false"
+					android:layout_alignParentRight="false"
+					android:layout_alignParentBottom="true"/>
+			</RelativeLayout>
+
+			<RelativeLayout
+				android:orientation="vertical"
+				android:layout_width="100dp"
+				android:layout_height="match_parent"
+				android:id="@+id/rl_menu_gallery"
+				android:layout_marginLeft="1dp"
+				android:layout_marginRight="1dp">
 
 				<TextView
-					android:layout_width="fill_parent"
-					android:layout_height="fill_parent"
-					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:id="@+id/menu_space"
-					android:padding="5dp"/>
-
-			</LinearLayout>
-
-		</ScrollView>
-
-		<!-- The visible screen -->
-
-		<LinearLayout
-			xmlns:android="http://schemas.android.com/apk/res/android"
-			android:layout_width="match_parent"
-			android:layout_height="match_parent"
-			android:background="@color/background_app"
-			android:orientation="vertical"
-			>
-
-			<!-- The action bar -->
-
-			<LinearLayout
-				android:layout_width="fill_parent"
-				android:layout_height="wrap_content"
-				android:background="@drawable/titlebar"
-				android:gravity="center_vertical"
-				android:orientation="horizontal"
-				android:padding="2dp">
-
-				<!-- Button to open slider menu -->
-
-				<ImageButton
-					android:id="@+id/bt_menu"
-					android:layout_width="40dp"
-					android:layout_height="40dp"
-					android:layout_weight=".2"
-					android:adjustViewBounds="false"
-					android:background="#00000000"
-					android:contentDescription="@string/app_name"
-					android:maxHeight="20dp"
-					android:maxWidth="20dp"
-					android:scaleType="fitCenter"
-					android:src="@drawable/menu"
-					android:padding="2dp"
-					android:alpha=".5"/>
-
-				<!-- Layout with the app title and current section -->
-
-				<LinearLayout
 					android:layout_width="wrap_content"
 					android:layout_height="wrap_content"
-					android:layout_gravity="center"
-					android:layout_weight=".8"
-					android:gravity="center"
-					android:orientation="vertical" >
-
-					<!-- App name. Remains unchanged -->
-
-					<TextView
-						android:layout_width="wrap_content"
-						android:layout_height="wrap_content"
-						android:gravity="center"
-						android:text="@string/app_name"
-						android:textSize="18sp"
-						android:textStyle="bold" />
-
-					<!-- Section title -->
-
-					<TextView
-						android:id="@+id/activity_main_content_title"
-						android:layout_width="wrap_content"
-						android:layout_height="wrap_content"
-						android:gravity="center"
-						android:text="@string/menu_home"
-						android:textSize="20sp" />
-
-				</LinearLayout>
+					android:textAppearance="?android:attr/textAppearanceMedium"
+					android:text="@string/menu_gallery"
+					android:layout_gravity="top"
+					android:textSize="15sp"
+					android:layout_centerInParent="true"
+					android:id="@+id/tv_menu_gallery"/>
 
 				<ImageView
-					android:layout_width="40dp"
-					android:layout_height="40dp"
-					android:id="@+id/iv_logo"
-					android:src="@drawable/ic_launcher"
-					android:adjustViewBounds="true"
-					android:layout_weight=".2"
-					android:maxHeight="45dp"
-					android:maxWidth="45dp"
-					android:padding="1dp"/>
-
-				<ProgressBar
-					android:id="@+id/pb_sync"
-					android:layout_width="40dp"
-					android:layout_height="40dp"
-					android:layout_weight=".2"
-					android:visibility="gone"
-					android:maxHeight="40dp"
-					android:maxWidth="40dp"/>
-
-			</LinearLayout>
-
-			<!-- The part where the fragments will be loaded -->
-
-			<FrameLayout
-				android:id="@+id/activity_main_content_fragment"
-				android:layout_width="match_parent"
-				android:layout_height="match_parent"
-				android:layout_marginLeft="9dp"
-				android:layout_marginRight="9dp">
-
-			</FrameLayout>
+					android:layout_width="match_parent"
+					android:layout_height="2dp"
+					android:id="@+id/iv_menu_gallery"
+					android:background="@color/menu_selected"
+					android:alpha="1"
+					android:layout_gravity="bottom"
+					android:layout_alignParentStart="false"
+					android:layout_alignParentEnd="false"
+					android:layout_alignParentLeft="false"
+					android:layout_alignParentRight="false"
+					android:layout_alignParentBottom="true"/>
+			</RelativeLayout>
 
 		</LinearLayout>
+	</HorizontalScrollView>
 
-	</com.ivalentin.margolariak.MainLayout>
+	<ScrollView
+		android:layout_width="fill_parent"
+		android:layout_height="wrap_content"
+		android:id="@+id/sv_main_content">
 
-	<RelativeLayout
-		android:orientation="vertical"
-		android:layout_width="match_parent"
-		android:layout_height="match_parent"
-		android:background="#003377"
-		android:alpha=".85"
-		android:id="@+id/rl_tutorial"
-		android:visibility="gone">
+		<FrameLayout
+			android:id="@+id/activity_main_content_fragment"
+			android:layout_width="match_parent"
+			android:layout_height="match_parent">
 
-		<ImageView
-			android:layout_width="90dp"
-			android:layout_height="90dp"
-			android:src="@drawable/tutorial_point"
-			tools:ignore="ContentDescription"/>
+		</FrameLayout>
+	</ScrollView>
 
-		<ImageView
-			android:layout_width="110dp"
-			android:layout_height="110dp"
-			android:src="@drawable/tutorial_slide"
-			android:layout_marginTop="110dp"
-			android:layout_marginLeft="-10dp"
-			android:layout_marginStart="-10dp"
-			tools:ignore="ContentDescription"/>
-
-		<TextView
-			android:layout_width="wrap_content"
-			android:layout_height="wrap_content"
-			android:textAppearance="?android:attr/textAppearanceMedium"
-			android:text="@string/tutorial_menu"
-			android:textColor="#ffffff"
-			android:textStyle="bold"
-			android:layout_marginTop="70dp"
-			android:layout_marginRight="20dp"
-			android:layout_marginEnd="20dp"
-			android:layout_marginLeft="100dp"
-			android:layout_marginStart="100dp"/>
+</LinearLayout>
 
-		<ImageView
-			android:layout_width="90dp"
-			android:layout_height="90dp"
-			android:id="@+id/iv_tutorial_content"
-			android:src="@drawable/tutorial_point"
-			android:layout_centerInParent="true"
-			tools:ignore="ContentDescription"/>
-
-		<TextView
-			android:layout_width="wrap_content"
-			android:layout_height="wrap_content"
-			android:textAppearance="?android:attr/textAppearanceMedium"
-			android:text="@string/tutorial_content"
-			android:textColor="#ffffff"
-			android:textStyle="bold"
-			android:layout_marginLeft="30dp"
-			android:layout_marginRight="30dp"
-			android:layout_below="@+id/iv_tutorial_content"/>
-
-		<Button
-			android:layout_width="wrap_content"
-			android:layout_height="wrap_content"
-			android:text="@string/tutorial_button"
-			android:id="@+id/bt_tutorial"
-			android:layout_gravity="center_horizontal"
-			android:textColor="@color/input_button_color"
-			android:textStyle="bold"
-			android:background="@drawable/button_selector"
-			android:layout_centerHorizontal="true"
-			android:layout_alignParentEnd="false"
-			android:layout_alignParentBottom="true"
-			android:layout_marginBottom="50dp"
-			android:paddingLeft="10dp"
-			android:paddingRight="10dp"/>
-	</RelativeLayout>
-
-</FrameLayout>

+ 105 - 63
app/src/main/res/layout/fragment_layout_home.xml

@@ -6,35 +6,40 @@
     android:layout_height="wrap_content" >
 
     <LinearLayout
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:orientation="vertical">
+		android:layout_width="fill_parent"
+		android:layout_height="wrap_content"
+		android:orientation="vertical"
+		android:background="@color/background_app">
     
 	    <LinearLayout
-	        android:id="@+id/ll_home_section_location"
-	        android:layout_width="fill_parent"
-	        android:layout_height="wrap_content"
-	        android:orientation="vertical"
+			android:id="@+id/ll_home_section_location"
+			android:layout_width="fill_parent"
+			android:layout_height="wrap_content"
+			android:orientation="vertical"
 			android:background="@drawable/section"
-			android:layout_margin="7dp"
-			android:padding="7dp"
-			android:visibility="gone">
+			android:visibility="gone"
+			android:layout_marginLeft="0dp"
+			android:layout_marginTop="2dp"
+			android:layout_marginRight="0dp"
+			android:layout_marginBottom="4dp"
+			android:paddingTop="5dp">
 
 			<TextView
 				android:layout_width="wrap_content"
 				android:layout_height="wrap_content"
 				android:text="@string/home_section_location"
 				android:textAppearance="?android:attr/textAppearanceLarge"
-				android:textStyle="bold"/>
+				android:textStyle="bold"
+				android:textColor="@color/section_title"/>
 
 			<LinearLayout
-                android:id="@+id/ll_home_section_location_content"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:layout_margin="10dp"
-                android:orientation="vertical"
+				android:id="@+id/ll_home_section_location_content"
+				android:layout_width="match_parent"
+				android:layout_height="wrap_content"
+				android:orientation="vertical"
 				android:background="@drawable/entry"
-				android:padding="7dp">
+				android:padding="7dp"
+				android:layout_margin="3dp">
 
 				<TextView
 					android:layout_width="wrap_content"
@@ -78,10 +83,13 @@
 			android:layout_width="match_parent"
 			android:layout_height="match_parent"
 			android:background="@drawable/section"
-			android:padding="7dp"
 			android:id="@+id/ll_home_section_lablanca"
-			android:layout_margin="7dp"
-			android:visibility="gone">
+			android:visibility="gone"
+			android:layout_marginLeft="0dp"
+			android:layout_marginTop="2dp"
+			android:layout_marginRight="0dp"
+			android:layout_marginBottom="4dp"
+			android:paddingTop="5dp">
 
 			<TextView
 				android:layout_width="wrap_content"
@@ -89,7 +97,8 @@
 				android:textAppearance="?android:attr/textAppearanceLarge"
 				android:text="@string/lablanca_title"
 				android:id="@+id/textView4"
-				android:textStyle="bold"/>
+				android:textStyle="bold"
+				android:textColor="@color/section_title"/>
 
 			<LinearLayout
 				android:orientation="horizontal"
@@ -97,7 +106,7 @@
 				android:layout_height="match_parent"
 				android:background="@drawable/entry"
 				android:padding="7dp"
-				android:layout_margin="10dp">
+				android:layout_margin="3dp">
 
 				<ImageView
 					android:layout_width="wrap_content"
@@ -128,9 +137,12 @@
 			android:layout_height="wrap_content"
 			android:orientation="vertical"
 			android:background="@drawable/section"
-			android:layout_margin="7dp"
-			android:padding="7dp"
-			android:visibility="gone">
+			android:visibility="gone"
+			android:layout_marginLeft="0dp"
+			android:layout_marginRight="0dp"
+			android:layout_marginTop="2dp"
+			android:layout_marginBottom="4dp"
+			android:paddingTop="5dp">
 
 			<TextView
 				android:layout_width="wrap_content"
@@ -138,7 +150,8 @@
 				android:text="@string/home_section_gmschedule"
 				android:textAppearance="?android:attr/textAppearanceLarge"
 				android:layout_marginBottom="10dp"
-				android:textStyle="bold"/>
+				android:textStyle="bold"
+				android:textColor="@color/section_title"/>
 
 			<LinearLayout
 				android:orientation="vertical"
@@ -147,7 +160,7 @@
 				android:background="@drawable/entry"
 				android:id="@+id/ll_home_section_gmschedule_now_content"
 				android:padding="7dp"
-				android:layout_margin="10dp">
+				android:layout_margin="3dp">
 
 				<TextView
 					android:layout_width="wrap_content"
@@ -174,7 +187,7 @@
 				android:background="@drawable/entry"
 				android:id="@+id/ll_home_section_gmschedule_later_content"
 				android:padding="7dp"
-				android:layout_margin="10dp">
+				android:layout_margin="3dp">
 
 				<TextView
 					android:layout_width="wrap_content"
@@ -202,9 +215,12 @@
 			android:layout_height="wrap_content"
 			android:orientation="vertical"
 			android:background="@drawable/section"
-			android:layout_margin="7dp"
-			android:padding="7dp"
-			android:visibility="gone">
+			android:visibility="gone"
+			android:layout_marginLeft="0dp"
+			android:layout_marginTop="2dp"
+			android:layout_marginRight="0dp"
+			android:layout_marginBottom="4dp"
+			android:paddingTop="5dp">
 
 			<TextView
 				android:layout_width="wrap_content"
@@ -212,7 +228,8 @@
 				android:text="@string/home_section_cityschedule"
 				android:textAppearance="?android:attr/textAppearanceLarge"
 				android:layout_marginBottom="10dp"
-				android:textStyle="bold"/>
+				android:textStyle="bold"
+				android:textColor="@color/section_title"/>
 
 			<LinearLayout
 				android:orientation="vertical"
@@ -221,7 +238,7 @@
 				android:background="@drawable/entry"
 				android:id="@+id/ll_home_section_cityschedule_now_content"
 				android:padding="7dp"
-				android:layout_margin="10dp">
+				android:layout_margin="3dp">
 
 				<TextView
                     android:layout_width="wrap_content"
@@ -248,7 +265,7 @@
 				android:background="@drawable/entry"
 				android:id="@+id/ll_home_section_cityschedule_later_content"
 				android:padding="7dp"
-				android:layout_margin="10dp">
+				android:layout_margin="3dp">
 
 				<TextView
 					android:layout_width="wrap_content"
@@ -276,25 +293,29 @@
 			android:layout_height="wrap_content"
 			android:orientation="vertical"
 			android:background="@drawable/section"
-			android:layout_margin="7dp"
-			android:padding="7dp"
-			android:visibility="gone">
+			android:visibility="gone"
+			android:layout_marginLeft="0dp"
+			android:layout_marginTop="2dp"
+			android:layout_marginRight="0dp"
+			android:layout_marginBottom="4dp"
+			android:paddingTop="5dp">
 
 			<TextView
 				android:layout_width="wrap_content"
 				android:layout_height="wrap_content"
 				android:text="@string/home_section_around"
 				android:textAppearance="?android:attr/textAppearanceLarge"
-				android:textStyle="bold"/>
+				android:textStyle="bold"
+				android:textColor="@color/section_title"/>
 
 			<LinearLayout
 				android:id="@+id/ll_home_section_around_content"
 				android:layout_width="match_parent"
 				android:layout_height="wrap_content"
-				android:layout_margin="10dp"
+				android:layout_margin="3dp"
 				android:orientation="vertical"
 				android:background="@drawable/entry"
-				android:padding="7dp">
+				>
 
 			</LinearLayout>
 
@@ -306,22 +327,26 @@
 			android:layout_height="wrap_content"
 			android:orientation="vertical"
 			android:background="@drawable/section"
-			android:layout_margin="7dp"
-			android:padding="7dp"
-			android:visibility="gone">
+			android:visibility="gone"
+			android:layout_marginLeft="0dp"
+			android:layout_marginTop="2dp"
+			android:layout_marginRight="0dp"
+			android:layout_marginBottom="4dp"
+			android:paddingTop="5dp">
 
 			<TextView
 				android:layout_width="wrap_content"
 				android:layout_height="wrap_content"
 				android:text="@string/home_section_activities_future"
 				android:textAppearance="?android:attr/textAppearanceLarge"
-				android:textStyle="bold"/>
+				android:textStyle="bold"
+				android:textColor="@color/section_title"/>
 
 			<LinearLayout
 				android:id="@+id/ll_home_section_activities_future_content"
 				android:layout_width="match_parent"
 				android:layout_height="wrap_content"
-				android:layout_margin="10dp"
+				android:layout_margin="3dp"
 				android:orientation="vertical">
 
 			</LinearLayout>
@@ -334,22 +359,27 @@
 			android:layout_height="wrap_content"
 			android:orientation="vertical"
 			android:background="@drawable/section"
-			android:layout_margin="7dp"
-			android:padding="7dp">
+			android:layout_marginLeft="0dp"
+			android:layout_marginTop="2dp"
+			android:layout_marginRight="0dp"
+			android:layout_marginBottom="4dp"
+			android:paddingTop="5dp">
 
 			<TextView
 				android:layout_width="wrap_content"
 				android:layout_height="wrap_content"
 				android:text="@string/home_section_blog"
 				android:textAppearance="?android:attr/textAppearanceLarge"
-				android:textStyle="bold"/>
+				android:textStyle="bold"
+				android:textColor="@color/section_title"/>
 
 			<LinearLayout
 				android:id="@+id/ll_home_section_blog_content"
 				android:layout_width="match_parent"
 				android:layout_height="wrap_content"
-				android:layout_margin="10dp"
-				android:orientation="vertical">
+				android:layout_margin="3dp"
+				android:orientation="vertical"
+				>
 
 			</LinearLayout>
 
@@ -361,21 +391,25 @@
 			android:layout_height="wrap_content"
 			android:orientation="vertical"
 			android:background="@drawable/section"
-			android:layout_margin="7dp"
-			android:padding="7dp">
+			android:layout_marginLeft="0dp"
+			android:layout_marginTop="2dp"
+			android:layout_marginRight="0dp"
+			android:layout_marginBottom="4dp"
+			android:paddingTop="5dp">
 
 			<TextView
 				android:layout_width="wrap_content"
 				android:layout_height="wrap_content"
 				android:text="@string/home_section_gallery"
 				android:textAppearance="?android:attr/textAppearanceLarge"
-				android:textStyle="bold"/>
+				android:textStyle="bold"
+				android:textColor="@color/section_title"/>
 
 			<LinearLayout
 				android:id="@+id/ll_home_section_gallery_content"
 				android:layout_width="match_parent"
 				android:layout_height="wrap_content"
-				android:layout_margin="10dp"
+				android:layout_margin="3dp"
 				android:orientation="vertical"
 				android:background="@drawable/entry"
 				android:padding="7dp">
@@ -510,22 +544,26 @@
 			android:layout_height="wrap_content"
 			android:orientation="vertical"
 			android:background="@drawable/section"
-			android:layout_margin="7dp"
-			android:padding="7dp"
-			android:visibility="gone">
+			android:visibility="gone"
+			android:layout_marginLeft="0dp"
+			android:layout_marginTop="2dp"
+			android:layout_marginRight="0dp"
+			android:layout_marginBottom="4dp"
+			android:paddingTop="5dp">
 
 			<TextView
 				android:layout_width="wrap_content"
 				android:layout_height="wrap_content"
 				android:text="@string/home_section_activities_past"
 				android:textAppearance="?android:attr/textAppearanceLarge"
-				android:textStyle="bold"/>
+				android:textStyle="bold"
+				android:textColor="@color/section_title"/>
 
 			<LinearLayout
 				android:id="@+id/ll_home_section_activities_past_content"
 				android:layout_width="match_parent"
 				android:layout_height="wrap_content"
-				android:layout_margin="10dp"
+				android:layout_margin="3dp"
 				android:orientation="vertical">
 
 			</LinearLayout>
@@ -538,21 +576,25 @@
 			android:layout_height="wrap_content"
 			android:orientation="vertical"
 			android:background="@drawable/section"
-			android:layout_margin="7dp"
-			android:padding="7dp">
+			android:layout_marginLeft="0dp"
+			android:layout_marginTop="2dp"
+			android:layout_marginRight="0dp"
+			android:layout_marginBottom="4dp"
+			android:paddingTop="5dp">
 
 			<TextView
 				android:layout_width="wrap_content"
 				android:layout_height="wrap_content"
 				android:text="@string/home_section_social"
 				android:textAppearance="?android:attr/textAppearanceLarge"
-				android:textStyle="bold"/>
+				android:textStyle="bold"
+				android:textColor="@color/section_title"/>
 
 			<LinearLayout
 				android:id="@+id/ll_home_section_social_content"
 				android:layout_width="match_parent"
 				android:layout_height="wrap_content"
-				android:layout_margin="10dp"
+				android:layout_margin="3dp"
 				android:orientation="vertical"
 				android:background="@drawable/entry"
 				android:padding="7dp">

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

@@ -12,8 +12,9 @@
 		android:layout_width="match_parent"
 		android:layout_height="match_parent"
 		android:background="@drawable/section"
-		android:layout_margin="7dp"
-		android:padding="7dp">
+		android:layout_marginTop="2dp"
+		android:layout_marginBottom="4dp"
+		android:paddingTop="5dp">
 
 		<TextView
 			android:layout_width="wrap_content"
@@ -21,7 +22,9 @@
 			android:textAppearance="@android:style/TextAppearance.Large"
 			android:text="@string/menu_location"
 			android:id="@+id/textView2"
-			android:textStyle="bold"/>
+			android:textStyle="bold"
+			android:layout_marginLeft="10dp"
+			android:textColor="@color/section_title"/>
 
 		<LinearLayout
 			android:orientation="vertical"

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

@@ -8,15 +8,18 @@
     <TextView
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:textAppearance="?android:attr/textAppearanceLarge"
-        android:id="@+id/tv_row_home_blog_title" />
+        android:textAppearance="?android:attr/textAppearanceMedium"
+        android:id="@+id/tv_row_home_blog_title"
+        android:textColor="@color/entry_title"
+        android:textStyle="bold"/>
 
     <TextView
         android:layout_width="match_parent"
         android:layout_height="0dp"
         android:textAppearance="?android:attr/textAppearanceSmall"
         android:id="@+id/tv_row_home_blog_date"
-        android:layout_weight=".5" />
+        android:layout_weight=".5"
+        android:textStyle="italic"/>
 
     <TextView
         android:layout_width="wrap_content"

+ 12 - 0
app/src/main/res/menu/menu.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+    <item
+        android:id="@+id/pop_menu_about"
+        android:title="@string/pop_menu_about" />
+    <item
+        android:id="@+id/pop_menu_sponsors"
+        android:title="@string/pop_menu_sponsors" />
+    <item
+        android:id="@+id/pop_menu_settings"
+        android:title="@string/pop_menu_settings" />
+</menu>

+ 7 - 4
app/src/main/res/values/color.xml

@@ -3,16 +3,18 @@
 
     <!-- Backgrounds for several sections -->
     
-    <color name="background_app">#c6e4f6</color>
+    <color name="background_app">#e4f4fd</color>
     <color name="background_menu">#4c9ed8</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="section_background">#d9ecf9</color>
+    <color name="section_border">#badde1</color>
+    <color name="section_title">#07383e</color>
     <color name="entry_background">#ffffff</color>
-    <color name="entry_border">#9cd3d9</color>
+    <color name="entry_border">#d8f3f5</color>
+    <color name="entry_title">#41786e</color>
     
     <!--Color for the menu entries-->
     <color name="menu_entry">#ffffff</color>
@@ -21,6 +23,7 @@
 
     <color name="background_bar">#9bc1da</color>
     <color name="background_bar_gradient">#bdf8fd</color>
+    <color name="menu_selected">#456075</color>
 
     <!--Color for input fields-->
     <color name="input_background">#223344</color>

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

@@ -179,6 +179,32 @@
 
 	<!-- Misc strings -->
 
+
+	<!-- Pop-up menu entry strings -->
+	<string name="pop_menu_settings">Settings</string>
+	<string name="pop_menu_about">About us</string>
+	<string name="pop_menu_sponsors">Sponsors</string>
+
+	<!--Preferences screen-->
+	<string name="preferences">Preferences</string>
+	<string name="preferences_sync">Sync</string>
+	<string name="preferences_sync_sync">Background Sync</string>
+	<string name="preferences_sync_sync_on">Background sync is enabled</string>
+	<string name="preferences_sync_sync_off">Background sync is disabled</string>
+	<string name="preferences_sync_notifications">Notifications</string>
+	<string name="preferences_sync_notifications_on">Notifications will be received</string>
+	<string name="preferences_sync_notifications_off">Notifications will not be received</string>
+	<string name="preferences_sync_notifications_disabled">Enable background sync to enable notifications</string>
+	<string name="preferences_sync_usage">Background data usage</string>
+	<string name="preferences_info">Information</string>
+	<string name="preferences_info_version">App version</string>
+	<string name="preferences_info_source">Source code</string>
+	<string name="preferences_info_source_summary">Checkout source code on Github</string>
+	<string name="preferences_info_feedback">Feedback</string>
+	<string name="preferences_info_feedback_summary">Send anonymous feedback to the developer</string>
+
 	<string name="eur" translatable="false">€</string>
+	<string name="Kb" translatable="false"> Kb</string>
+	<string name="Mb" translatable="false"> Mb</string>
 	
 </resources>

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

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