Project

General

Profile

« Previous | Next » 

Revision c651024f

Added by Leszek Koltunski over 2 years ago

Downloading updates: dialog progress.

View differences:

src/main/java/org/distorted/dialogs/RubikDialogUpdateView.java
20 20
package org.distorted.dialogs;
21 21

  
22 22
import android.app.Activity;
23
import android.util.TypedValue;
23 24
import android.view.View;
24 25
import android.widget.Button;
25 26
import android.widget.ImageView;
27
import android.widget.LinearLayout;
26 28
import android.widget.TextView;
27 29

  
28 30
import org.distorted.main.R;
......
44 46

  
45 47
///////////////////////////////////////////////////////////////////////////////////////////////////
46 48

  
47
  public View createView(Activity act, RubikUpdates.UpdateInfo info, boolean isNew)
49
  public View createView(Activity act, RubikUpdates.UpdateInfo info, int fontSize, boolean isNew,
50
                         LinearLayout.LayoutParams pImage, LinearLayout.LayoutParams pView,
51
                         LinearLayout.LayoutParams pText, LinearLayout.LayoutParams pButt )
48 52
    {
49 53
    int layoutID = R.layout.dialog_updates_pane;
50 54
    mView = act.getLayoutInflater().inflate(layoutID, null);
51
    Button install = mView.findViewById(R.id.updates_pane_button);
52 55

  
53
    install.setOnClickListener( new View.OnClickListener()
56
    Button button = mView.findViewById(R.id.updates_pane_button);
57

  
58
    button.setOnClickListener( new View.OnClickListener()
54 59
      {
55 60
      @Override
56 61
      public void onClick(View v)
......
63 68
    title.setText(info.mObjectLongName);
64 69
    TextView version = mView.findViewById(R.id.updates_pane_version);
65 70
    String strVersion = info.mUpdateObject
66
                        ? JsonWriter.VERSION_OBJECT_MAJOR+"."+info.mObjectMinorVersion
67
                        : JsonWriter.VERSION_EXTRAS_MAJOR+"."+info.mExtrasMinorVersion;
71
                        ? "v. "+JsonWriter.VERSION_OBJECT_MAJOR+"."+info.mObjectMinorVersion
72
                        : "v. "+JsonWriter.VERSION_EXTRAS_MAJOR+"."+info.mExtrasMinorVersion;
68 73
    version.setText(strVersion);
69 74
    TextView description = mView.findViewById(R.id.updates_pane_description);
70 75
    description.setText(info.mDescription);
......
72 77
    ImageView image = mView.findViewById(R.id.updates_pane_image);
73 78
    image.setBackgroundResource(R.drawable.unknown_icon);
74 79

  
80
    image.setLayoutParams(pImage);
81
    mView.setLayoutParams(pView);
82

  
83
    title.setTextSize(TypedValue.COMPLEX_UNIT_PX, fontSize);
84
    version.setTextSize(TypedValue.COMPLEX_UNIT_PX, fontSize);
85
    description.setTextSize(TypedValue.COMPLEX_UNIT_PX, fontSize);
86
    button.setTextSize(TypedValue.COMPLEX_UNIT_PX, fontSize);
87

  
88
    title.setLayoutParams(pText);
89
    version.setLayoutParams(pText);
90
    description.setLayoutParams(pText);
91
    button.setLayoutParams(pButt);
92

  
75 93
    return mView;
76 94
    }
77 95
  }

Also available in: Unified diff