Project

General

Profile

« Previous | Next » 

Revision f8a21f6b

Added by Leszek Koltunski over 1 year ago

Unify all dialogs.

View differences:

src/main/java/org/distorted/dialogs/RubikDialogUpdates.java
12 12
import java.util.ArrayList;
13 13

  
14 14
import android.app.Dialog;
15
import android.content.DialogInterface;
16 15
import android.graphics.Bitmap;
17 16
import android.util.TypedValue;
18 17
import android.view.View;
19
import android.widget.Button;
20 18
import android.widget.LinearLayout;
21 19
import android.widget.TextView;
22 20

  
23
import androidx.appcompat.app.AlertDialog;
24 21
import androidx.fragment.app.FragmentActivity;
25 22

  
26 23
import org.distorted.main.R;
......
38 35

  
39 36
///////////////////////////////////////////////////////////////////////////////////////////////////
40 37

  
41
  public int getResource()
42
    {
43
    return R.layout.dialog_updates;
44
    }
38
  public int getResource()      { return R.layout.dialog_updates; }
39
  public int getTitleResource() { return R.string.updates; }
40
  public boolean hasArgument()  { return false; }
41
  public int getPositive()      { return R.string.ok; }
42
  public int getNegative()      { return -1; }
45 43

  
46 44
///////////////////////////////////////////////////////////////////////////////////////////////////
47 45

  
48
  public int getTitleResource()
46
  public void positiveAction()
49 47
    {
50
    return R.string.updates;
51
    }
52 48

  
53
///////////////////////////////////////////////////////////////////////////////////////////////////
54

  
55
  public boolean hasArgument()
56
    {
57
    return false;
58 49
    }
59 50

  
60 51
///////////////////////////////////////////////////////////////////////////////////////////////////
61 52

  
62
  public void setPositive(AlertDialog.Builder builder)
53
  public void negativeAction()
63 54
    {
64
    builder.setPositiveButton( R.string.ok, new DialogInterface.OnClickListener()
65
      {
66
      @Override
67
      public void onClick(DialogInterface dialog, int which)
68
        {
69 55

  
70
        }
71
      });
72
    }
73

  
74
///////////////////////////////////////////////////////////////////////////////////////////////////
75

  
76
  public void setNegative(AlertDialog.Builder builder)
77
    {
78

  
79
    }
80

  
81
///////////////////////////////////////////////////////////////////////////////////////////////////
82

  
83
  public void onShowDialog(DialogInterface dialog, float size)
84
    {
85
    Button btnPositive = ((AlertDialog)dialog).getButton(Dialog.BUTTON_POSITIVE);
86
    btnPositive.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
87 56
    }
88 57

  
89 58
///////////////////////////////////////////////////////////////////////////////////////////////////
......
170 139
    {
171 140
    FragmentActivity act = getActivity();
172 141

  
173
android.util.Log.e("D", "receiveUpdate1");
174

  
175 142
    if( act!=null )
176 143
      {
177 144
      act.runOnUiThread(new Runnable()

Also available in: Unified diff