Why ToolbarPlacement doesn't work anymore in xaml - android

I'm new in xamarin and I wanted to put my TabbedPage in the bottom in Xaml by using this tutorial:
https://learn.microsoft.com/fr-fr/xamarin/xamarin-forms/platform/android/tabbedpage-toolbar-placement-color
Then, when it didn't work, I tried to rebuild the project like suggested in this stackoverflow question:
Where can I find ToolbarPlacement attribute of TabbedPage?
I saw some people using a old nugget package, but I don't really want to use it, especially if there is a native way of doing it.
Xamarin forms version : 4.1.0.555618
Android version : 9
I hope there is someone that have the same problem as me,
Thank you in advance,
halonico,

Setting the placement and color of the toolbar on a TabbedPage, you just add the following code:
xmlns:android="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core"
android:TabbedPage.BarItemColor="#666666"
android:TabbedPage.BarSelectedItemColor="Red"
android:TabbedPage.ToolbarPlacement="Bottom"
Although there are still many mistakes, you don't meed to worry about these, you try to clean your project, then build your project directly, you will see it works fine.

Related

Which format Android Studio default code style scheme follows?

If you go to: Android Studio -> Preferences -> Editor -> Code Style -> Java/Groovy/XML you find Default Scheme.
Or on MacOS: /Users/raiym/Library/Preferences/AndroidStudio3.1/codestyles/Default.xml
Where it comes from? Couldn't find which style guide Android Studio follows.
I've done quite a lot of researches, but in the end, I haven't reached a very satisfying answer: probably it's just a code style for IntelliJ.
The first thing I did was trying to compare the IntelliJ style with something else, but I always found some differences.
It doesn't follow Google's style because they don't fully qualify import, in fact, IntelliJ will try to unify imports by putting *, like writing import foo.*; instead of import foo.Bar;.
It doesn't follow Oracle's guidelines either since the switch statement is formatted in a different way:
switch (condition) {
case IDEA:
statements;
break;
case ORACLE:
statements;
break;
}
At this point, I've started looking for something else, but found even less. In fact, IntelliJ doesn't tell about the code style used in their software anywhere. Instead, they just explain how to change it.
Moreover, there are plugins for every possible code style! If one of them was the actual style in IDEA a plugin shouldn't be needed...
To make things worse, even for Kotlin, a language created by IntelliJ, they differentiate between "Kotlin Coding Conventions" and "IntelliJ IDEA default code style".
What I think is that they made a code style that works for most languages supported by their IDEs with little differences, and this is what Android Studio ended up using by default.
Android Studio code styles are based on IntelliJ Idea code styles. You can refer this link to know more about code styles in IntelliJ Idea
Code Style Java
Also you can refer this link to customise your code styles,
Android Studio Code Style

Disable animation on tabs click android bottom bar navigation - roughike

I'm using roughike library for bottom bar navigation in my android project. But facing a problem that is when I click on the tabs it's getting bigger. I tried many ways to disable the animation but unable to do it. I asked on the github support page but no luck. I just took a look at the source code and found there is a fix property which causing the problem and there may no functions to edit this. Someone please help me if there is any way to disable the animation.
Note: I'm using all default settings from the github readme. But I tried changing options etc.
Thanks,
Robin
https://github.com/roughike/BottomBar
To achieve some solution to this problem,I am also trying. I got some luck.May be you can try that
1. Please try to add this is in gradle file.
compile 'com.roughike:bottom-bar:1.4.0.1'
in your java code add the following:
bottomBar.useFixedMode();

how do we add blur effect into a view using android studio

i did some research about it and got somethings like Bitmap, getting View then transforming it into a blurred version of it then again adding it to the original; view , all this approach seems too hacky and almost whatever i founded is more than 2 or 3 years old solutions which are now not compatible with the new apis is there's any more clean way for it or any approach which is supportable for the new latest apis if yes then please let me know ??
You have many solutions :
use a library like this one : https://github.com/Manabu-GT/EtsyBlur
use a example code which seems not too dirty : https://futurestud.io/blog/how-to-blur-images-efficiently-with-androids-renderscript
use photoshop, if it is a drawable pre-blur it and add it in your project
others possibilities here : https://android-arsenal.com/tag/176

default drawables in android studio 1.0.2 like abc_menu_dropdown_panel_holo_light

I tried using #drawable/dialog_holo_light_frame or abc_menu_dropdown_panel_holo_light but didnt work, can you help me by listing good shadows provided default like aboves
I did iterative checking #drawable/abc_ and found #drawable/abc_popup_background_mtrl_mult to be of my need, may be it would be help to someone :D

When i create New android project using eclipse it create two xml layout

My old eclipse version worked perfectly but after updating eclipse, when I create a new Android project, it creates two XML layouts. 1st is activity_main.xml and second is fragment.xml. So when i add some item in activity_main.xml it wont display anything.
So how to use fragment layout?
This is the new Project Structure for Android by developers.
If you want to view any UI widgets put them inside fragment.xml file.
And any java code should put inside PlacementHolder class that is inner class of Main.java.
As others mentioned that's just the recent new project style from Android Team. But I guess you were also looking for an introduction into Fragments when you asked:
So how to use fragment layout?
Basically:
Android team has completely covered Fragments in their documentation. Start from here and then refer here. Then download this official source code and examine it closely.
Now I'm gonna share a personal experience:
I suggest you first study this tutorial on fragments from Vogella's website.
Why? Because the Android documentation is slow and rather boring there fore hard to understand, whereas the Vogella version is to-the-point and sharp.
You can then go back and study Android documentation.
at least read this: http://developer.android.com/guide/components/fragments.html it will give you an idea how the fragments work. And better switch now to Android Studio, the sooner the better.

Categories

Resources