Project

General

Profile

« Previous | Next » 

Revision 9fde123a

Added by Leszek Koltunski over 2 years ago

Downloading updates: dialog progress.

View differences:

src/main/java/org/distorted/dialogs/RubikDialogUpdateView.java
31 31
import org.distorted.main.R;
32 32
import org.distorted.network.RubikUpdates;
33 33

  
34
import static android.view.View.GONE;
35

  
34 36
///////////////////////////////////////////////////////////////////////////////////////////////////
35 37

  
36 38
public class RubikDialogUpdateView
......
46 48
                         LinearLayout.LayoutParams pImage, LinearLayout.LayoutParams pView,
47 49
                         LinearLayout.LayoutParams pText, LinearLayout.LayoutParams pButt )
48 50
    {
49
    boolean isCompleted = info.mPercent>=100;
50
    int layoutID = isCompleted
51
                   ? R.layout.dialog_updates_completed
52
                   : R.layout.dialog_updates_started;
53

  
54
    View view = act.getLayoutInflater().inflate(layoutID, null);
55

  
51
    View view = act.getLayoutInflater().inflate(R.layout.dialog_updates_pane, null);
56 52
    TextView title = view.findViewById(R.id.updates_pane_title);
57 53
    title.setText(info.mObjectLongName);
58 54
    TextView description = view.findViewById(R.id.updates_pane_description);
......
72 68

  
73 69
    view.setPadding(padding,padding,padding,padding);
74 70

  
75
    if( isCompleted )
76
      {
77
      Button button = view.findViewById(R.id.updates_pane_button);
71
    ProgressBar bar = view.findViewById(R.id.updates_pane_bar);
72
    Button button   = view.findViewById(R.id.updates_pane_button);
78 73

  
74
    if( info.mPercent>=100 )
75
      {
76
      bar.setVisibility(GONE);
79 77
      button.setOnClickListener( new View.OnClickListener()
80 78
        {
81 79
        @Override
......
90 88
      }
91 89
    else
92 90
      {
93
      ProgressBar bar = view.findViewById(R.id.updates_pane_bar);
91
      button.setVisibility(GONE);
94 92
      bar.setLayoutParams(pButt);
95 93
      bar.setProgress(info.mPercent);
96 94
      }

Also available in: Unified diff