Browse Source

sensors fragment; pause on pause; play on resume

tags/0.0.5
Robin Thoni 9 years ago
parent
commit
211ee1a082

+ 1
- 1
app/src/main/java/com/rthoni/camotion/business/SensorsBusiness.java View File

16
         return SensorsDataAccess.getAll(config, page, perPage);
16
         return SensorsDataAccess.getAll(config, page, perPage);
17
     }
17
     }
18
 
18
 
19
-    public static LuPromise<SensorValueDbo> getImage(LuDataAccessConfigDbo config, SensorDbo sensor)
19
+    public static LuPromise<SensorValueDbo> getValue(LuDataAccessConfigDbo config, SensorDbo sensor)
20
     {
20
     {
21
         return SensorsDataAccess.getValue(config, sensor.getId());
21
         return SensorsDataAccess.getValue(config, sensor.getId());
22
     }
22
     }

+ 3
- 2
app/src/main/java/com/rthoni/camotion/ui/MainActivity.java View File

24
 import com.rthoni.camotion.ui.fragments.CamerasFragment;
24
 import com.rthoni.camotion.ui.fragments.CamerasFragment;
25
 import com.rthoni.camotion.ui.fragments.CamotionFragment;
25
 import com.rthoni.camotion.ui.fragments.CamotionFragment;
26
 import com.rthoni.camotion.ui.fragments.DefaultFragment;
26
 import com.rthoni.camotion.ui.fragments.DefaultFragment;
27
+import com.rthoni.camotion.ui.fragments.SensorsFragment;
27
 
28
 
28
 import java.util.List;
29
 import java.util.List;
29
 
30
 
141
         CamotionFragment fragment;
142
         CamotionFragment fragment;
142
         if (view == R.id.nav_cameras) {
143
         if (view == R.id.nav_cameras) {
143
             fragment = new CamerasFragment();
144
             fragment = new CamerasFragment();
144
-        } /*else if (view == R.id.nav_sensors) {
145
+        } else if (view == R.id.nav_sensors) {
145
             fragment = new SensorsFragment();
146
             fragment = new SensorsFragment();
146
-        } else if (view == R.id.nav_commands) {
147
+        } /*else if (view == R.id.nav_commands) {
147
             fragment = new CommandsFragment();
148
             fragment = new CommandsFragment();
148
         } else if (view == -1) {
149
         } else if (view == -1) {
149
             fragment = new DefaultFragment();
150
             fragment = new DefaultFragment();

+ 20
- 4
app/src/main/java/com/rthoni/camotion/ui/fragments/CamerasFragment.java View File

1
 package com.rthoni.camotion.ui.fragments;
1
 package com.rthoni.camotion.ui.fragments;
2
 
2
 
3
-import android.view.View;
4
-
5
 import com.luticate.utils.business.LuPromise;
3
 import com.luticate.utils.business.LuPromise;
6
 import com.luticate.utils.dbo.LuMultipleDbo;
4
 import com.luticate.utils.dbo.LuMultipleDbo;
7
 import com.rthoni.camotion.business.CamerasBusiness;
5
 import com.rthoni.camotion.business.CamerasBusiness;
12
  *
10
  *
13
  * Created by robin on 11/29/15.
11
  * Created by robin on 11/29/15.
14
  */
12
  */
15
-public class CamerasFragment extends CamotionFragment<CameraDbo> {
13
+public class CamerasFragment extends CamotionFragment<CameraDbo, CameraView> {
16
 
14
 
17
     @Override
15
     @Override
18
     protected LuPromise<LuMultipleDbo<CameraDbo>> getLoadPagePromise(int page, int perPage, String query) {
16
     protected LuPromise<LuMultipleDbo<CameraDbo>> getLoadPagePromise(int page, int perPage, String query) {
26
     }
24
     }
27
 
25
 
28
     @Override
26
     @Override
29
-    protected View getDboView(CameraDbo camera) {
27
+    public void onPause() {
28
+        super.onPause();
29
+        for (CameraView view : _views)
30
+        {
31
+            view.pause();
32
+        }
33
+    }
34
+
35
+    @Override
36
+    public void onResume() {
37
+        super.onResume();
38
+        for (CameraView view : _views)
39
+        {
40
+            view.play();
41
+        }
42
+    }
43
+
44
+    @Override
45
+    protected CameraView getDboView(CameraDbo camera) {
30
         CameraView imageView = new CameraView(getActivity());
46
         CameraView imageView = new CameraView(getActivity());
31
         imageView.setCamotionDbo(_fullLoginDbo, _currentLocation);
47
         imageView.setCamotionDbo(_fullLoginDbo, _currentLocation);
32
         imageView.setCamera(camera);
48
         imageView.setCamera(camera);

+ 3
- 1
app/src/main/java/com/rthoni/camotion/ui/fragments/CamotionFragment.java View File

1
 package com.rthoni.camotion.ui.fragments;
1
 package com.rthoni.camotion.ui.fragments;
2
 
2
 
3
+import android.view.View;
4
+
3
 import com.luticate.auth.dbo.LuFullLoginDbo;
5
 import com.luticate.auth.dbo.LuFullLoginDbo;
4
 import com.luticate.utils.dbo.LuDbo;
6
 import com.luticate.utils.dbo.LuDbo;
5
 import com.luticate.utils.ui.fragments.ViewPaginationFragment;
7
 import com.luticate.utils.ui.fragments.ViewPaginationFragment;
8
 /**
10
 /**
9
  * Created by robin on 12/3/15.
11
  * Created by robin on 12/3/15.
10
  */
12
  */
11
-public abstract class CamotionFragment<Dbo extends LuDbo> extends ViewPaginationFragment<Dbo> {
13
+public abstract class CamotionFragment<Dbo extends LuDbo, DboView extends View> extends ViewPaginationFragment<Dbo, DboView> {
12
     protected LuFullLoginDbo _fullLoginDbo = null;
14
     protected LuFullLoginDbo _fullLoginDbo = null;
13
     protected LocationDbo _currentLocation = null;
15
     protected LocationDbo _currentLocation = null;
14
 
16
 

+ 55
- 0
app/src/main/java/com/rthoni/camotion/ui/fragments/SensorsFragment.java View File

1
+package com.rthoni.camotion.ui.fragments;
2
+
3
+import com.luticate.utils.business.LuPromise;
4
+import com.luticate.utils.dbo.LuMultipleDbo;
5
+import com.rthoni.camotion.business.CamerasBusiness;
6
+import com.rthoni.camotion.business.SensorsBusiness;
7
+import com.rthoni.camotion.dbo.CameraDbo;
8
+import com.rthoni.camotion.dbo.SensorDbo;
9
+import com.rthoni.camotion.ui.views.CameraView;
10
+import com.rthoni.camotion.ui.views.SensorView;
11
+
12
+/**
13
+ *
14
+ * Created by robin on 11/29/15.
15
+ */
16
+public class SensorsFragment extends CamotionFragment<SensorDbo, SensorView> {
17
+
18
+    @Override
19
+    protected LuPromise<LuMultipleDbo<SensorDbo>> getLoadPagePromise(int page, int perPage, String query) {
20
+        return SensorsBusiness.getAll(_currentLocation.getConfig(_fullLoginDbo.getLoginDbo()), page, perPage)
21
+                .map(new LuPromise.LuConverter<SensorDbo.MultipleSensorDbo, LuMultipleDbo<SensorDbo>>() {
22
+                    @Override
23
+                    public LuMultipleDbo<SensorDbo> convert(SensorDbo.MultipleSensorDbo data) {
24
+                        return data;
25
+                    }
26
+                });
27
+    }
28
+
29
+    @Override
30
+    public void onPause() {
31
+        super.onPause();
32
+        for (SensorView view : _views)
33
+        {
34
+            view.pause();
35
+        }
36
+    }
37
+
38
+    @Override
39
+    public void onResume() {
40
+        super.onResume();
41
+        for (SensorView view : _views)
42
+        {
43
+            view.play();
44
+        }
45
+    }
46
+
47
+    @Override
48
+    protected SensorView getDboView(SensorDbo sensor) {
49
+        SensorView imageView = new SensorView(getActivity());
50
+        imageView.setCamotionDbo(_fullLoginDbo, _currentLocation);
51
+        imageView.setSensor(sensor);
52
+        imageView.play();
53
+        return imageView;
54
+    }
55
+}

+ 13
- 12
app/src/main/java/com/rthoni/camotion/ui/views/SensorView.java View File

13
 import com.luticate.utils.business.LuPromise;
13
 import com.luticate.utils.business.LuPromise;
14
 import com.rthoni.camotion.R;
14
 import com.rthoni.camotion.R;
15
 import com.rthoni.camotion.business.CamerasBusiness;
15
 import com.rthoni.camotion.business.CamerasBusiness;
16
+import com.rthoni.camotion.business.SensorsBusiness;
16
 import com.rthoni.camotion.dbo.CameraDbo;
17
 import com.rthoni.camotion.dbo.CameraDbo;
17
 import com.rthoni.camotion.dbo.LocationDbo;
18
 import com.rthoni.camotion.dbo.LocationDbo;
18
 import com.rthoni.camotion.dbo.SensorDbo;
19
 import com.rthoni.camotion.dbo.SensorDbo;
20
+import com.rthoni.camotion.dbo.SensorValueDbo;
19
 
21
 
20
 /**
22
 /**
21
  * Created by robin on 12/4/15.
23
  * Created by robin on 12/4/15.
26
 
28
 
27
     private SensorDbo _sensor;
29
     private SensorDbo _sensor;
28
 
30
 
29
-    private ImageView _imageView;
31
+    private TextView _textView;
30
 
32
 
31
     private int _interval = 500;
33
     private int _interval = 500;
32
 
34
 
33
     private boolean _playing = false;
35
     private boolean _playing = false;
34
-    private LuPromise<Bitmap> _promise = null;
36
+    private LuPromise<SensorValueDbo> _promise = null;
35
 
37
 
36
     public void setCamotionDbo(LuFullLoginDbo fullLoginDbo, LocationDbo currentLocation)
38
     public void setCamotionDbo(LuFullLoginDbo fullLoginDbo, LocationDbo currentLocation)
37
     {
39
     {
46
     public void setSensor(SensorDbo sensor) {
48
     public void setSensor(SensorDbo sensor) {
47
         _sensor = sensor;
49
         _sensor = sensor;
48
 
50
 
49
-        /*((TextView)findViewById(R.id.textViewName)).setText(_sensor.getName());
51
+        ((TextView)findViewById(R.id.textViewName)).setText(_sensor.getName());
52
+        _textView = (TextView)findViewById(R.id.textViewValue);
50
 
53
 
51
-        findViewById(R.id.imageViewPause).setOnClickListener(new OnClickListener() {
54
+        /*findViewById(R.id.imageViewPause).setOnClickListener(new OnClickListener() {
52
             @Override
55
             @Override
53
             public void onClick(View v) {
56
             public void onClick(View v) {
54
                 togglePlay();
57
                 togglePlay();
82
 
85
 
83
     private void init()
86
     private void init()
84
     {
87
     {
85
-        inflate(getContext(), R.layout.sensors_layout, this);
88
+        inflate(getContext(), R.layout.sensor_view, this);
86
     }
89
     }
87
 
90
 
88
     public void togglePlay()
91
     public void togglePlay()
100
     public void pause()
103
     public void pause()
101
     {
104
     {
102
         _playing = false;
105
         _playing = false;
103
-        findViewById(R.id.imageViewPause).setVisibility(VISIBLE);
104
     }
106
     }
105
 
107
 
106
     public void play()
108
     public void play()
107
     {
109
     {
108
         _playing = true;
110
         _playing = true;
109
-        findViewById(R.id.imageViewPause).setVisibility(GONE);
110
         if (_promise == null || _promise.getStatus() != LuPromise.LuPromiseStatus.Running) {
111
         if (_promise == null || _promise.getStatus() != LuPromise.LuPromiseStatus.Running) {
111
             _play();
112
             _play();
112
         }
113
         }
114
 
115
 
115
     private void _play()
116
     private void _play()
116
     {
117
     {
117
-        /*_promise = CamerasBusiness.getImage(_currentLocation.getConfig(_fullLoginDbo.getLoginDbo()), _camera)
118
-                .then(new LuPromise.LuConsumer<Bitmap>() {
118
+        _promise = SensorsBusiness.getValue(_currentLocation.getConfig(_fullLoginDbo.getLoginDbo()), _sensor)
119
+                .then(new LuPromise.LuConsumer<SensorValueDbo>() {
119
                     @Override
120
                     @Override
120
-                    public void execute(Bitmap image) {
121
+                    public void execute(SensorValueDbo value) {
121
                         if (_playing) {
122
                         if (_playing) {
122
-                            _imageView.setImageBitmap(image);
123
+                            _textView.setText(String.valueOf(value.getValue()));
123
                             Handler h = new Handler();
124
                             Handler h = new Handler();
124
                             h.postDelayed(new Runnable() {
125
                             h.postDelayed(new Runnable() {
125
                                 @Override
126
                                 @Override
134
                     public void execute(LuPromise.LuPromiseError data) {
135
                     public void execute(LuPromise.LuPromiseError data) {
135
 
136
 
136
                     }
137
                     }
137
-                });*/
138
+                });
138
     }
139
     }
139
 }
140
 }

+ 0
- 48
app/src/main/res/layout/cameras_layout.xml View File

1
-<?xml version="1.0" encoding="utf-8"?>
2
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
-              android:layout_width="match_parent"
4
-              android:layout_height="match_parent"
5
-              android:orientation="vertical" >
6
-
7
-    <!-- Loading progress -->
8
-
9
-    <LinearLayout
10
-        android:id="@+id/loadStatus"
11
-        android:layout_width="wrap_content"
12
-        android:layout_height="wrap_content"
13
-        android:layout_gravity="center"
14
-        android:gravity="center_horizontal"
15
-        android:orientation="vertical"
16
-        android:visibility="gone" >
17
-
18
-        <ProgressBar
19
-            style="?android:attr/progressBarStyleLarge"
20
-            android:layout_width="wrap_content"
21
-            android:layout_height="wrap_content"
22
-            android:layout_marginBottom="8dp" />
23
-
24
-        <TextView
25
-            android:id="@+id/loading_status_message"
26
-            android:layout_width="wrap_content"
27
-            android:layout_height="wrap_content"
28
-            android:layout_marginBottom="16dp"
29
-            android:text="@string/loading"
30
-            android:textAppearance="?android:attr/textAppearanceMedium" />
31
-    </LinearLayout>
32
-
33
-    <!-- Layout -->
34
-
35
-    <ScrollView
36
-        android:id="@+id/mainScrollView"
37
-        android:layout_width="match_parent"
38
-        android:layout_height="0dp"
39
-        android:layout_weight="0.33" >
40
-
41
-        <LinearLayout
42
-            android:id="@+id/imagesLayoutScrollView"
43
-            android:layout_width="wrap_content"
44
-            android:layout_height="match_parent"
45
-            android:orientation="vertical" >
46
-        </LinearLayout>
47
-    </ScrollView>
48
-</LinearLayout>

+ 0
- 96
app/src/main/res/layout/commands_layout.xml View File

1
-<?xml version="1.0" encoding="utf-8"?>
2
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
-              android:layout_width="match_parent"
4
-              android:layout_height="match_parent"
5
-              android:orientation="vertical" >
6
-
7
-    <!-- Loading progress -->
8
-
9
-    <LinearLayout
10
-        android:id="@+id/loadStatus"
11
-        android:layout_width="wrap_content"
12
-        android:layout_height="wrap_content"
13
-        android:layout_gravity="center"
14
-        android:gravity="center_horizontal"
15
-        android:orientation="vertical"
16
-        android:visibility="gone" >
17
-
18
-        <ProgressBar
19
-            style="?android:attr/progressBarStyleLarge"
20
-            android:layout_width="wrap_content"
21
-            android:layout_height="wrap_content"
22
-            android:layout_marginBottom="8dp" />
23
-
24
-        <TextView
25
-            android:id="@+id/loading_status_message"
26
-            android:layout_width="wrap_content"
27
-            android:layout_height="wrap_content"
28
-            android:layout_marginBottom="16dp"
29
-            android:text="@string/loading"
30
-            android:textAppearance="?android:attr/textAppearanceMedium" />
31
-    </LinearLayout>
32
-
33
-    <!-- Layout -->
34
-
35
-    <ScrollView
36
-        android:id="@+id/mainScrollView"
37
-        android:layout_width="match_parent"
38
-        android:layout_height="0dp"
39
-        android:layout_weight="0.33" >
40
-
41
-        <LinearLayout
42
-            android:id="@+id/imagesLayoutScrollView"
43
-            android:layout_width="wrap_content"
44
-            android:layout_height="match_parent"
45
-            android:orientation="vertical" >
46
-
47
-            <ImageView
48
-                android:contentDescription="42"
49
-                android:layout_width="match_parent"
50
-                android:layout_height="wrap_content"
51
-                android:layout_margin="10px"
52
-                android:adjustViewBounds="true"
53
-                android:src="@drawable/camera_loading" />
54
-
55
-            <ImageView
56
-                android:contentDescription="42"
57
-                android:layout_width="match_parent"
58
-                android:layout_height="wrap_content"
59
-                android:layout_margin="10px"
60
-                android:adjustViewBounds="true"
61
-                android:src="@drawable/camera_loading" />
62
-
63
-            <ImageView
64
-                android:contentDescription="42"
65
-                android:layout_width="match_parent"
66
-                android:layout_height="wrap_content"
67
-                android:layout_margin="10px"
68
-                android:adjustViewBounds="true"
69
-                android:src="@drawable/camera_loading" />
70
-
71
-            <ImageView
72
-                android:contentDescription="42"
73
-                android:layout_width="match_parent"
74
-                android:layout_height="wrap_content"
75
-                android:layout_margin="10px"
76
-                android:adjustViewBounds="true"
77
-                android:src="@drawable/camera_loading" />
78
-
79
-            <ImageView
80
-                android:contentDescription="42"
81
-                android:layout_width="match_parent"
82
-                android:layout_height="wrap_content"
83
-                android:layout_margin="10px"
84
-                android:adjustViewBounds="true"
85
-                android:src="@drawable/camera_loading" />
86
-
87
-            <ImageView
88
-                android:contentDescription="42"
89
-                android:layout_width="match_parent"
90
-                android:layout_height="wrap_content"
91
-                android:layout_margin="10px"
92
-                android:adjustViewBounds="true"
93
-                android:src="@drawable/camera_loading" />
94
-        </LinearLayout>
95
-    </ScrollView>
96
-</LinearLayout>

+ 27
- 0
app/src/main/res/layout/sensor_view.xml View File

1
+<?xml version="1.0" encoding="utf-8"?>
2
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+              android:layout_width="match_parent"
4
+              android:layout_height="match_parent">
5
+
6
+    <TextView
7
+        android:layout_width="wrap_content"
8
+        android:layout_height="wrap_content"
9
+        android:textAppearance="?android:attr/textAppearanceMedium"
10
+        android:text=""
11
+        android:id="@+id/textViewName"
12
+        android:layout_alignParentTop="true"
13
+        android:layout_alignParentLeft="true"
14
+        android:layout_alignParentStart="true"
15
+        android:layout_toLeftOf="@+id/textViewValue"
16
+        android:layout_toStartOf="@+id/textViewValue"/>
17
+
18
+    <TextView
19
+        android:layout_width="wrap_content"
20
+        android:layout_height="wrap_content"
21
+        android:textAppearance="?android:attr/textAppearanceMedium"
22
+        android:text=""
23
+        android:id="@+id/textViewValue"
24
+        android:layout_alignParentTop="true"
25
+        android:layout_alignParentRight="true"
26
+        android:layout_alignParentEnd="true"/>
27
+</RelativeLayout>

+ 0
- 48
app/src/main/res/layout/sensors_layout.xml View File

1
-<?xml version="1.0" encoding="utf-8"?>
2
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
-              android:layout_width="match_parent"
4
-              android:layout_height="match_parent"
5
-              android:orientation="vertical" >
6
-
7
-    <!-- Loading progress -->
8
-
9
-    <LinearLayout
10
-        android:id="@+id/loadStatus"
11
-        android:layout_width="wrap_content"
12
-        android:layout_height="wrap_content"
13
-        android:layout_gravity="center"
14
-        android:gravity="center_horizontal"
15
-        android:orientation="vertical"
16
-        android:visibility="gone" >
17
-
18
-        <ProgressBar
19
-            style="?android:attr/progressBarStyleLarge"
20
-            android:layout_width="wrap_content"
21
-            android:layout_height="wrap_content"
22
-            android:layout_marginBottom="8dp" />
23
-
24
-        <TextView
25
-            android:id="@+id/loading_status_message"
26
-            android:layout_width="wrap_content"
27
-            android:layout_height="wrap_content"
28
-            android:layout_marginBottom="16dp"
29
-            android:text="@string/loading"
30
-            android:textAppearance="?android:attr/textAppearanceMedium" />
31
-    </LinearLayout>
32
-
33
-    <!-- Layout -->
34
-
35
-    <ScrollView
36
-        android:id="@+id/mainScrollView"
37
-        android:layout_width="match_parent"
38
-        android:layout_height="0dp"
39
-        android:layout_weight="0.33" >
40
-
41
-        <LinearLayout
42
-            android:id="@+id/sensorsLayoutScrollView"
43
-            android:layout_width="wrap_content"
44
-            android:layout_height="match_parent"
45
-            android:orientation="vertical" >
46
-        </LinearLayout>
47
-    </ScrollView>
48
-</LinearLayout>

+ 9
- 4
luticateutils/src/main/java/com/luticate/utils/ui/fragments/AbstractPaginationFragment.java View File

29
 
29
 
30
     protected String _query = "";
30
     protected String _query = "";
31
 
31
 
32
-    protected LuMultipleDbo<Dbo> _items = new LuMultipleDbo<>();
32
+    protected LuMultipleDbo<Dbo> _items = null;
33
 
33
 
34
     @Override
34
     @Override
35
     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
35
     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
48
                 loadPage(page);
48
                 loadPage(page);
49
             }
49
             }
50
         });
50
         });
51
-        loadPage(_page);
51
+        if (_items == null) {
52
+            loadPage(_page);
53
+        }
52
     }
54
     }
53
 
55
 
54
     protected void showProgress(final boolean show)
56
     protected void showProgress(final boolean show)
97
     public void loadPage(final int page)
99
     public void loadPage(final int page)
98
     {
100
     {
99
         final View v = getView();
101
         final View v = getView();
100
-        if (!isAdded() || v == null)
102
+        if (!isAdded() || v == null) {
101
             return;
103
             return;
104
+        }
102
         showProgress(true);
105
         showProgress(true);
103
-        _items.setData(new Vector<Dbo>());
106
+        if (_items != null) {
107
+            _items.setData(new Vector<Dbo>());
108
+        }
104
         getLoadPagePromise(page, _perPage, _query).then(new LuPromise.LuConsumer<LuMultipleDbo<Dbo>>() {
109
         getLoadPagePromise(page, _perPage, _query).then(new LuPromise.LuConsumer<LuMultipleDbo<Dbo>>() {
105
             @Override
110
             @Override
106
             public void execute(LuMultipleDbo<Dbo> items) {
111
             public void execute(LuMultipleDbo<Dbo> items) {

+ 10
- 3
luticateutils/src/main/java/com/luticate/utils/ui/fragments/ViewPaginationFragment.java View File

6
 import com.luticate.utils.R;
6
 import com.luticate.utils.R;
7
 import com.luticate.utils.dbo.LuDbo;
7
 import com.luticate.utils.dbo.LuDbo;
8
 
8
 
9
+import java.util.List;
10
+import java.util.Vector;
11
+
9
 /**
12
 /**
10
  * Created by robin on 12/6/15.
13
  * Created by robin on 12/6/15.
11
  */
14
  */
12
-public abstract class ViewPaginationFragment<Dbo extends LuDbo> extends AbstractPaginationFragment<Dbo> {
15
+public abstract class ViewPaginationFragment<Dbo extends LuDbo, DboView extends View> extends AbstractPaginationFragment<Dbo> {
16
+
17
+    protected List<DboView> _views = new Vector<>();
13
 
18
 
14
     @Override
19
     @Override
15
     protected int getLoaderViewId() {
20
     protected int getLoaderViewId() {
36
         View view = getView();
41
         View view = getView();
37
         LinearLayout layout = (LinearLayout) view.findViewById(R.id.itemsLayoutScrollView);
42
         LinearLayout layout = (LinearLayout) view.findViewById(R.id.itemsLayoutScrollView);
38
         layout.removeAllViews();
43
         layout.removeAllViews();
44
+        _views.clear();
39
         for (Dbo item : _items.getData())
45
         for (Dbo item : _items.getData())
40
         {
46
         {
41
-            View v = getDboView(item);
47
+            DboView v = getDboView(item);
42
             layout.addView(v);
48
             layout.addView(v);
49
+            _views.add(v);
43
         }
50
         }
44
     }
51
     }
45
 
52
 
46
-    protected abstract View getDboView(Dbo dbo);
53
+    protected abstract DboView getDboView(Dbo dbo);
47
 }
54
 }

Loading…
Cancel
Save