Project

General

Profile

« Previous | Next » 

Revision 7ac0ee88

Added by Leszek Koltunski over 2 years ago

Simplify ObjectList: now there's just one object per size.

View differences:

src/main/java/org/distorted/dialogs/RubikDialogTutorialView.java
77 77

  
78 78
    TutorialList list  = TutorialList.getObject(position);
79 79
    ObjectList objList = list.getObjectList();
80
    int size           = list.getSize();
81 80

  
82 81
    View tab = inflate( act, R.layout.dialog_tutorial_tab, null);
83 82
    LinearLayout layout = tab.findViewById(R.id.tabLayout);
......
93 92

  
94 93
      int countryID = res.getIdentifier( coun, "drawable", packageName);
95 94

  
96
      View row = createRow(ract,countryID,desc,url,auth,widthT,objList,size);
95
      View row = createRow(ract,countryID,desc,url,auth,widthT,objList);
97 96
      layout.addView(row);
98 97
      }
99 98

  
......
110 109
///////////////////////////////////////////////////////////////////////////////////////////////////
111 110

  
112 111
  private View createRow(final RubikActivity act, int countryID, final String desc, final String url,
113
                         final String auth, int width, final ObjectList obj, final int size)
112
                         final String auth, int width, final ObjectList obj)
114 113
    {
115 114
    View row = inflate( act, R.layout.dialog_tutorial_row, null);
116 115
    Button butt = row.findViewById(R.id.tutorialButton);
......
126 125
        {
127 126
        if( mCanClick )
128 127
          {
129
          act.switchTutorial(url,obj,size);
130
          analyticsReport(act,desc,auth,obj,size);
128
          act.switchTutorial(url,obj);
129
          analyticsReport(act,desc,auth,obj);
131 130
          clickPossible(false);
132 131
          }
133 132
        }
......
150 149

  
151 150
///////////////////////////////////////////////////////////////////////////////////////////////////
152 151

  
153
  private void analyticsReport(RubikActivity act, String desc, String author, ObjectList obj, int size)
152
  private void analyticsReport(RubikActivity act, String desc, String author, ObjectList obj)
154 153
    {
155 154
    String message = desc+" ("+author+")";
156 155

  
......
161 160
    else
162 161
      {
163 162
      FirebaseAnalytics analytics = act.getAnalytics();
164
      String name = obj.name()+"_"+size;
165 163

  
166 164
      if( analytics!=null )
167 165
        {
168 166
        Bundle bundle = new Bundle();
169 167
        bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, message);
170
        bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, name);
168
        bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, obj.name());
171 169
        analytics.logEvent(FirebaseAnalytics.Event.TUTORIAL_BEGIN, bundle);
172 170
        }
173 171
      }

Also available in: Unified diff