Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #3766, Added OPENSTREET attribution #3889

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.provider.Settings;
import android.util.Log;
Expand All @@ -29,6 +30,7 @@

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.AppCompatTextView;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
Expand Down Expand Up @@ -154,6 +156,8 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
MapView mapView;
@BindView(R.id.rv_nearby_list)
RecyclerView rvNearbyList;
@BindView(R.id.tv_attribution)
AppCompatTextView tvOpenStreetAttribution;

@Inject LocationServiceManager locationManager;
@Inject NearbyController nearbyController;
Expand Down Expand Up @@ -260,6 +264,11 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
scaleBarPlugin.create(scaleBarOptions);
});
});
tvOpenStreetAttribution.setOnClickListener(v -> {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("https://www.openstreetmap.org/copyright"));
startActivity(intent);
});
}

/**
Expand Down
16 changes: 14 additions & 2 deletions app/src/main/res/layout/fragment_nearby_parent.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

<!-- I have done this intentionally, the mapview because of some elevation or something,
sometimes hangs over the drawer layout and sometimes draws its onPaused state over the contributions, this seems to be the probable fix -->
<FrameLayout
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/nearby_filter">
Expand All @@ -40,7 +40,19 @@
android:layout_height="match_parent"
android:background="@android:color/transparent" />

</FrameLayout>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_attribution"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_margin="4dp"
android:text="&#169; OPENSTREETMAP \n contributors"
ashishkumar468 marked this conversation as resolved.
Show resolved Hide resolved
android:textAlignment="center"
android:textColor="@android:color/darker_gray"
android:textStyle="bold" />

</RelativeLayout>


<Button
Expand Down