forked from RomainDeschenes/Borderlands3DpsCalculator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from Jacusaurus/tossing_frags
Tossing Frags: Migrate Navigation And Update Deprecated Code Overhauls navigation to use the Navigation Framework (NavController), except when launching CameraActivity, and updates deprecated code. Resolves #1
- Loading branch information
Showing
16 changed files
with
696 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...va/com/borderlandsdpscalculator/borderlands3dpscalculator/activities/NavHostActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.borderlandsdpscalculator.borderlands3dpscalculator.activities; | ||
|
||
import android.view.View; | ||
|
||
import androidx.annotation.IdRes; | ||
import androidx.appcompat.app.AppCompatActivity; | ||
|
||
import com.borderlandsdpscalculator.borderlands3dpscalculator.R; | ||
|
||
//FragmentActivity is the base class for AppCompatActivity, so we can use AppCompatActivity to contain and display a fragment | ||
public class NavHostActivity extends AppCompatActivity { | ||
|
||
public NavHostActivity() { //constructor instantiates and inflates layout with a Fragment Container View, which is used to hold and display different Fragments | ||
super(R.layout.nav_host_container); | ||
} | ||
|
||
public static class SwitchFragEvent { //acts as an event that is accessible from anywhere (provided a NavHostActivity object has already been instantiated) | ||
//following variables are final, as they are not changed after being set during instantiation, and public, because the subscriber needs to be able to retrieve their values to perform its function | ||
public final int resId; | ||
public final View view; | ||
|
||
public SwitchFragEvent(@IdRes int resId, View view) { //constructor that takes two parameters and sets instance variables with them. Necessary to pass data from caller to subscriber outside of caller scope. | ||
this.resId = resId; | ||
this.view = view; | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.