File tree Expand file tree Collapse file tree 4 files changed +17
-15
lines changed
worldwind-tutorials/src/main/java/gov/nasa/worldwindx Expand file tree Collapse file tree 4 files changed +17
-15
lines changed Original file line number Diff line number Diff line change @@ -17,9 +17,9 @@ allprojects {
1717
1818ext {
1919 minSdkVersion = 19
20- targetSdkVersion = 31
20+ targetSdkVersion = 33
2121 versionCode = 11
22- versionName = ' 0.9.1 '
22+ versionName = ' 0.9.2 '
2323}
2424
2525task clean (type : Delete ) {
Original file line number Diff line number Diff line change @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33distributionPath =wrapper/dists
44zipStoreBase =GRADLE_USER_HOME
55zipStorePath =wrapper/dists
6- distributionUrl =https\://services.gradle.org/distributions/gradle-7.4.2 -bin.zip
6+ distributionUrl =https\://services.gradle.org/distributions/gradle-7.5.1 -bin.zip
Original file line number Diff line number Diff line change 1717import android .view .MenuItem ;
1818import android .view .View ;
1919
20+ import androidx .activity .OnBackPressedCallback ;
2021import androidx .annotation .NonNull ;
2122import androidx .appcompat .app .ActionBarDrawerToggle ;
2223import androidx .appcompat .app .AppCompatActivity ;
@@ -132,6 +133,17 @@ protected void onCreateDrawer() {
132133 this .navigationView = findViewById (R .id .nav_view );
133134 this .navigationView .setNavigationItemSelectedListener (this );
134135 this .navigationView .setCheckedItem (selectedItemId );
136+
137+ getOnBackPressedDispatcher ().addCallback (this , new OnBackPressedCallback (true ) {
138+ @ Override
139+ public void handleOnBackPressed () {
140+ if (drawer .isDrawerOpen (GravityCompat .START )) {
141+ drawer .closeDrawer (GravityCompat .START );
142+ } else {
143+ finish ();
144+ }
145+ }
146+ });
135147 }
136148
137149 @ Override
@@ -221,16 +233,6 @@ protected boolean printMetrics() {
221233 return this .handler .sendEmptyMessageDelayed (PRINT_METRICS , PRINT_METRICS_DELAY );
222234 }
223235
224- @ Override
225- public void onBackPressed () {
226- DrawerLayout drawer = findViewById (R .id .drawer_layout );
227- if (drawer .isDrawerOpen (GravityCompat .START )) {
228- drawer .closeDrawer (GravityCompat .START );
229- } else {
230- super .onBackPressed ();
231- }
232- }
233-
234236 @ Override
235237 protected void onPostCreate (Bundle savedInstanceState ) {
236238 super .onPostCreate (savedInstanceState );
Original file line number Diff line number Diff line change @@ -42,10 +42,10 @@ android {
4242}
4343
4444dependencies {
45- implementation ' androidx.annotation:annotation:1.3 .0'
45+ implementation ' androidx.annotation:annotation:1.4 .0'
4646 implementation ' androidx.appcompat:appcompat-resources:1.4.2'
4747 testImplementation ' junit:junit:4.13.2'
48- testImplementation ' org.mockito:mockito-core:3.12.4 '
48+ testImplementation ' org.mockito:mockito-core:4.7.0 '
4949 // PowerMockito is required to mock static methods like Logger.log
5050 testImplementation(' org.powermock:powermock-api-mockito2:2.0.9' ) {
5151 exclude module : ' hamcrest-core'
You can’t perform that action at this time.
0 commit comments