22
33import android .app .Activity ;
44
5-
65import com .androidblebeaconwrapperlib .beacon .BeaconHelper ;
76import com .androidblebeaconwrapperlib .beacon .BeaconResultEntity ;
87import com .androidblebeaconwrapperlib .beacon .BeaconResultListener ;
8+ import com .androidblebeaconwrapperlib .beaconwrapper .BleBeaconListener ;
99import com .androidblebeaconwrapperlib .network .NetworkManager ;
1010import com .androidblebeaconwrapperlib .network .RequestCallBackListener ;
1111import com .androidblebeaconwrapperlib .parse .FilterListener ;
1212import com .androidblebeaconwrapperlib .parse .ParserListClass ;
1313
14+
1415import java .util .List ;
1516import java .util .Map ;
1617
@@ -25,7 +26,6 @@ public class BLEBeaconWrapper<T> {
2526 private long timeInterval ;
2627 private Class <T > t ;
2728 private BleBeaconListener <T > tBleBeaconListener ;
28- private List <T > parsableList ;
2929
3030
3131 public BLEBeaconWrapper (Activity context ) {
@@ -47,14 +47,6 @@ public void getBeaconData(String url, Class<T> t, Map<String, String> headerData
4747
4848 }
4949
50- public void getBeaconData (String json , Class <T > t , long timeInterval ,
51- BleBeaconListener <T > tBleBeaconListener ) {
52- this .t = t ;
53- this .timeInterval = timeInterval ;
54- this .tBleBeaconListener = tBleBeaconListener ;
55- parseClassFields (json );
56- }
57-
5850 public void getBeaconData (List <T > list , long timeInterval ,
5951 BleBeaconListener <T > tBleBeaconListener ) {
6052 this .timeInterval = timeInterval ;
@@ -72,7 +64,6 @@ public void beforeCallBack() {
7264
7365 @ Override
7466 public void onResponse (String responseString ) {
75- tBleBeaconListener .onDismissProgress ();
7667 parseClassFields (responseString );
7768 }
7869
@@ -88,7 +79,7 @@ private void parseClassFields(String responseString) {
8879 parserListClass .parseData (t , responseString , new FilterListener <T >() {
8980 @ Override
9081 public void onResponse (List <T > filteredData ) {
91- BLEBeaconWrapper . this . parsableList = filteredData ;
82+ tBleBeaconListener . onParsableDataResult ( filteredData ) ;
9283 beaconWrapperOperation (filteredData );
9384 }
9485
@@ -99,10 +90,6 @@ public void onError(String errorMsg) {
9990 });
10091 }
10192
102- public List <T > getParsableData () {
103- return this .parsableList ;
104- }
105-
10693 public void stopBeaconUpdates () {
10794 beaconHelper .stopBeaconUpdates ();
10895 }
@@ -111,7 +98,7 @@ private void beaconWrapperOperation(List<T> filteredData) {
11198 beaconHelper .startBeaconUpdates (filteredData , timeInterval , new BeaconResultListener () {
11299 @ Override
113100 public void onResult (List <BeaconResultEntity > beaconResultEntities ) {
114- tBleBeaconListener .onResult (beaconResultEntities );
101+ tBleBeaconListener .onBeaconDataResult (beaconResultEntities );
115102 }
116103
117104 @ Override
0 commit comments