Skip to content

Commit

Permalink
App (LSPosed#752)
Browse files Browse the repository at this point in the history
* [app] Fix popup

* [app] Don't actually need to set binding to null
  • Loading branch information
aviraxp authored Jun 19, 2021
1 parent f410634 commit 2b593be
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
return binding.getRoot();
}

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
if (module == null) {
getNavController().navigate(R.id.action_app_list_fragment_to_modules_fragment);
}
}

@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand All @@ -101,10 +109,6 @@ public void onCreate(@Nullable Bundle savedInstanceState) {
int moduleUserId = args.getModuleUserId();

module = ModuleUtil.getInstance().getModule(modulePackageName, moduleUserId);
if (module == null) {
getNavController().navigate(R.id.action_modules_fragment);
return;
}

backupLauncher = registerForActivityResult(new ActivityResultContracts.CreateDocument(),
uri -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,6 @@ public boolean onOptionsItemSelected(@NonNull MenuItem item) {
return super.onOptionsItemSelected(item);
}

@Override
public void onDestroyView() {
super.onDestroyView();

binding = null;
}

private class RepoAdapter extends RecyclerView.Adapter<RepoAdapter.ViewHolder> implements Filterable {
private List<OnlineModule> fullList, showList;
private final LabelComparator labelComparator = new LabelComparator();
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/res/navigation/nav_graph.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@
<argument
android:name="moduleUserId"
app:argType="integer" />
<action
android:id="@+id/action_app_list_fragment_to_modules_fragment"
app:destination="@id/modules_fragment"
app:enterAnim="@anim/fragment_enter"
app:exitAnim="@anim/fragment_exit"
app:popEnterAnim="@anim/fragment_enter_pop"
app:popExitAnim="@anim/fragment_exit_pop"
app:popUpTo="@id/main_fragment"
app:popUpToInclusive="true" />
</fragment>
<fragment
android:id="@+id/repo_fragment"
Expand Down

0 comments on commit 2b593be

Please sign in to comment.