changed weird activity switching to smooth fragment switching

This commit is contained in:
CDaut 2022-03-26 21:59:51 +01:00 committed by CDaut
parent 07be587796
commit 5a514a389a
7 changed files with 43 additions and 203 deletions

View file

@ -1,37 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/debug_drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activities.HomeActivity"
tools:ignore="HardcodedText">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:theme="@style/Theme.ClimateGoApp.AppBarOverlay">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/Theme.ClimateGoApp.PopupOverlay" />
<include layout="@layout/fragment_debug" />
</LinearLayout>
<!--this the navigation view which draws
and shows the navigation drawer-->
<!--include the menu created in the menu folder-->
<com.google.android.material.navigation.NavigationView
android:id="@+id/nav_drawer"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
app:menu="@menu/navigation_menu" />
</androidx.drawerlayout.widget.DrawerLayout>

View file

@ -21,7 +21,11 @@
android:background="?attr/colorPrimary"
app:popupTheme="@style/Theme.ClimateGoApp.PopupOverlay" />
<include layout="@layout/fragment_home" />
<FrameLayout
android:id="@+id/home_act_fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
</FrameLayout>
</LinearLayout>
<!--this the navigation view which draws

View file

@ -3,21 +3,21 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/nav_graph"
app:startDestination="@id/HomeFragment">
app:startDestination="@id/home_fragment">
<fragment
android:id="@+id/HomeFragment"
android:id="@+id/home_fragment"
android:name="de.cdaut.climategoapp.HomeFragment"
android:label="@string/first_fragment_label"
tools:layout="@layout/fragment_home"/>
<fragment android:id="@+id/DebugFragment"
<fragment android:id="@+id/debug_fragment"
android:name="de.cdaut.climategoapp.DebugFragment"
android:label="@string/debug_fragment_label"
tools:layout="@layout/fragment_debug">
<action
android:id="@+id/action_DebugFragment_to_HomeFragment"
app:destination="@id/HomeFragment" />
app:destination="@id/home_fragment" />
</fragment>
</navigation>