Dragging Menu for different Activities on Android - android

I need help finding an approach to build a certain kind of menu for an app.
Let's say I have a menu activity and 2 other activities. My menu activity consists of 2 options.
I want to drag the "buttons" (not sure if button is the correct name in this case) sideways and while dragging, the other activity's screen starts appearing from the side.
The thing is, depending on which button I'm dragging, different screens should appear, and I couldn't find anything similar to read about.
Does anybody recommend some topic to read that could help?
How can I manage the activities in this case?

Related

Wear OS swipe-to-dismiss

I'm developing an app for Wear OS.
It has 2 screens, both extending from AppCompatActivity, both havingandroid.support.wear.widget.BoxInsetLayout as the root of their layouts.
From the first one i can navigate to the second one and in the second screen use left-right swipe to navigate back without problems, i didn't need to do anything for this to work.
For the first screen the same left-right swipe is not doing anything, and i can't understand why, as the documentation says:
An activity automatically supports swipe-to-dismiss. Swiping an activity from left to right results in dismissal of the activity, and the app navigates down the back stack.
Witch makes sense after seeing the default behaviour of my 2nd screen.
I've tried to put a SwipeDismissFrameLayout as the root element of that screen, that make the swipe work, but, instead of showing the watch face that is below, it's showing a gray screen and it's also not finishing the activity (unless i explicitly do it implementing the callback)
From what i can understand in the docs this should be working without having to do anything, but for some reason it's not...
Both activities have the same style and same layout root element.
Is there something i'm missing to make this work?

Close Button for Button - Possible?

I am making an app that has a couple list view menus that lead to a file display. When the user opens a file (in a webview), I want to create a tab bar so that they can quickly refer back to this file even after going back through the menu and viewing a different file. I planned on creating a fragment activity that housed a horiz scroll view that housed buttons that referenced the file that they viewed. Then, when they move on to a different file, they can just hit the tab and return to the file referenced on the tab.
Couple things:
-the tab bar, once created, needs to persist across activities until closed by the user
-the tab bar needs to refresh itself every time the user opens a new file
-it would be really nice to have a little close button (like the red x in the corner in apple stuff) on the tab buttons, so that the user can close individual tabs.
Is this possible?
any suggestions, tips, etc ?
Is android's built in tabs a better way to go than horiz scroll view with buttons?
thanks in advance

Transition when switching Activity out of SlidingMenu (J.Feinstein)

I am an android newbie and I am trying to create an Android App with three Activities: a Homescreen, a listview and a detailview.
I integrated J. Feinstein's Sliding Menu in my Homescreen and filled it with a ListView to display my different categories (Restaurants, Bars, Culture, whatever). When I click one of my List Items, the new Activity gets created and Pops up. However, I want the Activity to replace the old one while the SlidingMenu stays on top and then gently slides away. I saw this behaviour in the Example App but I cant quite find the bit of code that holds the answer to my question. Hope anyone can help :)
The sample app uses fragment transactions instead of starting new activities to change the content. As far as I know, that is the only way to do the two actions – close sliding menu and change content – simultaneously.

Wiping Activity stack

I'm implementing a not-so-standard navigational menu that is accessible from every screen in my app. That is to say, from every screen in my app, I can pop up a menu that will let me choose an entirely different area of the app to navigate directly to.
I have several screens that I call edit screens. They are screens where the user had chosen an item from a list of items and are able to then edit the data for that item. I do not wish for these screens to remain on the Activity stack if the user then uses the menu to navigate to some other area of the app.
This is easy enough. I can simply call "finish()" before navigating away. However, there are a couple places where it is possible to access a nested edit screen. Meaning the edit screen the user is currently on is a child of a parent edit screen. I want both off the Activity stack.
Can anyone think of a slick way to do this? The only way I can think of is to always use startActivityForResult and pass back some identifier that tells the screen to kill itself the next time it resumes.

Avoid Tabs from disappearing when searching

i've got a tabbed layout, and on one of the tabs i have a search functionality. When the user makes a new search, i need to show the results. However, doing so involves starting another activity to handle the search results.
this causes the tabs at the bottom to disappear. The user can get the tabs back by clicking on the 'back' button. But somehow, in the context of my application this can be a bit counter-intuitive and seems to be break the common layout flow.
is there any way to prevent the tabs from disappearing when invoking the search from one of the tabs?
thanks for any help/suggestions.
as far as i can understand your problem, You are not using tabs then you are using buttons. see some tabhost tutorials on how to create a tabbed activity. what you are doing is launching a new activity instead of just switching a tab in the existing one.
Also the other things you can look for are activity groups.
Hope this helps you somehow.

Categories

Resources