commit ef1f3e349aefae03832fecd5027c66eb913746e3
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Mon Dec 7 12:44:36 2020 +0100

    Make the Tutorial Dialog look better

diff --git a/src/main/java/org/distorted/dialogs/RubikDialogTutorialPagerAdapter.java b/src/main/java/org/distorted/dialogs/RubikDialogTutorialPagerAdapter.java
index e2b1aba9..4edd1606 100644
--- a/src/main/java/org/distorted/dialogs/RubikDialogTutorialPagerAdapter.java
+++ b/src/main/java/org/distorted/dialogs/RubikDialogTutorialPagerAdapter.java
@@ -66,7 +66,7 @@ class RubikDialogTutorialPagerAdapter extends PagerAdapter
     {
     DisplayMetrics metrics = mAct.getResources().getDisplayMetrics();
 
-    mViews[position] = new RubikDialogTutorialView(mAct, metrics.heightPixels, position);
+    mViews[position] = new RubikDialogTutorialView(mAct, metrics.widthPixels, position);
     collection.addView(mViews[position]);
 
     return mViews[position];
diff --git a/src/main/java/org/distorted/dialogs/RubikDialogTutorialView.java b/src/main/java/org/distorted/dialogs/RubikDialogTutorialView.java
index 004d77eb..b1429714 100644
--- a/src/main/java/org/distorted/dialogs/RubikDialogTutorialView.java
+++ b/src/main/java/org/distorted/dialogs/RubikDialogTutorialView.java
@@ -21,16 +21,16 @@ package org.distorted.dialogs;
 
 import android.content.Context;
 import android.content.res.Resources;
-import android.graphics.drawable.Drawable;
 import android.os.Bundle;
 import android.util.AttributeSet;
 import android.util.TypedValue;
 import android.view.View;
 import android.widget.Button;
 import android.widget.FrameLayout;
+import android.widget.ImageView;
 import android.widget.LinearLayout;
+import android.widget.TextView;
 
-import androidx.core.content.ContextCompat;
 import androidx.fragment.app.FragmentActivity;
 
 import com.google.firebase.analytics.FirebaseAnalytics;
@@ -59,11 +59,11 @@ public class RubikDialogTutorialView extends FrameLayout
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public RubikDialogTutorialView(FragmentActivity act, int height, int position)
+  public RubikDialogTutorialView(FragmentActivity act, int width, int position)
     {
     super(act);
 
-    int heightT = (int)(height* RubikActivity.TUTORIAL_ITEM_TEXT);
+    int widthT = (int)(width* RubikActivity.TUTORIAL_ITEM_TEXT);
 
     RubikActivity ract = (RubikActivity)getContext();
     Resources res = act.getResources();
@@ -87,7 +87,7 @@ public class RubikDialogTutorialView extends FrameLayout
 
       int countryID = res.getIdentifier( coun, "drawable", packageName);
 
-      View row = createRow(ract,countryID,desc,url,auth,heightT,objList,size);
+      View row = createRow(ract,countryID,desc,url,auth,widthT,objList,size);
       layout.addView(row);
       }
 
@@ -97,21 +97,14 @@ public class RubikDialogTutorialView extends FrameLayout
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   private View createRow(final RubikActivity act, int countryID, final String desc, final String url,
-                         final String auth, int height, final ObjectList obj, final int size)
+                         final String auth, int width, final ObjectList obj, final int size)
     {
     View row = inflate( act, R.layout.dialog_tutorial_row, null);
-    Button butt = row.findViewById(R.id.tutorialRowButton);
+    Button butt = row.findViewById(R.id.tutorialButton);
 
-    int id = countryID!=0 ? countryID : R.drawable.un;
-    final String buttText = desc+" ("+auth+")";
-
-    butt.setText(buttText);
-    butt.setTextSize(TypedValue.COMPLEX_UNIT_PX, 0.5f*height);
-    butt.setHeight(height);
-
-    Drawable img = ContextCompat.getDrawable(act,id);
-    img.setBounds(0, 0, (int)(1.0f*height), (int)(0.66f*height) );
-    butt.setCompoundDrawables(img,null,null,null);
+    butt.setText(R.string.view);
+    butt.setTextSize(TypedValue.COMPLEX_UNIT_PX, 0.5f*width);
+    butt.setHeight(width);
 
     butt.setOnClickListener( new View.OnClickListener()
       {
@@ -123,6 +116,18 @@ public class RubikDialogTutorialView extends FrameLayout
         }
       });
 
+    ImageView image = row.findViewById(R.id.tutorialCountry);
+    int id = countryID!=0 ? countryID : R.drawable.un;
+    image.setImageResource(id);
+
+    TextView author = row.findViewById(R.id.tutorialAuthor);
+    author.setTextSize(TypedValue.COMPLEX_UNIT_PX, 0.5f*width);
+    author.setText(auth);
+
+    TextView title  = row.findViewById(R.id.tutorialTitle);
+    title.setTextSize(TypedValue.COMPLEX_UNIT_PX, 0.5f*width);
+    title.setText(desc);
+
     return row;
     }
 
diff --git a/src/main/java/org/distorted/main/RubikActivity.java b/src/main/java/org/distorted/main/RubikActivity.java
index 32050422..bd74fb47 100644
--- a/src/main/java/org/distorted/main/RubikActivity.java
+++ b/src/main/java/org/distorted/main/RubikActivity.java
@@ -67,7 +67,7 @@ public class RubikActivity extends AppCompatActivity
     public static final float PATTERN_CHILD_TEXT  = 0.02f;
     public static final float SCORES_LEVEL_TEXT   = 0.035f;
     public static final float SCORES_ITEM_TEXT    = 0.030f;
-    public static final float TUTORIAL_ITEM_TEXT  = 0.050f;
+    public static final float TUTORIAL_ITEM_TEXT  = 0.100f;
     public static final float DIALOG_BUTTON_SIZE  = 0.06f;
     public static final float MENU_BIG_TEXT_SIZE  = 0.05f;
     public static final float MENU_MED_TEXT_SIZE  = 0.04f;
diff --git a/src/main/java/org/distorted/tutorial/TutorialList.java b/src/main/java/org/distorted/tutorial/TutorialList.java
index 3a221773..69e42480 100644
--- a/src/main/java/org/distorted/tutorial/TutorialList.java
+++ b/src/main/java/org/distorted/tutorial/TutorialList.java
@@ -29,7 +29,7 @@ public enum TutorialList
           new String[][] {
                           {"gb","rJlh5p2wAKA","How to Solve a 2x2 Rubik's Cube","Z3"},
                           {"es","f85wqJTIDlw","Resolver cubo de Rubik 2X2","Cuby"},
-                          {"ru","azC6P3VYFkc","Как собрать кубик 2Х2","Евгений Бондаренко"},
+                          {"ru","azC6P3VYFkc","Как собрать кубик 2Х2","Е Бондаренко"},
                           {"fr","V1XS993AUuw","Résoudre le cube 2x2","Rachma Nikov"},
                           {"pl","haNWdAYWGsY","Jak ułożyć kostkę Rubika 2x2","DżoDżo"},
                        //   {"tw","CfOCXxhCb8U","2x2魔術方塊復原","1hrBLD"},
@@ -40,7 +40,7 @@ public enum TutorialList
           new String[][] {
                           {"gb","-8ohoCKN0Zw","How to Solve a Rubik's Cube","Z3"},
                           {"es","GyY0OxDk5lI","Resolver cubo de Rubik 3x3","Cuby"},
-                          {"ru","5S2eq81FRzI","Как собрать кубик рубика","Евгений Бондаренко"},
+                          {"ru","5S2eq81FRzI","Как собрать кубик рубика","Е Бондаренко"},
                           {"fr","T-ASx2wbHVY","Comment résoudre un Rubik's Cube","Le Cube"},
                           {"pl","cBU9Y729nQM","Jak ułożyć kostkę Rubika 3x3","DżoDżo"},
                        //   {"tw","76NmRQx5CLA","魔術方塊教學","1hrBLD"},
@@ -76,7 +76,7 @@ public enum TutorialList
           new String[][] {
                           {"gb","xIQtn2qazvg","Pyraminx Layer By Layer","Z3"},
                           {"es","4cJJe9RAzAU","Resolver Pyraminx","Cuby"},
-                          {"ru","F4_bhfWyVRQ","Как собрать ПИРАМИДКУ","Евгений Бондаренко"},
+                          {"ru","F4_bhfWyVRQ","Как собрать ПИРАМИДКУ","Е Бондаренко"},
                           {"fr","Z2h1YI6jPes","Comment résoudre le Pyraminx","ValentinoCube"},
                           {"pl","uNpKpJfAa5I","Jak ułożyć: Pyraminx","DżoDżo"},
                       //    {"tw","YS3cDcP6Aro","金字塔方塊解法","1hrBLD"},
diff --git a/src/main/res/layout/dialog_tutorial_row.xml b/src/main/res/layout/dialog_tutorial_row.xml
index d47f1a52..ba1441b5 100644
--- a/src/main/res/layout/dialog_tutorial_row.xml
+++ b/src/main/res/layout/dialog_tutorial_row.xml
@@ -1,10 +1,89 @@
 <?xml version="1.0" encoding="utf-8"?>
-<Button xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/tutorialRowButton"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:paddingRight="15dp"
-    android:paddingLeft="15dp"
-    android:singleLine="true"
-    android:textAllCaps="false"
-    android:gravity="center"/>
\ No newline at end of file
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
+    android:gravity="center|fill_horizontal"
+    android:layout_marginLeft="8dp"
+    android:layout_marginRight="8dp"
+    android:layout_marginTop="10dp"
+    android:layout_marginBottom="10dp"
+    android:background="@color/black"
+    android:orientation="vertical">
+
+    <TextView
+        android:id="@+id/tutorialTitle"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:gravity="center"
+        android:textSize="18sp"
+        android:layout_marginTop="10dp"
+        android:layout_marginLeft="10dp"
+        android:layout_marginRight="10dp"
+        android:paddingLeft="2dp"
+        android:paddingRight="2dp"
+        android:maxLines="1"
+        android:background="@color/grey"/>
+
+    <LinearLayout
+        android:id="@+id/tutorialLayout"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="10dp"
+        android:layout_marginRight="10dp"
+        android:background="@color/grey"
+        android:gravity="center"
+        android:orientation="horizontal">
+
+        <LinearLayout
+             android:layout_width="0dp"
+             android:layout_height="match_parent"
+             android:layout_weight="0.4"
+             android:gravity="left"
+             android:orientation="horizontal">
+
+             <ImageView
+                 android:id="@+id/tutorialCountry"
+                 android:layout_width="match_parent"
+                 android:layout_height="match_parent"
+                 android:paddingBottom="3dp"
+                 android:paddingTop="3dp"
+                 android:paddingLeft="10dp"/>
+        </LinearLayout>
+
+        <LinearLayout
+             android:layout_width="0dp"
+             android:layout_height="match_parent"
+             android:layout_weight="1.5"
+             android:gravity="left"
+             android:orientation="horizontal">
+
+             <TextView
+                 android:id="@+id/tutorialAuthor"
+                 android:layout_width="wrap_content"
+                 android:layout_height="wrap_content"
+                 android:paddingLeft="5dp"
+                 android:textSize="18sp"
+                 android:maxLines="1"
+                 android:layout_gravity="center_vertical|start"/>
+        </LinearLayout>
+
+        <LinearLayout
+             android:layout_width="0dp"
+             android:layout_height="match_parent"
+             android:layout_weight="1.0"
+             android:gravity="right"
+             android:orientation="horizontal">
+
+             <Button
+                 android:id="@+id/tutorialButton"
+                 android:layout_width="match_parent"
+                 android:layout_height="wrap_content"
+                 android:paddingRight="15dp"
+                 android:paddingLeft="15dp"
+                 android:singleLine="true"
+                 android:textAllCaps="false"
+                 android:layout_gravity="right"/>
+        </LinearLayout>
+
+    </LinearLayout>
+</LinearLayout>
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index a39f37fa..04c8357d 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -37,6 +37,7 @@
     <string name="submitting">Submitting…</string>
     <string name="tutorial">Watch a tutorial?</string>
     <string name="tutorials">Tutorials</string>
+    <string name="view">View</string>
 
     <string name="credits1">Open Source app developed using the Distorted graphics library. Licensed under <a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html">GPL version 2</a> or - at your option - any later version.</string>
     <string name="credits2">Pretty Patterns by Walter Randelshofer. See <a href="http://www.randelshofer.ch">http://www.randelshofer.ch</a></string>
