Skip to content

Commit

Permalink
Merge pull request #58 from project-travel-mate/swati-checkstyle
Browse files Browse the repository at this point in the history
Adapters added to a different file
Fixed #57
  • Loading branch information
Swati4star authored May 27, 2018
2 parents 896f06a + 5009ee3 commit 9cd0b74
Show file tree
Hide file tree
Showing 34 changed files with 1,117 additions and 1,308 deletions.
2 changes: 0 additions & 2 deletions Android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

<application
android:largeHeap="true"
android:name=".MyApplication"
android:allowBackup="true"
android:icon="@drawable/google_travel_logo"
android:label="@string/app_name"
Expand Down Expand Up @@ -110,7 +109,6 @@
android:name=".destinations.funfacts.FunFacts"
android:label="@string/title_activity_fun_facts"
android:theme="@style/AppTheme.NoActionBar" />
<activity android:name=".DetectedBeacon" />
<activity android:name=".utilities.ShareContact" />
<activity
android:name=".login.LoginActivity"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void onCreate() {
}

@Override
public void onStart(Intent intent, int startId) {
public int onStartCommand(Intent intent, int flags, int startId) {
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
listener = new MyLocationListener();
if (ContextCompat.checkSelfPermission(LocationService.this,
Expand All @@ -91,6 +91,7 @@ public void onStart(Intent intent, int startId) {
locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 4000, 0, listener);
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 4000, 0, listener);
}
return START_NOT_STICKY;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;

import com.estimote.sdk.BeaconManager;
import com.estimote.sdk.Region;

import io.github.project_travel_mate.destinations.CityFragment;
import io.github.project_travel_mate.login.LoginActivity;
import io.github.project_travel_mate.travel.TravelFragment;
Expand All @@ -35,10 +32,6 @@
public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener {

private SharedPreferences sharedPreferences;
private Boolean discovered = false;
private String beaconmajor;
private BeaconManager beaconManager;
private Region region;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand All @@ -56,43 +49,6 @@ protected void onCreate(Bundle savedInstanceState) {
fragment = new CityFragment();
fragmentManager.beginTransaction().replace(R.id.inc, fragment).commit();

// If beacon detected, open activity
final Intent intent = getIntent();
if (intent.getBooleanExtra(Constants.IS_BEACON, false)) {
Intent intent1 = new Intent(MainActivity.this, DetectedBeacon.class);
intent1.putExtra(Constants.CUR_UID, intent.getStringExtra(Constants.CUR_UID));
intent1.putExtra(Constants.CUR_MAJOR, intent.getStringExtra(Constants.CUR_MAJOR));
intent1.putExtra(Constants.CUR_MINOR, intent.getStringExtra(Constants.CUR_MINOR));
intent1.putExtra(Constants.IS_BEACON, true);
startActivity(intent1);
}


/*// Start beacon ranging
beaconManager = new BeaconManager(this);
region = new Region("Minion region", UUID.fromString(Constants.UID), null, null);
beaconManager.connect(() -> beaconManager.startRanging(region));
beaconManager.setRangingListener(new BeaconManager.RangingListener() {
@Override
public void onBeaconsDiscovered(Region region1, List<Beacon> list) {
if (!discovered && list.size() > 0) {
Beacon nearestBeacon = list.get(0);
beaconmajor = Integer.toString(nearestBeacon.getMajor());
Log.e("Discovered", "Nearest places: " + nearestBeacon.getMajor());
discovered = true;
Intent intent1 = new Intent(MainActivity.this, DetectedBeacon.class);
intent1.putExtra(Constants.CUR_UID, " ");
intent1.putExtra(Constants.CUR_MAJOR, beaconmajor);
intent1.putExtra(Constants.CUR_MINOR, " ");
intent1.putExtra(Constants.IS_BEACON, true);
MainActivity.this.startActivity(intent1);
}
}
});*/

// Get runtime permissions for Android M
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (ContextCompat.checkSelfPermission(MainActivity.this,
Expand All @@ -112,7 +68,6 @@ public void onBeaconsDiscovered(Region region1, List<Beacon> list) {
Manifest.permission.ACCESS_FINE_LOCATION,
Manifest.permission.ACCESS_COARSE_LOCATION,
Manifest.permission.VIBRATE,

}, 0);
}
}
Expand Down

This file was deleted.

Loading

0 comments on commit 9cd0b74

Please sign in to comment.