commit c02fa107ec5f0d64fd35f7befe155efe43cd985b
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Fri Jan 20 15:52:02 2023 +0100

    Continue unifying all the dialogs under one RubikDialogAbstract.

diff --git a/src/main/java/org/distorted/bandaged/BandagedCreatorObjectView.java b/src/main/java/org/distorted/bandaged/BandagedCreatorObjectView.java
index df2a40cc..06ae7339 100644
--- a/src/main/java/org/distorted/bandaged/BandagedCreatorObjectView.java
+++ b/src/main/java/org/distorted/bandaged/BandagedCreatorObjectView.java
@@ -75,7 +75,7 @@ public class BandagedCreatorObjectView
       public void onClick(View v)
         {
         Bundle bundle = new Bundle();
-        bundle.putString("name", mName );
+        bundle.putString("argument", mName );
         RubikDialogBandagedDelete dialog = new RubikDialogBandagedDelete();
         dialog.setArguments(bundle);
         dialog.show( act.getSupportFragmentManager(), RubikDialogBandagedDelete.getDialogTag() );
diff --git a/src/main/java/org/distorted/dialogs/RubikDialogAbandon.java b/src/main/java/org/distorted/dialogs/RubikDialogAbandon.java
index c27b3cff..22d0d2da 100644
--- a/src/main/java/org/distorted/dialogs/RubikDialogAbandon.java
+++ b/src/main/java/org/distorted/dialogs/RubikDialogAbandon.java
@@ -38,6 +38,13 @@ public class RubikDialogAbandon extends RubikDialogAbstract
     return -1;
     }
 
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public boolean hasArgument()
+    {
+    return false;
+    }
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   public void setPositive(AlertDialog.Builder builder)
@@ -80,7 +87,7 @@ public class RubikDialogAbandon extends RubikDialogAbstract
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public void prepareBody(View view, FragmentActivity act, float size)
+  public void prepareBody(Dialog dialog, View view, FragmentActivity act, float size)
     {
 
     }
diff --git a/src/main/java/org/distorted/dialogs/RubikDialogAbout.java b/src/main/java/org/distorted/dialogs/RubikDialogAbout.java
index add82b49..c9f2b6e8 100644
--- a/src/main/java/org/distorted/dialogs/RubikDialogAbout.java
+++ b/src/main/java/org/distorted/dialogs/RubikDialogAbout.java
@@ -42,6 +42,13 @@ public class RubikDialogAbout extends RubikDialogAbstract
     return R.string.about;
     }
 
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public boolean hasArgument()
+    {
+    return false;
+    }
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   public void setPositive(AlertDialog.Builder builder)
@@ -73,7 +80,7 @@ public class RubikDialogAbout extends RubikDialogAbstract
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public void prepareBody(View view, FragmentActivity act, float size)
+  public void prepareBody(Dialog dialog, View view, FragmentActivity act, float size)
     {
     TextView text = view.findViewById(R.id.about_version);
     String appName = getString(R.string.app_name);
diff --git a/src/main/java/org/distorted/dialogs/RubikDialogAbstract.java b/src/main/java/org/distorted/dialogs/RubikDialogAbstract.java
index df445b3e..75ae5435 100644
--- a/src/main/java/org/distorted/dialogs/RubikDialogAbstract.java
+++ b/src/main/java/org/distorted/dialogs/RubikDialogAbstract.java
@@ -32,15 +32,18 @@ import org.distorted.main.RubikActivity;
 abstract public class RubikDialogAbstract extends AppCompatDialogFragment
   {
   protected float mTitleSize, mButSize, mTextSize;
+  protected int mWidth, mHeight;
+  protected String mArgument;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   abstract int getResource();
   abstract int getTitleResource();
+  abstract boolean hasArgument();
   abstract void setPositive(AlertDialog.Builder builder);
   abstract void setNegative(AlertDialog.Builder builder);
   abstract void onShowDialog(DialogInterface dialog, float size);
-  abstract void prepareBody(View view, FragmentActivity act, float size);
+  abstract void prepareBody(Dialog dialog, View view, FragmentActivity act, float size);
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -54,10 +57,26 @@ abstract public class RubikDialogAbstract extends AppCompatDialogFragment
 
     DisplayMetrics displaymetrics = new DisplayMetrics();
     act.getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
-    int h = displaymetrics.heightPixels;
-    mTitleSize= h * 0.032f;
-    mButSize  = h * 0.040f;
-    mTextSize = h * 0.025f;
+    mWidth    = displaymetrics.widthPixels;
+    mHeight   = displaymetrics.heightPixels;
+    mTitleSize= mHeight*0.032f;
+    mButSize  = mHeight*0.040f;
+    mTextSize = mHeight*0.025f;
+
+    if( hasArgument() )
+      {
+      Bundle args = getArguments();
+
+      try
+        {
+        mArgument = args!=null ? args.getString("argument") : "";
+        }
+      catch(Exception e)
+        {
+        mArgument = "";
+        }
+      }
+    else mArgument = "";
 
     final View view = inflater.inflate(getResource(), null);
     builder.setView(view);
@@ -74,10 +93,12 @@ abstract public class RubikDialogAbstract extends AppCompatDialogFragment
 
     setPositive(builder);
     setNegative(builder);
-    prepareBody(view,act,mTextSize);
 
     Dialog dialog = builder.create();
     dialog.setCanceledOnTouchOutside(false);
+
+    prepareBody(dialog,view,act,mTextSize);
+
     Window window = dialog.getWindow();
 
     if( window!=null )
diff --git a/src/main/java/org/distorted/dialogs/RubikDialogBandagedDelete.java b/src/main/java/org/distorted/dialogs/RubikDialogBandagedDelete.java
index 9dc5f65a..15b696fa 100644
--- a/src/main/java/org/distorted/dialogs/RubikDialogBandagedDelete.java
+++ b/src/main/java/org/distorted/dialogs/RubikDialogBandagedDelete.java
@@ -11,7 +11,6 @@ package org.distorted.dialogs;
 
 import android.app.Dialog;
 import android.content.DialogInterface;
-import android.os.Bundle;
 import android.util.TypedValue;
 import android.view.View;
 import android.widget.Button;
@@ -41,20 +40,16 @@ public class RubikDialogBandagedDelete extends RubikDialogAbstract
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public void setPositive(AlertDialog.Builder builder)
+  public boolean hasArgument()
     {
-    Bundle args = getArguments();
-    String name;
+    return true;
+    }
 
-    try
-      {
-      name = args.getString("name");
-      }
-    catch(Exception e)
-      {
-      name = "";
-      }
-    final String objectName = name;
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void setPositive(AlertDialog.Builder builder)
+    {
+    final String objectName = mArgument;
 
     builder.setPositiveButton( R.string.yes, new DialogInterface.OnClickListener()
       {
@@ -93,7 +88,7 @@ public class RubikDialogBandagedDelete extends RubikDialogAbstract
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public void prepareBody(View view, FragmentActivity act, float size)
+  public void prepareBody(Dialog dialog, View view, FragmentActivity act, float size)
     {
     TextView save = view.findViewById(R.id.delete_object_text);
     save.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
diff --git a/src/main/java/org/distorted/dialogs/RubikDialogBandagedSave.java b/src/main/java/org/distorted/dialogs/RubikDialogBandagedSave.java
index 1912fc4f..4f76a889 100644
--- a/src/main/java/org/distorted/dialogs/RubikDialogBandagedSave.java
+++ b/src/main/java/org/distorted/dialogs/RubikDialogBandagedSave.java
@@ -39,6 +39,13 @@ public class RubikDialogBandagedSave extends RubikDialogAbstract
     return R.string.save_object;
     }
 
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public boolean hasArgument()
+    {
+    return false;
+    }
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   public void setPositive(AlertDialog.Builder builder)
@@ -85,7 +92,7 @@ public class RubikDialogBandagedSave extends RubikDialogAbstract
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public void prepareBody(View view, FragmentActivity act, float size)
+  public void prepareBody(Dialog dialog, View view, FragmentActivity act, float size)
     {
     TextView save = view.findViewById(R.id.save_object_text);
     save.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
diff --git a/src/main/java/org/distorted/dialogs/RubikDialogEffects.java b/src/main/java/org/distorted/dialogs/RubikDialogEffects.java
deleted file mode 100644
index 18c86c4c..00000000
--- a/src/main/java/org/distorted/dialogs/RubikDialogEffects.java
+++ /dev/null
@@ -1,306 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Copyright 2019 Leszek Koltunski                                                               //
-//                                                                                               //
-// This file is part of Magic Cube.                                                              //
-//                                                                                               //
-// Magic Cube is proprietary software licensed under an EULA which you should have received      //
-// along with the code. If not, check https://distorted.org/magic/License-Magic-Cube.html        //
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-package org.distorted.dialogs;
-
-import android.app.Dialog;
-import android.content.DialogInterface;
-import android.os.Bundle;
-import androidx.annotation.NonNull;
-import androidx.fragment.app.FragmentActivity;
-import androidx.core.content.ContextCompat;
-import androidx.appcompat.app.AlertDialog;
-import androidx.appcompat.app.AppCompatDialogFragment;
-import android.util.DisplayMetrics;
-import android.util.TypedValue;
-import android.view.Gravity;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.Window;
-import android.widget.AdapterView;
-import android.widget.ArrayAdapter;
-import android.widget.Button;
-import android.widget.LinearLayout;
-import android.widget.SeekBar;
-import android.widget.Spinner;
-import android.widget.TextView;
-
-import org.distorted.objectlib.effects.BaseEffect;
-import org.distorted.main.R;
-import org.distorted.main.RubikActivity;
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-public class RubikDialogEffects extends AppCompatDialogFragment implements SeekBar.OnSeekBarChangeListener, AdapterView.OnItemSelectedListener
-  {
-  private final TextView[] mDurationText;
-  private float mTextSize;
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private void addSettingsSection(FragmentActivity act, LinearLayout layout, int index)
-    {
-    BaseEffect.Type beType = BaseEffect.Type.getType(index);
-
-    int textH= (int)(1.35f*mTextSize);
-    float A= 1.2f;
-    float B= 0.25f;
-
-    ///// OUTER LAYOUT ///////////////////////////////////////////////////////////////////
-
-    int margin = (int)(B*textH);
-    int color  = ContextCompat.getColor(act, R.color.grey);
-    LinearLayout outerLayout = new LinearLayout(act);
-    LinearLayout.LayoutParams outerLayoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT, 0.5f);
-    outerLayoutParams.topMargin    = index>0 ? margin : 0;
-    outerLayoutParams.bottomMargin = 0;
-    outerLayoutParams.leftMargin   = margin;
-    outerLayoutParams.rightMargin  = margin;
-
-    outerLayout.setLayoutParams(outerLayoutParams);
-    outerLayout.setGravity(Gravity.CENTER|Gravity.FILL_HORIZONTAL);
-    outerLayout.setBackgroundColor(color);
-    outerLayout.setOrientation(LinearLayout.VERTICAL);
-    layout.addView(outerLayout);
-
-    ///// TEXT ///////////////////////////////////////////////////////////////////////////
-
-    int layoutHeight = (int)(A*textH);
-    int padding      = (int)(B*textH);
-
-    LinearLayout.LayoutParams textParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,layoutHeight);
-
-    TextView textView = new TextView(act);
-    textView.setTextSize(TypedValue.COMPLEX_UNIT_PX, mTextSize);
-    textView.setText(beType.getText());
-    textView.setLayoutParams(textParams);
-    textView.setGravity(Gravity.CENTER);
-    textView.setPadding(padding,0,padding,0);
-    outerLayout.addView(textView);
-
-    ///// INNER LAYOUT1 //////////////////////////////////////////////////////////////////
-
-    int innerLayout1Height = (int)((A+B)*textH);
-    LinearLayout innerLayout1 = new LinearLayout(act);
-    LinearLayout.LayoutParams innerLayout1Params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,innerLayout1Height);
-
-    innerLayout1.setLayoutParams(innerLayout1Params);
-    innerLayout1.setGravity(Gravity.CENTER|Gravity.FILL_HORIZONTAL);
-    innerLayout1.setOrientation(LinearLayout.HORIZONTAL);
-    outerLayout.addView(innerLayout1);
-
-    ///// STUFF INSIDE INNER LAYOUT1 /////////////////////////////////////////////////////
-
-    int text1Padding = (int)(B*textH);
-    LinearLayout.LayoutParams text1LayoutParams = new LinearLayout.LayoutParams(0,layoutHeight,0.25f);
-
-    TextView text1View = new TextView(act);
-    text1View.setTextSize(TypedValue.COMPLEX_UNIT_PX, mTextSize);
-    text1View.setText(R.string.duration);
-    text1View.setLayoutParams(text1LayoutParams);
-    text1View.setGravity(Gravity.START|Gravity.CENTER);
-    text1View.setPadding(text1Padding,0,text1Padding,0);
-    innerLayout1.addView(text1View);
-    //////////////////////////////////////////////////////////////////
-    int text2Padding = (int)(B*textH);
-    LinearLayout.LayoutParams text2LayoutParams = new LinearLayout.LayoutParams(0,layoutHeight,0.25f);
-
-    mDurationText[index] = new TextView(act);
-    mDurationText[index].setTextSize(TypedValue.COMPLEX_UNIT_PX, mTextSize);
-    mDurationText[index].setLayoutParams(text2LayoutParams);
-    mDurationText[index].setGravity(Gravity.START|Gravity.CENTER);
-    mDurationText[index].setPadding(text2Padding,0,text2Padding,0);
-    innerLayout1.addView(mDurationText[index]);
-    //////////////////////////////////////////////////////////////////
-    int seekPadding = (int)(B*textH);
-    LinearLayout.LayoutParams seekLayoutParams = new LinearLayout.LayoutParams(0,LinearLayout.LayoutParams.MATCH_PARENT,0.5f);
-
-    SeekBar seekBar = new SeekBar(act);
-    seekBar.setLayoutParams(seekLayoutParams);
-    seekBar.setPadding(seekPadding,0,seekPadding,0);
-    seekBar.setId(index);
-    innerLayout1.addView(seekBar);
-
-    seekBar.setOnSeekBarChangeListener(this);
-    seekBar.setProgress(beType.getCurrentPos());
-
-    ///// INNER LAYOUT2 //////////////////////////////////////////////////////////////////
-
-    int innerLayout2Height = (int)((A+B)*textH);
-    LinearLayout innerLayout2 = new LinearLayout(act);
-    LinearLayout.LayoutParams innerLayout2Params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,innerLayout2Height);
-
-    innerLayout2.setLayoutParams(innerLayout2Params);
-    innerLayout2.setGravity(Gravity.CENTER|Gravity.FILL_HORIZONTAL);
-    innerLayout2.setOrientation(LinearLayout.HORIZONTAL);
-    outerLayout.addView(innerLayout2);
-
-    ///// STUFF INSIDE INNER LAYOUT2 /////////////////////////////////////////////////////
-
-    int text3Padding = (int)(B*textH);
-    LinearLayout.LayoutParams text3LayoutParams = new LinearLayout.LayoutParams(0,LinearLayout.LayoutParams.MATCH_PARENT,0.25f);
-
-    TextView text3View = new TextView(act);
-    text3View.setTextSize(TypedValue.COMPLEX_UNIT_PX, mTextSize);
-    text3View.setText(R.string.type);
-    text3View.setLayoutParams(text3LayoutParams);
-    text3View.setGravity(Gravity.START|Gravity.CENTER);
-    text3View.setPadding(text3Padding,0,text3Padding,0);
-    innerLayout2.addView(text3View);
-    //////////////////////////////////////////////////////////////////
-    int spinnerPadding = (int)(B*textH);
-    int spinnerMargin  = (int)(B*0.5f*textH);
-    LinearLayout.LayoutParams spinnerLayoutParams = new LinearLayout.LayoutParams(0,LinearLayout.LayoutParams.MATCH_PARENT,0.75f);
-    spinnerLayoutParams.topMargin    =   spinnerMargin;
-    spinnerLayoutParams.bottomMargin =   spinnerMargin;
-    spinnerLayoutParams.leftMargin   =   spinnerMargin;
-    spinnerLayoutParams.rightMargin  = 2*spinnerMargin;
-
-    Spinner spinner = new Spinner(act);
-    spinner.setLayoutParams(spinnerLayoutParams);
-    spinner.setPadding(spinnerPadding,0,spinnerPadding,0);
-    spinner.setBackgroundResource(R.drawable.ui_small_spinner);
-    spinner.setTextAlignment(View.TEXT_ALIGNMENT_TEXT_START);
-    spinner.setId(index+BaseEffect.Type.LENGTH);
-    innerLayout2.addView(spinner);
-
-    spinner.setOnItemSelectedListener(this);
-    String[] appear = BaseEffect.Type.getType(index).getNames();
-
-    ArrayAdapter<String> adapterType = new ArrayAdapter<String>(act, android.R.layout.simple_spinner_item, appear)
-      {
-      @NonNull
-      public View getView(int position, View convertView, @NonNull ViewGroup parent)
-        {
-        View v = super.getView(position, convertView, parent);
-        TextView tv = ((TextView) v);
-        tv.setTextSize(TypedValue.COMPLEX_UNIT_PX, mTextSize);
-        return v;
-        }
-      };
-
-    adapterType.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
-    spinner.setAdapter(adapterType);
-    spinner.setSelection(beType.getCurrentType());
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// PUBLIC API
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  public RubikDialogEffects()
-    {
-    mDurationText = new TextView[BaseEffect.Type.LENGTH];
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  @NonNull
-  @Override
-  public Dialog onCreateDialog(Bundle savedInstanceState)
-    {
-    FragmentActivity act = getActivity();
-    LayoutInflater inflater = act.getLayoutInflater();
-    AlertDialog.Builder builder = new AlertDialog.Builder(act);
-    TextView tv = (TextView) inflater.inflate(R.layout.dialog_title, null);
-
-    DisplayMetrics displaymetrics = new DisplayMetrics();
-    act.getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
-    final float titleSize= displaymetrics.widthPixels * RubikActivity.BIG_TEXT_SIZE;
-    final float okSize   = displaymetrics.widthPixels * RubikActivity.DIALOG_BUTTON_SIZE;
-
-    mTextSize = displaymetrics.widthPixels * RubikActivity.SMALL_TEXT_SIZE;
-
-    tv.setTextSize(TypedValue.COMPLEX_UNIT_PX, titleSize);
-    tv.setText(R.string.effects);
-    builder.setCustomTitle(tv);
-
-    builder.setCancelable(true);
-    builder.setPositiveButton( R.string.ok, new DialogInterface.OnClickListener()
-      {
-      @Override
-      public void onClick(DialogInterface dialog, int which)
-        {
-
-        }
-      });
-
-    final View view = inflater.inflate(R.layout.dialog_effects, null);
-    builder.setView(view);
-
-    LinearLayout linearLayout = view.findViewById(R.id.settingsLayout);
-
-    if( linearLayout!=null )
-      {
-      for (int i=0; i< BaseEffect.Type.LENGTH; i++)
-        {
-        addSettingsSection(act,linearLayout,i);
-        }
-      }
-    else
-      {
-      android.util.Log.e("dialog_settings", "linearLayout NULL!");
-      }
-
-    Dialog dialog = builder.create();
-    dialog.setCanceledOnTouchOutside(false);
-    Window window = dialog.getWindow();
-
-    if( window!=null )
-      {
-      window.getDecorView().setSystemUiVisibility(RubikActivity.FLAGS);
-      }
-
-    dialog.setOnShowListener(new DialogInterface.OnShowListener()
-      {
-      @Override
-      public void onShow(DialogInterface dialog)
-        {
-        Button btnPositive = ((AlertDialog)dialog).getButton(Dialog.BUTTON_POSITIVE);
-        btnPositive.setTextSize(TypedValue.COMPLEX_UNIT_PX, okSize);
-        }
-      });
-
-    return dialog;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  public void onItemSelected(AdapterView<?> parent, View view, int pos, long id)
-    {
-    int parentID = parent.getId();
-    int len = BaseEffect.Type.LENGTH;
-
-    if( parentID>=len && parentID< 2*len) // ith spinner's ID is equal to i+LENGTH (see createSettingSection)
-      {
-      BaseEffect.Type.getType(parentID-len).setCurrentType(pos);
-      }
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  public void onProgressChanged(SeekBar bar, int progress, boolean fromUser)
-    {
-    int barID = bar.getId();
-
-    if( barID>=0 && barID< BaseEffect.Type.LENGTH) // ith seekbar's ID is equal to i (see createSettingSection)
-      {
-      BaseEffect.Type.getType(barID).setCurrentPos(progress);
-      int ms = BaseEffect.Type.translatePos(progress);
-      mDurationText[barID].setText(getString(R.string.ms_placeholder,ms));
-      }
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  public void onNothingSelected(AdapterView<?> parent) { }
-  public void onStartTrackingTouch(SeekBar bar) { }
-  public void onStopTrackingTouch(SeekBar bar)  { }
-  }
diff --git a/src/main/java/org/distorted/dialogs/RubikDialogError.java b/src/main/java/org/distorted/dialogs/RubikDialogError.java
index 2dd3b0ac..cfff86f7 100644
--- a/src/main/java/org/distorted/dialogs/RubikDialogError.java
+++ b/src/main/java/org/distorted/dialogs/RubikDialogError.java
@@ -11,81 +11,76 @@ package org.distorted.dialogs;
 
 import android.app.Dialog;
 import android.content.DialogInterface;
-import android.os.Bundle;
-import android.util.DisplayMetrics;
 import android.util.TypedValue;
-import android.view.LayoutInflater;
 import android.view.View;
-import android.view.Window;
 import android.widget.Button;
 import android.widget.TextView;
 
-import androidx.annotation.NonNull;
 import androidx.appcompat.app.AlertDialog;
-import androidx.appcompat.app.AppCompatDialogFragment;
 import androidx.fragment.app.FragmentActivity;
 
 import org.distorted.main.R;
-import org.distorted.main.RubikActivity;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-public class RubikDialogError extends AppCompatDialogFragment
+public class RubikDialogError extends RubikDialogAbstract
   {
-  @NonNull
-  @Override
-  public Dialog onCreateDialog(Bundle savedInstanceState)
+  public int getResource()
     {
-    final FragmentActivity act = getActivity();
-    LayoutInflater inflater = act.getLayoutInflater();
-    AlertDialog.Builder builder = new AlertDialog.Builder(act);
+    return R.layout.dialog_error;
+    }
 
-    DisplayMetrics displaymetrics = new DisplayMetrics();
-    act.getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
-    int h = displaymetrics.heightPixels;
-    final float titleSize= h * 0.032f;
-    final float okSize   = h * 0.040f;
+///////////////////////////////////////////////////////////////////////////////////////////////////
 
-    TextView tv = (TextView) inflater.inflate(R.layout.dialog_title, null);
-    tv.setTextSize(TypedValue.COMPLEX_UNIT_PX, titleSize);
-    tv.setText(R.string.opengl_error);
-    builder.setCustomTitle(tv);
+  public int getTitleResource()
+    {
+    return R.string.opengl_error;
+    }
 
-    final View view = inflater.inflate(R.layout.dialog_error, null);
-    TextView text = view.findViewById(R.id.error_string);
-    text.setText(R.string.opengl_error_text);
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public boolean hasArgument()
+    {
+    return false;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void setPositive(AlertDialog.Builder builder)
+    {
+    final FragmentActivity act = getActivity();
 
     builder.setPositiveButton( R.string.ok, new DialogInterface.OnClickListener()
       {
       @Override
       public void onClick(DialogInterface dialog, int which)
         {
-        act.finish();
+        if( act!=null ) act.finish();
         }
       });
+    }
 
-    builder.setView(view);
+///////////////////////////////////////////////////////////////////////////////////////////////////
 
-    final Dialog dialog = builder.create();
-    dialog.setCanceledOnTouchOutside(false);
+  public void setNegative(AlertDialog.Builder builder)
+    {
 
-    Window window = dialog.getWindow();
+    }
 
-    if( window!=null )
-      {
-      window.getDecorView().setSystemUiVisibility(RubikActivity.FLAGS);
-      }
+///////////////////////////////////////////////////////////////////////////////////////////////////
 
-    dialog.setOnShowListener(new DialogInterface.OnShowListener()
-      {
-      @Override
-      public void onShow(DialogInterface dialog)
-        {
-        Button btnPositive = ((AlertDialog)dialog).getButton(Dialog.BUTTON_POSITIVE);
-        btnPositive.setTextSize(TypedValue.COMPLEX_UNIT_PX, okSize);
-        }
-      });
+  public void onShowDialog(DialogInterface dialog, float size)
+    {
+    Button btnPositive = ((AlertDialog)dialog).getButton(Dialog.BUTTON_POSITIVE);
+    btnPositive.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
 
-    return dialog;
+  public void prepareBody(Dialog dialog, View view, FragmentActivity act, float size)
+    {
+    TextView text = view.findViewById(R.id.error_string);
+    text.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
+    text.setText(R.string.opengl_error_text);
     }
   }
diff --git a/src/main/java/org/distorted/dialogs/RubikDialogNewRecord.java b/src/main/java/org/distorted/dialogs/RubikDialogNewRecord.java
index b7866989..4cb27a53 100644
--- a/src/main/java/org/distorted/dialogs/RubikDialogNewRecord.java
+++ b/src/main/java/org/distorted/dialogs/RubikDialogNewRecord.java
@@ -12,50 +12,46 @@ package org.distorted.dialogs;
 import android.app.Dialog;
 import android.content.DialogInterface;
 import android.os.Bundle;
-import androidx.annotation.NonNull;
 import androidx.fragment.app.FragmentActivity;
 import androidx.appcompat.app.AlertDialog;
-import androidx.appcompat.app.AppCompatDialogFragment;
 
-import android.util.DisplayMetrics;
 import android.util.TypedValue;
-import android.view.LayoutInflater;
 import android.view.View;
-import android.view.Window;
 import android.widget.Button;
 import android.widget.TextView;
 
 import org.distorted.main.R;
 import org.distorted.main.RubikActivity;
 import org.distorted.external.RubikScores;
-import org.distorted.objects.RubikObjectList;
 import org.distorted.screens.ScreenList;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-public class RubikDialogNewRecord extends AppCompatDialogFragment
+public class RubikDialogNewRecord extends RubikDialogAbstract
   {
-  @NonNull
-  @Override
-  public Dialog onCreateDialog(Bundle savedInstanceState)
+  public int getResource()
     {
-    FragmentActivity act = getActivity();
-    LayoutInflater inflater = act.getLayoutInflater();
-    AlertDialog.Builder builder = new AlertDialog.Builder(act);
-
-    DisplayMetrics displaymetrics = new DisplayMetrics();
-    act.getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
-    int h = displaymetrics.heightPixels;
-    final float titleSize= h*0.032f;
-    final float okSize   = h*0.040f;
-    final float textSize = h*0.032f;
-
-    TextView tv = (TextView) inflater.inflate(R.layout.dialog_title, null);
-    tv.setTextSize(TypedValue.COMPLEX_UNIT_PX, titleSize);
-    tv.setText(R.string.new_record);
-    builder.setCustomTitle(tv);
-    builder.setCancelable(true);
+    return R.layout.dialog_new_record;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public int getTitleResource()
+    {
+    return R.string.new_record;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public boolean hasArgument()
+    {
+    return true;
+    }
 
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void setPositive(AlertDialog.Builder builder)
+    {
     builder.setPositiveButton( R.string.yes, new DialogInterface.OnClickListener()
       {
       @Override
@@ -69,26 +65,26 @@ public class RubikDialogNewRecord extends AppCompatDialogFragment
 
         if( name.length()>0 )
           {
-          int object = RubikObjectList.getCurrObject();
-
-          bundle.putInt("tab", object );
-          bundle.putBoolean("submitting", true);
-
+          bundle.putString("argument", "true");
           RubikDialogScores scoresDiag = new RubikDialogScores();
           scoresDiag.setArguments(bundle);
           scoresDiag.show(act.getSupportFragmentManager(), null);
           }
         else
           {
-          bundle.putString("name", name );
-
+          bundle.putString("argument", name );
           RubikDialogSetName nameDiag = new RubikDialogSetName();
           nameDiag.setArguments(bundle);
           nameDiag.show(act.getSupportFragmentManager(), null);
           }
         }
       });
+    }
 
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void setNegative(AlertDialog.Builder builder)
+    {
     builder.setNegativeButton(R.string.no, new DialogInterface.OnClickListener()
       {
       @Override
@@ -98,50 +94,27 @@ public class RubikDialogNewRecord extends AppCompatDialogFragment
         ScreenList.switchScreen(act, ScreenList.PLAY);
         }
       });
+    }
 
-    Bundle args = getArguments();
-    long time;
+///////////////////////////////////////////////////////////////////////////////////////////////////
 
-    try
-      {
-      time = args.getLong("time");
-      }
-    catch(Exception e)
-      {
-      time = 0;
-      }
+  public void onShowDialog(DialogInterface dialog, float size)
+    {
+    Button btnPositive = ((AlertDialog)dialog).getButton(Dialog.BUTTON_POSITIVE);
+    btnPositive.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
+    Button btnNegative = ((AlertDialog)dialog).getButton(Dialog.BUTTON_NEGATIVE);
+    btnNegative.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
+    }
 
-    final View view = inflater.inflate(R.layout.dialog_new_record, null);
-    TextView text = view.findViewById(R.id.new_record_time);
-    text.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
-    text.setText(getString(R.string.ti_placeholder, (time/10)/100.0f));
-    builder.setView(view);
+///////////////////////////////////////////////////////////////////////////////////////////////////
 
+  public void prepareBody(Dialog dialog, View view, FragmentActivity act, float size)
+    {
+    TextView text = view.findViewById(R.id.new_record_time);
+    text.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
+    text.setText(getString(R.string.ti_placeholder, mArgument));
     TextView submit = view.findViewById(R.id.new_record_submit);
-    submit.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
-
-    Dialog dialog = builder.create();
-    dialog.setCanceledOnTouchOutside(false);
-    Window window = dialog.getWindow();
-
-    if( window!=null )
-      {
-      window.getDecorView().setSystemUiVisibility(RubikActivity.FLAGS);
-      }
-
-    dialog.setOnShowListener(new DialogInterface.OnShowListener()
-      {
-      @Override
-      public void onShow(DialogInterface dialog)
-        {
-        Button btnPositive = ((AlertDialog)dialog).getButton(Dialog.BUTTON_POSITIVE);
-        btnPositive.setTextSize(TypedValue.COMPLEX_UNIT_PX, okSize);
-        Button btnNegative = ((AlertDialog)dialog).getButton(Dialog.BUTTON_NEGATIVE);
-        btnNegative.setTextSize(TypedValue.COMPLEX_UNIT_PX, okSize);
-        }
-      });
-
-    return dialog;
+    submit.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/dialogs/RubikDialogPrivacy.java b/src/main/java/org/distorted/dialogs/RubikDialogPrivacy.java
index ad372aa6..c79fe477 100644
--- a/src/main/java/org/distorted/dialogs/RubikDialogPrivacy.java
+++ b/src/main/java/org/distorted/dialogs/RubikDialogPrivacy.java
@@ -11,20 +11,14 @@ package org.distorted.dialogs;
 
 import android.app.Dialog;
 import android.content.DialogInterface;
-import android.os.Bundle;
 import android.text.method.LinkMovementMethod;
 import android.text.method.MovementMethod;
-import android.util.DisplayMetrics;
 import android.util.TypedValue;
-import android.view.LayoutInflater;
 import android.view.View;
-import android.view.Window;
 import android.widget.Button;
 import android.widget.TextView;
 
-import androidx.annotation.NonNull;
 import androidx.appcompat.app.AlertDialog;
-import androidx.appcompat.app.AppCompatDialogFragment;
 import androidx.fragment.app.FragmentActivity;
 
 import org.distorted.main.R;
@@ -32,35 +26,32 @@ import org.distorted.main.RubikActivity;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-public class RubikDialogPrivacy extends AppCompatDialogFragment
+public class RubikDialogPrivacy extends RubikDialogAbstract
   {
-  @NonNull
-  @Override
-  public Dialog onCreateDialog(Bundle savedInstanceState)
+  public int getResource()
     {
-    final RubikActivity ract = (RubikActivity)getContext();
+    return R.layout.dialog_privacy;
+    }
 
-    FragmentActivity act = getActivity();
-    LayoutInflater inflater = act.getLayoutInflater();
-    AlertDialog.Builder builder = new AlertDialog.Builder(act);
+///////////////////////////////////////////////////////////////////////////////////////////////////
 
-    DisplayMetrics displaymetrics = new DisplayMetrics();
-    act.getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
-    int h = displaymetrics.heightPixels;
-    final float titleSize= h*0.032f;
-    final float butSize  = h*0.040f;
+  public int getTitleResource()
+    {
+    return R.string.privacy_policy;
+    }
 
-    TextView tv = (TextView) inflater.inflate(R.layout.dialog_title, null);
-    tv.setTextSize(TypedValue.COMPLEX_UNIT_PX, titleSize);
-    tv.setText(R.string.privacy_policy);
-    builder.setCustomTitle(tv);
+///////////////////////////////////////////////////////////////////////////////////////////////////
 
-    MovementMethod mm = LinkMovementMethod.getInstance();
-    final View view = inflater.inflate(R.layout.dialog_privacy, null);
-    TextView text = view.findViewById(R.id.privacy_string);
-    text.setMovementMethod(mm);
+  public boolean hasArgument()
+    {
+    return false;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
 
-    builder.setCancelable(true);
+  public void setPositive(AlertDialog.Builder builder)
+    {
+    final RubikActivity ract = (RubikActivity)getContext();
 
     builder.setPositiveButton( R.string.accept, new DialogInterface.OnClickListener()
       {
@@ -70,6 +61,13 @@ public class RubikDialogPrivacy extends AppCompatDialogFragment
         if( ract!=null ) ract.acceptPrivacy();
         }
       });
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void setNegative(AlertDialog.Builder builder)
+    {
+    final RubikActivity ract = (RubikActivity)getContext();
 
     builder.setNegativeButton( R.string.decline, new DialogInterface.OnClickListener()
       {
@@ -79,30 +77,24 @@ public class RubikDialogPrivacy extends AppCompatDialogFragment
         if( ract!=null ) ract.declinePrivacy();
         }
       });
+    }
 
-    builder.setView(view);
-
-    final Dialog dialog = builder.create();
-    dialog.setCanceledOnTouchOutside(false);
-    Window window = dialog.getWindow();
+///////////////////////////////////////////////////////////////////////////////////////////////////
 
-    if( window!=null )
-      {
-      window.getDecorView().setSystemUiVisibility(RubikActivity.FLAGS);
-      }
+  public void onShowDialog(DialogInterface dialog, float size)
+    {
+    Button btnPositive = ((AlertDialog)dialog).getButton(Dialog.BUTTON_POSITIVE);
+    btnPositive.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
+    Button btnNegative = ((AlertDialog)dialog).getButton(Dialog.BUTTON_NEGATIVE);
+    btnNegative.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
+    }
 
-    dialog.setOnShowListener(new DialogInterface.OnShowListener()
-      {
-      @Override
-      public void onShow(DialogInterface dialog)
-        {
-        Button btnPositive = ((AlertDialog)dialog).getButton(Dialog.BUTTON_POSITIVE);
-        btnPositive.setTextSize(TypedValue.COMPLEX_UNIT_PX, butSize);
-        Button btnNegative = ((AlertDialog)dialog).getButton(Dialog.BUTTON_NEGATIVE);
-        btnNegative.setTextSize(TypedValue.COMPLEX_UNIT_PX, butSize);
-        }
-      });
+///////////////////////////////////////////////////////////////////////////////////////////////////
 
-    return dialog;
+  public void prepareBody(Dialog dialog, View view, FragmentActivity act, float size)
+    {
+    MovementMethod mm = LinkMovementMethod.getInstance();
+    TextView text = view.findViewById(R.id.privacy_string);
+    text.setMovementMethod(mm);
     }
   }
diff --git a/src/main/java/org/distorted/dialogs/RubikDialogScores.java b/src/main/java/org/distorted/dialogs/RubikDialogScores.java
index 48303273..d18162e3 100644
--- a/src/main/java/org/distorted/dialogs/RubikDialogScores.java
+++ b/src/main/java/org/distorted/dialogs/RubikDialogScores.java
@@ -77,18 +77,15 @@ public class RubikDialogScores extends AppCompatDialogFragment
       });
 
     Bundle args = getArguments();
-    int curTab;
-    boolean isSubmitting;
+    String submitting;
 
     try
       {
-      curTab = args.getInt("tab");
-      isSubmitting = args.getBoolean("submitting");
+      submitting = args.getString("argument");
       }
     catch(Exception e)
       {
-      curTab = 0;
-      isSubmitting = false;
+      submitting = "";
       }
 
     LayoutInflater inflater = act.getLayoutInflater();
@@ -97,10 +94,10 @@ public class RubikDialogScores extends AppCompatDialogFragment
 
     ViewPager viewPager = view.findViewById(R.id.viewpager);
     TabLayout tabLayout = view.findViewById(R.id.sliding_tabs);
-    mPagerAdapter = new RubikDialogScoresPagerAdapter(act,viewPager,isSubmitting, this);
+    mPagerAdapter = new RubikDialogScoresPagerAdapter(act,viewPager,submitting.equals("true"), this);
     tabLayout.setupWithViewPager(viewPager);
 
-    viewPager.setCurrentItem(curTab);
+    viewPager.setCurrentItem(RubikObjectList.getCurrObject());
     int numObjects = RubikObjectList.getNumObjects();
     ViewGroup.LayoutParams paramsView = new ViewGroup.LayoutParams( tabWidth,tabHeight );
 
diff --git a/src/main/java/org/distorted/dialogs/RubikDialogScoresPagerAdapter.java b/src/main/java/org/distorted/dialogs/RubikDialogScoresPagerAdapter.java
index 504c50ca..6eb0a436 100644
--- a/src/main/java/org/distorted/dialogs/RubikDialogScoresPagerAdapter.java
+++ b/src/main/java/org/distorted/dialogs/RubikDialogScoresPagerAdapter.java
@@ -173,7 +173,7 @@ class RubikDialogScoresPagerAdapter extends PagerAdapter implements RubikNetwork
                 break;
       case '2': RubikScores scores = RubikScores.getInstance();
                 Bundle bundle = new Bundle();
-                bundle.putString("name", scores.getName() );
+                bundle.putString("argument", scores.getName() );
 
                 RubikDialogSetName nameDiag = new RubikDialogSetName();
                 nameDiag.setArguments(bundle);
diff --git a/src/main/java/org/distorted/dialogs/RubikDialogSetName.java b/src/main/java/org/distorted/dialogs/RubikDialogSetName.java
index 0d6e95cb..ec77cde8 100644
--- a/src/main/java/org/distorted/dialogs/RubikDialogSetName.java
+++ b/src/main/java/org/distorted/dialogs/RubikDialogSetName.java
@@ -12,17 +12,12 @@ package org.distorted.dialogs;
 import android.app.Dialog;
 import android.content.DialogInterface;
 import android.os.Bundle;
-import androidx.annotation.NonNull;
 import androidx.fragment.app.FragmentActivity;
 import androidx.appcompat.app.AlertDialog;
-import androidx.appcompat.app.AppCompatDialogFragment;
 import android.text.Editable;
 import android.text.TextWatcher;
-import android.util.DisplayMetrics;
 import android.util.TypedValue;
-import android.view.LayoutInflater;
 import android.view.View;
-import android.view.Window;
 import android.view.WindowManager;
 import android.widget.Button;
 import android.widget.EditText;
@@ -31,12 +26,11 @@ import android.widget.TextView;
 import org.distorted.main.R;
 import org.distorted.main.RubikActivity;
 import org.distorted.external.RubikScores;
-import org.distorted.objects.RubikObjectList;
 import org.distorted.screens.ScreenList;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-public class RubikDialogSetName extends AppCompatDialogFragment
+public class RubikDialogSetName extends RubikDialogAbstract
   {
   private static final int MAX_NAME_LEN = 15;
   private EditText mEdit;
@@ -64,58 +58,29 @@ public class RubikDialogSetName extends AppCompatDialogFragment
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  @NonNull
-  @Override
-  public Dialog onCreateDialog(Bundle savedInstanceState)
+  public int getResource()
     {
-    FragmentActivity act = getActivity();
-    LayoutInflater inflater = act.getLayoutInflater();
-    AlertDialog.Builder builder = new AlertDialog.Builder(act);
-
-    DisplayMetrics displaymetrics = new DisplayMetrics();
-    act.getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
-    int h = displaymetrics.heightPixels;
-    final float titleSize= h*0.032f;
-    final float okSize   = h*0.040f;
-    final float textSize = h*0.022f;
-
-    Bundle args = getArguments();
-    String name;
-
-    try
-      {
-      name = args.getString("name");
-      }
-    catch(Exception e)
-      {
-      name = "";
-      }
+    return R.layout.dialog_set_name;
+    }
 
-    boolean first = name.length()==0;
+///////////////////////////////////////////////////////////////////////////////////////////////////
 
-    TextView tv = (TextView) inflater.inflate(R.layout.dialog_title, null);
-    tv.setTextSize(TypedValue.COMPLEX_UNIT_PX, titleSize);
-    tv.setText( first ? R.string.choose_name : R.string.name_taken);
-    builder.setCustomTitle(tv);
+  public int getTitleResource()
+    {
+    return mArgument.length()==0 ? R.string.choose_name : R.string.name_taken;
+    }
 
-    final View view = inflater.inflate(R.layout.dialog_set_name, null);
-    TextView text = view.findViewById(R.id.set_name_message);
-    text.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
-    mEdit = view.findViewById(R.id.set_name);
-    mEdit.setHeight( (int)(2*titleSize) );
-    mEdit.setTextSize(TypedValue.COMPLEX_UNIT_PX, 1.5f*titleSize);
+///////////////////////////////////////////////////////////////////////////////////////////////////
 
-    if( first )
-      {
-      text.setText(R.string.new_name);
-      }
-    else
-      {
-      text.setText(act.getString(R.string.new_name_try_again, name));
-      }
+  public boolean hasArgument()
+    {
+    return true;
+    }
 
-    builder.setCancelable(true);
+///////////////////////////////////////////////////////////////////////////////////////////////////
 
+  public void setPositive(AlertDialog.Builder builder)
+    {
     builder.setPositiveButton( R.string.ok, new DialogInterface.OnClickListener()
       {
       @Override
@@ -140,9 +105,7 @@ public class RubikDialogSetName extends AppCompatDialogFragment
             RubikScores.getInstance().setName(name);
 
             Bundle bundle = new Bundle();
-            bundle.putInt("tab", RubikObjectList.getCurrObject() );
-            bundle.putBoolean("submitting", true);
-
+            bundle.putString("argument", "true");
             RubikDialogScores scores = new RubikDialogScores();
             scores.setArguments(bundle);
             scores.show(act.getSupportFragmentManager(), null);
@@ -154,9 +117,42 @@ public class RubikDialogSetName extends AppCompatDialogFragment
           }
         }
       });
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void setNegative(AlertDialog.Builder builder)
+    {
+
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void onShowDialog(DialogInterface dialog, float size)
+    {
+    Button btnPositive = ((AlertDialog)dialog).getButton(Dialog.BUTTON_POSITIVE);
+    btnPositive.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void prepareBody(Dialog dialog, View view, FragmentActivity act, float size)
+    {
+    TextView text = view.findViewById(R.id.set_name_message);
+    text.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
+    mEdit = view.findViewById(R.id.set_name);
+    mEdit.setHeight( (int)(2*mTitleSize) );
+    mEdit.setTextSize(TypedValue.COMPLEX_UNIT_PX, 1.5f*mTitleSize);
+
+    if( mArgument.length()==0 )
+      {
+      text.setText(R.string.new_name);
+      }
+    else
+      {
+      text.setText(act.getString(R.string.new_name_try_again, mArgument));
+      }
 
-    builder.setView(view);
-    final Dialog dialog = builder.create();
     dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
 
     mEdit.requestFocus();
@@ -175,25 +171,5 @@ public class RubikDialogSetName extends AppCompatDialogFragment
         ((AlertDialog) dialog).getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(count>0);
         }
       });
-
-    dialog.setCanceledOnTouchOutside(false);
-    Window window = dialog.getWindow();
-
-    if( window!=null )
-      {
-      window.getDecorView().setSystemUiVisibility(RubikActivity.FLAGS);
-      }
-
-    dialog.setOnShowListener(new DialogInterface.OnShowListener()
-      {
-      @Override
-      public void onShow(DialogInterface dialog)
-        {
-        Button btnPositive = ((AlertDialog)dialog).getButton(Dialog.BUTTON_POSITIVE);
-        btnPositive.setTextSize(TypedValue.COMPLEX_UNIT_PX, okSize);
-        }
-      });
-
-    return dialog;
     }
   }
diff --git a/src/main/java/org/distorted/dialogs/RubikDialogSolved.java b/src/main/java/org/distorted/dialogs/RubikDialogSolved.java
index b2f3998d..442e5dd5 100644
--- a/src/main/java/org/distorted/dialogs/RubikDialogSolved.java
+++ b/src/main/java/org/distorted/dialogs/RubikDialogSolved.java
@@ -11,17 +11,11 @@ package org.distorted.dialogs;
 
 import android.app.Dialog;
 import android.content.DialogInterface;
-import android.os.Bundle;
-import androidx.annotation.NonNull;
 import androidx.fragment.app.FragmentActivity;
 import androidx.appcompat.app.AlertDialog;
-import androidx.appcompat.app.AppCompatDialogFragment;
 
-import android.util.DisplayMetrics;
 import android.util.TypedValue;
-import android.view.LayoutInflater;
 import android.view.View;
-import android.view.Window;
 import android.widget.Button;
 import android.widget.TextView;
 
@@ -31,29 +25,31 @@ import org.distorted.screens.ScreenList;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-public class RubikDialogSolved extends AppCompatDialogFragment
+public class RubikDialogSolved extends RubikDialogAbstract
   {
-  @NonNull
-  @Override
-  public Dialog onCreateDialog(Bundle savedInstanceState)
+  public int getResource()
+    {
+    return R.layout.dialog_solved;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public int getTitleResource()
+    {
+    return R.string.solved;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public boolean hasArgument()
+    {
+    return true;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void setPositive(AlertDialog.Builder builder)
     {
-    FragmentActivity act = getActivity();
-    LayoutInflater inflater = act.getLayoutInflater();
-    AlertDialog.Builder builder = new AlertDialog.Builder(act);
-
-    DisplayMetrics displaymetrics = new DisplayMetrics();
-    act.getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
-    int h = displaymetrics.heightPixels;
-    final float titleSize= h*0.032f;
-    final float okSize   = h*0.040f;
-    final float textSize = h*0.022f;
-
-    TextView tv = (TextView) inflater.inflate(R.layout.dialog_title, null);
-    tv.setTextSize(TypedValue.COMPLEX_UNIT_PX, titleSize);
-    tv.setText(R.string.solved);
-    builder.setCustomTitle(tv);
-
-    builder.setCancelable(true);
     builder.setPositiveButton( R.string.ok, new DialogInterface.OnClickListener()
       {
       @Override
@@ -63,45 +59,30 @@ public class RubikDialogSolved extends AppCompatDialogFragment
         ScreenList.switchScreen(act, ScreenList.PLAY);
         }
       });
+    }
 
-    Bundle args = getArguments();
-    long time;
+///////////////////////////////////////////////////////////////////////////////////////////////////
 
-    try
-      {
-      time = args.getLong("time");
-      }
-    catch(Exception e)
-      {
-      time = 0;
-      }
+  public void setNegative(AlertDialog.Builder builder)
+    {
 
-    final View view = inflater.inflate(R.layout.dialog_solved, null);
-    TextView text = view.findViewById(R.id.solved_time);
-    text.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
-    text.setText(getString(R.string.ti_placeholder, (time/10)/100.0f));
-    builder.setView(view);
+    }
 
-    Dialog dialog = builder.create();
-    dialog.setCanceledOnTouchOutside(false);
-    Window window = dialog.getWindow();
+///////////////////////////////////////////////////////////////////////////////////////////////////
 
-    if( window!=null )
-      {
-      window.getDecorView().setSystemUiVisibility(RubikActivity.FLAGS);
-      }
+  public void onShowDialog(DialogInterface dialog, float size)
+    {
+    Button btnPositive = ((AlertDialog)dialog).getButton(Dialog.BUTTON_POSITIVE);
+    btnPositive.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
+    }
 
-    dialog.setOnShowListener(new DialogInterface.OnShowListener()
-      {
-      @Override
-      public void onShow(DialogInterface dialog)
-        {
-        Button btnPositive = ((AlertDialog)dialog).getButton(Dialog.BUTTON_POSITIVE);
-        btnPositive.setTextSize(TypedValue.COMPLEX_UNIT_PX, okSize);
-        }
-      });
+///////////////////////////////////////////////////////////////////////////////////////////////////
 
-    return dialog;
+  public void prepareBody(Dialog dialog, View view, FragmentActivity act, float size)
+    {
+    TextView text = view.findViewById(R.id.solved_time);
+    text.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
+    text.setText(getString(R.string.ti_placeholder, mArgument));
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/dialogs/RubikDialogSolverError.java b/src/main/java/org/distorted/dialogs/RubikDialogSolverError.java
index d37751b8..11ddf6f2 100644
--- a/src/main/java/org/distorted/dialogs/RubikDialogSolverError.java
+++ b/src/main/java/org/distorted/dialogs/RubikDialogSolverError.java
@@ -11,48 +11,43 @@ package org.distorted.dialogs;
 
 import android.app.Dialog;
 import android.content.DialogInterface;
-import android.os.Bundle;
-import androidx.annotation.NonNull;
 import androidx.fragment.app.FragmentActivity;
 import androidx.appcompat.app.AlertDialog;
-import androidx.appcompat.app.AppCompatDialogFragment;
 
-import android.util.DisplayMetrics;
 import android.util.TypedValue;
-import android.view.LayoutInflater;
 import android.view.View;
-import android.view.Window;
 import android.widget.Button;
 import android.widget.TextView;
 
 import org.distorted.main.R;
-import org.distorted.main.RubikActivity;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-public class RubikDialogSolverError extends AppCompatDialogFragment
+public class RubikDialogSolverError extends RubikDialogAbstract
   {
-  @NonNull
-  @Override
-  public Dialog onCreateDialog(Bundle savedInstanceState)
+  public int getResource()
+    {
+    return R.layout.dialog_solver_error;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public int getTitleResource()
+    {
+    return R.string.error;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public boolean hasArgument()
+    {
+    return true;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void setPositive(AlertDialog.Builder builder)
     {
-    FragmentActivity act = getActivity();
-    LayoutInflater inflater = act.getLayoutInflater();
-    AlertDialog.Builder builder = new AlertDialog.Builder(act);
-
-    DisplayMetrics displaymetrics = new DisplayMetrics();
-    act.getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
-    int h = displaymetrics.heightPixels;
-    final float titleSize= h * 0.030f;
-    final float okSize   = h * 0.040f;
-    final float textSize = h * 0.033f;
-
-    TextView tv = (TextView) inflater.inflate(R.layout.dialog_title, null);
-    tv.setTextSize(TypedValue.COMPLEX_UNIT_PX, titleSize);
-    tv.setText(R.string.error);
-    builder.setCustomTitle(tv);
-
-    builder.setCancelable(true);
     builder.setPositiveButton( R.string.ok, new DialogInterface.OnClickListener()
       {
       @Override
@@ -61,44 +56,29 @@ public class RubikDialogSolverError extends AppCompatDialogFragment
 
         }
       });
+    }
 
-    Bundle args = getArguments();
-    String errorStr;
+///////////////////////////////////////////////////////////////////////////////////////////////////
 
-    try
-      {
-      errorStr = args.getString("error");
-      }
-    catch(Exception e)
-      {
-      errorStr = "Error";
-      }
+  public void setNegative(AlertDialog.Builder builder)
+    {
 
-    final View view = inflater.inflate(R.layout.dialog_solver_error, null);
-    TextView text = view.findViewById(R.id.solver_error);
-    text.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
-    text.setText(errorStr);
-    builder.setView(view);
+    }
 
-    Dialog dialog = builder.create();
-    dialog.setCanceledOnTouchOutside(false);
-    Window window = dialog.getWindow();
+///////////////////////////////////////////////////////////////////////////////////////////////////
 
-    if( window!=null )
-      {
-      window.getDecorView().setSystemUiVisibility(RubikActivity.FLAGS);
-      }
+  public void onShowDialog(DialogInterface dialog, float size)
+    {
+    Button btnPositive = ((AlertDialog)dialog).getButton(Dialog.BUTTON_POSITIVE);
+    btnPositive.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
+    }
 
-    dialog.setOnShowListener(new DialogInterface.OnShowListener()
-      {
-      @Override
-      public void onShow(DialogInterface dialog)
-        {
-        Button btnPositive = ((AlertDialog)dialog).getButton(Dialog.BUTTON_POSITIVE);
-        btnPositive.setTextSize(TypedValue.COMPLEX_UNIT_PX, okSize);
-        }
-      });
+///////////////////////////////////////////////////////////////////////////////////////////////////
 
-    return dialog;
+  public void prepareBody(Dialog dialog, View view, FragmentActivity act, float size)
+    {
+    TextView text = view.findViewById(R.id.solver_error);
+    text.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
+    text.setText(mArgument);
     }
   }
diff --git a/src/main/java/org/distorted/dialogs/RubikDialogStarsExplain.java b/src/main/java/org/distorted/dialogs/RubikDialogStarsExplain.java
index c4bc0d55..85ca936b 100644
--- a/src/main/java/org/distorted/dialogs/RubikDialogStarsExplain.java
+++ b/src/main/java/org/distorted/dialogs/RubikDialogStarsExplain.java
@@ -11,67 +11,73 @@ package org.distorted.dialogs;
 
 import android.app.Dialog;
 import android.content.DialogInterface;
-import android.os.Bundle;
-import android.util.DisplayMetrics;
 import android.util.TypedValue;
-import android.view.LayoutInflater;
 import android.view.View;
-import android.view.Window;
 import android.widget.Button;
+import android.widget.TextView;
 
-import androidx.annotation.NonNull;
 import androidx.appcompat.app.AlertDialog;
-import androidx.appcompat.app.AppCompatDialogFragment;
 import androidx.fragment.app.FragmentActivity;
 
 import org.distorted.main.R;
-import org.distorted.main.RubikActivity;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-public class RubikDialogStarsExplain extends AppCompatDialogFragment
+public class RubikDialogStarsExplain extends RubikDialogAbstract
   {
-  @NonNull
-  @Override
-  public Dialog onCreateDialog(Bundle savedInstanceState)
+  public int getResource()
     {
-    FragmentActivity act = getActivity();
-    LayoutInflater inflater = act.getLayoutInflater();
-    AlertDialog.Builder builder = new AlertDialog.Builder(act);
-    DisplayMetrics displaymetrics = new DisplayMetrics();
-    act.getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
-    final float butSize = displaymetrics.heightPixels * 0.04f;
-    final View view = inflater.inflate(R.layout.dialog_stars_explain, null);
+    return R.layout.dialog_stars_explain;
+    }
 
-    builder.setCancelable(true);
+///////////////////////////////////////////////////////////////////////////////////////////////////
 
-    builder.setPositiveButton( R.string.ok, new DialogInterface.OnClickListener()
-      {
-      @Override
-      public void onClick(DialogInterface dialog, int which) { }
-      });
+  public int getTitleResource()
+    {
+    return -1;
+    }
 
-    builder.setView(view);
+///////////////////////////////////////////////////////////////////////////////////////////////////
 
-    final Dialog dialog = builder.create();
-    dialog.setCanceledOnTouchOutside(false);
-    Window window = dialog.getWindow();
+  public boolean hasArgument()
+    {
+    return false;
+    }
 
-    if( window!=null )
-      {
-      window.getDecorView().setSystemUiVisibility(RubikActivity.FLAGS);
-      }
+///////////////////////////////////////////////////////////////////////////////////////////////////
 
-    dialog.setOnShowListener(new DialogInterface.OnShowListener()
+  public void setPositive(AlertDialog.Builder builder)
+    {
+    builder.setPositiveButton( R.string.ok, new DialogInterface.OnClickListener()
       {
       @Override
-      public void onShow(DialogInterface dialog)
+      public void onClick(DialogInterface dialog, int which)
         {
-        Button btnPositive = ((AlertDialog)dialog).getButton(Dialog.BUTTON_POSITIVE);
-        btnPositive.setTextSize(TypedValue.COMPLEX_UNIT_PX, butSize);
+
         }
       });
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void setNegative(AlertDialog.Builder builder)
+    {
+
+    }
 
-    return dialog;
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void onShowDialog(DialogInterface dialog, float size)
+    {
+    Button btnPositive = ((AlertDialog)dialog).getButton(Dialog.BUTTON_POSITIVE);
+    btnPositive.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void prepareBody(Dialog dialog, View view, FragmentActivity act, float size)
+    {
+    TextView text = view.findViewById(R.id.stars_dialog_explain);
+    text.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
     }
   }
diff --git a/src/main/java/org/distorted/dialogs/RubikDialogStarsStatus.java b/src/main/java/org/distorted/dialogs/RubikDialogStarsStatus.java
index 6fe39967..2607a8b8 100644
--- a/src/main/java/org/distorted/dialogs/RubikDialogStarsStatus.java
+++ b/src/main/java/org/distorted/dialogs/RubikDialogStarsStatus.java
@@ -12,10 +12,8 @@ package org.distorted.dialogs;
 import android.app.Dialog;
 import android.content.Context;
 import android.content.DialogInterface;
-import android.os.Bundle;
 import android.util.DisplayMetrics;
 import android.util.TypedValue;
-import android.view.LayoutInflater;
 import android.view.View;
 import android.view.Window;
 import android.view.WindowManager;
@@ -23,115 +21,107 @@ import android.widget.Button;
 import android.widget.LinearLayout;
 import android.widget.TextView;
 
-import androidx.annotation.NonNull;
 import androidx.appcompat.app.AlertDialog;
-import androidx.appcompat.app.AppCompatDialogFragment;
 import androidx.fragment.app.FragmentActivity;
 
 import org.distorted.external.RubikScores;
 import org.distorted.main.R;
-import org.distorted.main.RubikActivity;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-public class RubikDialogStarsStatus extends AppCompatDialogFragment
+public class RubikDialogStarsStatus extends RubikDialogAbstract
   {
-  private static final float LAYOUT_HEIGHT = 0.110f;
-  private static final float MARGIN        = 0.007f;
-  private static final float BUTTON_SIZE   = 0.040f;
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  @NonNull
   @Override
-  public Dialog onCreateDialog(Bundle savedInstanceState)
+  public void onResume()
     {
-    FragmentActivity act = getActivity();
-    LayoutInflater inflater = act.getLayoutInflater();
-    AlertDialog.Builder builder = new AlertDialog.Builder(act);
-    DisplayMetrics displaymetrics = new DisplayMetrics();
-    act.getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
-    final View view = inflater.inflate(R.layout.dialog_stars_status, null);
-
-    int h = displaymetrics.heightPixels;
-    final float butSize = h * BUTTON_SIZE;
-    int height = (int)(h*LAYOUT_HEIGHT);
-    int margin = (int)(h*MARGIN);
+    super.onResume();
 
-    LinearLayout.LayoutParams params1 = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);
-    params1.setMargins(margin, margin, margin, margin);
-    LinearLayout.LayoutParams params2 = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,height);
-    params2.setMargins(margin, margin, margin, margin);
+    Window window = getDialog().getWindow();
+    Context context = getContext();
 
-    LinearLayout lm = view.findViewById(R.id.stars_main);
-    lm.setPadding(margin,margin,margin,margin);
+    if( window!=null && context!=null )
+      {
+      WindowManager.LayoutParams params = window.getAttributes();
+      params.width  = (int)Math.min( mHeight*0.65f,mWidth*0.95f );
+      params.height = WindowManager.LayoutParams.WRAP_CONTENT;
+      window.setAttributes(params);
+      }
+    }
 
-    LinearLayout ls = view.findViewById(R.id.stars_strings);
-    ls.setLayoutParams(params1);
-    LinearLayout l1 = view.findViewById(R.id.stars_layout_1);
-    l1.setLayoutParams(params2);
-    LinearLayout l2 = view.findViewById(R.id.stars_layout_2);
-    l2.setLayoutParams(params2);
-    LinearLayout l3 = view.findViewById(R.id.stars_layout_3);
-    l3.setLayoutParams(params2);
+///////////////////////////////////////////////////////////////////////////////////////////////////
 
-    fillUpNumberOfStars(view);
+  public int getResource()
+    {
+    return R.layout.dialog_stars_status;
+    }
 
-    builder.setCancelable(true);
+///////////////////////////////////////////////////////////////////////////////////////////////////
 
-    builder.setPositiveButton( R.string.ok, new DialogInterface.OnClickListener()
-      {
-      @Override
-      public void onClick(DialogInterface dialog, int which) { }
-      });
+  public int getTitleResource()
+    {
+    return -1;
+    }
 
-    builder.setView(view);
+///////////////////////////////////////////////////////////////////////////////////////////////////
 
-    final Dialog dialog = builder.create();
-    dialog.setCanceledOnTouchOutside(false);
-    Window window = dialog.getWindow();
+  public boolean hasArgument()
+    {
+    return false;
+    }
 
-    if( window!=null )
-      {
-      window.getDecorView().setSystemUiVisibility(RubikActivity.FLAGS);
-      }
+///////////////////////////////////////////////////////////////////////////////////////////////////
 
-    dialog.setOnShowListener(new DialogInterface.OnShowListener()
+  public void setPositive(AlertDialog.Builder builder)
+    {
+    builder.setPositiveButton( R.string.ok, new DialogInterface.OnClickListener()
       {
       @Override
-      public void onShow(DialogInterface dialog)
+      public void onClick(DialogInterface dialog, int which)
         {
-        Button btnPositive = ((AlertDialog)dialog).getButton(Dialog.BUTTON_POSITIVE);
-        btnPositive.setTextSize(TypedValue.COMPLEX_UNIT_PX, butSize);
+
         }
       });
-
-    return dialog;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  @Override
-  public void onResume()
+  public void setNegative(AlertDialog.Builder builder)
     {
-    super.onResume();
 
-    Window window = getDialog().getWindow();
-    Context context = getContext();
+    }
 
-    if( window!=null && context!=null )
-      {
-      DisplayMetrics metrics = context.getResources().getDisplayMetrics();
-      WindowManager.LayoutParams params = window.getAttributes();
-      params.width  = (int)Math.min( 0.65f*metrics.heightPixels,0.95f*metrics.widthPixels );
-      params.height = WindowManager.LayoutParams.WRAP_CONTENT;
-      window.setAttributes(params);
-      }
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void onShowDialog(DialogInterface dialog, float size)
+    {
+    Button btnPositive = ((AlertDialog)dialog).getButton(Dialog.BUTTON_POSITIVE);
+    btnPositive.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
     }
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  void fillUpNumberOfStars(View view)
+  public void prepareBody(Dialog dialog, View view, FragmentActivity act, float size)
     {
+    int height = (int)(mHeight*0.110f);
+    int margin = (int)(mHeight*0.007f);
+
+    LinearLayout.LayoutParams params1 = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);
+    params1.setMargins(margin, margin, margin, margin);
+    LinearLayout.LayoutParams params2 = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,height);
+    params2.setMargins(margin, margin, margin, margin);
+
+    LinearLayout lm = view.findViewById(R.id.stars_main);
+    lm.setPadding(margin,margin,margin,margin);
+
+    LinearLayout ls = view.findViewById(R.id.stars_strings);
+    ls.setLayoutParams(params1);
+    LinearLayout l1 = view.findViewById(R.id.stars_layout_1);
+    l1.setLayoutParams(params2);
+    LinearLayout l2 = view.findViewById(R.id.stars_layout_2);
+    l2.setLayoutParams(params2);
+    LinearLayout l3 = view.findViewById(R.id.stars_layout_3);
+    l3.setLayoutParams(params2);
+
     int number = RubikScores.getInstance().getNumStars();
     TextView v = view.findViewById(R.id.stars_string1);
     v.setText(getString(R.string.buy_string1,number));
diff --git a/src/main/java/org/distorted/dialogs/RubikDialogUpdates.java b/src/main/java/org/distorted/dialogs/RubikDialogUpdates.java
index a1cc72fa..6c6792d3 100644
--- a/src/main/java/org/distorted/dialogs/RubikDialogUpdates.java
+++ b/src/main/java/org/distorted/dialogs/RubikDialogUpdates.java
@@ -14,81 +14,53 @@ import java.util.ArrayList;
 import android.app.Dialog;
 import android.content.DialogInterface;
 import android.graphics.Bitmap;
-import android.os.Bundle;
-import android.util.DisplayMetrics;
 import android.util.TypedValue;
-import android.view.LayoutInflater;
 import android.view.View;
-import android.view.Window;
 import android.widget.Button;
 import android.widget.LinearLayout;
 import android.widget.TextView;
 
-import androidx.annotation.NonNull;
 import androidx.appcompat.app.AlertDialog;
-import androidx.appcompat.app.AppCompatDialogFragment;
 import androidx.fragment.app.FragmentActivity;
 
 import org.distorted.main.R;
-import org.distorted.main.RubikActivity;
 import org.distorted.external.RubikNetwork;
 import org.distorted.external.RubikUpdates;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-public class RubikDialogUpdates extends AppCompatDialogFragment implements RubikNetwork.IconReceiver, RubikNetwork.Updatee
+public class RubikDialogUpdates extends RubikDialogAbstract implements RubikNetwork.IconReceiver, RubikNetwork.Updatee
   {
   private TextView mText;
   private LinearLayout mLayout;
   private int mMargin, mSize, mFontSize, mPadding;
-
   private ArrayList<RubikDialogUpdateView> mPanes;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  private View createView(FragmentActivity act, LayoutInflater inflater, float size, int minH)
+  public int getResource()
     {
-    final View view = inflater.inflate(R.layout.dialog_updates, null);
-
-    mLayout= view.findViewById(R.id.updates_main_layout);
-    mText  = view.findViewById(R.id.updates_message);
-    mText.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
-    mText.setText( act.getString(R.string.downloading) );
+    return R.layout.dialog_updates;
+    }
 
-    mLayout.setMinimumHeight(minH);
-    mText.setMinimumHeight(minH);
+///////////////////////////////////////////////////////////////////////////////////////////////////
 
-    return view;
+  public int getTitleResource()
+    {
+    return R.string.updates;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  @NonNull
-  @Override
-  public Dialog onCreateDialog(Bundle savedInstanceState)
+  public boolean hasArgument()
     {
-    if( mPanes==null ) mPanes = new ArrayList<>();
+    return false;
+    }
 
-    FragmentActivity act = getActivity();
-    LayoutInflater inflater = act.getLayoutInflater();
-    AlertDialog.Builder builder = new AlertDialog.Builder(act);
-
-    DisplayMetrics displaymetrics = new DisplayMetrics();
-    act.getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
-    int h= displaymetrics.heightPixels;
-    final float titleSize= h*0.032f;
-    final float okSize   = h*0.04f;
-    mMargin   = (int)(h*0.01f);
-    mSize     = (int)(h*0.14f);
-    mFontSize = (int)(h*0.02f);
-    mPadding  = (int)(h*0.01f);
-
-    TextView title = (TextView) inflater.inflate(R.layout.dialog_title, null);
-    title.setTextSize(TypedValue.COMPLEX_UNIT_PX, titleSize);
-    title.setText(R.string.updates);
-    builder.setCustomTitle(title);
-
-    builder.setCancelable(true);
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void setPositive(AlertDialog.Builder builder)
+    {
     builder.setPositiveButton( R.string.ok, new DialogInterface.OnClickListener()
       {
       @Override
@@ -97,35 +69,46 @@ public class RubikDialogUpdates extends AppCompatDialogFragment implements Rubik
 
         }
       });
+    }
 
-    int minH = (int)(0.25f*h);
-    View view = createView(act,inflater,okSize,minH);
-    view.setMinimumHeight(minH);
-    builder.setView(view);
+///////////////////////////////////////////////////////////////////////////////////////////////////
 
-    Dialog dialog = builder.create();
-    dialog.setCanceledOnTouchOutside(false);
-    Window window = dialog.getWindow();
+  public void setNegative(AlertDialog.Builder builder)
+    {
 
-    if( window!=null )
-      {
-      window.getDecorView().setSystemUiVisibility(RubikActivity.FLAGS);
-      }
+    }
 
-    dialog.setOnShowListener(new DialogInterface.OnShowListener()
-      {
-      @Override
-      public void onShow(DialogInterface dialog)
-        {
-        Button btnPositive = ((AlertDialog)dialog).getButton(Dialog.BUTTON_POSITIVE);
-        btnPositive.setTextSize(TypedValue.COMPLEX_UNIT_PX, okSize);
-        }
-      });
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void onShowDialog(DialogInterface dialog, float size)
+    {
+    Button btnPositive = ((AlertDialog)dialog).getButton(Dialog.BUTTON_POSITIVE);
+    btnPositive.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void prepareBody(Dialog dialog, View view, FragmentActivity act, float size)
+    {
+    if( mPanes==null ) mPanes = new ArrayList<>();
+
+    int minH  = (int)(mHeight*0.25f);
+    mMargin   = (int)(mHeight*0.01f);
+    mSize     = (int)(mHeight*0.14f);
+    mFontSize = (int)(mHeight*0.02f);
+    mPadding  = (int)(mHeight*0.01f);
+
+    mLayout= view.findViewById(R.id.updates_main_layout);
+    mText  = view.findViewById(R.id.updates_message);
+    mText.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
+    mText.setText( act.getString(R.string.downloading) );
+
+    mLayout.setMinimumHeight(minH);
+    mText.setMinimumHeight(minH);
+    view.setMinimumHeight(minH);
 
     RubikNetwork network = RubikNetwork.getInstance();
     network.signUpForUpdates(this);
-
-    return dialog;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -187,6 +170,8 @@ public class RubikDialogUpdates extends AppCompatDialogFragment implements Rubik
     {
     FragmentActivity act = getActivity();
 
+android.util.Log.e("D", "receiveUpdate1");
+
     if( act!=null )
       {
       act.runOnUiThread(new Runnable()
diff --git a/src/main/java/org/distorted/main/RubikObjectLibInterface.java b/src/main/java/org/distorted/main/RubikObjectLibInterface.java
index 5a1966bb..a3e111e3 100644
--- a/src/main/java/org/distorted/main/RubikObjectLibInterface.java
+++ b/src/main/java/org/distorted/main/RubikObjectLibInterface.java
@@ -137,6 +137,16 @@ public class RubikObjectLibInterface implements ObjectLibInterface, ListenerOver
       }
     }
 
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private Bundle createDialogBundle()
+    {
+    Bundle bundle = new Bundle();
+    String arg = String.valueOf((mNewRecord/10)/100.0f);
+    bundle.putString("argument", arg );
+    return bundle;
+    }
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   private void requestReview(RubikActivity act)
@@ -442,9 +452,6 @@ public class RubikObjectLibInterface implements ObjectLibInterface, ListenerOver
     if( ScreenList.getCurrentScreen()== ScreenList.SOLV )
       {
       RubikActivity act = mAct.get();
-      Bundle bundle = new Bundle();
-      bundle.putLong("time", mNewRecord );
-
       reportRecord(act,startTime,endTime,debug,scrambleNum);
       requestReview(act);
 
@@ -465,18 +472,21 @@ public class RubikObjectLibInterface implements ObjectLibInterface, ListenerOver
                                 }
                              else
                                 {
+                                Bundle bundle = createDialogBundle();
                                 RubikDialogNewRecord d2 = new RubikDialogNewRecord();
                                 d2.setArguments(bundle);
                                 d2.show( act.getSupportFragmentManager(), RubikDialogNewRecord.getDialogTag() );
                                 }
                              break;
-        case RECORD_NEW    : RubikDialogNewRecord d2 = new RubikDialogNewRecord();
-                             d2.setArguments(bundle);
-                             d2.show( act.getSupportFragmentManager(), RubikDialogNewRecord.getDialogTag() );
+        case RECORD_NEW    : Bundle byes = createDialogBundle();
+                             RubikDialogNewRecord dyes = new RubikDialogNewRecord();
+                             dyes.setArguments(byes);
+                             dyes.show( act.getSupportFragmentManager(), RubikDialogNewRecord.getDialogTag() );
                              break;
-        case RECORD_NOT_NEW: RubikDialogSolved d3 = new RubikDialogSolved();
-                             d3.setArguments(bundle);
-                             d3.show( act.getSupportFragmentManager(), RubikDialogSolved.getDialogTag() );
+        case RECORD_NOT_NEW: Bundle bno = createDialogBundle();
+                             RubikDialogSolved dno = new RubikDialogSolved();
+                             dno.setArguments(bno);
+                             dno.show( act.getSupportFragmentManager(), RubikDialogSolved.getDialogTag() );
                              break;
         }
 
@@ -496,11 +506,9 @@ public class RubikObjectLibInterface implements ObjectLibInterface, ListenerOver
   public void overlayFinished(long id)
     {
     RubikActivity act = mAct.get();
-    Bundle bundle = new Bundle();
-    bundle.putLong("time", mNewRecord );
-
-    RubikDialogNewRecord d2 = new RubikDialogNewRecord();
-    d2.setArguments(bundle);
-    d2.show( act.getSupportFragmentManager(), RubikDialogNewRecord.getDialogTag() );
+    Bundle bundle = createDialogBundle();
+    RubikDialogNewRecord d = new RubikDialogNewRecord();
+    d.setArguments(bundle);
+    d.show( act.getSupportFragmentManager(), RubikDialogNewRecord.getDialogTag() );
     }
 }
diff --git a/src/main/java/org/distorted/screens/RubikScreenPlay.java b/src/main/java/org/distorted/screens/RubikScreenPlay.java
index 6f9f1bd2..75c30a5c 100644
--- a/src/main/java/org/distorted/screens/RubikScreenPlay.java
+++ b/src/main/java/org/distorted/screens/RubikScreenPlay.java
@@ -389,9 +389,7 @@ public class RubikScreenPlay extends RubikScreenBase implements RubikNetwork.Upd
           {
           mMenuPopup.dismiss();
           Bundle sBundle = new Bundle();
-          int currObject = RubikObjectList.getCurrObject();
-          sBundle.putInt("tab", currObject );
-          sBundle.putBoolean("submitting", false);
+          sBundle.putString("argument", "false");
           RubikDialogScores scores = new RubikDialogScores();
           scores.setArguments(sBundle);
           scores.show(act.getSupportFragmentManager(), null);
diff --git a/src/main/java/org/distorted/screens/RubikScreenSolver.java b/src/main/java/org/distorted/screens/RubikScreenSolver.java
index eaba2555..05f3a4ed 100644
--- a/src/main/java/org/distorted/screens/RubikScreenSolver.java
+++ b/src/main/java/org/distorted/screens/RubikScreenSolver.java
@@ -304,7 +304,7 @@ public class RubikScreenSolver extends RubikScreenAbstract
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public void displayErrorDialog( String message)
+  public void displayErrorDialog(String message)
     {
     mSolving = false;
     RubikActivity act = mWeakAct.get();
@@ -313,7 +313,7 @@ public class RubikScreenSolver extends RubikScreenAbstract
       {
       RubikDialogSolverError dialog = new RubikDialogSolverError();
       Bundle bundle = new Bundle();
-      bundle.putString("error", message );
+      bundle.putString("argument", message );
       dialog.setArguments(bundle);
       dialog.show( act.getSupportFragmentManager(), null);
       }
diff --git a/src/main/res/layout/dialog_stars_explain.xml b/src/main/res/layout/dialog_stars_explain.xml
index 3ff6ac3c..096ac81c 100644
--- a/src/main/res/layout/dialog_stars_explain.xml
+++ b/src/main/res/layout/dialog_stars_explain.xml
@@ -8,7 +8,7 @@
     android:orientation="vertical">
 
     <TextView
-        android:id="@+id/privacy_string"
+        android:id="@+id/stars_dialog_explain"
         android:background="@color/dark_grey"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
diff --git a/src/main/res/values-de/strings.xml b/src/main/res/values-de/strings.xml
index 97171f4e..579a0de2 100755
--- a/src/main/res/values-de/strings.xml
+++ b/src/main/res/values-de/strings.xml
@@ -97,5 +97,5 @@
 
     <string name="ms_placeholder">%1$d ms</string>
     <string name="lv_placeholder">Level %1$d</string>
-    <string name="ti_placeholder">%1$.2f Sekunden</string>
+    <string name="ti_placeholder">%1$s Sekunden</string>
 </resources>
diff --git a/src/main/res/values-es/strings.xml b/src/main/res/values-es/strings.xml
index 50f9b44f..226b9fb3 100755
--- a/src/main/res/values-es/strings.xml
+++ b/src/main/res/values-es/strings.xml
@@ -97,5 +97,5 @@
 
     <string name="ms_placeholder">%1$d ms</string>
     <string name="lv_placeholder">Nivel %1$d</string>
-    <string name="ti_placeholder">%1$.2f segundos</string>
+    <string name="ti_placeholder">%1$s segundos</string>
 </resources>
diff --git a/src/main/res/values-fr/strings.xml b/src/main/res/values-fr/strings.xml
index 55b75fb9..4bc6b40b 100755
--- a/src/main/res/values-fr/strings.xml
+++ b/src/main/res/values-fr/strings.xml
@@ -97,5 +97,5 @@
 
     <string name="ms_placeholder">%1$d ms</string>
     <string name="lv_placeholder">Niveau %1$d</string>
-    <string name="ti_placeholder">%1$.2f secondes</string>
+    <string name="ti_placeholder">%1$s secondes</string>
 </resources>
diff --git a/src/main/res/values-ja/strings.xml b/src/main/res/values-ja/strings.xml
index 9f85face..758d8e19 100755
--- a/src/main/res/values-ja/strings.xml
+++ b/src/main/res/values-ja/strings.xml
@@ -97,5 +97,5 @@
 
     <string name="ms_placeholder">%1$d ms</string>
     <string name="lv_placeholder">レベル %1$d</string>
-    <string name="ti_placeholder">%1$.2f 秒</string>
+    <string name="ti_placeholder">%1$s 秒</string>
 </resources>
diff --git a/src/main/res/values-ko/strings.xml b/src/main/res/values-ko/strings.xml
index afa6ca2e..f49ba123 100755
--- a/src/main/res/values-ko/strings.xml
+++ b/src/main/res/values-ko/strings.xml
@@ -97,5 +97,5 @@
 
     <string name="ms_placeholder">%1$d ms</string>
     <string name="lv_placeholder">레벨 %1$d</string>
-    <string name="ti_placeholder">%1$.2f 초</string>
+    <string name="ti_placeholder">%1$s 초</string>
 </resources>
diff --git a/src/main/res/values-pl/strings.xml b/src/main/res/values-pl/strings.xml
index eeccc542..2120bd43 100644
--- a/src/main/res/values-pl/strings.xml
+++ b/src/main/res/values-pl/strings.xml
@@ -97,5 +97,5 @@
 
     <string name="ms_placeholder">%1$d ms</string>
     <string name="lv_placeholder">Poziom %1$d</string>
-    <string name="ti_placeholder">%1$.2f sekund</string>
+    <string name="ti_placeholder">%1$s sekund</string>
 </resources>
diff --git a/src/main/res/values-ru/strings.xml b/src/main/res/values-ru/strings.xml
index 8b40e253..abfa54f9 100755
--- a/src/main/res/values-ru/strings.xml
+++ b/src/main/res/values-ru/strings.xml
@@ -97,5 +97,5 @@
 
     <string name="ms_placeholder">%1$d мс</string>
     <string name="lv_placeholder">Уровень %1$d</string>
-    <string name="ti_placeholder">%1$.2f сек.</string>
+    <string name="ti_placeholder">%1$s сек.</string>
 </resources>
diff --git a/src/main/res/values-zh-rCN/strings.xml b/src/main/res/values-zh-rCN/strings.xml
index 0e71beeb..323b008d 100644
--- a/src/main/res/values-zh-rCN/strings.xml
+++ b/src/main/res/values-zh-rCN/strings.xml
@@ -103,5 +103,5 @@
 
     <string name="ms_placeholder">%1$d毫秒</string>
     <string name="lv_placeholder">%1$d级</string>
-    <string name="ti_placeholder">%1$.2f 秒</string>
+    <string name="ti_placeholder">%1$s 秒</string>
 </resources>
diff --git a/src/main/res/values-zh-rTW/strings.xml b/src/main/res/values-zh-rTW/strings.xml
index f0cce415..dd55deb4 100644
--- a/src/main/res/values-zh-rTW/strings.xml
+++ b/src/main/res/values-zh-rTW/strings.xml
@@ -97,5 +97,5 @@
 
     <string name="ms_placeholder">%1$d毫秒</string>
     <string name="lv_placeholder">%1$d級</string>
-    <string name="ti_placeholder">%1$.2f 秒</string>
+    <string name="ti_placeholder">%1$s 秒</string>
 </resources>
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index 2a31e229..727a6ff1 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -123,6 +123,6 @@
 
     <string name="ms_placeholder">%1$d ms</string>
     <string name="lv_placeholder">Level %1$d</string>
-    <string name="ti_placeholder">%1$.2f seconds</string>
+    <string name="ti_placeholder">%1$s seconds</string>
 
 </resources>
