Project

General

Profile

« Previous | Next » 

Revision d433b50e

Added by Leszek Koltunski over 2 years ago

In the 'magic' app, ObjectType is now only used in RubikObject and RubikObjectList classes and nowhere else.
This is a major step towards being able to download objects from an online repository.

View differences:

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

  
36 36
import com.google.firebase.analytics.FirebaseAnalytics;
37 37

  
38
import org.distorted.objectlib.main.ObjectType;
39

  
40 38
import org.distorted.main.BuildConfig;
41 39
import org.distorted.main.R;
42 40
import org.distorted.main.RubikActivity;
41
import org.distorted.objects.RubikObject;
42
import org.distorted.objects.RubikObjectList;
43 43
import org.distorted.tutorials.TutorialList;
44 44

  
45 45
///////////////////////////////////////////////////////////////////////////////////////////////////
......
76 76
    String packageName = act.getPackageName();
77 77

  
78 78
    TutorialList list  = TutorialList.getObject(position);
79
    ObjectType objType = list.getObject();
79
    int object = list.getObject();
80 80

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

  
96 96
      int countryID = res.getIdentifier( coun, "drawable", packageName);
97 97

  
98
      View row = createRow(ract,countryID,desc,url,auth,widthT,objType,colorB,colorT);
98
      View row = createRow(ract,countryID,desc,url,auth,widthT,object,colorB,colorT);
99 99
      layout.addView(row);
100 100
      }
101 101

  
......
112 112
///////////////////////////////////////////////////////////////////////////////////////////////////
113 113

  
114 114
  private View createRow(final RubikActivity act, int countryID, final String desc, final String url,
115
                         final String auth, int size, final ObjectType obj, int colorB, int colorT)
115
                         final String auth, int size, final int obj, int colorB, int colorT)
116 116
    {
117 117
    float textSize = 0.5f*size;
118 118
    View row = inflate( act, R.layout.dialog_tutorial_row, null);
......
158 158

  
159 159
///////////////////////////////////////////////////////////////////////////////////////////////////
160 160

  
161
  private void analyticsReport(RubikActivity act, String desc, String author, ObjectType obj)
161
  private void analyticsReport(RubikActivity act, String desc, String author, int obj)
162 162
    {
163 163
    String message = desc+" ("+author+")";
164 164

  
......
172 172

  
173 173
      if( analytics!=null )
174 174
        {
175
        RubikObject object = RubikObjectList.getObject(obj);
176

  
175 177
        Bundle bundle = new Bundle();
176 178
        bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, message);
177
        bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, obj.name());
179
        bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, object==null ? "NULL" : object.getName() );
178 180
        analytics.logEvent(FirebaseAnalytics.Event.TUTORIAL_BEGIN, bundle);
179 181
        }
180 182
      }

Also available in: Unified diff