This commit is contained in:
neslihanturan 2019-09-15 14:11:21 +03:00
parent 7659aec94a
commit 9d1412b03d
7 changed files with 0 additions and 289 deletions

View file

@ -138,15 +138,6 @@
android:name=".review.ReviewActivity" android:name=".review.ReviewActivity"
android:label="@string/title_activity_review" /> android:label="@string/title_activity_review" />
<activity
android:name=".nearby.NearbyTestActivity"
android:label="@string/title_activity_nearby_test_activity" />
<activity
android:name=".nearby.NearbyTestFragmentActivity"
android:label="@string/title_activity_nearby_test_fragment" />
<service android:name=".upload.UploadService" /> <service android:name=".upload.UploadService" />
<service <service
android:name=".auth.WikiAccountAuthenticatorService" android:name=".auth.WikiAccountAuthenticatorService"

View file

@ -14,8 +14,6 @@ import fr.free.nrw.commons.category.CategoryImagesActivity;
import fr.free.nrw.commons.explore.SearchActivity; import fr.free.nrw.commons.explore.SearchActivity;
import fr.free.nrw.commons.explore.categories.ExploreActivity; import fr.free.nrw.commons.explore.categories.ExploreActivity;
import fr.free.nrw.commons.nearby.NearbyTestActivity;
import fr.free.nrw.commons.nearby.NearbyTestFragmentActivity;
import fr.free.nrw.commons.notification.NotificationActivity; import fr.free.nrw.commons.notification.NotificationActivity;
import fr.free.nrw.commons.review.ReviewActivity; import fr.free.nrw.commons.review.ReviewActivity;
import fr.free.nrw.commons.settings.SettingsActivity; import fr.free.nrw.commons.settings.SettingsActivity;
@ -69,10 +67,4 @@ public abstract class ActivityBuilderModule {
@ContributesAndroidInjector @ContributesAndroidInjector
abstract ReviewActivity bindReviewActivity(); abstract ReviewActivity bindReviewActivity();
@ContributesAndroidInjector
abstract NearbyTestActivity bindNearbyTestActivity();
@ContributesAndroidInjector
abstract NearbyTestFragmentActivity bindNearbyTestFragment();
} }

View file

@ -1,96 +0,0 @@
package fr.free.nrw.commons.nearby;
import android.os.Bundle;
import android.util.Log;
import com.mapbox.mapboxsdk.Mapbox;
import com.mapbox.mapboxsdk.maps.MapView;
import com.mapbox.mapboxsdk.maps.MapboxMap;
import com.mapbox.mapboxsdk.maps.OnMapReadyCallback;
import com.mapbox.mapboxsdk.maps.Style;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import fr.free.nrw.commons.R;
/**
* The most basic example of adding a map to an activity.
*/
public class NearbyTestActivity extends AppCompatActivity {
private MapView mapView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Mapbox access token is configured here. This needs to be called either in your application
// object or in the same activity which contains the mapview.
Mapbox.getInstance(this, getString(R.string.mapbox_commons_app_token));
// This contains the MapView in XML and needs to be called after the access token is configured.
setContentView(R.layout.activity_nearby_test);
mapView = findViewById(R.id.mapView);
mapView.onCreate(savedInstanceState);
mapView.getMapAsync(new OnMapReadyCallback() {
@Override
public void onMapReady(@NonNull MapboxMap mapboxMap) {
mapboxMap.setStyle(Style.MAPBOX_STREETS, new Style.OnStyleLoaded() {
@Override
public void onStyleLoaded(@NonNull Style style) {
Log.d("NearbyTests","Map inside activity is ready, works");
// Map is set up and the style has loaded. Now you can add data or make other map adjustments.
}
});
}
});
}
// Add the mapView lifecycle to the activity's lifecycle methods
@Override
public void onResume() {
super.onResume();
mapView.onResume();
}
@Override
protected void onStart() {
super.onStart();
mapView.onStart();
}
@Override
protected void onStop() {
super.onStop();
mapView.onStop();
}
@Override
public void onPause() {
super.onPause();
mapView.onPause();
}
@Override
public void onLowMemory() {
super.onLowMemory();
mapView.onLowMemory();
}
@Override
protected void onDestroy() {
super.onDestroy();
mapView.onDestroy();
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
mapView.onSaveInstanceState(outState);
}
}

View file

@ -1,71 +0,0 @@
package fr.free.nrw.commons.nearby;
import android.os.Bundle;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.fragment.app.FragmentTransaction;
import com.mapbox.mapboxsdk.Mapbox;
import com.mapbox.mapboxsdk.camera.CameraPosition;
import com.mapbox.mapboxsdk.geometry.LatLng;
import com.mapbox.mapboxsdk.maps.MapboxMap;
import com.mapbox.mapboxsdk.maps.MapboxMapOptions;
import com.mapbox.mapboxsdk.maps.OnMapReadyCallback;
import com.mapbox.mapboxsdk.maps.Style;
import com.mapbox.mapboxsdk.maps.SupportMapFragment;
import fr.free.nrw.commons.R;
import fr.free.nrw.commons.theme.NavigationBaseActivity;
public class NearbyTestFragmentActivity extends NavigationBaseActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_nearby_test_fragment);
// Mapbox access token is configured here. This needs to be called either in your application
// object or in the same activity which contains the mapview.
Mapbox.getInstance(this, getString(R.string.mapbox_commons_app_token));
// Create supportMapFragment
SupportMapFragment mapFragment;
if (savedInstanceState == null) {
// Create fragment
final FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
// Build mapboxMap
MapboxMapOptions options = MapboxMapOptions.createFromAttributes(this, null);
options.camera(new CameraPosition.Builder()
.target(new LatLng(-52.6885, -70.1395))
.zoom(9)
.build());
// Create map fragment
mapFragment = SupportMapFragment.newInstance(options);
// Add map fragment to parent container
transaction.add(R.id.container, mapFragment, "com.mapbox.map");
transaction.commit();
} else {
mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentByTag("com.mapbox.map");
}
mapFragment.getMapAsync(new OnMapReadyCallback() {
@Override
public void onMapReady(@NonNull MapboxMap mapboxMap) {
mapboxMap.setStyle(Style.SATELLITE, new Style.OnStyleLoaded() {
@Override
public void onStyleLoaded(@NonNull Style style) {
Log.d("NearbyTests","Map inside support fragment is ready, works");
// Map is set up and the style has loaded. Now you can add data or make other map adjustments
}
});
}
});
}
}

View file

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:mapbox="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.mapbox.mapboxsdk.maps.MapView
android:id="@+id/mapView"
android:layout_width="match_parent"
android:layout_height="match_parent"
mapbox:mapbox_cameraTargetLat="-36.84"
mapbox:mapbox_cameraTargetLng="174.76"
mapbox:mapbox_cameraZoom="10"
mapbox:mapbox_cameraBearing="34.33"
mapbox:mapbox_cameraTilt="50.25"
mapbox:mapbox_cameraZoomMax="12.41"
mapbox:mapbox_cameraZoomMin="6"
mapbox:mapbox_uiRotateGestures="false"
/>
</LinearLayout>

View file

@ -1,37 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/fragment_below_textview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:gravity="center_horizontal" />
<androidx.cardview.widget.CardView
android:id="@+id/cardview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/fragment_below_textview"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:cardCornerRadius="2dp"
app:cardElevation="@dimen/cardview_default_elevation">
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</androidx.cardview.widget.CardView>
</RelativeLayout>

View file

@ -1,46 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/contributionsListBackground"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
>
<include layout="@layout/toolbar"/>
<com.google.android.material.tabs.TabLayout
android:id="@+id/tab_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/tabBackground"
app:tabIndicatorColor="?attr/tabIndicatorColor"
app:tabSelectedTextColor="?attr/tabSelectedTextColor"
app:tabTextColor="?attr/tabTextColor"
android:layout_below="@id/toolbar"
app:tabMode="fixed" />
<FrameLayout android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/contributionsFragmentContainer"
android:orientation="horizontal"
android:layout_below="@id/tab_layout">
<fr.free.nrw.commons.contributions.UnswipableViewPager
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
</RelativeLayout>
<include layout="@layout/drawer_view" />
</androidx.drawerlayout.widget.DrawerLayout>