Browse Source
Merge branch 'feature/multistack-navigation' of https://github.com/ammargitham/barinsta into pr/1542
renovate/androidx.fragment-fragment-ktx-1.x
Merge branch 'feature/multistack-navigation' of https://github.com/ammargitham/barinsta into pr/1542
renovate/androidx.fragment-fragment-ktx-1.x
Austin Huang
3 years ago
No known key found for this signature in database
GPG Key ID: 84C23AA04587A91F
43 changed files with 3882 additions and 1120 deletions
-
148app/src/main/java/awais/instagrabber/activities/MainActivity.kt
-
1app/src/main/java/awais/instagrabber/customviews/ChatMessageLayout.java
-
77app/src/main/java/awais/instagrabber/customviews/PostsRecyclerView.java
-
29app/src/main/java/awais/instagrabber/customviews/helpers/PostFetcher.java
-
78app/src/main/java/awais/instagrabber/dialogs/PostLoadingDialogFragment.kt
-
2app/src/main/java/awais/instagrabber/dialogs/TabOrderPreferenceDialogFragment.java
-
57app/src/main/java/awais/instagrabber/fragments/FollowViewerFragment.kt
-
1app/src/main/java/awais/instagrabber/fragments/HashTagFragment.java
-
1app/src/main/java/awais/instagrabber/fragments/LocationFragment.java
-
19app/src/main/java/awais/instagrabber/fragments/PostViewV2Fragment.java
-
1app/src/main/java/awais/instagrabber/fragments/StoryViewerFragment.kt
-
2app/src/main/java/awais/instagrabber/fragments/TopicPostsFragment.java
-
312app/src/main/java/awais/instagrabber/fragments/UserSearchFragment.java
-
252app/src/main/java/awais/instagrabber/fragments/UserSearchFragment.kt
-
2app/src/main/java/awais/instagrabber/fragments/UserSearchMode.kt
-
49app/src/main/java/awais/instagrabber/fragments/directmessages/DirectMessageInboxFragment.kt
-
57app/src/main/java/awais/instagrabber/fragments/main/ProfileFragment.kt
-
2app/src/main/java/awais/instagrabber/fragments/settings/GeneralPreferencesFragment.java
-
6app/src/main/java/awais/instagrabber/models/Tab.kt
-
23app/src/main/java/awais/instagrabber/utils/BarinstaDeepLinkHelper.kt
-
33app/src/main/java/awais/instagrabber/utils/KeywordsFilterUtils.kt
-
30app/src/main/java/awais/instagrabber/utils/NavigationHelper.kt
-
6app/src/main/java/awais/instagrabber/viewmodels/FollowViewModel.kt
-
97app/src/main/java/awais/instagrabber/viewmodels/MediaViewModel.java
-
61app/src/main/java/awais/instagrabber/viewmodels/ProfileFragmentViewModel.kt
-
13app/src/main/java/awais/instagrabber/viewmodels/StoryFragmentViewModel.kt
-
2app/src/main/java/awais/instagrabber/viewmodels/UserSearchViewModel.java
-
1app/src/main/java/thoughtbot/expandableadapter/ExpandableGroup.java
-
3app/src/main/res/layout/activity_main.xml
-
1app/src/main/res/layout/fragment_followers_viewer.xml
-
28app/src/main/res/menu/bottom_nav_menu.xml
-
333app/src/main/res/navigation/direct_messages_nav_graph.xml
-
518app/src/main/res/navigation/discover_nav_graph.xml
-
484app/src/main/res/navigation/favorites_nav_graph.xml
-
520app/src/main/res/navigation/feed_nav_graph.xml
-
539app/src/main/res/navigation/more_nav_graph.xml
-
495app/src/main/res/navigation/notification_viewer_nav_graph.xml
-
567app/src/main/res/navigation/profile_nav_graph.xml
-
12app/src/main/res/navigation/root_nav_graph.xml
-
108app/src/main/res/navigation/settings_nav_graph.xml
-
9app/src/main/res/values/ids.xml
-
18app/src/test/java/awais/instagrabber/common/Adapters.kt
-
5app/src/test/java/awais/instagrabber/viewmodels/ProfileFragmentViewModelTest.kt
@ -0,0 +1,78 @@ |
|||
package awais.instagrabber.dialogs |
|||
|
|||
import android.app.Dialog |
|||
import android.content.Context |
|||
import android.os.Bundle |
|||
import android.util.Log |
|||
import android.widget.Toast |
|||
import androidx.fragment.app.DialogFragment |
|||
import androidx.lifecycle.lifecycleScope |
|||
import androidx.navigation.fragment.findNavController |
|||
import awais.instagrabber.R |
|||
import awais.instagrabber.utils.* |
|||
import awais.instagrabber.utils.extensions.TAG |
|||
import awais.instagrabber.webservices.GraphQLRepository |
|||
import awais.instagrabber.webservices.MediaRepository |
|||
import com.google.android.material.dialog.MaterialAlertDialogBuilder |
|||
import kotlinx.coroutines.Dispatchers |
|||
import kotlinx.coroutines.launch |
|||
import kotlinx.coroutines.withContext |
|||
import java.util.* |
|||
|
|||
class PostLoadingDialogFragment : DialogFragment() { |
|||
private var isLoggedIn: Boolean = false |
|||
|
|||
private val mediaRepository: MediaRepository by lazy { MediaRepository.getInstance() } |
|||
private val graphQLRepository: GraphQLRepository by lazy { GraphQLRepository.getInstance() } |
|||
|
|||
override fun onCreate(savedInstanceState: Bundle?) { |
|||
super.onCreate(savedInstanceState) |
|||
val cookie = Utils.settingsHelper.getString(Constants.COOKIE) |
|||
var userId: Long = 0 |
|||
var csrfToken: String? = null |
|||
if (cookie.isNotBlank()) { |
|||
userId = getUserIdFromCookie(cookie) |
|||
csrfToken = getCsrfTokenFromCookie(cookie) |
|||
} |
|||
if (cookie.isBlank() || userId == 0L || csrfToken.isNullOrBlank()) { |
|||
isLoggedIn = false |
|||
return |
|||
} |
|||
isLoggedIn = true |
|||
} |
|||
|
|||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { |
|||
return MaterialAlertDialogBuilder(requireContext()) |
|||
.setCancelable(false) |
|||
.setView(R.layout.dialog_opening_post) |
|||
.create() |
|||
} |
|||
|
|||
override fun onAttach(context: Context) { |
|||
super.onAttach(context) |
|||
val arguments = PostLoadingDialogFragmentArgs.fromBundle(arguments ?: return) |
|||
val shortCode = arguments.shortCode |
|||
lifecycleScope.launch(Dispatchers.IO) { |
|||
try { |
|||
val media = if (isLoggedIn) mediaRepository.fetch(TextUtils.shortcodeToId(shortCode)) else graphQLRepository.fetchPost(shortCode) |
|||
withContext(Dispatchers.Main) { |
|||
if (media == null) { |
|||
Toast.makeText(context, R.string.post_not_found, Toast.LENGTH_SHORT).show() |
|||
return@withContext |
|||
} |
|||
try { |
|||
findNavController().navigate(PostLoadingDialogFragmentDirections.actionToPost(media, 0)) |
|||
} catch (e: Exception) { |
|||
Log.e(TAG, "showPostView: ", e) |
|||
} |
|||
} |
|||
} catch (e: Exception) { |
|||
Log.e(TAG, "showPostView: ", e) |
|||
} finally { |
|||
withContext(Dispatchers.Main) { |
|||
dismiss() |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
@ -1,312 +0,0 @@ |
|||
package awais.instagrabber.fragments; |
|||
|
|||
import android.content.Context; |
|||
import android.os.Bundle; |
|||
import android.view.KeyEvent; |
|||
import android.view.LayoutInflater; |
|||
import android.view.View; |
|||
import android.view.ViewGroup; |
|||
|
|||
import androidx.annotation.NonNull; |
|||
import androidx.annotation.Nullable; |
|||
import androidx.appcompat.app.ActionBar; |
|||
import androidx.core.util.Pair; |
|||
import androidx.fragment.app.Fragment; |
|||
import androidx.lifecycle.SavedStateHandle; |
|||
import androidx.lifecycle.ViewModelProvider; |
|||
import androidx.navigation.NavBackStackEntry; |
|||
import androidx.navigation.NavController; |
|||
import androidx.navigation.fragment.NavHostFragment; |
|||
import androidx.recyclerview.widget.LinearLayoutManager; |
|||
import androidx.transition.TransitionManager; |
|||
|
|||
import com.google.android.material.chip.Chip; |
|||
import com.google.android.material.snackbar.Snackbar; |
|||
|
|||
import java.util.Objects; |
|||
import java.util.Set; |
|||
|
|||
import awais.instagrabber.activities.MainActivity; |
|||
import awais.instagrabber.adapters.UserSearchResultsAdapter; |
|||
import awais.instagrabber.customviews.helpers.TextWatcherAdapter; |
|||
import awais.instagrabber.databinding.FragmentUserSearchBinding; |
|||
import awais.instagrabber.repositories.responses.directmessages.RankedRecipient; |
|||
import awais.instagrabber.utils.TextUtils; |
|||
import awais.instagrabber.utils.Utils; |
|||
import awais.instagrabber.utils.ViewUtils; |
|||
import awais.instagrabber.viewmodels.UserSearchViewModel; |
|||
|
|||
public class UserSearchFragment extends Fragment { |
|||
private static final String TAG = UserSearchFragment.class.getSimpleName(); |
|||
|
|||
private FragmentUserSearchBinding binding; |
|||
private UserSearchViewModel viewModel; |
|||
private UserSearchResultsAdapter resultsAdapter; |
|||
private int paddingOffset; |
|||
|
|||
private final int windowWidth = Utils.displayMetrics.widthPixels; |
|||
private final int minInputWidth = Utils.convertDpToPx(50); |
|||
private String actionLabel; |
|||
private String title; |
|||
private boolean multiple; |
|||
|
|||
@Override |
|||
public void onCreate(@Nullable final Bundle savedInstanceState) { |
|||
super.onCreate(savedInstanceState); |
|||
} |
|||
|
|||
@Nullable |
|||
@Override |
|||
public View onCreateView(@NonNull final LayoutInflater inflater, @Nullable final ViewGroup container, @Nullable final Bundle savedInstanceState) { |
|||
binding = FragmentUserSearchBinding.inflate(inflater, container, false); |
|||
viewModel = new ViewModelProvider(this).get(UserSearchViewModel.class); |
|||
return binding.getRoot(); |
|||
} |
|||
|
|||
@Override |
|||
public void onViewCreated(@NonNull final View view, @Nullable final Bundle savedInstanceState) { |
|||
paddingOffset = binding.search.getPaddingStart() + binding.search.getPaddingEnd() + binding.group |
|||
.getPaddingStart() + binding.group.getPaddingEnd() + binding.group.getChipSpacingHorizontal(); |
|||
init(); |
|||
} |
|||
|
|||
@Override |
|||
public void onDestroyView() { |
|||
super.onDestroyView(); |
|||
viewModel.cleanup(); |
|||
} |
|||
|
|||
private void init() { |
|||
final Bundle arguments = getArguments(); |
|||
if (arguments != null) { |
|||
final UserSearchFragmentArgs fragmentArgs = UserSearchFragmentArgs.fromBundle(arguments); |
|||
actionLabel = fragmentArgs.getActionLabel(); |
|||
title = fragmentArgs.getTitle(); |
|||
multiple = fragmentArgs.getMultiple(); |
|||
viewModel.setHideThreadIds(fragmentArgs.getHideThreadIds()); |
|||
viewModel.setHideUserIds(fragmentArgs.getHideUserIds()); |
|||
viewModel.setSearchMode(fragmentArgs.getSearchMode()); |
|||
viewModel.setShowGroups(fragmentArgs.getShowGroups()); |
|||
} |
|||
setupTitles(); |
|||
setupInput(); |
|||
setupResults(); |
|||
setupObservers(); |
|||
// show cached results |
|||
viewModel.showCachedResults(); |
|||
} |
|||
|
|||
private void setupTitles() { |
|||
if (!TextUtils.isEmpty(actionLabel)) { |
|||
binding.done.setText(actionLabel); |
|||
} |
|||
if (!TextUtils.isEmpty(title)) { |
|||
final MainActivity activity = (MainActivity) getActivity(); |
|||
if (activity != null) { |
|||
final ActionBar actionBar = activity.getSupportActionBar(); |
|||
if (actionBar != null) { |
|||
actionBar.setTitle(title); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
private void setupResults() { |
|||
final Context context = getContext(); |
|||
if (context == null) return; |
|||
binding.results.setLayoutManager(new LinearLayoutManager(context)); |
|||
resultsAdapter = new UserSearchResultsAdapter(multiple, (position, recipient, selected) -> { |
|||
if (!multiple) { |
|||
final NavController navController = NavHostFragment.findNavController(this); |
|||
if (!setResult(navController, recipient)) return; |
|||
navController.navigateUp(); |
|||
return; |
|||
} |
|||
viewModel.setSelectedRecipient(recipient, !selected); |
|||
resultsAdapter.setSelectedRecipient(recipient, !selected); |
|||
if (!selected) { |
|||
createChip(recipient); |
|||
return; |
|||
} |
|||
final View chip = findChip(recipient); |
|||
if (chip == null) return; |
|||
removeChipFromGroup(chip); |
|||
}); |
|||
binding.results.setAdapter(resultsAdapter); |
|||
binding.done.setOnClickListener(v -> { |
|||
final NavController navController = NavHostFragment.findNavController(this); |
|||
if (!setResult(navController, viewModel.getSelectedRecipients())) return; |
|||
navController.navigateUp(); |
|||
}); |
|||
} |
|||
|
|||
private boolean setResult(@NonNull final NavController navController, final RankedRecipient rankedRecipient) { |
|||
final NavBackStackEntry navBackStackEntry = navController.getPreviousBackStackEntry(); |
|||
if (navBackStackEntry == null) return false; |
|||
final SavedStateHandle savedStateHandle = navBackStackEntry.getSavedStateHandle(); |
|||
savedStateHandle.set("result", rankedRecipient); |
|||
return true; |
|||
} |
|||
|
|||
private boolean setResult(@NonNull final NavController navController, final Set<RankedRecipient> rankedRecipients) { |
|||
final NavBackStackEntry navBackStackEntry = navController.getPreviousBackStackEntry(); |
|||
if (navBackStackEntry == null) return false; |
|||
final SavedStateHandle savedStateHandle = navBackStackEntry.getSavedStateHandle(); |
|||
savedStateHandle.set("result", rankedRecipients); |
|||
return true; |
|||
} |
|||
|
|||
private void setupInput() { |
|||
binding.search.addTextChangedListener(new TextWatcherAdapter() { |
|||
@Override |
|||
public void onTextChanged(final CharSequence s, final int start, final int before, final int count) { |
|||
// if (TextUtils.isEmpty(s)) { |
|||
// viewModel.cancelSearch(); |
|||
// viewModel.clearResults(); |
|||
// return; |
|||
// } |
|||
viewModel.search(s == null ? null : s.toString().trim()); |
|||
} |
|||
}); |
|||
binding.search.setOnKeyListener((v, keyCode, event) -> { |
|||
if (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_DEL) { |
|||
final View chip = getLastChip(); |
|||
if (chip == null) return false; |
|||
removeChip(chip); |
|||
} |
|||
return false; |
|||
}); |
|||
binding.group.setOnHierarchyChangeListener(new ViewGroup.OnHierarchyChangeListener() { |
|||
@Override |
|||
public void onChildViewAdded(final View parent, final View child) {} |
|||
|
|||
@Override |
|||
public void onChildViewRemoved(final View parent, final View child) { |
|||
binding.group.post(() -> { |
|||
TransitionManager.beginDelayedTransition(binding.getRoot()); |
|||
calculateInputWidth(0); |
|||
}); |
|||
} |
|||
}); |
|||
|
|||
} |
|||
|
|||
private void setupObservers() { |
|||
viewModel.getRecipients().observe(getViewLifecycleOwner(), results -> { |
|||
if (results == null) return; |
|||
switch (results.status) { |
|||
case SUCCESS: |
|||
if (results.data != null) { |
|||
resultsAdapter.submitList(results.data); |
|||
} |
|||
break; |
|||
case ERROR: |
|||
if (results.message != null) { |
|||
Snackbar.make(binding.getRoot(), results.message, Snackbar.LENGTH_LONG).show(); |
|||
} |
|||
if (results.resId != 0) { |
|||
Snackbar.make(binding.getRoot(), results.resId, Snackbar.LENGTH_LONG).show(); |
|||
} |
|||
if (results.data != null) { |
|||
resultsAdapter.submitList(results.data); |
|||
} |
|||
break; |
|||
case LOADING: |
|||
//noinspection DuplicateBranchesInSwitch |
|||
if (results.data != null) { |
|||
resultsAdapter.submitList(results.data); |
|||
} |
|||
break; |
|||
} |
|||
}); |
|||
viewModel.showAction().observe(getViewLifecycleOwner(), showAction -> binding.done.setVisibility(showAction ? View.VISIBLE : View.GONE)); |
|||
} |
|||
|
|||
private void createChip(final RankedRecipient recipient) { |
|||
final Context context = getContext(); |
|||
if (context == null) return; |
|||
final Chip chip = new Chip(context); |
|||
chip.setTag(recipient); |
|||
chip.setText(getRecipientText(recipient)); |
|||
chip.setCloseIconVisible(true); |
|||
chip.setOnCloseIconClickListener(v -> removeChip(chip)); |
|||
binding.group.post(() -> { |
|||
final Pair<Integer, Integer> measure = ViewUtils.measure(chip, binding.group); |
|||
TransitionManager.beginDelayedTransition(binding.getRoot()); |
|||
calculateInputWidth(measure.second != null ? measure.second : 0); |
|||
binding.group.addView(chip, binding.group.getChildCount() - 1); |
|||
}); |
|||
} |
|||
|
|||
private String getRecipientText(final RankedRecipient recipient) { |
|||
if (recipient == null) return null; |
|||
if (recipient.getUser() != null) { |
|||
return recipient.getUser().getFullName(); |
|||
} |
|||
if (recipient.getThread() != null) { |
|||
return recipient.getThread().getThreadTitle(); |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
private void removeChip(@NonNull final View chip) { |
|||
final RankedRecipient recipient = (RankedRecipient) chip.getTag(); |
|||
if (recipient == null) return; |
|||
viewModel.setSelectedRecipient(recipient, false); |
|||
resultsAdapter.setSelectedRecipient(recipient, false); |
|||
removeChipFromGroup(chip); |
|||
} |
|||
|
|||
private View findChip(final RankedRecipient recipient) { |
|||
if (recipient == null || recipient.getUser() == null && recipient.getThread() == null) return null; |
|||
boolean isUser = recipient.getUser() != null; |
|||
final int childCount = binding.group.getChildCount(); |
|||
if (childCount == 0) return null; |
|||
for (int i = childCount - 1; i >= 0; i--) { |
|||
final View child = binding.group.getChildAt(i); |
|||
if (child == null) continue; |
|||
final RankedRecipient tag = (RankedRecipient) child.getTag(); |
|||
if (tag == null || isUser && tag.getUser() == null || !isUser && tag.getThread() == null) continue; |
|||
if ((isUser && tag.getUser().getPk() == recipient.getUser().getPk()) |
|||
|| (!isUser && Objects.equals(tag.getThread().getThreadId(), recipient.getThread().getThreadId()))) { |
|||
return child; |
|||
} |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
private void removeChipFromGroup(final View chip) { |
|||
binding.group.post(() -> { |
|||
TransitionManager.beginDelayedTransition(binding.getRoot()); |
|||
binding.group.removeView(chip); |
|||
}); |
|||
} |
|||
|
|||
private void calculateInputWidth(final int newChipWidth) { |
|||
final View lastChip = getLastChip(); |
|||
int lastRight = lastChip != null ? lastChip.getRight() : 0; |
|||
final int remainingSpaceInRow = windowWidth - lastRight; |
|||
if (remainingSpaceInRow < newChipWidth) { |
|||
// next chip will go to the next row, so assume no chips present |
|||
lastRight = 0; |
|||
} |
|||
final int newRight = lastRight + newChipWidth; |
|||
final int newInputWidth = windowWidth - newRight - paddingOffset; |
|||
binding.search.getLayoutParams().width = newInputWidth < minInputWidth ? windowWidth : newInputWidth; |
|||
binding.search.requestLayout(); |
|||
} |
|||
|
|||
private View getLastChip() { |
|||
final int childCount = binding.group.getChildCount(); |
|||
if (childCount == 0) { |
|||
return null; |
|||
} |
|||
for (int i = childCount - 1; i >= 0; i--) { |
|||
final View child = binding.group.getChildAt(i); |
|||
if (child instanceof Chip) { |
|||
return child; |
|||
} |
|||
} |
|||
return null; |
|||
} |
|||
} |
@ -0,0 +1,252 @@ |
|||
package awais.instagrabber.fragments |
|||
|
|||
import android.os.Bundle |
|||
import android.view.KeyEvent |
|||
import android.view.LayoutInflater |
|||
import android.view.View |
|||
import android.view.ViewGroup |
|||
import android.view.ViewGroup.OnHierarchyChangeListener |
|||
import androidx.fragment.app.Fragment |
|||
import androidx.fragment.app.viewModels |
|||
import androidx.navigation.NavController |
|||
import androidx.navigation.fragment.NavHostFragment |
|||
import androidx.recyclerview.widget.LinearLayoutManager |
|||
import androidx.transition.TransitionManager |
|||
import awais.instagrabber.activities.MainActivity |
|||
import awais.instagrabber.adapters.UserSearchResultsAdapter |
|||
import awais.instagrabber.customviews.helpers.TextWatcherAdapter |
|||
import awais.instagrabber.databinding.FragmentUserSearchBinding |
|||
import awais.instagrabber.models.Resource |
|||
import awais.instagrabber.repositories.responses.directmessages.RankedRecipient |
|||
import awais.instagrabber.utils.Utils |
|||
import awais.instagrabber.utils.extensions.trimAll |
|||
import awais.instagrabber.utils.measure |
|||
import awais.instagrabber.viewmodels.UserSearchViewModel |
|||
import com.google.android.material.chip.Chip |
|||
import com.google.android.material.snackbar.Snackbar |
|||
|
|||
class UserSearchFragment : Fragment() { |
|||
|
|||
private lateinit var binding: FragmentUserSearchBinding |
|||
|
|||
private var resultsAdapter: UserSearchResultsAdapter? = null |
|||
private var paddingOffset = 0 |
|||
private var actionLabel: String? = null |
|||
private var title: String? = null |
|||
private var multiple = false |
|||
|
|||
private val viewModel: UserSearchViewModel by viewModels() |
|||
private val windowWidth = Utils.displayMetrics.widthPixels |
|||
private val minInputWidth = Utils.convertDpToPx(50f) |
|||
|
|||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View { |
|||
binding = FragmentUserSearchBinding.inflate(inflater, container, false) |
|||
return binding.root |
|||
} |
|||
|
|||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
|||
paddingOffset = with(binding) { |
|||
search.paddingStart + search.paddingEnd + group.paddingStart + group.paddingEnd + group.chipSpacingHorizontal |
|||
} |
|||
init() |
|||
} |
|||
|
|||
override fun onDestroyView() { |
|||
super.onDestroyView() |
|||
viewModel.cleanup() |
|||
} |
|||
|
|||
private fun init() { |
|||
val arguments = arguments |
|||
if (arguments != null) { |
|||
val fragmentArgs = UserSearchFragmentArgs.fromBundle(arguments) |
|||
actionLabel = fragmentArgs.actionLabel |
|||
title = fragmentArgs.title |
|||
multiple = fragmentArgs.multiple |
|||
viewModel.setHideThreadIds(fragmentArgs.hideThreadIds) |
|||
viewModel.setHideUserIds(fragmentArgs.hideUserIds) |
|||
viewModel.setSearchMode(fragmentArgs.searchMode) |
|||
viewModel.setShowGroups(fragmentArgs.showGroups) |
|||
} |
|||
setupTitles() |
|||
setupInput() |
|||
setupResults() |
|||
setupObservers() |
|||
// show cached results |
|||
viewModel.showCachedResults() |
|||
} |
|||
|
|||
private fun setupTitles() { |
|||
if (!actionLabel.isNullOrBlank()) { |
|||
binding.done.text = actionLabel |
|||
} |
|||
if (title.isNullOrBlank()) return |
|||
(activity as MainActivity?)?.supportActionBar?.title = title |
|||
} |
|||
|
|||
private fun setupResults() { |
|||
val context = context ?: return |
|||
binding.results.layoutManager = LinearLayoutManager(context) |
|||
resultsAdapter = UserSearchResultsAdapter(multiple) { _: Int, recipient: RankedRecipient, selected: Boolean -> |
|||
if (!multiple) { |
|||
val navController = NavHostFragment.findNavController(this) |
|||
if (!setResult(navController, recipient)) return@UserSearchResultsAdapter |
|||
navController.navigateUp() |
|||
return@UserSearchResultsAdapter |
|||
} |
|||
viewModel.setSelectedRecipient(recipient, !selected) |
|||
resultsAdapter?.setSelectedRecipient(recipient, !selected) |
|||
if (!selected) { |
|||
createChip(recipient) |
|||
return@UserSearchResultsAdapter |
|||
} |
|||
val chip = findChip(recipient) ?: return@UserSearchResultsAdapter |
|||
removeChipFromGroup(chip) |
|||
} |
|||
binding.results.adapter = resultsAdapter |
|||
binding.done.setOnClickListener { |
|||
val navController = NavHostFragment.findNavController(this) |
|||
if (!setResult(navController, viewModel.selectedRecipients)) return@setOnClickListener |
|||
navController.navigateUp() |
|||
} |
|||
} |
|||
|
|||
private fun setResult(navController: NavController, rankedRecipient: RankedRecipient): Boolean { |
|||
navController.previousBackStackEntry?.savedStateHandle?.set("result", rankedRecipient) ?: return false |
|||
return true |
|||
} |
|||
|
|||
private fun setResult(navController: NavController, rankedRecipients: Set<RankedRecipient>): Boolean { |
|||
navController.previousBackStackEntry?.savedStateHandle?.set("result", rankedRecipients) ?: return false |
|||
return true |
|||
} |
|||
|
|||
private fun setupInput() { |
|||
binding.search.addTextChangedListener(object : TextWatcherAdapter() { |
|||
override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) { |
|||
viewModel.search(s.toString().trimAll()) |
|||
} |
|||
}) |
|||
binding.search.setOnKeyListener { _: View?, _: Int, event: KeyEvent? -> |
|||
if (event != null && event.action == KeyEvent.ACTION_DOWN && event.keyCode == KeyEvent.KEYCODE_DEL) { |
|||
val chip = lastChip ?: return@setOnKeyListener false |
|||
removeChip(chip) |
|||
} |
|||
false |
|||
} |
|||
binding.group.setOnHierarchyChangeListener(object : OnHierarchyChangeListener { |
|||
override fun onChildViewAdded(parent: View, child: View) {} |
|||
override fun onChildViewRemoved(parent: View, child: View) { |
|||
binding.group.post { |
|||
TransitionManager.beginDelayedTransition(binding.root) |
|||
calculateInputWidth(0) |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
|
|||
private fun setupObservers() { |
|||
viewModel.recipients.observe(viewLifecycleOwner) { |
|||
if (it == null) return@observe |
|||
when (it.status) { |
|||
Resource.Status.SUCCESS -> if (it.data != null) { |
|||
resultsAdapter?.submitList(it.data) |
|||
} |
|||
Resource.Status.ERROR -> { |
|||
if (it.message != null) { |
|||
Snackbar.make(binding.root, it.message, Snackbar.LENGTH_LONG).show() |
|||
} |
|||
if (it.resId != 0) { |
|||
Snackbar.make(binding.root, it.resId, Snackbar.LENGTH_LONG).show() |
|||
} |
|||
if (it.data != null) { |
|||
resultsAdapter?.submitList(it.data) |
|||
} |
|||
} |
|||
Resource.Status.LOADING -> if (it.data != null) { |
|||
resultsAdapter?.submitList(it.data) |
|||
} |
|||
} |
|||
} |
|||
viewModel.showAction().observe(viewLifecycleOwner) { binding.done.visibility = if (it) View.VISIBLE else View.GONE } |
|||
} |
|||
|
|||
private fun createChip(recipient: RankedRecipient) { |
|||
val context = context ?: return |
|||
val chip = Chip(context).apply { |
|||
tag = recipient |
|||
text = getRecipientText(recipient) |
|||
isCloseIconVisible = true |
|||
setOnCloseIconClickListener { removeChip(this) } |
|||
} |
|||
binding.group.post { |
|||
val measure = measure(chip, binding.group) |
|||
TransitionManager.beginDelayedTransition(binding.root) |
|||
calculateInputWidth(if (measure.second != null) measure.second else 0) |
|||
binding.group.addView(chip, binding.group.childCount - 1) |
|||
} |
|||
} |
|||
|
|||
private fun getRecipientText(recipient: RankedRecipient?): String? = when { |
|||
recipient == null -> null |
|||
recipient.user != null -> recipient.user.fullName |
|||
recipient.thread != null -> recipient.thread.threadTitle |
|||
else -> null |
|||
} |
|||
|
|||
private fun removeChip(chip: View) { |
|||
val recipient = chip.tag as RankedRecipient |
|||
viewModel.setSelectedRecipient(recipient, false) |
|||
resultsAdapter?.setSelectedRecipient(recipient, false) |
|||
removeChipFromGroup(chip) |
|||
} |
|||
|
|||
private fun findChip(recipient: RankedRecipient?): View? { |
|||
if (recipient == null || recipient.user == null && recipient.thread == null) return null |
|||
val isUser = recipient.user != null |
|||
val childCount = binding.group.childCount |
|||
if (childCount == 0) return null |
|||
for (i in childCount - 1 downTo 0) { |
|||
val child = binding.group.getChildAt(i) ?: continue |
|||
val tag = child.tag as RankedRecipient |
|||
if (isUser && tag.user == null || !isUser && tag.thread == null) continue |
|||
if (isUser && tag.user?.pk == recipient.user?.pk || !isUser && tag.thread?.threadId == recipient.thread?.threadId) { |
|||
return child |
|||
} |
|||
} |
|||
return null |
|||
} |
|||
|
|||
private fun removeChipFromGroup(chip: View) { |
|||
binding.group.post { |
|||
TransitionManager.beginDelayedTransition(binding.root) |
|||
binding.group.removeView(chip) |
|||
} |
|||
} |
|||
|
|||
private fun calculateInputWidth(newChipWidth: Int) { |
|||
var lastRight = lastChip?.right ?: 0 |
|||
val remainingSpaceInRow = windowWidth - lastRight |
|||
if (remainingSpaceInRow < newChipWidth) { |
|||
// next chip will go to the next row, so assume no chips present |
|||
lastRight = 0 |
|||
} |
|||
val newRight = lastRight + newChipWidth |
|||
val newInputWidth = windowWidth - newRight - paddingOffset |
|||
binding.search.layoutParams.width = if (newInputWidth < minInputWidth) windowWidth else newInputWidth |
|||
binding.search.requestLayout() |
|||
} |
|||
|
|||
private val lastChip: View? |
|||
get() { |
|||
val childCount = binding.group.childCount |
|||
if (childCount == 0) return null |
|||
for (i in childCount - 1 downTo 0) { |
|||
val child = binding.group.getChildAt(i) |
|||
if (child is Chip) { |
|||
return child |
|||
} |
|||
} |
|||
return null |
|||
} |
|||
} |
@ -1,6 +1,6 @@ |
|||
package awais.instagrabber.fragments |
|||
|
|||
enum class UserSearchMode(name: String) { |
|||
enum class UserSearchMode(val mode: String) { |
|||
USER_SEARCH("user_name"), |
|||
RAVEN("raven"), |
|||
RESHARE("reshare"); |
@ -0,0 +1,23 @@ |
|||
package awais.instagrabber.utils |
|||
|
|||
import android.net.Uri |
|||
import androidx.core.net.toUri |
|||
|
|||
private const val domain = "barinsta" |
|||
|
|||
fun getDirectThreadDeepLink(threadId: String, threadTitle: String, isPending: Boolean = false): Uri = |
|||
"$domain://dm_thread/$threadId/$threadTitle?pending=${isPending}".toUri() |
|||
|
|||
fun getProfileDeepLink(username: String): Uri = "$domain://profile/$username".toUri() |
|||
|
|||
fun getPostDeepLink(shortCode: String): Uri = "$domain://post/$shortCode".toUri() |
|||
|
|||
fun getLocationDeepLink(locationId: Long): Uri = "$domain://location/$locationId".toUri() |
|||
|
|||
fun getLocationDeepLink(locationId: String): Uri = "$domain://location/$locationId".toUri() |
|||
|
|||
fun getHashtagDeepLink(hashtag: String): Uri = "$domain://hashtag/$hashtag".toUri() |
|||
|
|||
fun getNotificationsDeepLink(type: String, targetId: Long = 0): Uri = "$domain://notifications/$type?targetId=$targetId".toUri() |
|||
|
|||
fun getSearchDeepLink(): Uri = "$domain://search".toUri() |
@ -1,19 +1,108 @@ |
|||
package awais.instagrabber.viewmodels; |
|||
|
|||
import android.util.Log; |
|||
|
|||
import androidx.annotation.NonNull; |
|||
import androidx.lifecycle.LiveData; |
|||
import androidx.lifecycle.MutableLiveData; |
|||
import androidx.lifecycle.ViewModel; |
|||
import androidx.lifecycle.ViewModelProvider; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
import awais.instagrabber.customviews.helpers.PostFetcher; |
|||
import awais.instagrabber.fragments.settings.PreferenceKeys; |
|||
import awais.instagrabber.interfaces.FetchListener; |
|||
import awais.instagrabber.repositories.responses.Media; |
|||
import awais.instagrabber.utils.KeywordsFilterUtilsKt; |
|||
|
|||
import static awais.instagrabber.utils.Utils.settingsHelper; |
|||
|
|||
public class MediaViewModel extends ViewModel { |
|||
private MutableLiveData<List<Media>> list; |
|||
private static final String TAG = MediaViewModel.class.getSimpleName(); |
|||
|
|||
private boolean refresh = true; |
|||
|
|||
private final PostFetcher postFetcher; |
|||
private final MutableLiveData<List<Media>> list = new MutableLiveData<>(); |
|||
|
|||
public MediaViewModel(@NonNull final PostFetcher.PostFetchService postFetchService) { |
|||
final FetchListener<List<Media>> fetchListener = new FetchListener<List<Media>>() { |
|||
@Override |
|||
public void onResult(final List<Media> result) { |
|||
if (refresh) { |
|||
list.postValue(filterResult(result, true)); |
|||
refresh = false; |
|||
return; |
|||
} |
|||
list.postValue(filterResult(result, false)); |
|||
} |
|||
|
|||
@Override |
|||
public void onFailure(final Throwable t) { |
|||
Log.e(TAG, "onFailure: ", t); |
|||
} |
|||
}; |
|||
postFetcher = new PostFetcher(postFetchService, fetchListener); |
|||
} |
|||
|
|||
public MutableLiveData<List<Media>> getList() { |
|||
if (list == null) { |
|||
list = new MutableLiveData<>(); |
|||
@NonNull |
|||
private List<Media> filterResult(final List<Media> result, final boolean isRefresh) { |
|||
final List<Media> models = list.getValue(); |
|||
final List<Media> modelsCopy = models == null || isRefresh ? new ArrayList<>() : new ArrayList<>(models); |
|||
if (settingsHelper.getBoolean(PreferenceKeys.TOGGLE_KEYWORD_FILTER)) { |
|||
final List<String> keywords = new ArrayList<>(settingsHelper.getStringSet(PreferenceKeys.KEYWORD_FILTERS)); |
|||
final List<Media> filter = KeywordsFilterUtilsKt.filter(keywords, result); |
|||
if (filter != null) { |
|||
modelsCopy.addAll(filter); |
|||
} |
|||
return modelsCopy; |
|||
} |
|||
modelsCopy.addAll(result); |
|||
return modelsCopy; |
|||
} |
|||
|
|||
public LiveData<List<Media>> getList() { |
|||
return list; |
|||
} |
|||
|
|||
public boolean hasMore() { |
|||
return postFetcher.hasMore(); |
|||
} |
|||
|
|||
public void fetch() { |
|||
postFetcher.fetch(); |
|||
} |
|||
|
|||
public void reset() { |
|||
postFetcher.reset(); |
|||
} |
|||
|
|||
public boolean isFetching() { |
|||
return postFetcher.isFetching(); |
|||
} |
|||
|
|||
public void refresh() { |
|||
refresh = true; |
|||
reset(); |
|||
fetch(); |
|||
} |
|||
|
|||
public static class ViewModelFactory implements ViewModelProvider.Factory { |
|||
|
|||
@NonNull |
|||
private final PostFetcher.PostFetchService postFetchService; |
|||
|
|||
public ViewModelFactory(@NonNull final PostFetcher.PostFetchService postFetchService) { |
|||
this.postFetchService = postFetchService; |
|||
} |
|||
|
|||
@NonNull |
|||
@Override |
|||
public <T extends ViewModel> T create(@NonNull final Class<T> modelClass) { |
|||
//noinspection unchecked |
|||
return (T) new MediaViewModel(postFetchService); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,28 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<menu xmlns:android="http://schemas.android.com/apk/res/android"> |
|||
<item |
|||
android:id="@id/direct_messages_nav_graph" |
|||
android:icon="@drawable/ic_message_24" |
|||
android:contentDescription="@string/title_dm" |
|||
android:title="@string/title_dm" /> |
|||
<item |
|||
android:id="@id/feed_nav_graph" |
|||
android:icon="@drawable/ic_home_24" |
|||
android:contentDescription="@string/feed" |
|||
android:title="@string/feed" /> |
|||
<item |
|||
android:id="@id/profile_nav_graph" |
|||
android:icon="@drawable/ic_person_24" |
|||
android:contentDescription="@string/profile" |
|||
android:title="@string/profile" /> |
|||
<item |
|||
android:id="@id/discover_nav_graph" |
|||
android:icon="@drawable/ic_explore_24" |
|||
android:contentDescription="@string/title_discover" |
|||
android:title="@string/title_discover" /> |
|||
<item |
|||
android:id="@id/more_nav_graph" |
|||
android:icon="@drawable/ic_more_horiz_24" |
|||
android:contentDescription="@string/more" |
|||
android:title="@string/more" /> |
|||
</menu> |
@ -0,0 +1,518 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<navigation 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/discover_nav_graph" |
|||
app:startDestination="@id/discoverFragment"> |
|||
|
|||
<fragment |
|||
android:id="@+id/discoverFragment" |
|||
android:name="awais.instagrabber.fragments.main.DiscoverFragment" |
|||
android:label="@string/title_discover" |
|||
tools:layout="@layout/fragment_discover"> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_topic_posts" |
|||
app:destination="@id/topicPostsFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/storyViewerFragment" |
|||
android:name="awais.instagrabber.fragments.StoryViewerFragment" |
|||
android:label="StoryViewerFragment" |
|||
tools:layout="@layout/fragment_story_viewer"> |
|||
|
|||
<argument |
|||
android:name="options" |
|||
app:argType="awais.instagrabber.repositories.requests.StoryViewerOptions" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_user_search" |
|||
app:destination="@id/user_search" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/postViewFragment" |
|||
android:name="awais.instagrabber.fragments.PostViewV2Fragment" |
|||
android:label="@string/post" |
|||
tools:layout="@layout/dialog_post_view"> |
|||
|
|||
<argument |
|||
android:name="media" |
|||
app:argType="awais.instagrabber.repositories.responses.Media" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="position" |
|||
app:argType="integer" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_likes" |
|||
app:destination="@id/likesViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_saved_collections" |
|||
app:destination="@id/savedCollectionsFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_user_search" |
|||
app:destination="@id/user_search" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/locationFragment" |
|||
android:name="awais.instagrabber.fragments.LocationFragment" |
|||
android:label="" |
|||
tools:layout="@layout/fragment_location"> |
|||
|
|||
<argument |
|||
android:name="locationId" |
|||
app:argType="long" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_story" |
|||
app:destination="@id/storyViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/hashTagFragment" |
|||
android:name="awais.instagrabber.fragments.HashTagFragment" |
|||
android:label="" |
|||
tools:layout="@layout/fragment_hashtag"> |
|||
|
|||
<argument |
|||
android:name="hashtag" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_story" |
|||
app:destination="@id/storyViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<dialog |
|||
android:id="@+id/commentsViewerFragment" |
|||
android:name="awais.instagrabber.fragments.comments.CommentsViewerFragment" |
|||
android:label="Comments" |
|||
tools:layout="@layout/fragment_comments"> |
|||
|
|||
<argument |
|||
android:name="shortCode" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="postId" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="postUserId" |
|||
app:argType="long" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_likes" |
|||
app:destination="@id/likesViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</dialog> |
|||
|
|||
<!-- Copy of profile fragment tag --> |
|||
<!-- Required to get back arrow in action bar --> |
|||
<!-- See https://issuetracker.google.com/issues/192395936 --> |
|||
<fragment |
|||
android:id="@+id/profile_non_top" |
|||
android:name="awais.instagrabber.fragments.main.ProfileFragment" |
|||
android:label="@string/profile" |
|||
tools:layout="@layout/fragment_profile"> |
|||
|
|||
<argument |
|||
android:name="username" |
|||
android:defaultValue="" |
|||
app:argType="string" |
|||
app:nullable="true" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_saved" |
|||
app:destination="@id/savedViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_saved_collections" |
|||
app:destination="@id/savedCollectionsFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_follow_viewer" |
|||
app:destination="@id/followViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_story" |
|||
app:destination="@id/storyViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_user_search" |
|||
app:destination="@id/user_search" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_notifications" |
|||
app:destination="@id/notifications_viewer_non_top" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/savedViewerFragment" |
|||
android:name="awais.instagrabber.fragments.SavedViewerFragment" |
|||
android:label="Saved" |
|||
tools:layout="@layout/fragment_saved"> |
|||
|
|||
<argument |
|||
android:name="username" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="profileId" |
|||
app:argType="long" /> |
|||
|
|||
<argument |
|||
android:name="type" |
|||
app:argType="awais.instagrabber.models.enums.PostItemType" |
|||
app:nullable="false" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/followViewerFragment" |
|||
android:name="awais.instagrabber.fragments.FollowViewerFragment" |
|||
android:label="" |
|||
tools:layout="@layout/fragment_followers_viewer"> |
|||
|
|||
<argument |
|||
android:name="profileId" |
|||
app:argType="long" /> |
|||
|
|||
<argument |
|||
android:name="isFollowersList" |
|||
app:argType="boolean" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="username" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<dialog |
|||
android:id="@+id/likesViewerFragment" |
|||
android:name="awais.instagrabber.fragments.LikesViewerFragment" |
|||
android:label="Comments" |
|||
tools:layout="@layout/fragment_likes"> |
|||
|
|||
<argument |
|||
android:name="postId" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="isComment" |
|||
app:argType="boolean" |
|||
app:nullable="false" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</dialog> |
|||
|
|||
<fragment |
|||
android:id="@+id/topicPostsFragment" |
|||
android:name="awais.instagrabber.fragments.TopicPostsFragment" |
|||
tools:layout="@layout/fragment_topic_posts"> |
|||
|
|||
<argument |
|||
android:name="topicCluster" |
|||
app:argType="awais.instagrabber.repositories.responses.discover.TopicCluster" /> |
|||
|
|||
<argument |
|||
android:name="titleColor" |
|||
app:argType="integer" /> |
|||
|
|||
<argument |
|||
android:name="backgroundColor" |
|||
app:argType="integer" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
</fragment> |
|||
|
|||
<!-- Copy of notification viewer fragment tag --> |
|||
<!-- Required to get back arrow in action bar --> |
|||
<!-- See https://issuetracker.google.com/issues/192395936 --> |
|||
<fragment |
|||
android:id="@+id/notifications_viewer_non_top" |
|||
android:name="awais.instagrabber.fragments.NotificationsViewerFragment" |
|||
android:label="@string/title_notifications" |
|||
tools:layout="@layout/fragment_notifications_viewer"> |
|||
|
|||
<argument |
|||
android:name="type" |
|||
android:defaultValue="notif" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="targetId" |
|||
android:defaultValue="0L" |
|||
app:argType="long" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_story" |
|||
app:destination="@id/storyViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/savedCollectionsFragment" |
|||
android:name="awais.instagrabber.fragments.SavedCollectionsFragment" |
|||
android:label="@string/saved" |
|||
tools:layout="@layout/fragment_saved_collections"> |
|||
|
|||
<argument |
|||
android:name="isSaving" |
|||
android:defaultValue="false" |
|||
app:argType="boolean" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_collection_posts" |
|||
app:destination="@id/collectionPostsFragment" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/collectionPostsFragment" |
|||
android:name="awais.instagrabber.fragments.CollectionPostsFragment" |
|||
tools:layout="@layout/fragment_collection_posts"> |
|||
|
|||
<argument |
|||
android:name="savedCollection" |
|||
app:argType="awais.instagrabber.repositories.responses.saved.SavedCollection" /> |
|||
|
|||
<argument |
|||
android:name="titleColor" |
|||
app:argType="integer" /> |
|||
|
|||
<argument |
|||
android:name="backgroundColor" |
|||
app:argType="integer" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/user_search" |
|||
android:name="awais.instagrabber.fragments.UserSearchFragment" |
|||
android:label="@string/search" |
|||
tools:layout="@layout/fragment_user_search"> |
|||
<argument |
|||
android:name="multiple" |
|||
android:defaultValue="false" |
|||
app:argType="boolean" /> |
|||
|
|||
<argument |
|||
android:name="title" |
|||
android:defaultValue="@null" |
|||
app:argType="string" |
|||
app:nullable="true" /> |
|||
|
|||
<argument |
|||
android:name="action_label" |
|||
android:defaultValue="@null" |
|||
app:argType="string" |
|||
app:nullable="true" /> |
|||
|
|||
<argument |
|||
android:name="show_groups" |
|||
android:defaultValue="false" |
|||
app:argType="boolean" /> |
|||
|
|||
<argument |
|||
android:name="search_mode" |
|||
android:defaultValue="USER_SEARCH" |
|||
app:argType="awais.instagrabber.fragments.UserSearchMode" /> |
|||
|
|||
<argument |
|||
android:name="hideUserIds" |
|||
android:defaultValue="@null" |
|||
app:argType="long[]" |
|||
app:nullable="true" /> |
|||
|
|||
<argument |
|||
android:name="hideThreadIds" |
|||
android:defaultValue="@null" |
|||
app:argType="string[]" |
|||
app:nullable="true" /> |
|||
</fragment> |
|||
</navigation> |
@ -0,0 +1,484 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<navigation 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/favorites_nav_graph" |
|||
app:startDestination="@id/favoritesFragment"> |
|||
|
|||
<fragment |
|||
android:id="@+id/favoritesFragment" |
|||
android:name="awais.instagrabber.fragments.FavoritesFragment" |
|||
android:label="@string/title_favorites" |
|||
tools:layout="@layout/fragment_favorites"> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/storyViewerFragment" |
|||
android:name="awais.instagrabber.fragments.StoryViewerFragment" |
|||
android:label="StoryViewerFragment" |
|||
tools:layout="@layout/fragment_story_viewer"> |
|||
|
|||
<argument |
|||
android:name="options" |
|||
app:argType="awais.instagrabber.repositories.requests.StoryViewerOptions" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_user_search" |
|||
app:destination="@id/user_search" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/postViewFragment" |
|||
android:name="awais.instagrabber.fragments.PostViewV2Fragment" |
|||
android:label="@string/post" |
|||
tools:layout="@layout/dialog_post_view"> |
|||
|
|||
<argument |
|||
android:name="media" |
|||
app:argType="awais.instagrabber.repositories.responses.Media" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="position" |
|||
app:argType="integer" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_likes" |
|||
app:destination="@id/likesViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_saved_collections" |
|||
app:destination="@id/savedCollectionsFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_user_search" |
|||
app:destination="@id/user_search" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/locationFragment" |
|||
android:name="awais.instagrabber.fragments.LocationFragment" |
|||
android:label="" |
|||
tools:layout="@layout/fragment_location"> |
|||
|
|||
<argument |
|||
android:name="locationId" |
|||
app:argType="long" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_story" |
|||
app:destination="@id/storyViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/hashTagFragment" |
|||
android:name="awais.instagrabber.fragments.HashTagFragment" |
|||
android:label="" |
|||
tools:layout="@layout/fragment_hashtag"> |
|||
|
|||
<argument |
|||
android:name="hashtag" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_story" |
|||
app:destination="@id/storyViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<dialog |
|||
android:id="@+id/commentsViewerFragment" |
|||
android:name="awais.instagrabber.fragments.comments.CommentsViewerFragment" |
|||
android:label="Comments" |
|||
tools:layout="@layout/fragment_comments"> |
|||
|
|||
<argument |
|||
android:name="shortCode" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="postId" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="postUserId" |
|||
app:argType="long" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_likes" |
|||
app:destination="@id/likesViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</dialog> |
|||
|
|||
<!-- Copy of profile fragment tag --> |
|||
<!-- Required to get back arrow in action bar --> |
|||
<!-- See https://issuetracker.google.com/issues/192395936 --> |
|||
<fragment |
|||
android:id="@+id/profile_non_top" |
|||
android:name="awais.instagrabber.fragments.main.ProfileFragment" |
|||
android:label="@string/profile" |
|||
tools:layout="@layout/fragment_profile"> |
|||
|
|||
<argument |
|||
android:name="username" |
|||
android:defaultValue="" |
|||
app:argType="string" |
|||
app:nullable="true" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_saved" |
|||
app:destination="@id/savedViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_saved_collections" |
|||
app:destination="@id/savedCollectionsFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_follow_viewer" |
|||
app:destination="@id/followViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_story" |
|||
app:destination="@id/storyViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_user_search" |
|||
app:destination="@id/user_search" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_notifications" |
|||
app:destination="@id/notifications_viewer_non_top" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/savedViewerFragment" |
|||
android:name="awais.instagrabber.fragments.SavedViewerFragment" |
|||
android:label="Saved" |
|||
tools:layout="@layout/fragment_saved"> |
|||
|
|||
<argument |
|||
android:name="username" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="profileId" |
|||
app:argType="long" /> |
|||
|
|||
<argument |
|||
android:name="type" |
|||
app:argType="awais.instagrabber.models.enums.PostItemType" |
|||
app:nullable="false" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/followViewerFragment" |
|||
android:name="awais.instagrabber.fragments.FollowViewerFragment" |
|||
android:label="" |
|||
tools:layout="@layout/fragment_followers_viewer"> |
|||
|
|||
<argument |
|||
android:name="profileId" |
|||
app:argType="long" /> |
|||
|
|||
<argument |
|||
android:name="isFollowersList" |
|||
app:argType="boolean" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="username" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<dialog |
|||
android:id="@+id/likesViewerFragment" |
|||
android:name="awais.instagrabber.fragments.LikesViewerFragment" |
|||
android:label="Comments" |
|||
tools:layout="@layout/fragment_likes"> |
|||
|
|||
<argument |
|||
android:name="postId" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="isComment" |
|||
app:argType="boolean" |
|||
app:nullable="false" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</dialog> |
|||
|
|||
<fragment |
|||
android:id="@+id/savedCollectionsFragment" |
|||
android:name="awais.instagrabber.fragments.SavedCollectionsFragment" |
|||
android:label="@string/saved" |
|||
tools:layout="@layout/fragment_saved_collections"> |
|||
|
|||
<argument |
|||
android:name="isSaving" |
|||
android:defaultValue="false" |
|||
app:argType="boolean" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_collection_posts" |
|||
app:destination="@id/collectionPostsFragment" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/collectionPostsFragment" |
|||
android:name="awais.instagrabber.fragments.CollectionPostsFragment" |
|||
tools:layout="@layout/fragment_collection_posts"> |
|||
|
|||
<argument |
|||
android:name="savedCollection" |
|||
app:argType="awais.instagrabber.repositories.responses.saved.SavedCollection" /> |
|||
|
|||
<argument |
|||
android:name="titleColor" |
|||
app:argType="integer" /> |
|||
|
|||
<argument |
|||
android:name="backgroundColor" |
|||
app:argType="integer" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/user_search" |
|||
android:name="awais.instagrabber.fragments.UserSearchFragment" |
|||
android:label="@string/search" |
|||
tools:layout="@layout/fragment_user_search"> |
|||
<argument |
|||
android:name="multiple" |
|||
android:defaultValue="false" |
|||
app:argType="boolean" /> |
|||
|
|||
<argument |
|||
android:name="title" |
|||
android:defaultValue="@null" |
|||
app:argType="string" |
|||
app:nullable="true" /> |
|||
|
|||
<argument |
|||
android:name="action_label" |
|||
android:defaultValue="@null" |
|||
app:argType="string" |
|||
app:nullable="true" /> |
|||
|
|||
<argument |
|||
android:name="show_groups" |
|||
android:defaultValue="false" |
|||
app:argType="boolean" /> |
|||
|
|||
<argument |
|||
android:name="search_mode" |
|||
android:defaultValue="USER_SEARCH" |
|||
app:argType="awais.instagrabber.fragments.UserSearchMode" /> |
|||
|
|||
<argument |
|||
android:name="hideUserIds" |
|||
android:defaultValue="@null" |
|||
app:argType="long[]" |
|||
app:nullable="true" /> |
|||
|
|||
<argument |
|||
android:name="hideThreadIds" |
|||
android:defaultValue="@null" |
|||
app:argType="string[]" |
|||
app:nullable="true" /> |
|||
</fragment> |
|||
|
|||
<!-- Copy of notification viewer fragment tag --> |
|||
<!-- Required to get back arrow in action bar --> |
|||
<!-- See https://issuetracker.google.com/issues/192395936 --> |
|||
<fragment |
|||
android:id="@+id/notifications_viewer_non_top" |
|||
android:name="awais.instagrabber.fragments.NotificationsViewerFragment" |
|||
android:label="@string/title_notifications" |
|||
tools:layout="@layout/fragment_notifications_viewer"> |
|||
|
|||
<argument |
|||
android:name="type" |
|||
android:defaultValue="notif" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="targetId" |
|||
android:defaultValue="0L" |
|||
app:argType="long" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_story" |
|||
app:destination="@id/storyViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
</fragment> |
|||
</navigation> |
@ -0,0 +1,520 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<navigation 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/feed_nav_graph" |
|||
app:startDestination="@id/feedFragment"> |
|||
|
|||
<fragment |
|||
android:id="@+id/feedFragment" |
|||
android:name="awais.instagrabber.fragments.main.FeedFragment" |
|||
android:label="@string/feed" |
|||
tools:layout="@layout/fragment_feed"> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_story" |
|||
app:destination="@id/storyViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_story_list" |
|||
app:destination="@id/storyListViewerFragment" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/storyViewerFragment" |
|||
android:name="awais.instagrabber.fragments.StoryViewerFragment" |
|||
android:label="StoryViewerFragment" |
|||
tools:layout="@layout/fragment_story_viewer"> |
|||
|
|||
<argument |
|||
android:name="options" |
|||
app:argType="awais.instagrabber.repositories.requests.StoryViewerOptions" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_user_search" |
|||
app:destination="@id/user_search" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/postViewFragment" |
|||
android:name="awais.instagrabber.fragments.PostViewV2Fragment" |
|||
android:label="@string/post" |
|||
tools:layout="@layout/dialog_post_view"> |
|||
|
|||
<argument |
|||
android:name="media" |
|||
app:argType="awais.instagrabber.repositories.responses.Media" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="position" |
|||
app:argType="integer" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_likes" |
|||
app:destination="@id/likesViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_saved_collections" |
|||
app:destination="@id/savedCollectionsFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_user_search" |
|||
app:destination="@id/user_search" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/locationFragment" |
|||
android:name="awais.instagrabber.fragments.LocationFragment" |
|||
android:label="" |
|||
tools:layout="@layout/fragment_location"> |
|||
|
|||
<argument |
|||
android:name="locationId" |
|||
app:argType="long" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_story" |
|||
app:destination="@id/storyViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/hashTagFragment" |
|||
android:name="awais.instagrabber.fragments.HashTagFragment" |
|||
android:label="" |
|||
tools:layout="@layout/fragment_hashtag"> |
|||
|
|||
<argument |
|||
android:name="hashtag" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_story" |
|||
app:destination="@id/storyViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<dialog |
|||
android:id="@+id/commentsViewerFragment" |
|||
android:name="awais.instagrabber.fragments.comments.CommentsViewerFragment" |
|||
android:label="Comments" |
|||
tools:layout="@layout/fragment_comments"> |
|||
|
|||
<argument |
|||
android:name="shortCode" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="postId" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="postUserId" |
|||
app:argType="long" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_likes" |
|||
app:destination="@id/likesViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</dialog> |
|||
|
|||
<!-- Copy of profile fragment tag --> |
|||
<!-- Required to get back arrow in action bar --> |
|||
<!-- See https://issuetracker.google.com/issues/192395936 --> |
|||
<fragment |
|||
android:id="@+id/profile_non_top" |
|||
android:name="awais.instagrabber.fragments.main.ProfileFragment" |
|||
android:label="@string/profile" |
|||
tools:layout="@layout/fragment_profile"> |
|||
|
|||
<argument |
|||
android:name="username" |
|||
android:defaultValue="" |
|||
app:argType="string" |
|||
app:nullable="true" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_saved" |
|||
app:destination="@id/savedViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_saved_collections" |
|||
app:destination="@id/savedCollectionsFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_follow_viewer" |
|||
app:destination="@id/followViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_story" |
|||
app:destination="@id/storyViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_user_search" |
|||
app:destination="@id/user_search" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_notifications" |
|||
app:destination="@id/notifications_viewer_non_top" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/savedViewerFragment" |
|||
android:name="awais.instagrabber.fragments.SavedViewerFragment" |
|||
android:label="Saved" |
|||
tools:layout="@layout/fragment_saved"> |
|||
|
|||
<argument |
|||
android:name="username" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="profileId" |
|||
app:argType="long" /> |
|||
|
|||
<argument |
|||
android:name="type" |
|||
app:argType="awais.instagrabber.models.enums.PostItemType" |
|||
app:nullable="false" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/followViewerFragment" |
|||
android:name="awais.instagrabber.fragments.FollowViewerFragment" |
|||
android:label="" |
|||
tools:layout="@layout/fragment_followers_viewer"> |
|||
|
|||
<argument |
|||
android:name="profileId" |
|||
app:argType="long" /> |
|||
|
|||
<argument |
|||
android:name="isFollowersList" |
|||
app:argType="boolean" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="username" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<dialog |
|||
android:id="@+id/likesViewerFragment" |
|||
android:name="awais.instagrabber.fragments.LikesViewerFragment" |
|||
android:label="Comments" |
|||
tools:layout="@layout/fragment_likes"> |
|||
|
|||
<argument |
|||
android:name="postId" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="isComment" |
|||
app:argType="boolean" |
|||
app:nullable="false" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</dialog> |
|||
|
|||
<!-- Copy of notification viewer fragment tag --> |
|||
<!-- Required to get back arrow in action bar --> |
|||
<!-- See https://issuetracker.google.com/issues/192395936 --> |
|||
<fragment |
|||
android:id="@+id/notifications_viewer_non_top" |
|||
android:name="awais.instagrabber.fragments.NotificationsViewerFragment" |
|||
android:label="@string/title_notifications" |
|||
tools:layout="@layout/fragment_notifications_viewer"> |
|||
|
|||
<argument |
|||
android:name="type" |
|||
android:defaultValue="notif" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="targetId" |
|||
android:defaultValue="0L" |
|||
app:argType="long" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_story" |
|||
app:destination="@id/storyViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/savedCollectionsFragment" |
|||
android:name="awais.instagrabber.fragments.SavedCollectionsFragment" |
|||
android:label="@string/saved" |
|||
tools:layout="@layout/fragment_saved_collections"> |
|||
|
|||
<argument |
|||
android:name="isSaving" |
|||
android:defaultValue="false" |
|||
app:argType="boolean" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_collection_posts" |
|||
app:destination="@id/collectionPostsFragment" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/collectionPostsFragment" |
|||
android:name="awais.instagrabber.fragments.CollectionPostsFragment" |
|||
tools:layout="@layout/fragment_collection_posts"> |
|||
|
|||
<argument |
|||
android:name="savedCollection" |
|||
app:argType="awais.instagrabber.repositories.responses.saved.SavedCollection" /> |
|||
|
|||
<argument |
|||
android:name="titleColor" |
|||
app:argType="integer" /> |
|||
|
|||
<argument |
|||
android:name="backgroundColor" |
|||
app:argType="integer" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/storyListViewerFragment" |
|||
android:name="awais.instagrabber.fragments.StoryListViewerFragment" |
|||
android:label="Stories" |
|||
tools:layout="@layout/fragment_story_list_viewer"> |
|||
|
|||
<argument |
|||
android:name="type" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_story" |
|||
app:destination="@id/storyViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/user_search" |
|||
android:name="awais.instagrabber.fragments.UserSearchFragment" |
|||
android:label="@string/search" |
|||
tools:layout="@layout/fragment_user_search"> |
|||
<argument |
|||
android:name="multiple" |
|||
android:defaultValue="false" |
|||
app:argType="boolean" /> |
|||
|
|||
<argument |
|||
android:name="title" |
|||
android:defaultValue="@null" |
|||
app:argType="string" |
|||
app:nullable="true" /> |
|||
|
|||
<argument |
|||
android:name="action_label" |
|||
android:defaultValue="@null" |
|||
app:argType="string" |
|||
app:nullable="true" /> |
|||
|
|||
<argument |
|||
android:name="show_groups" |
|||
android:defaultValue="false" |
|||
app:argType="boolean" /> |
|||
|
|||
<argument |
|||
android:name="search_mode" |
|||
android:defaultValue="USER_SEARCH" |
|||
app:argType="awais.instagrabber.fragments.UserSearchMode" /> |
|||
|
|||
<argument |
|||
android:name="hideUserIds" |
|||
android:defaultValue="@null" |
|||
app:argType="long[]" |
|||
app:nullable="true" /> |
|||
|
|||
<argument |
|||
android:name="hideThreadIds" |
|||
android:defaultValue="@null" |
|||
app:argType="string[]" |
|||
app:nullable="true" /> |
|||
</fragment> |
|||
</navigation> |
@ -0,0 +1,539 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<navigation 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/more_nav_graph" |
|||
app:startDestination="@id/morePreferencesFragment"> |
|||
|
|||
<fragment |
|||
android:id="@+id/morePreferencesFragment" |
|||
android:name="awais.instagrabber.fragments.settings.MorePreferencesFragment" |
|||
android:label="@string/more"> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_settings" |
|||
app:destination="@id/settings_nav_graph" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_about" |
|||
app:destination="@id/aboutFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_favorites" |
|||
app:destination="@id/favorites_non_top" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_backup" |
|||
app:destination="@id/backupPreferencesFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_notifications" |
|||
app:destination="@id/notifications_viewer_non_top" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_story_list" |
|||
app:destination="@id/storyListViewerFragment" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/storyViewerFragment" |
|||
android:name="awais.instagrabber.fragments.StoryViewerFragment" |
|||
android:label="StoryViewerFragment" |
|||
tools:layout="@layout/fragment_story_viewer"> |
|||
|
|||
<argument |
|||
android:name="options" |
|||
app:argType="awais.instagrabber.repositories.requests.StoryViewerOptions" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_user_search" |
|||
app:destination="@id/user_search" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/postViewFragment" |
|||
android:name="awais.instagrabber.fragments.PostViewV2Fragment" |
|||
android:label="@string/post" |
|||
tools:layout="@layout/dialog_post_view"> |
|||
|
|||
<argument |
|||
android:name="media" |
|||
app:argType="awais.instagrabber.repositories.responses.Media" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="position" |
|||
app:argType="integer" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_likes" |
|||
app:destination="@id/likesViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_saved_collections" |
|||
app:destination="@id/savedCollectionsFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_user_search" |
|||
app:destination="@id/user_search" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/locationFragment" |
|||
android:name="awais.instagrabber.fragments.LocationFragment" |
|||
android:label="" |
|||
tools:layout="@layout/fragment_location"> |
|||
|
|||
<argument |
|||
android:name="locationId" |
|||
app:argType="long" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_story" |
|||
app:destination="@id/storyViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/hashTagFragment" |
|||
android:name="awais.instagrabber.fragments.HashTagFragment" |
|||
android:label="" |
|||
tools:layout="@layout/fragment_hashtag"> |
|||
|
|||
<argument |
|||
android:name="hashtag" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_story" |
|||
app:destination="@id/storyViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<dialog |
|||
android:id="@+id/commentsViewerFragment" |
|||
android:name="awais.instagrabber.fragments.comments.CommentsViewerFragment" |
|||
android:label="Comments" |
|||
tools:layout="@layout/fragment_comments"> |
|||
|
|||
<argument |
|||
android:name="shortCode" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="postId" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="postUserId" |
|||
app:argType="long" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_likes" |
|||
app:destination="@id/likesViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</dialog> |
|||
|
|||
<!-- Copy of profile fragment tag --> |
|||
<!-- Required to get back arrow in action bar --> |
|||
<!-- See https://issuetracker.google.com/issues/192395936 --> |
|||
<fragment |
|||
android:id="@+id/profile_non_top" |
|||
android:name="awais.instagrabber.fragments.main.ProfileFragment" |
|||
android:label="@string/profile" |
|||
tools:layout="@layout/fragment_profile"> |
|||
|
|||
<argument |
|||
android:name="username" |
|||
android:defaultValue="" |
|||
app:argType="string" |
|||
app:nullable="true" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_saved" |
|||
app:destination="@id/savedViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_saved_collections" |
|||
app:destination="@id/savedCollectionsFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_follow_viewer" |
|||
app:destination="@id/followViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_story" |
|||
app:destination="@id/storyViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_user_search" |
|||
app:destination="@id/user_search" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_notifications" |
|||
app:destination="@id/notifications_viewer_non_top" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/savedViewerFragment" |
|||
android:name="awais.instagrabber.fragments.SavedViewerFragment" |
|||
android:label="Saved" |
|||
tools:layout="@layout/fragment_saved"> |
|||
|
|||
<argument |
|||
android:name="username" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="profileId" |
|||
app:argType="long" /> |
|||
|
|||
<argument |
|||
android:name="type" |
|||
app:argType="awais.instagrabber.models.enums.PostItemType" |
|||
app:nullable="false" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/followViewerFragment" |
|||
android:name="awais.instagrabber.fragments.FollowViewerFragment" |
|||
android:label="" |
|||
tools:layout="@layout/fragment_followers_viewer"> |
|||
|
|||
<argument |
|||
android:name="profileId" |
|||
app:argType="long" /> |
|||
|
|||
<argument |
|||
android:name="isFollowersList" |
|||
app:argType="boolean" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="username" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<dialog |
|||
android:id="@+id/likesViewerFragment" |
|||
android:name="awais.instagrabber.fragments.LikesViewerFragment" |
|||
android:label="Comments" |
|||
tools:layout="@layout/fragment_likes"> |
|||
|
|||
<argument |
|||
android:name="postId" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="isComment" |
|||
app:argType="boolean" |
|||
app:nullable="false" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</dialog> |
|||
|
|||
<!-- Copy of favorites fragment tag --> |
|||
<!-- Required to get back arrow in action bar --> |
|||
<!-- See https://issuetracker.google.com/issues/192395936 --> |
|||
<fragment |
|||
android:id="@+id/favorites_non_top" |
|||
android:name="awais.instagrabber.fragments.FavoritesFragment" |
|||
android:label="@string/title_favorites" |
|||
tools:layout="@layout/fragment_favorites"> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
</fragment> |
|||
|
|||
<!-- Copy of notification viewer fragment tag --> |
|||
<!-- Required to get back arrow in action bar --> |
|||
<!-- See https://issuetracker.google.com/issues/192395936 --> |
|||
<fragment |
|||
android:id="@+id/notifications_viewer_non_top" |
|||
android:name="awais.instagrabber.fragments.NotificationsViewerFragment" |
|||
android:label="@string/title_notifications" |
|||
tools:layout="@layout/fragment_notifications_viewer"> |
|||
|
|||
<argument |
|||
android:name="type" |
|||
android:defaultValue="notif" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="targetId" |
|||
android:defaultValue="0L" |
|||
app:argType="long" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_story" |
|||
app:destination="@id/storyViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/savedCollectionsFragment" |
|||
android:name="awais.instagrabber.fragments.SavedCollectionsFragment" |
|||
android:label="@string/saved" |
|||
tools:layout="@layout/fragment_saved_collections"> |
|||
|
|||
<argument |
|||
android:name="isSaving" |
|||
android:defaultValue="false" |
|||
app:argType="boolean" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_collection_posts" |
|||
app:destination="@id/collectionPostsFragment" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/collectionPostsFragment" |
|||
android:name="awais.instagrabber.fragments.CollectionPostsFragment" |
|||
tools:layout="@layout/fragment_collection_posts"> |
|||
|
|||
<argument |
|||
android:name="savedCollection" |
|||
app:argType="awais.instagrabber.repositories.responses.saved.SavedCollection" /> |
|||
|
|||
<argument |
|||
android:name="titleColor" |
|||
app:argType="integer" /> |
|||
|
|||
<argument |
|||
android:name="backgroundColor" |
|||
app:argType="integer" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/user_search" |
|||
android:name="awais.instagrabber.fragments.UserSearchFragment" |
|||
android:label="@string/search" |
|||
tools:layout="@layout/fragment_user_search"> |
|||
<argument |
|||
android:name="multiple" |
|||
android:defaultValue="false" |
|||
app:argType="boolean" /> |
|||
|
|||
<argument |
|||
android:name="title" |
|||
android:defaultValue="@null" |
|||
app:argType="string" |
|||
app:nullable="true" /> |
|||
|
|||
<argument |
|||
android:name="action_label" |
|||
android:defaultValue="@null" |
|||
app:argType="string" |
|||
app:nullable="true" /> |
|||
|
|||
<argument |
|||
android:name="show_groups" |
|||
android:defaultValue="false" |
|||
app:argType="boolean" /> |
|||
|
|||
<argument |
|||
android:name="search_mode" |
|||
android:defaultValue="USER_SEARCH" |
|||
app:argType="awais.instagrabber.fragments.UserSearchMode" /> |
|||
|
|||
<argument |
|||
android:name="hideUserIds" |
|||
android:defaultValue="@null" |
|||
app:argType="long[]" |
|||
app:nullable="true" /> |
|||
|
|||
<argument |
|||
android:name="hideThreadIds" |
|||
android:defaultValue="@null" |
|||
app:argType="string[]" |
|||
app:nullable="true" /> |
|||
</fragment> |
|||
|
|||
<include app:graph="@navigation/settings_nav_graph" /> |
|||
|
|||
<fragment |
|||
android:id="@+id/storyListViewerFragment" |
|||
android:name="awais.instagrabber.fragments.StoryListViewerFragment" |
|||
android:label="Stories" |
|||
tools:layout="@layout/fragment_story_list_viewer"> |
|||
|
|||
<argument |
|||
android:name="type" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_story" |
|||
app:destination="@id/storyViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
</navigation> |
@ -0,0 +1,495 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<navigation 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/notification_viewer_nav_graph" |
|||
app:startDestination="@id/notificationsViewer"> |
|||
|
|||
<fragment |
|||
android:id="@+id/notificationsViewer" |
|||
android:name="awais.instagrabber.fragments.NotificationsViewerFragment" |
|||
android:label="@string/title_notifications" |
|||
tools:layout="@layout/fragment_notifications_viewer"> |
|||
|
|||
<argument |
|||
android:name="type" |
|||
android:defaultValue="notif" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="targetId" |
|||
android:defaultValue="0L" |
|||
app:argType="long" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_story" |
|||
app:destination="@id/storyViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/storyViewerFragment" |
|||
android:name="awais.instagrabber.fragments.StoryViewerFragment" |
|||
android:label="StoryViewerFragment" |
|||
tools:layout="@layout/fragment_story_viewer"> |
|||
|
|||
<argument |
|||
android:name="options" |
|||
app:argType="awais.instagrabber.repositories.requests.StoryViewerOptions" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_user_search" |
|||
app:destination="@id/user_search" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/postViewFragment" |
|||
android:name="awais.instagrabber.fragments.PostViewV2Fragment" |
|||
android:label="@string/post" |
|||
tools:layout="@layout/dialog_post_view"> |
|||
|
|||
<argument |
|||
android:name="media" |
|||
app:argType="awais.instagrabber.repositories.responses.Media" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="position" |
|||
app:argType="integer" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_likes" |
|||
app:destination="@id/likesViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_saved_collections" |
|||
app:destination="@id/savedCollectionsFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_user_search" |
|||
app:destination="@id/user_search" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/locationFragment" |
|||
android:name="awais.instagrabber.fragments.LocationFragment" |
|||
android:label="" |
|||
tools:layout="@layout/fragment_location"> |
|||
|
|||
<argument |
|||
android:name="locationId" |
|||
app:argType="long" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_story" |
|||
app:destination="@id/storyViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/hashTagFragment" |
|||
android:name="awais.instagrabber.fragments.HashTagFragment" |
|||
android:label="" |
|||
tools:layout="@layout/fragment_hashtag"> |
|||
|
|||
<argument |
|||
android:name="hashtag" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_story" |
|||
app:destination="@id/storyViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<dialog |
|||
android:id="@+id/commentsViewerFragment" |
|||
android:name="awais.instagrabber.fragments.comments.CommentsViewerFragment" |
|||
android:label="Comments" |
|||
tools:layout="@layout/fragment_comments"> |
|||
|
|||
<argument |
|||
android:name="shortCode" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="postId" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="postUserId" |
|||
app:argType="long" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_likes" |
|||
app:destination="@id/likesViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</dialog> |
|||
|
|||
<!-- Copy of profile fragment tag --> |
|||
<!-- Required to get back arrow in action bar --> |
|||
<!-- See https://issuetracker.google.com/issues/192395936 --> |
|||
<fragment |
|||
android:id="@+id/profile_non_top" |
|||
android:name="awais.instagrabber.fragments.main.ProfileFragment" |
|||
android:label="@string/profile" |
|||
tools:layout="@layout/fragment_profile"> |
|||
|
|||
<argument |
|||
android:name="username" |
|||
android:defaultValue="" |
|||
app:argType="string" |
|||
app:nullable="true" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_saved" |
|||
app:destination="@id/savedViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_saved_collections" |
|||
app:destination="@id/savedCollectionsFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_follow_viewer" |
|||
app:destination="@id/followViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_story" |
|||
app:destination="@id/storyViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_user_search" |
|||
app:destination="@id/user_search" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_notifications" |
|||
app:destination="@id/notifications_viewer_non_top" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/savedViewerFragment" |
|||
android:name="awais.instagrabber.fragments.SavedViewerFragment" |
|||
android:label="Saved" |
|||
tools:layout="@layout/fragment_saved"> |
|||
|
|||
<argument |
|||
android:name="username" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="profileId" |
|||
app:argType="long" /> |
|||
|
|||
<argument |
|||
android:name="type" |
|||
app:argType="awais.instagrabber.models.enums.PostItemType" |
|||
app:nullable="false" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/followViewerFragment" |
|||
android:name="awais.instagrabber.fragments.FollowViewerFragment" |
|||
android:label="" |
|||
tools:layout="@layout/fragment_followers_viewer"> |
|||
|
|||
<argument |
|||
android:name="profileId" |
|||
app:argType="long" /> |
|||
|
|||
<argument |
|||
android:name="isFollowersList" |
|||
app:argType="boolean" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="username" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<dialog |
|||
android:id="@+id/likesViewerFragment" |
|||
android:name="awais.instagrabber.fragments.LikesViewerFragment" |
|||
android:label="Comments" |
|||
tools:layout="@layout/fragment_likes"> |
|||
|
|||
<argument |
|||
android:name="postId" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="isComment" |
|||
app:argType="boolean" |
|||
app:nullable="false" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</dialog> |
|||
|
|||
<!-- Copy of notification viewer fragment tag --> |
|||
<!-- Required to get back arrow in action bar --> |
|||
<!-- See https://issuetracker.google.com/issues/192395936 --> |
|||
<fragment |
|||
android:id="@+id/notifications_viewer_non_top" |
|||
android:name="awais.instagrabber.fragments.NotificationsViewerFragment" |
|||
android:label="@string/title_notifications" |
|||
tools:layout="@layout/fragment_notifications_viewer"> |
|||
|
|||
<argument |
|||
android:name="type" |
|||
android:defaultValue="notif" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="targetId" |
|||
android:defaultValue="0L" |
|||
app:argType="long" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_story" |
|||
app:destination="@id/storyViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/savedCollectionsFragment" |
|||
android:name="awais.instagrabber.fragments.SavedCollectionsFragment" |
|||
android:label="@string/saved" |
|||
tools:layout="@layout/fragment_saved_collections"> |
|||
|
|||
<argument |
|||
android:name="isSaving" |
|||
android:defaultValue="false" |
|||
app:argType="boolean" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_collection_posts" |
|||
app:destination="@id/collectionPostsFragment" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/collectionPostsFragment" |
|||
android:name="awais.instagrabber.fragments.CollectionPostsFragment" |
|||
tools:layout="@layout/fragment_collection_posts"> |
|||
|
|||
<argument |
|||
android:name="savedCollection" |
|||
app:argType="awais.instagrabber.repositories.responses.saved.SavedCollection" /> |
|||
|
|||
<argument |
|||
android:name="titleColor" |
|||
app:argType="integer" /> |
|||
|
|||
<argument |
|||
android:name="backgroundColor" |
|||
app:argType="integer" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/user_search" |
|||
android:name="awais.instagrabber.fragments.UserSearchFragment" |
|||
android:label="@string/search" |
|||
tools:layout="@layout/fragment_user_search"> |
|||
<argument |
|||
android:name="multiple" |
|||
android:defaultValue="false" |
|||
app:argType="boolean" /> |
|||
|
|||
<argument |
|||
android:name="title" |
|||
android:defaultValue="@null" |
|||
app:argType="string" |
|||
app:nullable="true" /> |
|||
|
|||
<argument |
|||
android:name="action_label" |
|||
android:defaultValue="@null" |
|||
app:argType="string" |
|||
app:nullable="true" /> |
|||
|
|||
<argument |
|||
android:name="show_groups" |
|||
android:defaultValue="false" |
|||
app:argType="boolean" /> |
|||
|
|||
<argument |
|||
android:name="search_mode" |
|||
android:defaultValue="USER_SEARCH" |
|||
app:argType="awais.instagrabber.fragments.UserSearchMode" /> |
|||
|
|||
<argument |
|||
android:name="hideUserIds" |
|||
android:defaultValue="@null" |
|||
app:argType="long[]" |
|||
app:nullable="true" /> |
|||
|
|||
<argument |
|||
android:name="hideThreadIds" |
|||
android:defaultValue="@null" |
|||
app:argType="string[]" |
|||
app:nullable="true" /> |
|||
</fragment> |
|||
</navigation> |
@ -0,0 +1,567 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<navigation 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/profile_nav_graph" |
|||
app:startDestination="@id/profileFragment"> |
|||
|
|||
<fragment |
|||
android:id="@+id/profileFragment" |
|||
android:name="awais.instagrabber.fragments.main.ProfileFragment" |
|||
android:label="@string/profile" |
|||
tools:layout="@layout/fragment_profile"> |
|||
|
|||
<argument |
|||
android:name="username" |
|||
android:defaultValue="" |
|||
app:argType="string" |
|||
app:nullable="true" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_saved" |
|||
app:destination="@id/savedViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_saved_collections" |
|||
app:destination="@id/savedCollectionsFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_follow_viewer" |
|||
app:destination="@id/followViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_story" |
|||
app:destination="@id/storyViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_user_search" |
|||
app:destination="@id/user_search" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_notifications" |
|||
app:destination="@id/notifications_viewer_non_top" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<dialog |
|||
android:id="@+id/post_loading_dialog" |
|||
android:name="awais.instagrabber.dialogs.PostLoadingDialogFragment" |
|||
android:label="@string/direct_download_loading"> |
|||
|
|||
<argument |
|||
android:name="shortCode" |
|||
app:argType="string" /> |
|||
|
|||
<deepLink app:uri="barinsta://post/{shortCode}" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
</dialog> |
|||
|
|||
<fragment |
|||
android:id="@+id/storyViewerFragment" |
|||
android:name="awais.instagrabber.fragments.StoryViewerFragment" |
|||
android:label="StoryViewerFragment" |
|||
tools:layout="@layout/fragment_story_viewer"> |
|||
|
|||
<argument |
|||
android:name="options" |
|||
app:argType="awais.instagrabber.repositories.requests.StoryViewerOptions" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_user_search" |
|||
app:destination="@id/user_search" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/searchFragment" |
|||
android:name="awais.instagrabber.fragments.search.SearchFragment" |
|||
android:label="@string/search" |
|||
tools:layout="@layout/fragment_search"> |
|||
|
|||
<deepLink app:uri="barinsta://search" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/postViewFragment" |
|||
android:name="awais.instagrabber.fragments.PostViewV2Fragment" |
|||
android:label="@string/post" |
|||
tools:layout="@layout/dialog_post_view"> |
|||
|
|||
<argument |
|||
android:name="media" |
|||
app:argType="awais.instagrabber.repositories.responses.Media" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="position" |
|||
app:argType="integer" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_likes" |
|||
app:destination="@id/likesViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_saved_collections" |
|||
app:destination="@id/savedCollectionsFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_user_search" |
|||
app:destination="@id/user_search" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/locationFragment" |
|||
android:name="awais.instagrabber.fragments.LocationFragment" |
|||
android:label="" |
|||
tools:layout="@layout/fragment_location"> |
|||
|
|||
<argument |
|||
android:name="locationId" |
|||
app:argType="long" /> |
|||
|
|||
<deepLink app:uri="barinsta://location/{locationId}" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_story" |
|||
app:destination="@id/storyViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/hashTagFragment" |
|||
android:name="awais.instagrabber.fragments.HashTagFragment" |
|||
android:label="" |
|||
tools:layout="@layout/fragment_hashtag"> |
|||
|
|||
<argument |
|||
android:name="hashtag" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<deepLink app:uri="barinsta://hashtag/{hashtag}" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_story" |
|||
app:destination="@id/storyViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<dialog |
|||
android:id="@+id/commentsViewerFragment" |
|||
android:name="awais.instagrabber.fragments.comments.CommentsViewerFragment" |
|||
android:label="Comments" |
|||
tools:layout="@layout/fragment_comments"> |
|||
|
|||
<argument |
|||
android:name="shortCode" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="postId" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="postUserId" |
|||
app:argType="long" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_likes" |
|||
app:destination="@id/likesViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</dialog> |
|||
|
|||
<!-- Copy of profile fragment tag --> |
|||
<!-- Required to get back arrow in action bar --> |
|||
<!-- See https://issuetracker.google.com/issues/192395936 --> |
|||
<fragment |
|||
android:id="@+id/profile_non_top" |
|||
android:name="awais.instagrabber.fragments.main.ProfileFragment" |
|||
android:label="@string/profile" |
|||
tools:layout="@layout/fragment_profile"> |
|||
|
|||
<argument |
|||
android:name="username" |
|||
android:defaultValue="" |
|||
app:argType="string" |
|||
app:nullable="true" /> |
|||
|
|||
<deepLink app:uri="barinsta://profile/{username}" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_saved" |
|||
app:destination="@id/savedViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_saved_collections" |
|||
app:destination="@id/savedCollectionsFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_follow_viewer" |
|||
app:destination="@id/followViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_story" |
|||
app:destination="@id/storyViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_user_search" |
|||
app:destination="@id/user_search" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_notifications" |
|||
app:destination="@id/notifications_viewer_non_top" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/savedViewerFragment" |
|||
android:name="awais.instagrabber.fragments.SavedViewerFragment" |
|||
android:label="Saved" |
|||
tools:layout="@layout/fragment_saved"> |
|||
|
|||
<argument |
|||
android:name="username" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="profileId" |
|||
app:argType="long" /> |
|||
|
|||
<argument |
|||
android:name="type" |
|||
app:argType="awais.instagrabber.models.enums.PostItemType" |
|||
app:nullable="false" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/followViewerFragment" |
|||
android:name="awais.instagrabber.fragments.FollowViewerFragment" |
|||
android:label="" |
|||
tools:layout="@layout/fragment_followers_viewer"> |
|||
|
|||
<argument |
|||
android:name="profileId" |
|||
app:argType="long" /> |
|||
|
|||
<argument |
|||
android:name="isFollowersList" |
|||
app:argType="boolean" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="username" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<dialog |
|||
android:id="@+id/likesViewerFragment" |
|||
android:name="awais.instagrabber.fragments.LikesViewerFragment" |
|||
android:label="Comments" |
|||
tools:layout="@layout/fragment_likes"> |
|||
|
|||
<argument |
|||
android:name="postId" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="isComment" |
|||
app:argType="boolean" |
|||
app:nullable="false" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</dialog> |
|||
|
|||
<!-- Copy of notification viewer fragment tag --> |
|||
<!-- Required to get back arrow in action bar --> |
|||
<!-- See https://issuetracker.google.com/issues/192395936 --> |
|||
<fragment |
|||
android:id="@+id/notifications_viewer_non_top" |
|||
android:name="awais.instagrabber.fragments.NotificationsViewerFragment" |
|||
android:label="@string/title_notifications" |
|||
tools:layout="@layout/fragment_notifications_viewer"> |
|||
|
|||
<argument |
|||
android:name="type" |
|||
android:defaultValue="notif" |
|||
app:argType="string" |
|||
app:nullable="false" /> |
|||
|
|||
<argument |
|||
android:name="targetId" |
|||
android:defaultValue="0L" |
|||
app:argType="long" /> |
|||
|
|||
<deepLink app:uri="barinsta://notifications/{type}?targetId={targetId}" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_story" |
|||
app:destination="@id/storyViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/savedCollectionsFragment" |
|||
android:name="awais.instagrabber.fragments.SavedCollectionsFragment" |
|||
android:label="@string/saved" |
|||
tools:layout="@layout/fragment_saved_collections"> |
|||
|
|||
<argument |
|||
android:name="isSaving" |
|||
android:defaultValue="false" |
|||
app:argType="boolean" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_collection_posts" |
|||
app:destination="@id/collectionPostsFragment" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/collectionPostsFragment" |
|||
android:name="awais.instagrabber.fragments.CollectionPostsFragment" |
|||
tools:layout="@layout/fragment_collection_posts"> |
|||
|
|||
<argument |
|||
android:name="savedCollection" |
|||
app:argType="awais.instagrabber.repositories.responses.saved.SavedCollection" /> |
|||
|
|||
<argument |
|||
android:name="titleColor" |
|||
app:argType="integer" /> |
|||
|
|||
<argument |
|||
android:name="backgroundColor" |
|||
app:argType="integer" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_comments" |
|||
app:destination="@id/commentsViewerFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_hashtag" |
|||
app:destination="@id/hashTagFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_location" |
|||
app:destination="@id/locationFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_post" |
|||
app:destination="@id/postViewFragment" /> |
|||
|
|||
<action |
|||
android:id="@+id/action_to_profile" |
|||
app:destination="@id/profile_non_top" /> |
|||
</fragment> |
|||
|
|||
<fragment |
|||
android:id="@+id/user_search" |
|||
android:name="awais.instagrabber.fragments.UserSearchFragment" |
|||
android:label="@string/search" |
|||
tools:layout="@layout/fragment_user_search"> |
|||
<argument |
|||
android:name="multiple" |
|||
android:defaultValue="false" |
|||
app:argType="boolean" /> |
|||
|
|||
<argument |
|||
android:name="title" |
|||
android:defaultValue="@null" |
|||
app:argType="string" |
|||
app:nullable="true" /> |
|||
|
|||
<argument |
|||
android:name="action_label" |
|||
android:defaultValue="@null" |
|||
app:argType="string" |
|||
app:nullable="true" /> |
|||
|
|||
<argument |
|||
android:name="show_groups" |
|||
android:defaultValue="false" |
|||
app:argType="boolean" /> |
|||
|
|||
<argument |
|||
android:name="search_mode" |
|||
android:defaultValue="USER_SEARCH" |
|||
app:argType="awais.instagrabber.fragments.UserSearchMode" /> |
|||
|
|||
<argument |
|||
android:name="hideUserIds" |
|||
android:defaultValue="@null" |
|||
app:argType="long[]" |
|||
app:nullable="true" /> |
|||
|
|||
<argument |
|||
android:name="hideThreadIds" |
|||
android:defaultValue="@null" |
|||
app:argType="string[]" |
|||
app:nullable="true" /> |
|||
</fragment> |
|||
</navigation> |
@ -0,0 +1,12 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<navigation> |
|||
|
|||
<!--android:id="@+id/root"--> |
|||
<!--app:startDestination="@id/profile_nav_graph"--> |
|||
|
|||
<!--<include app:graph="@navigation/dm_nav_graph" />--> |
|||
<!--<include app:graph="@navigation/feed_nav_graph" />--> |
|||
<!--<include app:graph="@navigation/profile_nav_graph" />--> |
|||
<!--<include app:graph="@navigation/discover_nav_graph" />--> |
|||
<!--<include app:graph="@navigation/more_nav_graph" />--> |
|||
</navigation> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue