mirror of
https://github.com/FatttSnake/OxygenToolbox.git
synced 2026-04-06 05:41:26 +08:00
Optimized exit experience
This commit is contained in:
@@ -64,13 +64,15 @@ public class MainActivity extends AppCompatActivity {
|
||||
if (navigationView.getMenu().getItem(0).isChecked()) {
|
||||
drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED);
|
||||
fab.setVisibility(View.VISIBLE);
|
||||
} else if (navigationView.getMenu().getItem(4).isChecked()) {
|
||||
finish();
|
||||
} else {
|
||||
drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
|
||||
fab.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
navigationView.getMenu().getItem(4).setOnMenuItemClickListener(item -> {
|
||||
finish();
|
||||
return false;
|
||||
});
|
||||
// Passing each menu ID as a set of Ids because each
|
||||
// menu should be considered as top level destinations.
|
||||
mAppBarConfiguration = new AppBarConfiguration.Builder(R.id.nav_home)
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.fatapp.oxygentoolbox.ui.exit;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
public class ExitFragment extends Fragment {
|
||||
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,4 @@
|
||||
android:label="@string/menu_about"
|
||||
tools:layout="@layout/fragment_about" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_exit"
|
||||
android:name="com.fatapp.oxygentoolbox.ui.exit.ExitFragment" />
|
||||
</navigation>
|
||||
Reference in New Issue
Block a user