Ticytocgame
Ticytocgame
>
<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;
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)
}
});
}
}
<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>