Pārlūkot izejas kodu

UI revamped for the home page.

seavenois 9 gadi atpakaļ
vecāks
revīzija
7677893d74

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

@@ -673,9 +673,7 @@ public class HomeLayout extends Fragment implements LocationListener {
 			} else {
 				text = Html.fromHtml(cursor.getString(6)).toString();
 			}
-			if (text.length() > 100) {
-				text = text.substring(0, 100) + "...";
-			}
+
 			TextView tvText = (TextView) entry.findViewById(R.id.tv_row_home_activity_text);
 			tvText.setText(text);
 
@@ -807,9 +805,6 @@ public class HomeLayout extends Fragment implements LocationListener {
 
 				//Set text
 				String text = Html.fromHtml(cursor.getString(4)).toString();
-				if (text.length() > 100) {
-					text = text.substring(0, 100) + "...";
-				}
 				TextView tvText = (TextView) entry.findViewById(R.id.tv_row_home_activity_text);
 				tvText.setText(text);
 
@@ -929,9 +924,6 @@ public class HomeLayout extends Fragment implements LocationListener {
 
 			//Set text
 			String text = Html.fromHtml(cursor.getString(2)).toString();
-			if (text.length() > 100) {
-				text = text.substring(0, 100) + "...";
-			}
 			TextView tvText = (TextView) entry.findViewById(R.id.tv_row_home_blog_text);
 			tvText.setText(text);
 

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

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
+
+    <gradient
+        android:angle="90"
+        android:endColor="#00ffffff"
+        android:startColor="#ffffffff"
+        android:type="linear" />
+
+    <corners
+        android:radius="0dp"/>
+
+</shape>

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

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

+ 66 - 52
app/src/main/res/layout/fragment_layout_home.xml

@@ -1,5 +1,6 @@
 <com.ivalentin.margolariak.CustomScrollView
 	xmlns:android="http://schemas.android.com/apk/res/android"
+	xmlns:app="http://schemas.android.com/apk/res-auto"
 	xmlns:tools="http://schemas.android.com/tools"
 	android:id="@+id/sh_home_layout"
     android:layout_width="fill_parent"
@@ -46,11 +47,12 @@
 				android:layout_margin="8dp">
 
 				<TextView
-					android:layout_width="wrap_content"
+					android:layout_width="match_parent"
 					android:layout_height="wrap_content"
-					android:textAppearance="@android:style/TextAppearance.Medium"
-					android:text="@string/home_section_location_text_0"
-					android:id="@+id/textView9"/>
+					android:textAppearance="?android:attr/textAppearanceMedium"
+					android:textColor="@color/entry_title"
+					android:textStyle="bold"
+					android:text="@string/home_section_location_text_0"/>
 
 				<LinearLayout
 					android:orientation="horizontal"
@@ -131,8 +133,14 @@
 					android:id="@+id/tv_home_section_lablanca_text"
 					android:layout_weight=".6"
 					android:padding="7dp"
-					android:maxLines="4"
-					android:ellipsize="end"/>
+					android:maxLines="4"/>
+
+				<ImageView
+					android:layout_width="match_parent"
+					android:layout_weight="1"
+					android:layout_height="40dp"
+					android:layout_marginTop="-40dp"
+					android:background="@drawable/gradient_v_white"/>
 
 			</LinearLayout>
 		</LinearLayout>
@@ -172,11 +180,12 @@
 				android:layout_margin="8dp">
 
 				<TextView
-					android:layout_width="wrap_content"
+					android:layout_width="match_parent"
 					android:layout_height="wrap_content"
-					android:textAppearance="@android:style/TextAppearance.Medium"
-					android:text="@string/schedule_now"
-					android:textStyle="bold"/>
+					android:textAppearance="?android:attr/textAppearanceMedium"
+					android:textColor="@color/entry_title"
+					android:textStyle="bold"
+					android:text="@string/schedule_now"/>
 
 				<LinearLayout
 					android:id="@+id/ll_home_section_gmschedule_now_list"
@@ -199,11 +208,12 @@
 				android:layout_margin="8dp">
 
 				<TextView
-					android:layout_width="wrap_content"
+					android:layout_width="match_parent"
 					android:layout_height="wrap_content"
-					android:textAppearance="@android:style/TextAppearance.Medium"
-					android:text="@string/schedule_later"
-					android:textStyle="bold"/>
+					android:textAppearance="?android:attr/textAppearanceMedium"
+					android:textColor="@color/entry_title"
+					android:textStyle="bold"
+					android:text="@string/schedule_later"/>
 
 				<LinearLayout
 					android:id="@+id/ll_home_section_gmschedule_later_list"
@@ -253,11 +263,12 @@
 				android:layout_margin="8dp">
 
 				<TextView
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:textAppearance="@android:style/TextAppearance.Medium"
-                    android:text="@string/schedule_now"
-					android:textStyle="bold"/>
+					android:layout_width="match_parent"
+					android:layout_height="wrap_content"
+					android:textAppearance="?android:attr/textAppearanceMedium"
+					android:textColor="@color/entry_title"
+					android:textStyle="bold"
+                    android:text="@string/schedule_now"/>
 
 				<LinearLayout
                     android:id="@+id/ll_home_section_cityschedule_now_list"
@@ -280,11 +291,12 @@
 				android:layout_margin="8dp">
 
 				<TextView
-					android:layout_width="wrap_content"
+					android:layout_width="match_parent"
 					android:layout_height="wrap_content"
-					android:textAppearance="@android:style/TextAppearance.Medium"
-					android:text="@string/schedule_later"
-					android:textStyle="bold"/>
+					android:textAppearance="?android:attr/textAppearanceMedium"
+					android:textColor="@color/entry_title"
+					android:textStyle="bold"
+					android:text="@string/schedule_later"/>
 
 				<LinearLayout
 					android:id="@+id/ll_home_section_cityschedule_later_list"
@@ -402,7 +414,7 @@
 				android:layout_width="match_parent"
 				android:layout_height="wrap_content"
 				android:orientation="vertical"
-				>
+				android:layout_margin="8dp">
 
 			</LinearLayout>
 
@@ -459,9 +471,9 @@
 							android:layout_height="wrap_content"
 							android:id="@+id/iv_home_section_gallery_0"
 							android:contentDescription="@string/app_cdesc"
-							android:layout_margin="7dp"
-							android:padding="1dp"
-							android:background="@color/album_border"
+							android:layout_margin="3dp"
+							android:padding="0.5dp"
+							android:background="@color/image_border"
 							android:adjustViewBounds="true"
 							/>
 					</LinearLayout>
@@ -478,9 +490,9 @@
 							android:layout_height="wrap_content"
 							android:id="@+id/iv_home_section_gallery_1"
 							android:contentDescription="@string/app_cdesc"
-							android:layout_margin="7dp"
-							android:background="@color/album_border"
-							android:padding="1dp"
+							android:layout_margin="3dp"
+							android:background="@color/image_border"
+							android:padding="0.5dp"
 							android:adjustViewBounds="true"
 							/>
 					</LinearLayout>
@@ -505,9 +517,9 @@
 							android:layout_height="wrap_content"
 							android:id="@+id/iv_home_section_gallery_2"
 							android:contentDescription="@string/app_cdesc"
-							android:layout_margin="7dp"
-							android:padding="1dp"
-							android:background="@color/album_border"
+							android:layout_margin="3dp"
+							android:padding="0.5dp"
+							android:background="@color/image_border"
 							android:adjustViewBounds="true"
 							/>
 					</LinearLayout>
@@ -524,9 +536,9 @@
 							android:layout_height="wrap_content"
 							android:id="@+id/iv_home_section_gallery_3"
 							android:contentDescription="@string/app_cdesc"
-							android:layout_margin="7dp"
-							android:background="@color/album_border"
-							android:padding="1dp"
+							android:layout_margin="3dp"
+							android:background="@color/image_border"
+							android:padding="0.5dp"
 							android:adjustViewBounds="true"
 							/>
 					</LinearLayout>
@@ -642,40 +654,40 @@
 						android:id="@+id/iv_home_section_social_phone"
 						android:layout_width="wrap_content"
 						android:layout_height="wrap_content"
-						android:layout_margin="10dp"
+						android:layout_margin="5dp"
 						android:adjustViewBounds="true"
 						android:contentDescription="@string/social_phone"
-						android:maxWidth="50dp"
+						android:maxWidth="60dp"
 						android:src="@drawable/social_phone"/>
 
 					<ImageView
 						android:id="@+id/iv_home_section_social_mail"
 						android:layout_width="wrap_content"
 						android:layout_height="wrap_content"
-						android:layout_margin="10dp"
+						android:layout_margin="5dp"
 						android:adjustViewBounds="true"
 						android:contentDescription="@string/social_mail"
-						android:maxWidth="50dp"
+						android:maxWidth="60dp"
 						android:src="@drawable/social_mail" />
 
 					<ImageView
 						android:id="@+id/iv_home_section_social_whatsapp"
 						android:layout_width="wrap_content"
 						android:layout_height="wrap_content"
-						android:layout_margin="10dp"
+						android:layout_margin="5dp"
 						android:adjustViewBounds="true"
 						android:contentDescription="@string/social_whatsapp"
-						android:maxWidth="50dp"
+						android:maxWidth="60dp"
 						android:src="@drawable/social_whatsapp" />
 
 					<ImageView
 						android:id="@+id/iv_home_section_social_facebook"
 						android:layout_width="wrap_content"
 						android:layout_height="wrap_content"
-						android:layout_margin="10dp"
+						android:layout_margin="5dp"
 						android:adjustViewBounds="true"
 						android:contentDescription="@string/social_facebook"
-						android:maxWidth="50dp"
+						android:maxWidth="60dp"
 						android:src="@drawable/social_facebook" />
 				</LinearLayout>
 
@@ -688,42 +700,44 @@
 						android:id="@+id/iv_home_section_social_twitter"
 						android:layout_width="wrap_content"
 						android:layout_height="wrap_content"
-						android:layout_margin="10dp"
+						android:layout_margin="5dp"
 						android:adjustViewBounds="true"
 						android:contentDescription="@string/social_twitter"
-						android:maxWidth="50dp"
+						android:maxWidth="60dp"
 						android:src="@drawable/social_twitter" />
 
 					<ImageView
 						android:id="@+id/iv_home_section_social_googleplus"
 						android:layout_width="wrap_content"
 						android:layout_height="wrap_content"
-						android:layout_margin="10dp"
+						android:layout_margin="5dp"
 						android:adjustViewBounds="true"
 						android:contentDescription="@string/social_googleplus"
-						android:maxWidth="50dp"
+						android:maxWidth="60dp"
 						android:src="@drawable/social_googleplus" />
 
 					<ImageView
 						android:id="@+id/iv_home_section_social_youtube"
 						android:layout_width="wrap_content"
 						android:layout_height="wrap_content"
-						android:layout_margin="10dp"
+						android:layout_margin="5dp"
 						android:adjustViewBounds="true"
 						android:contentDescription="@string/social_youtube"
-						android:maxWidth="50dp"
+						android:maxWidth="60dp"
 						android:src="@drawable/social_youtube" />
 
 					<ImageView
 						android:id="@+id/iv_home_section_social_instagram"
 						android:layout_width="wrap_content"
 						android:layout_height="wrap_content"
-						android:layout_margin="10dp"
+						android:layout_margin="5dp"
 						android:adjustViewBounds="true"
 						android:contentDescription="@string/social_instagram"
-						android:maxWidth="50dp"
+						android:maxWidth="60dp"
 						android:src="@drawable/social_instagram" />
+
 				</LinearLayout>
+
 			</LinearLayout>
 
 		</LinearLayout>

+ 57 - 33
app/src/main/res/layout/row_home_activities.xml

@@ -7,19 +7,13 @@
               android:layout_margin="8dp">
 
     <TextView
-        android:layout_width="wrap_content"
+        android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:textAppearance="?android:attr/textAppearanceLarge"
+        android:textAppearance="?android:attr/textAppearanceMedium"
+        android:textColor="@color/entry_title"
+        android:textStyle="bold"
         android:id="@+id/tv_row_home_activity_title" />
 
-    <TextView
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:textAppearance="?android:attr/textAppearanceSmall"
-        android:id="@+id/tv_row_home_activity_date"
-        android:gravity="end"
-        android:textStyle="italic" />
-
     <TextView
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
@@ -40,35 +34,65 @@
             android:maxWidth="130dp"
             android:layout_weight=".8"
             android:layout_margin="3dp"
-            android:layout_gravity="center_vertical"
-            android:adjustViewBounds="true"/>
+            android:layout_gravity="top"
+            android:adjustViewBounds="true"
+            android:background="@color/image_border"
+            android:padding="0.5dp"/>
 
-        <TextView
-            android:layout_width="fill_parent"
+        <LinearLayout
+            android:orientation="vertical"
             android:layout_height="wrap_content"
-            android:id="@+id/tv_row_home_activity_text"
             android:layout_weight=".2"
-            android:textAppearance="@android:style/TextAppearance.Medium"
-            android:layout_margin="5dp" />
-    </LinearLayout>
+            android:layout_width="match_parent"
+            android:layout_gravity="top">
 
-    <LinearLayout
-        android:orientation="horizontal"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent" >
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:textAppearance="?android:attr/textAppearanceSmall"
+                android:id="@+id/tv_row_home_activity_date"
+                android:gravity="end"
+                android:textStyle="italic"
+                android:layout_weight="1"
+                android:layout_marginTop="4dp"
+                android:layout_marginStart="8dp"
+                android:layout_marginLeft="8dp"/>
 
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:textAppearance="?android:attr/textAppearanceSmall"
-            android:id="@+id/tv_row_home_activity_city" />
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:textAppearance="?android:attr/textAppearanceSmall"
+                android:id="@+id/tv_row_home_activity_city"
+                android:layout_weight="1"
+                android:layout_marginLeft="8dp"
+                android:layout_marginStart="8dp"/>
+
+            <TextView
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:id="@+id/tv_row_home_activity_text"
+                android:layout_weight="1"
+                android:textAppearance="@android:style/TextAppearance.Medium"
+                android:layout_margin="5dp"
+                android:maxLines="4"/>
+
+            <ImageView
+                android:layout_width="match_parent"
+                android:layout_weight="1"
+                android:layout_height="40dp"
+                android:layout_marginTop="-40dp"
+                android:background="@drawable/gradient_v_white"/>
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:textAppearance="?android:attr/textAppearanceSmall"
+                android:id="@+id/tv_row_home_activity_price"
+                android:layout_weight="1"
+                android:layout_marginLeft="35dp"
+                android:layout_marginStart="35dp"/>
+        </LinearLayout>
 
-        <TextView
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:textAppearance="?android:attr/textAppearanceSmall"
-            android:id="@+id/tv_row_home_activity_price"
-            android:gravity="end" />
     </LinearLayout>
 
 </LinearLayout>

+ 39 - 17
app/src/main/res/layout/row_home_blog.xml

@@ -7,25 +7,16 @@
               android:layout_margin="8dp">
 
     <TextView
+        android:id="@+id/tv_row_home_blog_title"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         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:textStyle="italic"/>
-
     <TextView
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:text="New Text"
         android:id="@+id/tv_row_home_blog_hidden"
         android:visibility="gone" />
 
@@ -42,16 +33,47 @@
             android:maxWidth="130dp"
             android:layout_weight=".7"
             android:layout_margin="3dp"
-            android:layout_gravity="center_vertical"
-            android:adjustViewBounds="true"/>
+            android:adjustViewBounds="true"
+            android:padding="0.5dp"
+            android:background="@color/image_border"
+            android:layout_gravity="top"/>
 
-        <TextView
-            android:layout_width="fill_parent"
+        <LinearLayout
+            android:orientation="vertical"
+            android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:id="@+id/tv_row_home_blog_text"
             android:layout_weight=".3"
-            android:textAppearance="@android:style/TextAppearance.Medium"
-            android:layout_margin="5dp" />
+            android:layout_gravity="top">
+
+            <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=".3"
+                android:textStyle="italic"
+                android:layout_marginTop="4dp"
+                android:layout_marginStart="8dp"
+                android:layout_marginLeft="8dp"/>
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:id="@+id/tv_row_home_blog_text"
+                android:layout_weight=".3"
+                android:textAppearance="@android:style/TextAppearance.Medium"
+                android:layout_margin="5dp"
+                android:maxLines="4"/>
+
+            <ImageView
+                android:layout_width="match_parent"
+                android:layout_weight="1"
+                android:layout_height="40dp"
+                android:layout_marginTop="-40dp"
+                android:background="@drawable/gradient_v_white"/>
+
+        </LinearLayout>
+
     </LinearLayout>
 
 </LinearLayout>

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

@@ -15,7 +15,10 @@
     <color name="section_title_background">#0078ff</color>
     <color name="entry_background">#ffffff</color>
     <color name="entry_border">#6D6990</color>
-    <color name="entry_title">#41786e</color>
+    <color name="entry_title">#275573</color>
+
+    <!--Color for the border of the image-->
+    <color name="image_border">#292690</color>
     
     <!--Color for the menu entries-->
     <color name="menu_entry">#ffffff</color>