General layout (WIP), Broken navigation
This commit is contained in:
parent
1a123f6b8d
commit
f2c182e69a
@ -12,6 +12,6 @@
|
||||
</deviceKey>
|
||||
</Target>
|
||||
</targetSelectedWithDropDown>
|
||||
<timeTargetWasSelectedWithDropDown value="2023-06-16T19:25:50.154175976Z" />
|
||||
<timeTargetWasSelectedWithDropDown value="2023-06-16T20:57:31.174436180Z" />
|
||||
</component>
|
||||
</project>
|
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
@ -1,10 +1,13 @@
|
||||
package com.cringe_studios.cringe_authenticator;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.Menu;
|
||||
|
||||
import com.cringe_studios.cringe_authenticator.ui.dynamic.DynamicFragment;
|
||||
import com.cringe_studios.cringe_authenticator.ui.home.HomeFragment;
|
||||
import com.cringe_studios.cringe_authenticator.ui.settings.SettingsFragment;
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
import com.google.android.material.navigation.NavigationView;
|
||||
|
||||
@ -42,7 +45,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
// 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, R.id.nav_settings, R.id.nav_credits)
|
||||
R.id.nav_home, R.id.nav_credits)
|
||||
.setOpenableLayout(drawer)
|
||||
.build();
|
||||
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_content_main);
|
||||
@ -57,6 +60,11 @@ public class MainActivity extends AppCompatActivity {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void onSettings(MenuItem item) {
|
||||
NavHostFragment f = (NavHostFragment) getSupportFragmentManager().findFragmentById(R.id.nav_host_fragment_content_main);
|
||||
f.getChildFragmentManager().beginTransaction().replace(R.id.nav_host_fragment_content_main, new SettingsFragment()).commit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onSupportNavigateUp() {
|
||||
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_content_main);
|
||||
|
@ -3,7 +3,8 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".ui.dynamic.DynamicFragment">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_dynamic"
|
||||
|
@ -8,10 +8,6 @@
|
||||
android:id="@+id/nav_home"
|
||||
android:icon="@drawable/ic_launcher_foreground"
|
||||
android:title="Home" />
|
||||
<item
|
||||
android:id="@+id/nav_settings"
|
||||
android:icon="@drawable/ic_launcher_foreground"
|
||||
android:title="Settings" />
|
||||
<item
|
||||
android:id="@+id/nav_credits"
|
||||
android:icon="@drawable/ic_launcher_foreground"
|
||||
|
@ -5,5 +5,6 @@
|
||||
android:id="@+id/action_settings"
|
||||
android:orderInCategory="100"
|
||||
android:title="@string/action_settings"
|
||||
app:showAsAction="never" />
|
||||
app:showAsAction="never"
|
||||
android:onClick="onSettings" />
|
||||
</menu>
|
@ -11,12 +11,6 @@
|
||||
android:label="@string/menu_home"
|
||||
tools:layout="@layout/fragment_home" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_settings"
|
||||
android:name="com.cringe_studios.cringe_authenticator.ui.settings.SettingsFragment"
|
||||
android:label="Settings"
|
||||
tools:layout="@layout/fragment_settings" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_credits"
|
||||
android:name="com.cringe_studios.cringe_authenticator.ui.credits.CreditsFragment"
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
plugins {
|
||||
id 'com.android.application' version '8.0.1' apply false
|
||||
id 'com.android.library' version '8.0.1' apply false
|
||||
id 'com.android.application' version '8.0.2' apply false
|
||||
id 'com.android.library' version '8.0.2' apply false
|
||||
}
|
Loading…
Reference in New Issue
Block a user