<AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <TextView android:id="@+id/Header" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_x="10dp" android:layout_y="12dp" android:text="ชุดประจำชาติ" android:textAppearance="?android:attr/textAppearanceLarge" /> <ImageButton android:id="@+id/btnBack" android:layout_width="45dp" android:layout_height="45dp" android:layout_x="272dp" android:layout_y="1dp" android:background="@android:color/transparent" android:src="@drawable/icon_back" /> <ImageButton android:id="@+id/back" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_x="59dp" android:layout_y="378dp" android:background="@android:color/transparent" android:src="@drawable/back_button" /> <ImageButton android:id="@+id/next" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_x="220dp" android:layout_y="378dp" android:background="@android:color/transparent" android:src="@drawable/next_button" /> <ViewAnimator android:id="@+id/viewAnimator1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_x="45dp" android:layout_y="86dp" > <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <TableRow android:layout_width="fill_parent" android:layout_height="wrap_content"> <ImageView android:layout_width="236dp" android:layout_height="match_parent" android:src="@drawable/uniform_brunei" > </ImageView> </TableRow> <TableRow android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:text="บรูไนดารุสซาลาม " /> </TableRow> </TableLayout> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <TableRow android:layout_width="fill_parent" android:layout_height="wrap_content"> <ImageView android:layout_width="236dp" android:layout_height="match_parent" android:src="@drawable/uniform_cambodia" > </ImageView> </TableRow> <TableRow android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:text="ราชอาณาจักรกัมพูชา " /> </TableRow> </TableLayout> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <TableRow android:layout_width="fill_parent" android:layout_height="wrap_content"> <ImageView android:layout_width="236dp" android:layout_height="match_parent" android:src="@drawable/uniform_indonisiaload" > </ImageView> </TableRow> <TableRow android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:text="สาธารณรัฐอินโดนีเซีย" /> </TableRow> </TableLayout> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <TableRow android:layout_width="fill_parent" android:layout_height="wrap_content"> <ImageView android:layout_width="236dp" android:layout_height="match_parent" android:src="@drawable/uniform_laos" > </ImageView> </TableRow> <TableRow android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:text="สาธารณรัฐประชาธิปไตยประชาชนลาว" /> </TableRow> </TableLayout> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <TableRow android:layout_width="fill_parent" android:layout_height="wrap_content"> <ImageView android:layout_width="236dp" android:layout_height="match_parent" android:src="@drawable/uniform_malasia" > </ImageView> </TableRow> <TableRow android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:text="ประเทศมาเลเซีย" /> </TableRow> </TableLayout> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <TableRow android:layout_width="fill_parent" android:layout_height="wrap_content"> <ImageView android:layout_width="236dp" android:layout_height="match_parent" android:src="@drawable/uniform_philipines" > </ImageView> </TableRow> <TableRow android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:text="สาธารณรัฐฟิลิปปินส์ " /> </TableRow> </TableLayout> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <TableRow android:layout_width="fill_parent" android:layout_height="wrap_content"> <ImageView android:layout_width="236dp" android:layout_height="match_parent" android:src="@drawable/uniform_singkapore" > </ImageView> </TableRow> <TableRow android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:text="สาธารณรัฐสิงคโปร์ " /> </TableRow> </TableLayout> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <TableRow android:layout_width="fill_parent" android:layout_height="wrap_content"> <ImageView android:layout_width="236dp" android:layout_height="match_parent" android:src="@drawable/uniform_thailand" > </ImageView> </TableRow> <TableRow android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:text="ราชอาณาจักรไทย " /> </TableRow> </TableLayout> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <TableRow android:layout_width="fill_parent" android:layout_height="wrap_content"> <ImageView android:layout_width="236dp" android:layout_height="match_parent" android:src="@drawable/uniform_vietnam" > </ImageView> </TableRow> <TableRow android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:text="สาธารณรัฐสังคมนิยมเวียดนาม " /> </TableRow> </TableLayout> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <TableRow android:layout_width="fill_parent" android:layout_height="wrap_content"> <ImageView android:layout_width="236dp" android:layout_height="match_parent" android:src="@drawable/uniform_myanmar" > </ImageView> </TableRow> <TableRow android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:text="สหภาพพม่า " /> </TableRow> </TableLayout> </ViewAnimator> </AbsoluteLayout>
package com.example.asian; import android.os.Bundle; import android.app.Activity; import android.content.Intent; import android.view.Menu; import android.view.View; import android.view.Window; import android.view.WindowManager; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.widget.ImageButton; import android.widget.ViewAnimator; public class UniformActivity extends Activity { ViewAnimator va; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.activity_uniform); va = (ViewAnimator) findViewById(R.id.viewAnimator1); final Animation in = AnimationUtils.loadAnimation(this, android.R.anim.slide_in_left); final Animation out = AnimationUtils.loadAnimation(this, android.R.anim.slide_out_right); va.setInAnimation(in); va.setOutAnimation(out); va.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { va.showNext(); } }); // Back ImageButton btnBack = (ImageButton) findViewById(R.id.back); btnBack.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { va.showPrevious(); } }); // Next ImageButton btnNext = (ImageButton) findViewById(R.id.next); btnNext.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { va.showNext(); } }); // Back to Home final ImageButton btnHome = (ImageButton) findViewById(R.id.btnBack); // Perform action on click btnHome.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { // Open History Intent newActivity = new Intent(UniformActivity.this,HomeActivity.class); startActivity(newActivity); } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.activity_main, menu); return true; } }
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง