Android Studio: How to slide between screens? (Kotlin) - android-studio

I'm trying to do my first app and one of the things that i'm triying is to change between different screens when someone slides the screen with the finger. But i'm just new at this and i don't really know how to do this.
Could anyone help me? Thanks in advance!
PS: I'm using Kotlin

You'll want to use a ViewPager and either BottomNavigationView NavigationView or ActionBar.. Then you will use Fragments and Activitys that contain code to handle the individual parts of your app.
The ViewPager is what gives the swipeability and then you probably want tabs of some type so the user knows which tab they're on. The BottomNavigationView and NavigationView are how you display tabs. I've got examples in my profile (and a finished project on github) but I use Xamarin.Android not kotlin.
This appears to be a good tutorial on how to do it in Kotlin:
https://tutorialwing.com/android-viewpager-using-kotlin-with-fragment/
It's too much to type out on here.

Related

ListView is legacy in Android Studio 5 and I am trying to do scrollable list so what to use?

I have been reading ListView is Scrollable and ScrollView is scrollable and you don't really want to put them together. Also, ListView is legacy (which I think means deprecated) in Android Studio 4. I am a complete newb so if I ask this question wrong, it's because I don't yet have enough knowledge to ask the right question.
I would like to do a list of contacts that is scrollable so I would think I want a ScrollView + some kind of list but that piece I am not sure of. What should I combine ScrollView with? Or is this the wrong question? My end goal is a simple scrollable list of contacts and a user can choose a single contact.
You can try to use RecyclerView. I think this is the best option when You load many items, in Your example contacts. RecyclerView is faster than a simple scroll view, it looks better, and has many many customization options. Useful docs:
Create a List with RecyclerView
RecyclerView
Good video explanation with an example:
If You use Java
If You use Kotlin

Android Studio - Can't move or drag buttons freely

I'm new to Android Studio (working on Windows) and I am now using Buttons for the first time. I'm using them inside a TabHost. It seems that I can't move/drag the buttons to anywhere I want in the design, they just stay at the top of the design. I've searched this on Google and someone suggested a RelativeLayout instead of a LinearLayout. I've switched layouts already and I still can't move the Buttons as I want.
Any ideas? Thanks in advance

Winrt Xaml Toolkit does not allow me to add new controls

I'd like to add the imagebutton control to my windows store app, however when I install the Winrt Xaml Toolkit using NuGet it does not allow me (using the intellisense) to add any new controls. All I'd like to do is be able to specify an image for an appBarButton when hovered and an image when pressed. I find it slightly ridiculous that Microsoft has made it so difficult. Any help is MUCH appreciated.
it's funny how I can spend hours on programming with no success, then the next morning find the answer in 5 minutes. Here's the answer I needed, was found at
How can i change background image of a button when hover or click in XAML for Windows 8?
I needed to add this xml namespace at the top of the page...
xmlns:controls="using:WinRTXamlToolkit.Controls"
Then this works.
<controls:ImageButton HorizonalAlignment="Center"
NormalStateImageSource="normal.png"
HoverStateImageSource="hover.png"
PressedStateImageSource="pressed.png" />
Hope this helps someone else who has the same question.

MvvmCross: PictureChooser Plugin - Preview screen Button Text

Is there a way to change the text in iOS and Android for the two buttons which showing up inside the Picture Preview screen after you take a photo using MvvmCross PictureChooser plugin?
I have searched on it but I can't seam to find anything.
Thank you!
There's no way provided by MvvmCross to do this.
The source code to the picture chooser is in https://github.com/MvvmCross/MvvmCross/tree/v3.1/Plugins/Cirrious/PictureChooser
On Droid, this uses the standard ActionGetContent intent - https://github.com/MvvmCross/MvvmCross/blob/v3.1/Plugins/Cirrious/PictureChooser/Cirrious.MvvmCross.Plugins.PictureChooser.Droid/MvxPictureChooserTask.cs#L37
On iOS, this uses the standard UIImagePickerController - https://github.com/MvvmCross/MvvmCross/blob/v3.1/Plugins/Cirrious/PictureChooser/Cirrious.MvvmCross.Plugins.PictureChooser.Touch/MvxImagePickerTask.cs
So to customise these, you'll need to replace this code or to look to see if there are any "standard" ways on each platform.

android - UI like sliding down notification bar

I want to develop a panel with animation same as notification panel. I mean to say the notification panel is a cool control where you grab and slide down the notification bar and see all the notifications.
Actually, I am having 2 UI , 1st should be shown with Button at top, when user click on that button, the 2nd UI with listview items should be slide down same as notification panel and again when user click or drag the 2nd UI at the top side, then 2nd UI should be become invisible. I hope i made clear my question.
From Christian's answer, I am trying to use a sliding drawer that will display a
list of options. I need this to expand over the current ListView on the page.
So if anybody know how to implement such layout or UI with sliding down animation then please share it.
Please suggest how to build with such control or layout? any ideas or suggestions
Thanx
Have you tried the SlidingDrawer widget?
Paresh I found a solution in this post about sliding drawers.
android misc widgets has it implemented , though it still has some flaws but it will definitely prove helpful.
Though in the same SO post CommonsWare has quoted :
...
You similarly cannot make a
SlidingDrawer that descends from the
top.
Good Luck.
You can use SlidingTray from: http://aniqroid.sileria.com to make this happen
http://aniqroid.sileria.com/doc/api/com/sileria/android/view/SlidingTray.html
Alternatively you can also use a custom PopupWindow class which is part of Android API.

Resources