Skip to content

Commit f8de3b2

Browse files
committed
Merge develop to master for 7.2.7 release
2 parents 464c9a2 + 0e6c71f commit f8de3b2

File tree

119 files changed

+2019
-2751
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+2019
-2751
lines changed

mage/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def googleMapsApiDebugKey = hasProperty('DEBUG_MAPS_API_KEY') ? DEBUG_MAPS_API_K
3333

3434
android {
3535
defaultConfig {
36-
compileSdk 34
36+
compileSdk 36
3737
}
3838

3939
buildFeatures{
@@ -89,10 +89,10 @@ android {
8989

9090
defaultConfig {
9191
applicationId "mil.nga.giat.mage"
92-
versionCode 1954
93-
versionName '7.2.6'
92+
versionCode 1955
93+
versionName '7.2.7'
9494
minSdkVersion 27
95-
targetSdkVersion 34
95+
targetSdkVersion 36
9696
multiDexEnabled true
9797
resValue "string", "serverURLDefaultValue", serverURL
9898
resValue "string", "recentMapXYZDefaultValue", "263.0,40.0,3"

mage/src/main/AndroidManifest.xml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@
7676
android:name=".login.LoginActivity"
7777
android:exported="true"
7878
android:configChanges="orientation"
79-
android:screenOrientation="portrait"
8079
android:windowSoftInputMode="stateAlwaysHidden"
8180
android:theme="@style/AppTheme3.NoActionBar"
8281
tools:ignore="DiscouragedApi">
@@ -158,12 +157,16 @@
158157
android:name=".event.EventsActivity"
159158
android:theme="@style/AppTheme.NoActionBar" />
160159
<activity
161-
android:name=".filter.FilterActivity" />
160+
android:name=".filter.FilterActivity"
161+
android:theme="@style/AppTheme.NoActionBar"
162+
android:label="@string/filter" />
162163
<activity
163164
android:name=".filter.ObservationFilterActivity"
165+
android:theme="@style/AppTheme.NoActionBar"
164166
android:label="@string/observation_filter" />
165167
<activity
166168
android:name=".filter.LocationFilterActivity"
169+
android:theme="@style/AppTheme.NoActionBar"
167170
android:label="@string/locations_filter" />
168171
<activity
169172
android:name=".LandingActivity"
@@ -183,27 +186,34 @@
183186
<activity
184187
android:name=".preferences.LocationPreferencesActivity"
185188
android:label="@string/location_settings"
189+
android:theme="@style/AppTheme.NoActionBar"
186190
android:parentActivityName=".LandingActivity" />
187191
<activity
188192
android:name=".preferences.GeneralPreferencesActivity"
193+
android:label="@string/settings"
194+
android:theme="@style/AppTheme.NoActionBar"
189195
android:parentActivityName=".LandingActivity" />
190196
<activity
191197
android:name=".preferences.FetchPreferencesActivity"
192198
android:label="@string/fetch_settings"
199+
android:theme="@style/AppTheme.NoActionBar"
193200
android:parentActivityName=".LandingActivity" />
194201
<activity
195202
android:name=".map.preference.MapPreferencesActivity"
196203
android:label="@string/map_settings"
204+
android:theme="@style/AppTheme.NoActionBar"
197205
android:parentActivityName=".LandingActivity" />
198206
<activity
199207
android:name=".map.preference.TileOverlayPreferenceActivity"
200208
android:label="Offline Layers"
209+
android:theme="@style/AppTheme.NoActionBar"
201210
android:launchMode="singleTop"
202211
android:parentActivityName=".map.preference.MapPreferencesActivity"
203212
android:uiOptions="splitActionBarWhenNarrow" />
204213
<activity
205214
android:name=".map.preference.OnlineLayersPreferenceActivity"
206215
android:label="Online Layers"
216+
android:theme="@style/AppTheme.NoActionBar"
207217
android:launchMode="singleTop"
208218
android:parentActivityName=".map.preference.MapPreferencesActivity"
209219
android:uiOptions="splitActionBarWhenNarrow" />
@@ -226,9 +236,12 @@
226236
<activity android:name=".observation.attachment.AttachmentViewActivity"
227237
android:theme="@style/AppTheme.NoActionBar"/>
228238

229-
<activity android:name=".profile.ProfilePictureViewerActivity" />
230-
<activity android:name=".profile.ProfileActivity" />
239+
<activity android:name=".profile.ProfilePictureViewerActivity"
240+
android:theme="@style/AppTheme.NoActionBar"/>
241+
<activity android:name=".profile.ProfileActivity"
242+
android:theme="@style/AppTheme.NoActionBar"/>
231243
<activity android:name=".profile.ChangePasswordActivity"
244+
android:theme="@style/AppTheme.NoActionBar"
232245
android:label="Change Password"/>
233246
<activity
234247
android:name=".people.PeopleActivity"

mage/src/main/java/mil/nga/giat/mage/LandingActivity.kt

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,15 @@ import androidx.activity.result.ActivityResult
1717
import androidx.activity.result.contract.ActivityResultContracts
1818
import androidx.appcompat.app.AppCompatActivity
1919
import androidx.core.app.NotificationManagerCompat
20+
import androidx.core.content.edit
2021
import androidx.core.view.GravityCompat
22+
import androidx.core.view.ViewCompat
23+
import androidx.core.view.WindowInsetsCompat
24+
import androidx.core.view.updatePadding
2125
import androidx.fragment.app.Fragment
2226
import androidx.lifecycle.ViewModelProvider
2327
import androidx.preference.PreferenceManager
28+
import androidx.recyclerview.widget.RecyclerView
2429
import com.google.android.material.navigation.NavigationView
2530
import dagger.hilt.android.AndroidEntryPoint
2631
import kotlinx.coroutines.CoroutineScope
@@ -54,7 +59,6 @@ import mil.nga.giat.mage.profile.ProfileActivity
5459
import org.apache.commons.lang3.StringUtils
5560
import java.io.File
5661
import javax.inject.Inject
57-
import androidx.core.content.edit
5862

5963

6064
/**
@@ -175,7 +179,17 @@ class LandingActivity : AppCompatActivity(), NavigationView.OnNavigationItemSele
175179
}
176180
binding = ActivityLandingBinding.inflate(layoutInflater)
177181
setContentView(binding!!.root)
178-
binding!!.navigation.setNavigationItemSelectedListener(this)
182+
183+
val navigationView = binding!!.navigation
184+
185+
ViewCompat.setOnApplyWindowInsetsListener(navigationView) { v, windowInsets ->
186+
val insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout())
187+
v.updatePadding(left = insets.left)
188+
windowInsets
189+
}
190+
191+
navigationView.setNavigationItemSelectedListener(this)
192+
179193
currentNightMode = resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK
180194
bottomNavigationFragments.add(MapFragment())
181195
bottomNavigationFragments.add(ObservationFeedFragment())
@@ -192,25 +206,33 @@ class LandingActivity : AppCompatActivity(), NavigationView.OnNavigationItemSele
192206
onTitle(event)
193207
setRecentEvents(event)
194208
}
195-
setSupportActionBar(binding!!.toolbar)
196209

197-
requestPermissionsOnFirstLaunch()
210+
val toolBar = binding!!.toolbar
211+
ViewCompat.setOnApplyWindowInsetsListener(toolBar) { v: View, windowInsets: WindowInsetsCompat ->
212+
val insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())
213+
v.setPadding(insets.left, 0, insets.right, 0)
214+
windowInsets
215+
}
198216

199-
binding!!.toolbar.setNavigationIcon(R.drawable.ic_menu_white_24dp)
200-
binding!!.toolbar.setNavigationOnClickListener {
217+
setSupportActionBar(toolBar)
218+
219+
toolBar.setNavigationIcon(R.drawable.ic_menu_white_24dp)
220+
toolBar.setNavigationOnClickListener {
201221
binding!!.drawerLayout.openDrawer(
202222
GravityCompat.START
203223
)
204224
}
205-
val headerView = binding!!.navigation.getHeaderView(0)
225+
val headerView = navigationView.getHeaderView(0)
206226
headerView.setOnClickListener {
207227
onNavigationItemSelected(
208-
binding!!.navigation.menu.findItem(R.id.profile_navigation)
228+
navigationView.menu.findItem(R.id.profile_navigation)
209229
)
210230
}
211231

212232
addBackClickHandler()
213233

234+
requestPermissionsOnFirstLaunch()
235+
214236
// Check if MAGE was launched with a local file
215237
val openPath = intent.getStringExtra(EXTRA_OPEN_FILE_PATH)
216238
openPath?.let { handleOpenFilePath(it) }
@@ -232,6 +254,7 @@ class LandingActivity : AppCompatActivity(), NavigationView.OnNavigationItemSele
232254
viewModel.setEvent(event!!.remoteId)
233255
}
234256

257+
235258
override fun onResume() {
236259
super.onResume()
237260
val selectedItem = binding!!.bottomNavigation.menu.findItem(

mage/src/main/java/mil/nga/giat/mage/event/EventActivity.kt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,18 @@ package mil.nga.giat.mage.event
33
import android.os.Bundle
44
import android.view.LayoutInflater
55
import android.view.MenuItem
6+
import android.view.View
67
import android.view.ViewGroup
78
import androidx.appcompat.app.AppCompatActivity
9+
import androidx.appcompat.widget.Toolbar
10+
import androidx.core.view.ViewCompat
11+
import androidx.core.view.WindowInsetsCompat
812
import androidx.recyclerview.widget.DividerItemDecoration
913
import androidx.recyclerview.widget.LinearLayoutManager
1014
import androidx.recyclerview.widget.RecyclerView
1115
import dagger.hilt.android.AndroidEntryPoint
1216
import mil.nga.giat.mage.MageApplication
17+
import mil.nga.giat.mage.R
1318
import mil.nga.giat.mage.databinding.ActivityEventBinding
1419
import mil.nga.giat.mage.databinding.RecyclerFormListItemBinding
1520
import mil.nga.giat.mage.form.Form
@@ -38,9 +43,22 @@ class EventActivity : AppCompatActivity() {
3843
binding = ActivityEventBinding.inflate(layoutInflater)
3944
setContentView(binding.root)
4045

46+
ViewCompat.setOnApplyWindowInsetsListener(binding.toolbar) { v: View, windowInsets: WindowInsetsCompat ->
47+
val insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())
48+
v.setPadding(insets.left, 0, insets.right, 0)
49+
windowInsets
50+
}
51+
4152
setSupportActionBar(binding.toolbar)
4253
supportActionBar?.setDisplayHomeAsUpEnabled(true)
4354

55+
56+
ViewCompat.setOnApplyWindowInsetsListener(binding.scroll) { v: View, windowInsets: WindowInsetsCompat ->
57+
val insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout())
58+
v.setPadding(insets.left, 0, insets.right, insets.bottom)
59+
windowInsets
60+
}
61+
4462
intent.extras?.getLong(EVENT_ID_EXTRA)?.let { eventId ->
4563
event = eventLocalDataSource.read(eventId)
4664
}

mage/src/main/java/mil/nga/giat/mage/event/EventsActivity.kt

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ import android.content.Intent
44
import android.os.Bundle
55
import android.view.MenuItem
66
import android.view.View
7+
import android.widget.LinearLayout
78
import androidx.appcompat.app.AppCompatActivity
89
import androidx.appcompat.widget.SearchView
10+
import androidx.core.view.ViewCompat
11+
import androidx.core.view.WindowInsetsCompat
12+
import androidx.core.view.updatePadding
913
import androidx.lifecycle.ViewModelProvider
1014
import androidx.recyclerview.widget.DefaultItemAnimator
1115
import androidx.recyclerview.widget.LinearLayoutManager
@@ -14,11 +18,11 @@ import kotlinx.coroutines.runBlocking
1418
import mil.nga.giat.mage.LandingActivity
1519
import mil.nga.giat.mage.MageApplication
1620
import mil.nga.giat.mage.R
21+
import mil.nga.giat.mage.data.datasource.event.EventLocalDataSource
22+
import mil.nga.giat.mage.database.model.event.Event
1723
import mil.nga.giat.mage.databinding.ActivityEventsBinding
1824
import mil.nga.giat.mage.login.LoginActivity
1925
import mil.nga.giat.mage.network.Resource
20-
import mil.nga.giat.mage.database.model.event.Event
21-
import mil.nga.giat.mage.data.datasource.event.EventLocalDataSource
2226
import javax.inject.Inject
2327

2428
@AndroidEntryPoint
@@ -36,13 +40,26 @@ class EventsActivity : AppCompatActivity() {
3640
binding = ActivityEventsBinding.inflate(layoutInflater)
3741
setContentView(binding.root)
3842

43+
ViewCompat.setOnApplyWindowInsetsListener(binding.eventsAppBar) { v: View, windowInsets: WindowInsetsCompat ->
44+
val insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())
45+
v.setPadding(insets.left, insets.top, insets.right, 0)
46+
windowInsets
47+
}
48+
3949
setSupportActionBar(binding.toolbar)
4050

4151
if (intent.getBooleanExtra(CLOSABLE_EXTRA, false)) {
4252
supportActionBar?.setHomeAsUpIndicator(R.drawable.ic_close_white_24dp)
4353
supportActionBar?.setDisplayHomeAsUpEnabled(true)
4454
}
4555

56+
val eventsContent = findViewById<LinearLayout>(R.id.eventsContent)
57+
ViewCompat.setOnApplyWindowInsetsListener(eventsContent) { v, windowInsets ->
58+
val insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout())
59+
v.updatePadding(left = insets.left, right = insets.right, bottom = insets.bottom)
60+
WindowInsetsCompat.CONSUMED
61+
}
62+
4663
binding.loadingStatus.visibility = View.VISIBLE
4764

4865
binding.searchView.isIconified = false

mage/src/main/java/mil/nga/giat/mage/feed/FeedScreen.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,12 @@ fun FeedItemTopBar(
116116
onClose: () -> Unit
117117
) {
118118
TopAppBar(
119+
modifier = Modifier
120+
.background(color = MaterialTheme.colors.topAppBarBackground)
121+
.windowInsetsPadding(WindowInsets.systemBars.only(WindowInsetsSides.Horizontal + WindowInsetsSides.Top)),
119122
backgroundColor = MaterialTheme.colors.topAppBarBackground,
120123
contentColor = Color.White,
124+
elevation = 0.dp,
121125
title = {
122126
Text(
123127
text = title ?: "",

mage/src/main/java/mil/nga/giat/mage/feed/item/FeedItemScreen.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,12 @@ fun FeedItemTopBar(
112112
onClose: () -> Unit
113113
) {
114114
TopAppBar(
115+
modifier = Modifier
116+
.background(color = MaterialTheme.colors.topAppBarBackground)
117+
.windowInsetsPadding(WindowInsets.systemBars.only(WindowInsetsSides.Horizontal + WindowInsetsSides.Top)),
115118
backgroundColor = MaterialTheme.colors.topAppBarBackground,
116119
contentColor = Color.White,
120+
elevation = 0.dp,
117121
title = {},
118122
navigationIcon = {
119123
IconButton(onClick = { onClose.invoke() }) {

mage/src/main/java/mil/nga/giat/mage/filter/FilterActivity.java

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010

1111
import androidx.appcompat.app.ActionBar;
1212
import androidx.appcompat.app.AppCompatActivity;
13+
import androidx.appcompat.widget.Toolbar;
14+
import androidx.core.graphics.Insets;
15+
import androidx.core.view.OnApplyWindowInsetsListener;
16+
import androidx.core.view.ViewCompat;
17+
import androidx.core.view.WindowCompat;
18+
import androidx.core.view.WindowInsetsCompat;
1319

1420
import org.apache.commons.lang3.StringUtils;
1521

@@ -29,13 +35,28 @@ public class FilterActivity extends AppCompatActivity {
2935
@Override
3036
protected void onCreate(Bundle savedInstanceState) {
3137
super.onCreate(savedInstanceState);
32-
setContentView(R.layout.activity_filter);
38+
setContentView(R.layout.activity_filter);
3339

34-
ActionBar actionBar = getSupportActionBar();
35-
actionBar.setTitle("Filter");
36-
actionBar.setDisplayHomeAsUpEnabled(true);
40+
Toolbar toolbar = findViewById(R.id.filter_toolbar);
41+
ViewCompat.setOnApplyWindowInsetsListener(toolbar, (v, windowInsets) -> {
42+
Insets insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars());
43+
v.setPadding(insets.left,0,insets.right, 0);
44+
return windowInsets;
45+
});
3746

38-
preferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
47+
setSupportActionBar(toolbar);
48+
49+
getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_arrow_back_white_24dp);
50+
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
51+
52+
View scrollView = findViewById(R.id.filter_scrollview);
53+
ViewCompat.setOnApplyWindowInsetsListener(scrollView, (v, windowInsets) -> {
54+
Insets insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars() | WindowInsetsCompat.Type.displayCutout());
55+
v.setPadding(insets.left,0,insets.right, insets.bottom);
56+
return windowInsets;
57+
});
58+
59+
preferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
3960
}
4061

4162
@Override

mage/src/main/java/mil/nga/giat/mage/filter/LocationFilterActivity.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
import android.widget.Spinner;
1717

1818
import androidx.appcompat.app.AppCompatActivity;
19+
import androidx.appcompat.widget.Toolbar;
20+
import androidx.core.graphics.Insets;
21+
import androidx.core.view.ViewCompat;
22+
import androidx.core.view.WindowInsetsCompat;
1923

2024
import mil.nga.giat.mage.R;
2125

@@ -35,8 +39,26 @@ public class LocationFilterActivity extends AppCompatActivity implements Compoun
3539
protected void onCreate(Bundle savedInstanceState) {
3640
super.onCreate(savedInstanceState);
3741
setContentView(R.layout.activity_location_filter);
42+
43+
Toolbar toolbar = findViewById(R.id.location_filter_toolbar);
44+
ViewCompat.setOnApplyWindowInsetsListener(toolbar, (v, windowInsets) -> {
45+
Insets insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars());
46+
v.setPadding(insets.left,0,insets.right, 0);
47+
return windowInsets;
48+
});
49+
50+
setSupportActionBar(toolbar);
51+
52+
getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_arrow_back_white_24dp);
3853
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
3954

55+
View scrollView = findViewById(R.id.scrollView);
56+
ViewCompat.setOnApplyWindowInsetsListener(scrollView, (v, windowInsets) -> {
57+
Insets insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars() | WindowInsetsCompat.Type.displayCutout());
58+
v.setPadding(insets.left,0,insets.right, insets.bottom);
59+
return windowInsets;
60+
});
61+
4062
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
4163

4264
timeFilter = activeTimeFilter = preferences.getInt(getResources().getString(R.string.activeLocationTimeFilterKey), getResources().getInteger(R.integer.time_filter_last_month));

0 commit comments

Comments
 (0)