www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: ggp on February 19, 2014, 04:10:32 pm

Title: layout View.INVISIBLE
Post by: ggp on February 19, 2014, 04:10:32 pm
No hide joystick and label layout when show gui :-\

and
Code: [Select]
View v2 = this.findViewById(R.id.mylayout);no work

Code: [Select]
private void updateGameState() {
if (selected != -1) {
//loadSelectedLevel();
}
//showSelection();
                        //View v2 = this.findViewById(R.id.mylayout);
View v2 = (LinearLayout) findViewById(R.id.mylayout);

if (startTouch) {

showSelection();

startTouch = false;

v2.setVisibility(View.VISIBLE);

}else{
v2.setVisibility(View.INVISIBLE);


}
       ...

This is my xml
Code: [Select]
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <android.opengl.GLSurfaceView
        android:id="@+id/surface_view"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:visibility="visible" />

    <LinearLayout
        android:id="@+id/mylayout"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="horizontal"
        android:visibility="visible" >

        <LinearLayout
            android:id="@+id/mylayout2"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:orientation="horizontal" >

            <com.android.joystick.JoystickView
                android:id="@+id/joystickView"
                android:layout_width="100dip"
                android:layout_height="100dip"
                android:layout_gravity="bottom"
                android:layout_marginTop="20dip"
                android:color="#88000000" />

            <TableLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:layout_marginTop="10dip" >

                <TableRow>

                    <TextView
                        android:layout_width="50dip"
                        android:layout_height="wrap_content"
                        android:layout_gravity="bottom"
                        android:text="X" />

                    <TextView
                        android:id="@+id/TextViewX"
                        android:layout_width="100dip"
                        android:layout_height="wrap_content" />
                </TableRow>

                <TableRow>

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Y" />

                    <TextView
                        android:id="@+id/TextViewY"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content" />
                </TableRow>
            </TableLayout>
        </LinearLayout>
    </LinearLayout>

</FrameLayout>

Title: Re: layout View.INVISIBLE
Post by: EgonOlsen on February 19, 2014, 04:24:05 pm
That's not a jPCT related question. This isn't a general Android support forum. You better ask that question in a more related forum instead.