Răsfoiți Sursa

Imrpoved UI for the festival section. HW acceleration for some WebViews.

seavenois 10 ani în urmă
părinte
comite
396eff541b

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

@@ -2,8 +2,8 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
           xmlns:tools="http://schemas.android.com/tools"
           package="com.ivalentin.margolariak"
-    android:versionCode="15"
-    android:versionName="2.0.1" >
+    android:versionCode="17"
+    android:versionName="2.0.3" >
 
     <uses-permission android:name="android.permission.INTERNET" />
     <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>

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

@@ -9,6 +9,7 @@ import android.database.Cursor;
 import android.database.sqlite.SQLiteDatabase;
 import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
+import android.os.Build;
 import android.os.Bundle;
 import android.app.Fragment;
 import android.support.v4.app.ActivityCompat;
@@ -102,7 +103,13 @@ public class ActivityFutureLayout extends Fragment implements OnMapReadyCallback
         //Set fields
         tvTitle.setText(cursor.getString(1));
         ((MainActivity) getActivity()).setSectionTitle(cursor.getString(1));
-        wvText.loadDataWithBaseURL(null, cursor.getString(2), "text/html", "utf-8", null);
+		if (Build.VERSION.SDK_INT >= 19) {
+			wvText.setLayerType(View.LAYER_TYPE_HARDWARE, null);
+		}
+		else {
+			wvText.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
+		}
+		wvText.loadDataWithBaseURL(null, cursor.getString(2), "text/html", "utf-8", null);
         tvDate.setText(GM.formatDate(cursor.getString(3) + " 00:00:00", lang, false));
         tvPrice.setText(String.format(getString(R.string.price), cursor.getInt(5)));
         tvCity.setText(cursor.getString(4));

+ 7 - 0
app/src/main/java/com/ivalentin/margolariak/ActivityPastLayout.java

@@ -6,6 +6,7 @@ import android.database.Cursor;
 import android.database.sqlite.SQLiteDatabase;
 import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
+import android.os.Build;
 import android.os.Bundle;
 import android.app.Fragment;
 import android.util.Log;
@@ -65,6 +66,12 @@ public class ActivityPastLayout extends Fragment {
         TextView tvDate = (TextView) view.findViewById(R.id.tv_activity_past_date);
         TextView tvCity = (TextView) view.findViewById(R.id.tv_activity_past_city);
         WebView wvText = (WebView) view.findViewById(R.id.wv_activity_past_text);
+        if (Build.VERSION.SDK_INT >= 19) {
+            wvText.setLayerType(View.LAYER_TYPE_HARDWARE, null);
+        }
+        else {
+            wvText.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
+        }
 
         //Set fields
         tvTitle.setText(cursor.getString(1));

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

@@ -6,6 +6,7 @@ import android.database.Cursor;
 import android.database.sqlite.SQLiteDatabase;
 import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
+import android.os.Build;
 import android.os.Bundle;
 import android.app.Fragment;
 import android.app.FragmentManager;
@@ -60,6 +61,14 @@ public class AlbumLayout extends Fragment {
         //Set album elements
         TextView tvTitle = (TextView) view.findViewById(R.id.tv_album_title);
         WebView tvDescription = (WebView) view.findViewById(R.id.wv_album_description);
+
+		if (Build.VERSION.SDK_INT >= 19) {
+			tvDescription.setLayerType(View.LAYER_TYPE_HARDWARE, null);
+		}
+		else {
+			tvDescription.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
+		}
+
         tvTitle.setText(cursor.getString(1));
 		final String albumName = cursor.getString(1);
         if (cursor.getString(2).length() < 1){

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

@@ -7,6 +7,7 @@ import android.database.Cursor;
 import android.database.sqlite.SQLiteDatabase;
 import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
+import android.os.Build;
 import android.os.Bundle;
 import android.util.Log;
 import android.view.LayoutInflater;
@@ -64,6 +65,14 @@ public class LablancaLayout extends Fragment {
 
 		//Set text
 		WebView headerText = (WebView) view.findViewById(R.id.wv_lablanca_header);
+
+		if (Build.VERSION.SDK_INT >= 19) {
+			headerText.setLayerType(View.LAYER_TYPE_HARDWARE, null);
+		}
+		else {
+			headerText.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
+		}
+
 		headerText.loadDataWithBaseURL(null, cursor.getString(0), "text/html", "utf-8", null);
 
 		//Set image

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

@@ -6,6 +6,7 @@ import android.database.Cursor;
 import android.database.sqlite.SQLiteDatabase;
 import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
+import android.os.Build;
 import android.os.Bundle;
 import android.app.Fragment;
 import android.util.Log;
@@ -74,6 +75,14 @@ public class PostLayout extends Fragment {
         TextView tvDate = (TextView) view.findViewById(R.id.tv_post_date);
         final TextView tvComments = (TextView) view.findViewById(R.id.tv_comments);
         WebView wvText = (WebView) view.findViewById(R.id.wv_post_text);
+
+        if (Build.VERSION.SDK_INT >= 19) {
+            wvText.setLayerType(View.LAYER_TYPE_HARDWARE, null);
+        }
+        else {
+            wvText.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
+        }
+
         LinearLayout llCommentList = (LinearLayout) view.findViewById(R.id.ll_comment_list);
 
         //Set fields

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

@@ -4,6 +4,7 @@ import android.annotation.SuppressLint;
 import android.app.Dialog;
 import android.content.Context;
 import android.content.SharedPreferences;
+import android.os.Build;
 import android.os.Bundle;
 import android.app.Fragment;
 import android.view.Gravity;
@@ -140,6 +141,14 @@ public class SettingsLayout extends Fragment{
 		//Set the custom dialog components - text, image and button
 		TextView tvTitle = (TextView) dialog.findViewById(R.id.tv_dialog_settings_title);
 		WebView wvText = (WebView) dialog.findViewById(R.id.wv_dialog_settings_text);
+
+		if (Build.VERSION.SDK_INT >= 19) {
+			wvText.setLayerType(View.LAYER_TYPE_HARDWARE, null);
+		}
+		else {
+			wvText.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
+		}
+
 		Button btClose = (Button) dialog.findViewById(R.id.bt_dialog_settings_close);
 
 		//Set text

+ 3 - 4
app/src/main/res/layout/fragment_layout_home.xml

@@ -105,8 +105,7 @@
 					android:contentDescription="@string/app_cdesc"
 					android:layout_weight=".4"
 					android:layout_margin="3dp"
-					android:background="@color/album_border"
-					android:padding="1dp"/>
+					android:adjustViewBounds="true"/>
 
 				<TextView
 					android:layout_width="wrap_content"
@@ -153,7 +152,7 @@
 					android:layout_height="wrap_content"
 					android:textAppearance="@android:style/TextAppearance.Medium"
 					android:text="@string/schedule_now"
-					/>
+					android:textStyle="bold"/>
 
 				<LinearLayout
 					android:id="@+id/ll_home_section_gmschedule_now_list"
@@ -180,7 +179,7 @@
 					android:layout_height="wrap_content"
 					android:textAppearance="@android:style/TextAppearance.Medium"
 					android:text="@string/schedule_later"
-					/>
+					android:textStyle="bold"/>
 
 				<LinearLayout
 					android:id="@+id/ll_home_section_gmschedule_later_list"

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

@@ -43,8 +43,7 @@
                     android:contentDescription="@string/app_cdesc"
                     android:layout_weight=".4"
                     android:layout_margin="3dp"
-                    android:background="@color/album_border"
-                    android:padding="1dp"/>
+                    android:adjustViewBounds="true"/>
 
                 <WebView
                     android:layout_width="wrap_content"

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

@@ -21,22 +21,26 @@
 
         <TextView
             android:id="@+id/tv_row_home_schedule_title"
-            android:layout_width="wrap_content"
+            android:layout_width="fill_parent"
             android:layout_height="wrap_content"
-            android:textAppearance="@android:style/TextAppearance.Large"/>
+            android:textAppearance="@android:style/TextAppearance.Large"
+            android:layout_weight=".3"/>
 
         <TextView
             android:id="@+id/tv_row_home_schedule_time"
-            android:layout_width="wrap_content"
+            android:layout_width="fill_parent"
             android:layout_height="wrap_content"
             android:layout_marginStart="20dp"
-            android:textAppearance="@android:style/TextAppearance.Medium"/>
+            android:textAppearance="@android:style/TextAppearance.Medium"
+            android:minWidth="75dp"
+            android:layout_weight=".7"
+            android:textAlignment="textEnd"/>
     </LinearLayout>
 
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_marginBottom="5dp"
+        android:layout_marginBottom="25dp"
         android:layout_marginLeft="15dp"
         android:layout_marginStart="15dp"
         android:layout_marginTop="5dp"