-
Notifications
You must be signed in to change notification settings - Fork 0
/
Seat Layout
85 lines (80 loc) · 2.62 KB
/
Seat Layout
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package com.example.railpnr;
import android.os.Bundle;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentManager;
import android.content.Intent;
import android.graphics.drawable.TransitionDrawable;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.RelativeLayout;
@SuppressLint("NewApi")
public class SeatLayout extends Fragment implements OnClickListener
{
ImageView im;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater,ViewGroup container, Bundle savedInstanceState)
{
View inflatedView = inflater.inflate(R.layout.activity_seat_layout, container, false);
((Button)inflatedView.findViewById(R.id.ac1T1)).setOnClickListener(this);
((Button)inflatedView.findViewById(R.id.ac1T2)).setOnClickListener(this);
((Button)inflatedView.findViewById(R.id.ac2T1)).setOnClickListener(this);
((Button)inflatedView.findViewById(R.id.ac2T2)).setOnClickListener(this);
((Button)inflatedView.findViewById(R.id.ac3)).setOnClickListener(this);
((Button)inflatedView.findViewById(R.id.sl)).setOnClickListener(this);
((Button)inflatedView.findViewById(R.id.ss)).setOnClickListener(this);
((Button)inflatedView.findViewById(R.id.ssJn)).setOnClickListener(this);
im=(ImageView)inflatedView.findViewById(R.id.imageView1);
im.setOnClickListener(this);
return inflatedView;
}
@Override
public void onClick(View arg0)
{
im.setVisibility(View.VISIBLE);
switch(arg0.getId())
{
case R.id.ac1T1:
im.setImageResource(R.drawable.aaa);
break;
case R.id.ac1T2:
im.setImageResource(R.drawable.aab);
break;
case R.id.ac2T1:
im.setImageResource(R.drawable.aba);
break;
case R.id.ac2T2:
im.setImageResource(R.drawable.abb);
break;
case R.id.ac3:
im.setImageResource(R.drawable.acc);
break;
case R.id.sl:
im.setImageResource(R.drawable.sleeper);
break;
case R.id.ss:
im.setImageResource(R.drawable.sb);
break;
case R.id.ssJn:
im.setImageResource(R.drawable.sbjsht);
break;
case R.id.imageView1:
getFragmentManager().beginTransaction().remove(this).commit();
((MainActivity)getActivity()).booktk.setVisibility(View.VISIBLE);
((MainActivity)getActivity()).pnrck.setVisibility(View.VISIBLE);
((MainActivity)getActivity()).service.setVisibility(View.VISIBLE);
break;
}
}
}