Margin-problem with changed layout for titlebar

by $搂Kalle搂$ » Thu, 12 Feb 2009 04:11:21 GMT


Sponsored Links
 I am using the following Layout for the titlebar with a blue backround
color

<RelativeLayout
        android:id="@+id/RelativeLayout01"
        xmlns:android=" http://schemas.android.com/apk/res/android" ;
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="#ff000099">
        <TextView
                android:id="@+id/TextView01"
                android:layout_height="wrap_content"
                android:text="@string/app_name"
                android:textColor="#ffffffff"
                android:textStyle="bold"
                android:gravity="center_vertical"
                android:layout_centerVertical="true"
                android:layout_width="wrap_content">
        </TextView>
</RelativeLayout>

In onCreate I got:
...
        requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
        setContentView(R.layout.main);
        getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE,
R.layout.title);
...

With that I get a changed titlebar for my HelloWorlApp, that is fine.
But somehow on the left and right side there is some margin and I
still can see some Grey from the original titlebar.

What did I wrong?

KalLe
--~--~---------~--~----~------------~-------~--~----~



Margin-problem with changed layout for titlebar

by $搂Kalle搂$ » Sat, 14 Feb 2009 17:03:22 GMT


 I uploaded a screenshot, which shows the problem, I have with the
changed titlebar

 http://hphone.eu/Android/Titlebar.html 

KalLe



--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Margin-problem with changed layout for titlebar

by $搂Kalle搂$ » Sun, 15 Feb 2009 08:44:40 GMT


 on't worry. I will not try to make my apps like Windows x.x. I just
want to understand the changebale titlebar for the moment ;-)

Here is the complete layout, which fits to the scrrenshot I mentioned.
I do not think, that the icons caused the problem.

######################
<?xml version="1.0" encoding="utf-8" ?>

<RelativeLayout
android:id="@+id/RelativeLayout01"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ff000099">
<TextView
android:id="@+id/TextView01"
android:layout_height="wrap_content"
android:text="@string/app_name"
android:textColor="#ffffffff"
android:textStyle="bold"
android:gravity="center_vertical"
android:layout_centerVertical="true"
android:layout_width="wrap_content" />
<AbsoluteLayout
android:id="@+id/AbsoluteLayout01"
android:layout_width="fill_parent"
android:layout_toRightOf="@+id/TextView01"
android:layout_height="fill_parent">
<LinearLayout android:id="@+id/LinearLayout01"
android:gravity="right"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageButton
android:id="@+id/ImageButton01"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_gravity="center_vertical"

android:layout_marginRight="20dip"
android:clickable="true"

android:background="@drawable/us" />
<ImageButton
android:id="@+id/ImageButton02"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_gravity="center_vertical"

android:layout_marginRight="20dip"
android:clickable="true"

android:background="@drawable/es" />
<ImageButton
android:id="@+id/ImageButton03"

android:layout_width="wrap_content"



Margin-problem with changed layout for titlebar

by elDoudou » Fri, 10 Apr 2009 23:26:17 GMT


 If you take a look at the hierarchy viewer, you will notice that the
customized title is contained in a FrameLayout with id
"title_container", which has a left and right padding set to 7. I
would be you, I'd try something like have a handle on your activity
root view, ask for its parent (a FrameLayout with id "content"), from
there ask this new view parent, i.e. a LinearLayout with no
identifier, and ask this view second child, which is the FrameLayout
responsible for setting the left and right passings: call the
setPadding() method on it, and see what happens.

This is really dirty, and I woul suggest to do as mentionned in the
previous post in your case! That was just meant to say that it might
be possible...

Hope that helps. Regards, douard
--~--~---------~--~----~------------~-------~--~----~



Margin-problem with changed layout for titlebar

by elDoudou » Mon, 13 Apr 2009 17:18:02 GMT


 As you are asking, please read 
 http://developer.android.com/guide/developing/tools/hierarchy-viewer.html 
for the explanations about the hierarchy viewer.
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. EGL and surface destruction

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I have an application that uses EGL. It creates an EGLSurface in the
normal manner, draws on it, etc. Then the user presses the HOME button.

The EGL spec says this:


I would expect that my app detaching from the screen to be considered
this sort of power management event.

However, Android doesn't do this. Instead what happens is that it calls
my SurfaceHolder.Callback.surfaceDestroyed() method and then nukes the
surface without telling me. The Android docs say this:


It doesn't explicitly mention what happens to the EGLSurface attached to
the Surface that's been destroyed, but it appears to stop working ---
I've certainly spotted calls to eglSwapBuffers() just hang, with these
messages being produced:

W/SurfaceComposerClient(  297): lock_layer timed out (is the CPU
pegged?) layer=2, lcblk=0x4235c120, state=00000043 (was 00000043)

This is a big problem for me. My (third party, can't change) renderer
ist rendering in a different thread, and is expecting EGL to behave
according to the spec; that is, that the EGLSurface survives being
disconnected from the screen. Android's insistence on asynchronously
destroying it and leaving behind a bogus pointer is not useful.

Is there any way of getting Android to behave in a more
standards-compliant manner, and not destroy (or invalidate) the EGLSurface?

- --
€€  €€€€€ http://www.cowlark.com €€€€€
"Sufficiently advanced incompetence is indistinguishable from
malice." -- Vernon Schryver
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAksFgyMACgkQf9E0noFvlzh94wCfSepclO6XaZpA/umeMqVlrgRZ
WokAoISSm2F51G0sT07W5EQh4wsJE9Pa
=ur5V
-----END PGP SIGNATURE-----

-- 

2. Will someone to fix ALSA on eclair

The ALSA sound driver break after the eclair update and eclair have a
new sound framework. Will Wind River or other body to fix it? Thanks.

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

3. default screenwidth of android

4. Nesting a relative layout and linear layout

5. Possible to change between "full screen" and "with status bar"?

6. how to set list item selected???

7. How to Build a Library and Link to the Android Kernel