How to hide status bar in AOSP build - android-source

I'd like to hide/remove the status bar (i.e the top bar containing clock, notifications,...) in my custom AOSP image.
Do you know if it's practically possible ? And how ?

The status bar layout is defined in frameworks/base/packages/SystemUI/res/layout/status_bar.xml:
<com.android.systemui.statusbar.phone.PhoneStatusBarView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui"
android:layout_width="match_parent"
android:layout_height="#dimen/status_bar_height"
android:id="#+id/status_bar"
android:background="#drawable/system_bar_background"
android:orientation="vertical"
android:focusable="false"
android:descendantFocusability="afterDescendants"
>
<!-- […] -->
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
You could try to set the height of com.android.systemui.statusbar.phone.PhoneStatusBarView to 0dp (defined by status_bar_height in frameworks/base/core/res/res/values/dimens.xml) or its visibility to gone.
Here is a link to a guide on xda-developers that explains how to "hack" SystemUI.apk and framework-res.apk to hide the status bar: [GUIDE] Hide Status Bar and still being able to expand it on Jelly Bean.
It may be useful to know which resources to modify.

Related

dotnet maui how to hide the back button on desktop?

I'm trying to hide the backbutton shown in the image on desktop, but no matter what I tried, then it keept showing up.
I have tried
<Shell.BackButtonBehavior>
<BackButtonBehavior IsVisible="False" IsEnabled="False" />
</Shell.BackButtonBehavior>
And I have tried following this SO post Why Back Button is hidden in Maui?
My navigation is done by saying await Shell.Current.GoToAsync(new ShellNavigationState(location), false);
Am I missing something?
So everything you need to know can be found here:
https://learn.microsoft.com/en-us/dotnet/maui/user-interface/pages/navigationpage
NavigationPage.HasBackButton = true/false
Image (Proof)
https://gyazo.com/afbc744e7b6c5d1caa56960a536390c7
If this was helpful, mark this please as answer :)
This technique (the code in your question), added within the <ContentPage ... > declaration at the top of the xaml:
<Shell.BackButtonBehavior>
<BackButtonBehavior IsVisible="False" IsEnabled="False" />
</Shell.BackButtonBehavior>
seems to work when using the Shell to activate pages in C# codebehind (often in the BindingSource e.g., viewmodel):
await Shell.Current.GoToAsync($"{nameof(MyContentPage)}");
Adding this within the <ContentPage ...> declaration at the top of the xaml:
NavigationPage.HasBackButton="false"
seems to be applicable when using the push/pop within a NavigationPage:
await Navigation.PushAsync(new DetailsPage());
I don't use the Navigation.PushAsync. My app requires very specific navigation based on current data state, so a stack doesn't work for me.
I have verified setting the Shell.BackButtonBehavior (in the very code you provided) works in my case because I am activating pages via
await Shell.Current.GoToAsync
To enable/disable something you can use OnPlatform or OnIdiom
Exemple :
NavigationPage.HasBackButton="{OnIdiom Default='True', Desktop='False'}"

How to show a view programmably in a position defined in plugin.xml?

I want to show views (multiple) in my plugin source code using:
showView(id, id2, IWorkbenchPage.VIEW_ACTIVATE)
This view is first closed, shown after my proccess completed.
I defined the view and its positon in plugin.xml as below:
name="..."
icon="..."
category="..."
class="..."
allowMultiple="true"
id="myid"
extension
point="org.eclipse.ui.perspectiveExtensions"
perspectiveExtension
targetID="org.eclipse.jdt.ui.JavaPerspective"
view
ratio="0.5"
relative="org.eclipse.ui.views.ContentOutline"
relationship="stack"
visible="false"
id="myid"
I want to show them top right area of perspective (the same as Outline view).
If I set visible true or open my view manually in GUI, it appears top right as I expected,
but when I use "showView()" above, views always appears at the bottom (console, problems, etc.)
How can I show my views always top right programmably?
You need to add placeholders for the rest of your views, that have a secondary ID. Another entry in your perspectiveExtension with a compound ID and a wildcard should work: myid:*. See IPageLayout javadoc for more information.

Android spinner view

Iam new to android development..
I had a doubt that while using spinner view, we are including an attribute as android:drawSelectorOnTop="true" . Can anyone explain me the reason for use of this attribute
<Spinner android:id="#+id/spinner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"
/>
The property indicates whether to mark it as selected using a color (Orange in case of emulator) once the item in the list gets selected by the user.
Please refer the below image:
http://www.edureka.in/blog/wp-content/uploads/2013/01/custom-spine.jpg

How to change the icon of tab host once setup? (Android)

I am trying to change the Icon of one of the tabs of tab host at run
time. I am not able to figure out hwo to do with the widget. could
some one let me know how its done ?
spec = tabHost.newTabSpec("hello").setIndicator("hello",
res.getDrawable(R.drawable.tab1)).setContent(intent);
tabHost.addTab(spec)
The xml file is as below
selector xmlns:android="http://schemas.android.com/apk/res/android"
-- When selected, use grey --
item android:drawable="#drawable/icon1"
android:state_selected="true" />
-- When not selected, use white-
item android:drawable="#drawable/icon1"
/selector
Thanks ,
Titus
Here is how to change the icon after the TabHost (tab child) was created. This solution is not using the XML selector, this code will change the icon permanently.
View ic = (View) tabHost.getTabWidget().getChildTabViewAt(0).findViewById(android.R.id.icon);
ic.setBackgroundResource(R.drawable.icon_public);
This example will change the icon of first tab.

Removing a view from Eclipse Window -> Show views

We have an application in which some views only work when attached to certain perspectives.
We want to remove those views from the Window -> Show View dialog so that users cannot add them to perspectives where they don't work.
Any ideas on how to do this either programmatically or declaratively?
I have tried using <visibleWhen />, but the views are still showing in the dialog:
<view class="com.mycompany.ViewClass"
id="com.mycompany.ViewId"
name="View Name"
restorable="true">
<visibleWhen>
<with variable="activeWorkbenchWindow.activePerspective">
<equals value="com.mycompany.MyPerspective"/>
</with>
</visibleWhen>
</view>
I don't think there is any problem with the <visibleWhen /> clause, so I'm wondering if it can be used with a View?
It should be treated as a menu contribution, using the <visibleWhen/> to only display that option when a certain condition is met.
See the wiki article "Menu Contribution" for more.
Unfortunately, it seems that Eclipse already does this for the Introduction view by calling the private ViewContentProvider.removeIntroView on the content provider for the Show Views dialog. A way to get around this limitation is to define activities by adding to the org.eclipse.ui.activities extension point (see activityPatternBinding on how activities can be mapped to UI contributions). Doing this will not only remove the views from the Show Views dialog, but it will also prevent them from showing in the perspectives themselves. The views can then be shown programmatically. I had to also enable the activities in the ApplicationWorkbenchAdvisor.preStartup method because of limitations in our application:
Set<String> activityIds = new HashSet<String>();
activityIds.add("com.my.activity.id");
IWorkbenchActivitySupport activitySupport = PlatformUI.getWorkbench().getActivitySupport();
activitySupport.setEnabledActivityIds(activityIds);
In this case, the activity has to be disabled before showing the dialog, so the Show Views menu contribution has to be modified to do this as well.
Hopefully an extension point will be added to the next version of Eclipse to provide the option for developers to remove views from the dialog declaratively.