0% found this document useful (0 votes)
28 views5 pages

Ticytocgame

The document defines an Android layout with three horizontal LinearLayouts (L1, L2, L3) each containing three ImageViews separated by colored Views. It also includes a Java class that retrieves the ImageView widgets and sets an onclick listener for one of them.

Uploaded by

ilias ahmed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views5 pages

Ticytocgame

The document defines an Android layout with three horizontal LinearLayouts (L1, L2, L3) each containing three ImageViews separated by colored Views. It also includes a Java class that retrieves the ImageView widgets and sets an onclick listener for one of them.

Uploaded by

ilias ahmed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

?xml version="1.0" encoding="utf-8"?

>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:padding="5dp"
android:layout_height="match_parent"
tools:context=".MainActivity">

<LinearLayout
android:id="@+id/L1"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<ImageView
android:id="@+id/I11"
android:layout_weight="0.3"
android:layout_width="match_parent"
android:layout_height="150dp" />

<View
android:background="#d90404"
android:layout_width="4dp"
android:layout_height="150dp"/>
<ImageView
android:id="@+id/I12"
android:layout_weight="0.3"
android:layout_width="match_parent"
android:layout_height="150dp" />

<View
android:background="#05660b"
android:layout_width="4dp"
android:layout_height="150dp"/>
<ImageView
android:id="@+id/I13"
android:layout_weight="0.3"
android:layout_width="match_parent"
android:layout_height="150dp" />

</LinearLayout>

<View
android:layout_below="@id/L1"
android:background="#8245d7"
android:layout_width="match_parent"
android:layout_height="4dp"/>

<LinearLayout
android:id="@+id/L2"
android:layout_below="@id/L1"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<ImageView
android:id="@+id/I21"
android:layout_weight="0.3"
android:layout_width="match_parent"
android:layout_height="150dp" />

<View
android:background="#dd58df"
android:layout_width="4dp"
android:layout_height="150dp"/>
<ImageView
android:id="@+id/I22"
android:layout_weight="0.3"
android:layout_width="match_parent"
android:layout_height="150dp" />

<View
android:background="#7b0528"
android:layout_width="4dp"
android:layout_height="150dp"/>
<ImageView
android:id="@+id/I23"
android:layout_weight="0.3"
android:layout_width="match_parent"
android:layout_height="150dp" />

</LinearLayout>
<View
android:layout_below="@id/L2"
android:background="#7f830b"
android:layout_width="match_parent"
android:layout_height="4dp"/>
<LinearLayout
android:id="@+id/L3"
android:layout_below="@id/L2"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<ImageView
android:id="@+id/I31"
android:layout_weight="0.3"
android:layout_width="match_parent"
android:layout_height="150dp" />

<View
android:background="#d1661f"
android:layout_width="4dp"
android:layout_height="150dp"/>
<ImageView
android:id="@+id/I32"
android:layout_weight="0.3"
android:layout_width="match_parent"
android:layout_height="150dp" />

<View
android:background="#15a673"
android:layout_width="4dp"
android:layout_height="150dp"/>
<ImageView
android:id="@+id/I33"
android:layout_weight="0.3"
android:layout_width="match_parent"
android:layout_height="150dp" />

</LinearLayout>
package com.example.androidapps.myapplication;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

public class MainActivity extends AppCompatActivity {

ImageView I11,I12,I13,I21,I22,I23,I31,I32,I33;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

I31=findViewById(R.id.I31);
I32=findViewById(R.id.I32);
I33=findViewById(R.id.I33);

I11.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(i%2==1)
}
});

}
}

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


<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<LinearLayout
android:id="@+id/L1"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<ImageView
android:id="@+id/I11"
android:layout_weight="0.31"
android:layout_width="match_parent"
android:layout_height="150dp" />
<View
android:background="#d90404"
android:layout_width="4dp"
android:layout_height="150dp"/>
<ImageView
android:id="@+id/I12"
android:layout_weight="0.31"
android:layout_width="match_parent"
android:layout_height="150dp" />

<View
android:background="#05660b"
android:layout_width="4dp"
android:layout_height="150dp"/>
<ImageView
android:id="@+id/I13"
android:layout_weight="0.31"
android:layout_width="match_parent"
android:layout_height="150dp" />

</LinearLayout>

<View
android:layout_below="@id/L1"
android:background="#8245d7"
android:layout_width="match_parent"
android:layout_height="4dp"/>

<LinearLayout
android:id="@+id/L2"
android:layout_below="@id/L1"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<ImageView
android:id="@+id/I21"
android:layout_weight="0.31"
android:layout_width="match_parent"
android:layout_height="150dp" />

<View
android:background="#dd58df"
android:layout_width="4dp"
android:layout_height="150dp"/>
<ImageView
android:id="@+id/I22"
android:layout_weight="0.31"
android:layout_width="match_parent"
android:layout_height="150dp" />

<View
android:background="#7b0528"
android:layout_width="4dp"
android:layout_height="150dp"/>
<ImageView
android:id="@+id/I23"
android:layout_weight="0.31"
android:layout_width="match_parent"
android:layout_height="150dp" />

</LinearLayout>
<View
android:layout_below="@id/L2"
android:background="#7f830b"
android:layout_width="match_parent"
android:layout_height="4dp"/>
<LinearLayout
android:id="@+id/L3"
android:layout_below="@id/L2"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<ImageView
android:id="@+id/I31"
android:layout_weight="0.31"
android:layout_width="match_parent"
android:layout_height="150dp" />

<View
android:background="#d1661f"
android:layout_width="4dp"
android:layout_height="150dp"/>
<ImageView
android:id="@+id/I32"
android:layout_weight="0.31"
android:layout_width="match_parent"
android:layout_height="150dp" />

<View
android:background="#15a673"
android:layout_width="4dp"
android:layout_height="150dp"/>
<ImageView
android:id="@+id/I33"
android:layout_weight="0.31"
android:layout_width="match_parent"
android:layout_height="150dp" />

</LinearLayout>

You might also like