ソースを参照

Improved section toolbar. Added basic settings menu.

seavenois 10 年 前
コミット
61aad62662

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

@@ -49,10 +49,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="com.ivalentin.margolariak.SettingsFragment"
+            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"

+ 8 - 0
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;
 
 	/**

+ 117 - 18
app/src/main/java/com/ivalentin/margolariak/MainActivity.java

@@ -13,20 +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.preference.PreferenceActivity;
+import android.support.v4.view.MenuItemCompat;
 import android.util.Log;
 import android.view.Gravity;
 import android.view.KeyEvent;
+import android.view.Menu;
 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.RelativeLayout;
@@ -44,14 +48,79 @@ public class MainActivity extends Activity{
 	//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(2).setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
+			@Override
+			public boolean onMenuItemClick(MenuItem item) {
+				Intent intent = new Intent(MainActivity.this, SettingsFragment.class);
+				startActivity(intent);
+
+				return true;
+			}
+		});
+
 		popup.show();
 	}
 
+//	@Override
+//	public boolean onCreateOptionsMenu(Menu menu) {
+//		Log.e("MENU", "CREATED");
+//		getMenuInflater().inflate(R.menu.menu, menu);
+//		Log.e("SETT", String.valueOf(R.id.pop_menu_settings));
+//		for (int i = 0; i< menu.size() ;i++) {
+//			MenuItem menuItem = menu.getItem(i);
+//			Log.e("MENU", String.valueOf(menuItem.getItemId()));
+//
+//			if (menuItem.getItemId() == R.id.pop_menu_settings) {
+//				View view = MenuItemCompat.getActionView(menuItem);
+//				if (view != null) {
+//					view.setOnClickListener(new OnClickListener() {
+//
+//						@Override
+//						public void onClick(View v) {
+//							Intent intent = new Intent(MainActivity.this, SettingsFragment.class);
+//							startActivity(intent);
+//						}
+//					});
+//				}
+//			}
+//		}
+//		return true;
+//	}
+
+	@Override
+	public boolean onOptionsItemSelected(MenuItem item) {
+		Log.e("MENU","SELECTED");
+		// Handle item selection
+		switch (item.getItemId()) {
+			case R.id.pop_menu_about:
+				//TODO
+				return true;
+			case R.id.pop_menu_sponsors:
+				//TODO
+				return true;
+			case R.id.pop_menu_settings:
+				Log.e("MENU","SETTINGS");
+				Intent intent = new Intent( this, SettingsFragment.class );
+				//intent.putExtra( PreferenceActivity.EXTRA_SHOW_FRAGMENT, Fragment1.class.getName() );
+				//intent.putExtra( PreferenceActivity.EXTRA_NO_HEADERS, true );
+				startActivity(intent);
+				return true;
+			default:
+				return super.onOptionsItemSelected(item);
+		}
+	}
+
 	/**
 	 * Loads a section in the main screen.
 	 * 
@@ -64,15 +133,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:
@@ -85,6 +166,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:
@@ -92,6 +175,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:
@@ -99,40 +184,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){
-			//TODO: Change tabs
-		}
-			//mLayout.toggleMenu();
 	}
 
 	/**
@@ -191,19 +273,36 @@ public class MainActivity extends Activity{
 		//Remove title bar.
 	    this.requestWindowFeature(Window.FEATURE_NO_TITLE);
 	    super.onCreate(savedInstanceState);
-	    
+
 	    //Set layout.
 		setContentView(R.layout.activity_main);
 
 		//Assign menu items
-		RelativeLayout menuItem[] = new RelativeLayout[6];
+		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);
-		//TextView menuSpacer = (TextView) findViewById(R.id.menu_space);
+		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];
@@ -583,7 +682,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);

+ 17 - 0
app/src/main/java/com/ivalentin/margolariak/SettingsFragment.java

@@ -0,0 +1,17 @@
+package com.ivalentin.margolariak;
+
+import android.os.Bundle;
+import android.preference.PreferenceActivity;
+import android.preference.PreferenceFragment;
+import android.util.Log;
+
+public class SettingsFragment extends PreferenceActivity {
+	@Override
+	public void onCreate(Bundle savedInstanceState) {
+		super.onCreate(savedInstanceState);
+
+		// Load the preferences from an XML resource
+		addPreferencesFromResource(R.xml.preferences);
+		Log.e("PREFERENCES", "STARED");
+	}
+}

+ 271 - 257
app/src/main/res/layout/activity_main.xml

@@ -1,288 +1,300 @@
-<ScrollView
+<LinearLayout
 	xmlns:android="http://schemas.android.com/apk/res/android"
 	android:layout_width="match_parent"
-	android:layout_height="wrap_content">
+	android:layout_height="fill_parent"
+	android:orientation="vertical">
 
 	<LinearLayout
-		android:layout_width="match_parent"
+		android:layout_width="fill_parent"
 		android:layout_height="wrap_content"
-		android:orientation="vertical">
+		android:background="@drawable/titlebar"
+		android:gravity="center_vertical"
+		android:orientation="horizontal"
+		android:padding="2dp">
+
+		<!-- Button to open 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 -->
 
 		<LinearLayout
-			android:layout_width="fill_parent"
+			android:layout_width="wrap_content"
 			android:layout_height="wrap_content"
-			android:background="@drawable/titlebar"
-			android:gravity="center_vertical"
-			android:orientation="horizontal"
-			android:padding="2dp">
+			android:layout_gravity="center"
+			android:layout_weight=".8"
+			android:gravity="center"
+			android:orientation="vertical" >
 
-			<!-- Button to open slider menu -->
+			<!-- App name. Remains unchanged -->
 
-			<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"/>
+			<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" />
 
-			<!-- Layout with the app title and current section -->
+			<!-- Section title -->
 
-			<LinearLayout
+			<TextView
+				android:id="@+id/activity_main_content_title"
 				android:layout_width="wrap_content"
 				android:layout_height="wrap_content"
-				android:layout_gravity="center"
-				android:layout_weight=".8"
 				android:gravity="center"
-				android:orientation="vertical" >
+				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 -->
 
-				<!-- App name. Remains unchanged -->
+	<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: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: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 -->
+					android:textAppearance="?android:attr/textAppearanceMedium"
+					android:text="@string/menu_home"
+					android:layout_gravity="top"
+					android:textSize="15sp"
+					android:layout_centerInParent="true"
+					android:textStyle="bold"
+					android:id="@+id/tv_menu_home"/>
+
+				<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/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" />
+					android:textAppearance="?android:attr/textAppearanceMedium"
+					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">
 
-			</LinearLayout>
+				<TextView
+					android:layout_width="wrap_content"
+					android:layout_height="wrap_content"
+					android:textAppearance="?android:attr/textAppearanceMedium"
+					android:text="@string/menu_lablanca"
+					android:layout_gravity="top"
+					android:textSize="15sp"
+					android:layout_centerInParent="true"
+					android:id="@+id/tv_menu_lablanca"/>
+
+				<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">
 
-			<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" />
-
-			<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"/>
+				<TextView
+					android:layout_width="wrap_content"
+					android:layout_height="wrap_content"
+					android:textAppearance="?android:attr/textAppearanceMedium"
+					android:text="@string/menu_activities"
+					android:layout_gravity="top"
+					android:textSize="15sp"
+					android:layout_centerInParent="true"
+					android:id="@+id/tv_menu_activities"/>
+
+				<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">
 
-		</LinearLayout>
+				<TextView
+					android:layout_width="wrap_content"
+					android:layout_height="wrap_content"
+					android:textAppearance="?android:attr/textAppearanceMedium"
+					android:text="@string/menu_blog"
+					android:layout_gravity="top"
+					android:textSize="15sp"
+					android:layout_centerInParent="true"
+					android:id="@+id/tv_menu_blog"/>
+
+				<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">
 
-		<!-- The part where the fragments will be loaded -->
+				<TextView
+					android:layout_width="wrap_content"
+					android:layout_height="wrap_content"
+					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="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>
 
-		<HorizontalScrollView
-			android:layout_width="wrap_content"
-			android:layout_height="50dp"
-			android:id="@+id/horizontalScrollView"
-			android:scrollIndicators="none"
-			android:background="@color/background_bar_gradient">
+		</LinearLayout>
+	</HorizontalScrollView>
 
-			<LinearLayout
-				android:orientation="horizontal"
-				android:layout_width="wrap_content"
-				android:layout_height="match_parent"
-				>
-
-				<RelativeLayout
-					android:orientation="vertical"
-					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:layout_width="wrap_content"
-						android:layout_height="wrap_content"
-						android:textAppearance="?android:attr/textAppearanceMedium"
-						android:text="@string/menu_home"
-						android:layout_gravity="top"
-						android:textSize="15sp"
-						android:layout_centerInParent="true"/>
-
-					<ImageView
-						android:layout_width="match_parent"
-						android:layout_height="8dp"
-						android:id="@+id/iv_menu_home"
-						android:background="#0000dd"
-						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:layout_width="wrap_content"
-						android:layout_height="wrap_content"
-						android:textAppearance="?android:attr/textAppearanceMedium"
-						android:text="@string/menu_location"
-						android:layout_gravity="top"
-						android:textSize="15sp"
-						android:layout_centerInParent="true"/>
-
-					<ImageView
-						android:layout_width="match_parent"
-						android:layout_height="2dp"
-						android:id="@+id/iv_menu_location"
-						android:background="#0000dd"
-						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:layout_width="wrap_content"
-						android:layout_height="wrap_content"
-						android:textAppearance="?android:attr/textAppearanceMedium"
-						android:text="@string/menu_lablanca"
-						android:layout_gravity="top"
-						android:textSize="15sp"
-						android:layout_centerInParent="true"/>
-
-					<ImageView
-						android:layout_width="match_parent"
-						android:layout_height="2dp"
-						android:id="@+id/iv_menu_lablanca"
-						android:background="#0000dd"
-						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:layout_width="wrap_content"
-						android:layout_height="wrap_content"
-						android:textAppearance="?android:attr/textAppearanceMedium"
-						android:text="@string/menu_activities"
-						android:layout_gravity="top"
-						android:textSize="15sp"
-						android:layout_centerInParent="true"/>
-
-					<ImageView
-						android:layout_width="match_parent"
-						android:layout_height="2dp"
-						android:id="@+id/iv_menu_activities"
-						android:background="#0000dd"
-						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:layout_width="wrap_content"
-						android:layout_height="wrap_content"
-						android:textAppearance="?android:attr/textAppearanceMedium"
-						android:text="@string/menu_blog"
-						android:layout_gravity="top"
-						android:textSize="15sp"
-						android:layout_centerInParent="true"/>
-
-					<ImageView
-						android:layout_width="match_parent"
-						android:layout_height="2dp"
-						android:id="@+id/iv_menu_blog"
-						android:background="#0000dd"
-						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="wrap_content"
-						android:layout_height="wrap_content"
-						android:textAppearance="?android:attr/textAppearanceMedium"
-						android:text="@string/menu_gallery"
-						android:layout_gravity="top"
-						android:textSize="15sp"
-						android:layout_centerInParent="true"/>
-
-					<ImageView
-						android:layout_width="match_parent"
-						android:layout_height="2dp"
-						android:id="@+id/iv_menu_gallery"
-						android:background="#0000dd"
-						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>
+	<ScrollView
+		android:layout_width="fill_parent"
+		android:layout_height="wrap_content"
+		android:id="@+id/sv_main_content">
 
 		<FrameLayout
 			android:id="@+id/activity_main_content_fragment"
@@ -290,5 +302,7 @@
 			android:layout_height="match_parent">
 
 		</FrameLayout>
-	</LinearLayout>
-</ScrollView>
+	</ScrollView>
+
+</LinearLayout>
+

+ 3 - 3
app/src/main/res/menu/menu.xml

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

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

@@ -21,6 +21,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>

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

@@ -185,6 +185,24 @@
 	<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>
 	
 </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="pref_sync_sync"
+            android:title="@string/preferences_sync_sync"
+            android:summary="@string/preferences_sync_sync_on"
+            android:defaultValue="true" />
+        <CheckBoxPreference
+            android:key="pref_sync_notifications"
+            android:title="@string/preferences_sync_notifications"
+            android:summary="@string/preferences_sync_notifications_on"
+            android:defaultValue="true" />
+        <Preference
+            android:key="pref_sync_usage"
+            android:title="@string/preferences_sync_usage"
+            android:summary="0 kb" />
+
+    </PreferenceCategory>
+
+    <PreferenceCategory
+        android:title="@string/preferences_info">
+
+        <Preference
+            android:key="pref_sync_usage"
+            android:title="@string/preferences_info_version"
+            android:summary="_" />
+
+        <Preference
+            android:key="pref_sync_source"
+            android:title="@string/preferences_info_source"
+            android:summary="@string/preferences_info_source_summary" />
+
+        <Preference
+            android:key="pref_sync_feedback"
+            android:title="@string/preferences_info_feedback"
+            android:summary="@string/preferences_info_feedback_summary" />
+
+    </PreferenceCategory>
+
+</PreferenceScreen>