Android N 7.0 status bar animation - java

I need to implement the new Android N notification drawer into my app. I've managed to mimic the L and M themes already, but my question is
How is the expansion animation created? What type of view is there and how it reacts to swiping down? Below is a GIF so you can see what I mean. Is that a custom GridView? Or something more advanced?
Thanks a lot for any thoughts on how this works.

Related

Buttons/Images in Java and their positioning (android app) Problem

I'm am currently developing an app but came across a problem.
I want to have a Button or Image that I can move around. In the background, I have 3 "zones" where the Button/Image could be placed.
I don't know what to look for. I have searched the Internet for things like
https://developer.android.com/training/gestures/movement
Track X and Y coorinate of a button
Position of a Button Container with button
Button position after moving
(Android Studio button positioning)
I have searched for many things but cannot find a proper solution.
Please be so kind and share links with me on how to solve my problem.
Thank you in advance.
** SOLVED **
What i needed was Drag an Drop buttons
Looks like you'll need to implement a custom GLSurfaceView where you have a canvas to draw your different regions, and can also track movements. have a look here:
Displaying graphics with OpenGL ES
Respond to touch events

How to hide notification icons in Android Status Bar?

I'm working on a German Learning app project, inspired by Duolingo app.
I need to make my app to be a little bit similar with this feature. It's like making the user to focus on the quiz, and ignore everything in status bar (notification bar). Now, what I need is i want to hide the icons on notification bar. Is there a way to do so?
This is what I want
And this is the fact
You can dim the status and navigation bars by setting the SYSTEM_UI_FLAG_LOW_PROFILE flag.
View decorView = getActivity().getWindow().getDecorView();
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
https://developer.android.com/training/system-ui/dim.html
This decoration is reset whenever the keyboard is made visible, but you can watch for the keyboard being hidden (using an onGlobalLayoutListener) and resetting the flag.
You could just disable notifications for the offending apps in your device's settings menu. I'm looking for an option to hide them from the status bar while keeping notifications in the shade and on the lock screen. Apparently not on a Samsung device.

java android view structure

Just a simple maybe stupid question.
Is it ok to use multiple activities at once in an android application using an Inflater? I want to have multiple views on my screen without losing the previous view. For example, a user clicks on a button and a information screen shows up. Start Intent would convert the whole screen to the information screen activity.
Using an Inflater works but I'm just wondering if its the right way to display multiple views. Thanks in advance.
You should be using Fragments for this. Each fragment has a view/layout and you can move them in & out of your main view as you require. There are many tutorials
You can set the visibility of the views, e.g.:
Button b = (Button)findViewById(R.id.button);
b.setVisibility(View.GONE);

Android Gallery on image change

Hi I'm writing a gallery library for a few projects i'm working on so far i have slide show and buttons for navigating the gallery besides using fling. I'd like to hide the navigation buttons after say 3 seconds of not swiping. So the idea is once scrolling stops, start a runnable to set the imageviews view to gone after the 3 seconds and then once scrolling starts again set the view to visible again.
How can i listen for fling in android Gallery class
Gallery g = (Gallery) findViewById(R.id.gallery);
Thanks
There is an inherited method called onFling which is perfectly suitable for that. Just let it call an interface's method and provide all the parameters you're needing.
Using an interface as listener is pretty common when coding for Android.

Android: many activities on single screen?

I'm creating my first app for Android device and I was faced with a challenge... I want to create fixed bottom bar on every screen of my application (something similar to bars from tunein radio).
However I do not know how to make bars which are fixed on every activity (bar do not load when new activity is loaded but is permanent on every app screen). I do not want to <include> my bars in every activity (I've tried this solution but my bars were loading with activity).
Is it possible that this is Activitygroup and only middle activity is changing? If so how can I do that?
PS.
What book or tutorial do you recommend ;-)?
tunein radio bottom and top bar image #1
Use fragments api. It perfectly fits your needs.
Look at ViewFlipper. It lets you manage multiple views. You'd have one activity that would watch your button bar and flip views in response to buttons.

Categories