mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
parent
d8f7d89a59
commit
b373617a68
3 changed files with 2 additions and 18 deletions
|
|
@ -41,6 +41,7 @@ dependencies {
|
||||||
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.1.0'
|
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.1.0'
|
||||||
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-localization-v8:0.11.0'
|
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-localization-v8:0.11.0'
|
||||||
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-scalebar-v9:0.4.0'
|
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-scalebar-v9:0.4.0'
|
||||||
|
implementation 'com.mapbox.mapboxsdk:mapbox-android-telemetry:6.1.0'
|
||||||
implementation 'com.github.deano2390:MaterialShowcaseView:1.2.0'
|
implementation 'com.github.deano2390:MaterialShowcaseView:1.2.0'
|
||||||
implementation 'com.dinuscxj:circleprogressbar:1.1.1'
|
implementation 'com.dinuscxj:circleprogressbar:1.1.1'
|
||||||
implementation 'com.karumi:dexter:5.0.0'
|
implementation 'com.karumi:dexter:5.0.0'
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@
|
||||||
<uses-permission android:name="com.google.android.apps.photos.permission.GOOGLE_PHOTOS" />
|
<uses-permission android:name="com.google.android.apps.photos.permission.GOOGLE_PHOTOS" />
|
||||||
<uses-permission android:name="android.permission.SET_WALLPAPER"/>
|
<uses-permission android:name="android.permission.SET_WALLPAPER"/>
|
||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||||
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -143,31 +143,15 @@ public class MainActivity extends BaseActivity
|
||||||
|
|
||||||
private void setUpPager() {
|
private void setUpPager() {
|
||||||
tabLayout.setOnNavigationItemSelectedListener(item -> {
|
tabLayout.setOnNavigationItemSelectedListener(item -> {
|
||||||
if (VERSION.SDK_INT >= VERSION_CODES.M) {
|
|
||||||
if (item.getTitle().equals(getString(R.string.nearby_fragment))
|
|
||||||
&& checkSelfPermission(permission.READ_PHONE_STATE)
|
|
||||||
!= PackageManager.PERMISSION_GRANTED) {
|
|
||||||
requestPhoneStatePermission(() -> {
|
|
||||||
tabLayout.setSelectedItemId(NavTab.NEARBY.code());
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!item.getTitle().equals(getString(R.string.more))) {
|
if (!item.getTitle().equals(getString(R.string.more))) {
|
||||||
// do not change title for more fragment
|
// do not change title for more fragment
|
||||||
setTitle(item.getTitle());
|
setTitle(item.getTitle());
|
||||||
}
|
}
|
||||||
Fragment fragment = NavTab.of(item.getOrder()).newInstance();
|
final Fragment fragment = NavTab.of(item.getOrder()).newInstance();
|
||||||
return loadFragment(fragment, true);
|
return loadFragment(fragment, true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void requestPhoneStatePermission(final Runnable runnable) {
|
|
||||||
PermissionUtils.checkPermissionsAndPerformAction(this,
|
|
||||||
android.Manifest.permission.READ_PHONE_STATE, (Runnable) runnable::run, (Runnable) () -> {
|
|
||||||
}, R.string.need_permission, R.string.read_phone_state_permission_message);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setUpLoggedOutPager() {
|
private void setUpLoggedOutPager() {
|
||||||
loadFragment(ExploreFragment.newInstance(),false);
|
loadFragment(ExploreFragment.newInstance(),false);
|
||||||
tabLayout.setOnNavigationItemSelectedListener(item -> {
|
tabLayout.setOnNavigationItemSelectedListener(item -> {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue