mirror of
				https://github.com/KokaKiwi/BarInsta
				synced 2025-10-30 19:15:35 +00:00 
			
		
		
		
	put setToolbar() on onResume()
fix problem with ActionBar duplicating
This commit is contained in:
		
							parent
							
								
									eba32935ae
								
							
						
					
					
						commit
						5221442988
					
				| @ -305,7 +305,6 @@ public class HashTagFragment extends Fragment implements SwipeRefreshLayout.OnRe | ||||
| 
 | ||||
|     @Override | ||||
|     public void onViewCreated(@NonNull final View view, @Nullable final Bundle savedInstanceState) { | ||||
|         fragmentActivity.setToolbar(binding.toolbar, this); | ||||
|         if (!shouldRefresh) return; | ||||
|         binding.swipeRefreshLayout.setOnRefreshListener(this); | ||||
|         init(); | ||||
| @ -321,6 +320,7 @@ public class HashTagFragment extends Fragment implements SwipeRefreshLayout.OnRe | ||||
|     @Override | ||||
|     public void onResume() { | ||||
|         super.onResume(); | ||||
|         fragmentActivity.setToolbar(binding.toolbar, this); | ||||
|         setTitle(); | ||||
|     } | ||||
| 
 | ||||
|  | ||||
| @ -300,7 +300,6 @@ public class LocationFragment extends Fragment implements SwipeRefreshLayout.OnR | ||||
| 
 | ||||
|     @Override | ||||
|     public void onViewCreated(@NonNull final View view, @Nullable final Bundle savedInstanceState) { | ||||
|         fragmentActivity.setToolbar(binding.toolbar, this); | ||||
|         if (!shouldRefresh) return; | ||||
|         binding.swipeRefreshLayout.setOnRefreshListener(this); | ||||
|         init(); | ||||
| @ -315,6 +314,7 @@ public class LocationFragment extends Fragment implements SwipeRefreshLayout.OnR | ||||
|     @Override | ||||
|     public void onResume() { | ||||
|         super.onResume(); | ||||
|         fragmentActivity.setToolbar(binding.toolbar, this); | ||||
|         setTitle(); | ||||
|     } | ||||
| 
 | ||||
|  | ||||
| @ -280,7 +280,6 @@ public class FeedFragment extends Fragment implements SwipeRefreshLayout.OnRefre | ||||
| 
 | ||||
|     @Override | ||||
|     public void onViewCreated(@NonNull final View view, @Nullable final Bundle savedInstanceState) { | ||||
|         fragmentActivity.setToolbar(binding.toolbar, this); | ||||
|         if (!shouldRefresh) return; | ||||
|         binding.feedSwipeRefreshLayout.setOnRefreshListener(this); | ||||
|         /* | ||||
| @ -335,6 +334,12 @@ public class FeedFragment extends Fragment implements SwipeRefreshLayout.OnRefre | ||||
|         fetchStories(); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public void onResume() { | ||||
|         super.onResume(); | ||||
|         fragmentActivity.setToolbar(binding.toolbar, this); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public void onStop() { | ||||
|         super.onStop(); | ||||
|  | ||||
| @ -380,12 +380,14 @@ class ProfileFragment : Fragment(), OnRefreshListener, ConfirmDialogFragmentCall | ||||
| 
 | ||||
|     override fun onResume() { | ||||
|         super.onResume() | ||||
|         mainActivity.setToolbar(binding.toolbar, this) | ||||
|         try { | ||||
|             val backStackEntry = NavHostFragment.findNavController(this).currentBackStackEntry | ||||
|             if (backStackEntry != null) { | ||||
|                 backStackSavedStateResultLiveData = backStackEntry.savedStateHandle.getLiveData("result") | ||||
|                 backStackSavedStateResultLiveData?.observe(viewLifecycleOwner, backStackSavedStateObserver) | ||||
|             } | ||||
|             mainActivity.supportActionBar?.title = viewModel.username.value | ||||
|         } catch (e: Exception) { | ||||
|             Log.e(TAG, "onResume: ", e) | ||||
|         } | ||||
| @ -439,7 +441,6 @@ class ProfileFragment : Fragment(), OnRefreshListener, ConfirmDialogFragmentCall | ||||
|     } | ||||
| 
 | ||||
|     private fun init() { | ||||
|         mainActivity.setToolbar(binding.toolbar, this) | ||||
|         binding.swipeRefreshLayout.setOnRefreshListener(this) | ||||
|         disableDm = !isNavRootInCurrentTabs("direct_messages_nav_graph") | ||||
|         setupHighlights() | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user