project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/netplay/TestActivity.java
changeset 7330 867e4fda496e
child 7332 3f2e130f9715
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/netplay/TestActivity.java	Mon Jul 16 20:16:03 2012 +0200
@@ -0,0 +1,41 @@
+package org.hedgewars.hedgeroid.netplay;
+
+import org.hedgewars.hedgeroid.R;
+
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentActivity;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.app.FragmentPagerAdapter;
+import android.support.v4.view.ViewPager;
+
+public class TestActivity extends FragmentActivity {
+	@Override
+	protected void onCreate(Bundle arg0) {
+		super.onCreate(arg0);
+		setContentView(R.layout.activity_lobby_paged);
+		ViewPager pager = (ViewPager)findViewById(R.id.pager);
+		pager.setAdapter(new Adapter(getSupportFragmentManager()));
+	}
+	
+	private static class Adapter extends FragmentPagerAdapter {
+		public Adapter(FragmentManager mgr) {
+			super(mgr);
+		}
+		
+		@Override
+		public int getCount() {
+			return 3;
+		}
+		
+		@Override
+		public Fragment getItem(int arg0) {
+			switch(arg0) {
+			case 0: return new RoomlistFragment();
+			case 1: return new LobbyChatFragment();
+			case 2: return new PlayerlistFragment();
+			default: throw new IndexOutOfBoundsException();
+			}
+		}
+	}
+}