protected override void OnCreate(Bundle savedInstanceState) { RequestWindowFeature(WindowFeatures.NoTitle); Window.SetFlags(WindowManagerFlags.Fullscreen, WindowManagerFlags.Fullscreen); Bundle Extras = Intent.Extras; byte[] BackgroundByteArray = Extras.GetByteArray("BackgroundByteArray"); base.OnCreate(savedInstanceState); Initiate(); SetContentView(Resource.Layout.Organizator_Trip); CheckIfFirstLogin(); IconsContainter = FindViewById <GridView>(Resource.Id.GridViewLay); Background = FindViewById <RelativeLayout>(Resource.Id.relativeLayout1); LeftDrawerListView = FindViewById <ListView>(Resource.Id.left_drawer_listview); UserProfilePic = FindViewById <ImageView>(Resource.Id.imageView1); UserNume = FindViewById <TextView>(Resource.Id.textView1); Background.Background = DrawableConverter.ByteArrayToDrawable(BackgroundByteArray, this); SetTypeface.Normal.SetTypeFace(this, UserNume); IconsContainter.Adapter = new Organizator_Trip_GridViewAdapter(this, new Drawable[] { Resources.GetDrawable(Resource.Drawable.Chat), Resources.GetDrawable(Resource.Drawable.VizualizareExcursionisti), Resources.GetDrawable(Resource.Drawable.Galerie), Resources.GetDrawable(Resource.Drawable.Distance), Resources.GetDrawable(Resource.Drawable.QuestionPool) }); LeftDrawerListView.Adapter = new Organizator_Trip_LeftDrawer(this, Background.Background, new string[] { "Informatii excursie" }); IconsContainter.ItemSelected += (object sender, AdapterView.ItemSelectedEventArgs e) => { Toast.MakeText(this, e.Position.ToString(), ToastLength.Short).Show(); }; }
protected override void OnCreate(Bundle savedInstanceState) { RequestWindowFeature(WindowFeatures.NoTitle); Window.SetFlags(WindowManagerFlags.Fullscreen, WindowManagerFlags.Fullscreen); Bundle Extras = Intent.Extras; byte[] BackgroundByteArray = Extras.GetByteArray("BackgroundUtilizatorMainByteArray"); base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Organizator_CreareExcursie); Pager = FindViewById <ViewPager> (Resource.Id.viewPager1); Titlu = FindViewById <TextView> (Resource.Id.textView1); Background = FindViewById <RelativeLayout> (Resource.Id.relativeLayout1); SetTypeface.Bold.SetTypeFace(this, Titlu); Background.Background = DrawableConverter.ByteArrayToDrawable(BackgroundByteArray, this); Pager.Adapter = new Organizator_CreareExcursie_ViewPagerAdapter(SupportFragmentManager, this, Background.Background); Pager.PageSelected += (object sender, ViewPager.PageSelectedEventArgs e) => { Titlu.Text = Titluri[e.Position]; }; }
protected override void OnCreate(Bundle savedInstanceState) { RequestWindowFeature(WindowFeatures.NoTitle); Window.SetFlags(WindowManagerFlags.Fullscreen, WindowManagerFlags.Fullscreen); Bundle Extras = Intent.Extras; byte[] BackgroundByteArray = Extras.GetByteArray("BackgroundByteArray"); base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Utilizator_Trip_TripInfo); ListView ListaInformatii = FindViewById <ListView> (Resource.Id.listView1); LinearLayout Background = FindViewById <LinearLayout> (Resource.Id.linearLayout1); Background.Background = DrawableConverter.ByteArrayToDrawable(BackgroundByteArray, this); string[] Informatii = new string[] { Utilizator_Trip.TripInfo[1], Utilizator_Trip.TripInfo[3], Utilizator_Trip.TripInfo[4], Utilizator_Trip.TripInfo[5], Utilizator_Trip.TripInfo[6], Utilizator_Trip.TripInfo[7] }; ListaInformatii.Adapter = new Utilizator_Trip_TripInfo_Adapter(this, Informatii); }
public OnlineClient(Utilizator_Trip context, string[] Messages) { this.context = context; Nume = Messages[2]; Prenume = Messages[3]; TipCont = Messages[4]; NumarTelefon = Messages[5]; Position = Messages[7]; TcpClient Client = new TcpClient(_Details.ServerIP, _Details.LargeFilesPort); NetworkStream ns = Client.GetStream(); using (MemoryStream ms = new MemoryStream()) { _TcpDataExchange.WriteStreamString(ns, CryptDecryptData.CryptData(new string[] { _Details.GetProfilePic, NumarTelefon })); int ReadedBytes; byte[] Buffer = new byte[1000]; while ((ReadedBytes = ns.Read(Buffer, 0, Buffer.Length)) > 0) { ms.Write(Buffer, 0, ReadedBytes); } Client.Close(); ns.Dispose(); Drawable PhotoDrawable = DrawableConverter.ByteArrayToDrawable(ms.ToArray(), context); Bitmap PhotoBitmap = ((BitmapDrawable)PhotoDrawable).Bitmap; Photo = new BitmapDrawable(context.Resources, RoundedBitmap.MakeRound(PhotoBitmap, PhotoBitmap.Width)); } }
public override Android.Views.View GetView(int position, Android.Views.View convertView, Android.Views.ViewGroup parent) { LayoutInflater inflater = context.LayoutInflater; View v = inflater.Inflate(Resource.Layout.Common_LeftDrawer, null, true); ImageView OptionIconIView = v.FindViewById <ImageView> (Resource.Id.imageView2); TextView OptionTView = v.FindViewById <TextView> (Resource.Id.textView2); OptionTView.Text = Optiuni [position]; SetTypeface.Normal.SetTypeFace(context, OptionTView); OptionIconIView.SetImageDrawable(OptiuniIcon[position]); OptionTView.Click += (object sender, EventArgs e) => { switch (((TextView)sender).Text) { case "Logout": { SaveUsingSharedPreferences Save = new SaveUsingSharedPreferences(context); Save.Clear(SaveUsingSharedPreferences.Tags.Login.Username); Intent StartSignUp = new Intent(context, typeof(Login)); StartSignUp.PutExtra("BackgroundLoginByteArray", DrawableConverter.DrawableToByteArray(Background)); context.StartActivity(StartSignUp); } break; } }; return(v); }
private void SwitchingBackgrounds() { for (int i = 1; i < 5; i++) { DrawableList.Add(DrawableConverter.GetDrawableFromAssets("LB/img" + i.ToString() + ".jpg", this)); } for (int i = 1; i < 8; i++) { DrawableList.Add(DrawableConverter.GetDrawableFromAssets("LoadingBackgrounds/img" + i.ToString() + ".jpg", this)); } SwitchingBackgroundsThread = new Thread(new ThreadStart(() => { while (true) { int randId = new Random().Next(0, DrawableList.Count); while (randId == 3) { randId = new Random().Next(0, DrawableList.Count); } RunOnUiThread(() => Backgroud.Background = DrawableList [randId]); Thread.Sleep(1000); } })); SwitchingBackgroundsThread.Start(); }
protected override void OnCreate(Android.OS.Bundle savedInstanceState) { RequestWindowFeature(Android.Views.WindowFeatures.NoTitle); Window.SetFlags(Android.Views.WindowManagerFlags.Fullscreen, Android.Views.WindowManagerFlags.Fullscreen); Bundle Extras = Intent.Extras; string[] DateUtilizatorNou = Extras.GetStringArray("FacebookUserData"); BackID = Extras.GetInt("BackgroundLoginByteArray"); base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Login); LoginText = FindViewById <EditText> (Resource.Id.editText1); ParolaText = FindViewById <EditText> (Resource.Id.editText2); LoginBtn = FindViewById <Button> (Resource.Id.button1); SignUpBtn = FindViewById <Button> (Resource.Id.button2); RememberMe = FindViewById <CheckBox> (Resource.Id.checkBox1); Backgroud = FindViewById <RelativeLayout> (Resource.Id.relativeLayout1); LoginWithFacebook = FindViewById <ImageView>(Resource.Id.imageView3); SetTypeface.Italic.SetTypeFace(this, LoginText); SetTypeface.Italic.SetTypeFace(this, ParolaText); SetTypeface.Italic.SetTypeFace(this, LoginBtn); SetTypeface.Italic.SetTypeFace(this, SignUpBtn); SetTypeface.Italic.SetTypeFace(this, RememberMe); if (DateUtilizatorNou != null) { CreateNewFacebookUser(DateUtilizatorNou); } List <Drawable> DrawableList = new List <Drawable>(); for (int i = 1; i < 5; i++) { DrawableList.Add(DrawableConverter.GetDrawableFromAssets("LB/img" + i.ToString() + ".jpg", this)); } for (int i = 1; i < 8; i++) { DrawableList.Add(DrawableConverter.GetDrawableFromAssets("LoadingBackgrounds/img" + i.ToString() + ".jpg", this)); } Backgroud.Background = DrawableList[BackID]; SignUpBtn.Click += SignUpBtn_Click; LoginBtn.Click += LoginBtn_Click; LoginWithFacebook.Click += LoginWithFacebook_Click; if (new SaveUsingSharedPreferences(this).LoadString(SaveUsingSharedPreferences.Tags.Login.Username) != string.Empty) { Intent StartSignUp = new Intent(this, typeof(Utilizator_Main)); StartSignUp.PutExtra("BackgroundUtilizatorMainByteArray", DrawableConverter.DrawableToByteArray(Backgroud.Background)); StartActivity(StartSignUp); } }
protected override void OnCreate(Bundle savedInstanceState) { RequestWindowFeature(WindowFeatures.NoTitle); Window.SetFlags(WindowManagerFlags.Fullscreen, WindowManagerFlags.Fullscreen); Bundle Extras = Intent.Extras; byte[] BackgroundByteArray = Extras.GetByteArray("BackgroundByteArray"); TripInfo = Extras.GetStringArrayList("TripData").ToArray(); Me = new TripClient(Utilizator_Main.INPUT, Utilizator_Main.OUTPUT, new SaveUsingSharedPreferences(this).LoadString(SaveUsingSharedPreferences.Tags.Login.Username), this); TripId = new SaveUsingSharedPreferences(this).LoadString(SaveUsingSharedPreferences.Tags.Trip.TipId); base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Utilizator_Trip); InitiateView(); CheckIfNewInTrip(); test = this; LocalActivityManager LAM = new LocalActivityManager(this, false); LAM.DispatchCreate(savedInstanceState); LAM.DispatchResume(); LAM.DispatchPause(IsFinishing); tabHost.Setup(LAM); int[] Layouturi = new int[] { Resource.Layout.Utilizator_Trip_ChatView, Resource.Layout.Utilizator_Trip_MaskB, Resource.Layout.Utilizator_Trip_MaskC, }; Background.Background = DrawableConverter.ByteArrayToDrawable(BackgroundByteArray, this); SetTypeface.Normal.SetTypeFace(this, UserNume); LeftDrawerListView.Adapter = new Utilizator_Trip_LeftDrawerAdapter(this, Background.Background, new string[] { "Galerie", "Modificare Cont", "As vrea sa cumpar", "Informatii excursie", "Setari", "Iesire Excursie", "Logut" }); // OrganizatorProfilePic.SetImageDrawable(RoundedUserProfile); // OrganizatorNume.Text = "Nume Prenume"; // SetTypeface.Normal.SetTypeFace (this,OrganizatorNume); Pager.Adapter = new Utilizator_Trip_ViewPagerAdapter(SupportFragmentManager, this); for (int i = 0; i < 3; i++) { CreateTab(typeof(Utilizator_Trip_MaskA), Tags[i], string.Empty, TabsIcon[i], tabHost); } tabHost.TabChanged += TabHost_TabChanged; Pager.PageSelected += Pager_PageSelected; ClientGetMessage += Utilizator_Trip_ClientGetMessage; }
private void RenderGif() { AnimationDrawable test = new AnimationDrawable(); test.OneShot = false; for (int i = 1; i < 90; i++) { Drawable d = DrawableConverter.GetDrawableFromAssets("gif/i" + i.ToString() + ".png", this); test.AddFrame(d, 1); } iView.SetImageDrawable(test); }
protected override void OnCreate(Android.OS.Bundle savedInstanceState) { RequestWindowFeature(Android.Views.WindowFeatures.NoTitle); Window.SetFlags(Android.Views.WindowManagerFlags.Fullscreen, Android.Views.WindowManagerFlags.Fullscreen); Bundle Extras = Intent.Extras; int BackgroundByteArray = Extras.GetInt("BackgroundSignUpByteArray"); base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.SignUp); Pager = FindViewById <ViewPager> (Resource.Id.viewPager1); Titlu = FindViewById <TextView> (Resource.Id.textView1); Background = FindViewById <RelativeLayout> (Resource.Id.relativeLayout1); string[] Titluri = new string[] { "Informatii Personale", "Informatii Virtuale", "Finalizare", }; int[] Layouturi = new int[] { Resource.Layout.SignUp_Page1, Resource.Layout.SIgnUp_Page2, Resource.Layout.SignUp_Page3, }; SetTypeface.Bold.SetTypeFace(this, Titlu); List <Drawable> DrawableList = new List <Drawable>(); for (int i = 1; i < 5; i++) { DrawableList.Add(DrawableConverter.GetDrawableFromAssets("LB/img" + i.ToString() + ".jpg", this)); } for (int i = 1; i < 8; i++) { DrawableList.Add(DrawableConverter.GetDrawableFromAssets("LoadingBackgrounds/img" + i.ToString() + ".jpg", this)); } Background.Background = DrawableList[BackgroundByteArray]; Pager.Adapter = new ViewPagerAdapter(SupportFragmentManager, Layouturi, this, Pager); Pager.OffscreenPageLimit = 3; Pager.PageSelected += (object sender, ViewPager.PageSelectedEventArgs e) => { Titlu.Text = Titluri[e.Position]; }; }
protected override void OnCreate(Bundle savedInstanceState) { RequestWindowFeature(WindowFeatures.NoTitle); Window.SetFlags(WindowManagerFlags.Fullscreen, WindowManagerFlags.Fullscreen); Bundle Extras = Intent.Extras; byte[] BackgroundByteArray = Extras.GetByteArray("BackgroundUtilizatorMainByteArray"); base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Organizator_Main); CreareExcursieBtn = FindViewById <Button> (Resource.Id.button1); CreareExcursieTView = FindViewById <TextView> (Resource.Id.textView2); LeftDrawer = FindViewById <ListView> (Resource.Id.left_drawer_listview); UserProfilePic = FindViewById <ImageView> (Resource.Id.imageView1); UserNume = FindViewById <TextView> (Resource.Id.textView1); Background = FindViewById <RelativeLayout> (Resource.Id.relativeLayout1); Background.Background = DrawableConverter.ByteArrayToDrawable(BackgroundByteArray, this); Drawable RoundedUserProfile = DrawableConverter.GetDrawableFromAssets("LoadingBackgrounds/img1.jpg", this); RoundedUserProfile = new BitmapDrawable(Resources, RoundedBitmap.MakeRound(((BitmapDrawable)RoundedUserProfile).Bitmap, ((BitmapDrawable)RoundedUserProfile).Bitmap.Width)); UserProfilePic.SetImageDrawable(RoundedUserProfile); UserNume.Text = "Dragos Mihaitza"; SetTypeface.Normal.SetTypeFace(this, UserNume); Drawable d = Resources.GetDrawable(Resource.Drawable.SettingsIcon); LeftDrawer.Adapter = new Organizator_Main_LeftDrawerAdapter(this, new string[] { "test 1", "test 2", "test 3", }, new Drawable[] { d, d, d }); SetTypeface.Normal.SetTypeFace(this, CreareExcursieTView); SetTypeface.Normal.SetTypeFace(this, CreareExcursieBtn); CreareExcursieBtn.Click += (object sender, EventArgs e) => { Intent StartCreareExcursie = new Intent(this, typeof(Organizator_CreareExcursie)); StartCreareExcursie.PutExtra("BackgroundUtilizatorMainByteArray", DrawableConverter.DrawableToByteArray(Background.Background)); StartActivity(StartCreareExcursie); }; }
void auth_Completed(object sender, AuthenticatorCompletedEventArgs e) { OAuth2Request Query = new OAuth2Request("GET", new Uri("https://graph.facebook.com/me?fields=gender,email,birthday,first_name,last_name,picture.type(large)"), null, e.Account); try { Query.GetResponseAsync().ContinueWith(t => { if (t.IsFaulted) { System.Console.WriteLine("Error: " + t.Exception.InnerException.Message); } else { JObject Response = JObject.Parse(t.Result.GetResponseText()); string[] DateUtilizatorNou = new string[] { Response["first_name"].ToString(), Response["last_name"].ToString(), Response["gender"].ToString(), Response["birthday"].ToString(), Response["email"].ToString(), Response["picture"]["data"]["url"].ToString() }; Intent StartLogin = new Intent(this, typeof(Login)); StartLogin.PutExtra("FacebookUserData", DateUtilizatorNou); StartLogin.PutExtra("BackgroundLoginByteArray", DrawableConverter.DrawableToByteArray(Backgroud.Background)); StartActivity(StartLogin); } }); } catch { Intent StartLogin = new Intent(this, typeof(Login)); StartLogin.PutExtra("BackgroundLoginByteArray", DrawableConverter.DrawableToByteArray(Backgroud.Background)); StartActivity(StartLogin); } }
protected override void OnResume() { TcpClient Client = new TcpClient(_Details.ServerIP, _Details.LargeFilesPort); NetworkStream ns = Client.GetStream(); _TcpDataExchange.WriteStreamString(ns, CryptDecryptData.CryptData(new string[] { _Details.GetProfilePic, new SaveUsingSharedPreferences(this).LoadString(SaveUsingSharedPreferences.Tags.Login.Username) })); int ReadedBytes; byte[] Buffer = new byte[1000]; MemoryStream ms = new MemoryStream(); while ((ReadedBytes = ns.Read(Buffer, 0, Buffer.Length)) > 0) { ms.Write(Buffer, 0, ReadedBytes); } Client.Close(); ns.Dispose(); Bitmap bitMap = ((BitmapDrawable)DrawableConverter.ByteArrayToDrawable(ms.ToArray(), this)).Bitmap; UserProfilePic.SetImageDrawable(new BitmapDrawable(Resources, RoundedBitmap.MakeRound(bitMap, bitMap.Height / 2))); TcpClient client = new TcpClient(_Details.ServerIP, _Details.LargeFilesPort); NetworkStream Ns = client.GetStream(); _TcpDataExchange.WriteStreamString(Ns, CryptDecryptData.CryptData(new string[] { _Details.GetUserName, new SaveUsingSharedPreferences(this).LoadString(SaveUsingSharedPreferences.Tags.Login.Username) })); string NumeUtilizator = CryptDecryptData.DecryptData(_TcpDataExchange.ReadStreamString(Ns))[0]; UserNume.Text = NumeUtilizator; client.Close(); Ns.Dispose(); base.OnResume(); }
protected override void OnCreate(Bundle savedInstanceState) { Bundle GetBytes = Intent.Extras; byte[] PhotoBytes = GetBytes.GetByteArray("PhBytes"); RequestWindowFeature(WindowFeatures.NoTitle); Window.SetFlags(WindowManagerFlags.Fullscreen, WindowManagerFlags.Fullscreen); base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Utilizator_Trip_ModifyAccount_ConfirmPhoto); ImageView Photo = FindViewById <ImageView> (Resource.Id.imageView1); Button Confim = FindViewById <Button> (Resource.Id.button1); Button Cancel = FindViewById <Button> (Resource.Id.button2); TripClient Me = Utilizator_Trip.Me; Photo.SetImageDrawable(DrawableConverter.ByteArrayToDrawable(PhotoBytes, this)); Confim.Click += (object sender, EventArgs e) => { Dialog diag = new Dialog(this); diag.RequestWindowFeature((int)WindowFeatures.NoTitle); LinearLayout View = new LinearLayout(this); ProgressBar UploadProgress = new ProgressBar(this); diag.SetContentView(View); new Thread(() => { using (MemoryStream ms = new MemoryStream(PhotoBytes)) { int PackSize = 1000; int TotalLength = (int)ms.Length; int NoOfPackets = (int)Math.Ceiling((double)ms.Length / (double)PackSize); int CurrentPackSize; UploadProgress.Max = NoOfPackets; for (int i = 0; i < NoOfPackets; i++) { if (TotalLength > PackSize) { TotalLength -= PackSize; CurrentPackSize = PackSize; } else { CurrentPackSize = TotalLength; } byte[] CurrentBytes = new byte[CurrentPackSize]; int ReadedLength = ms.Read(CurrentBytes, 0, CurrentBytes.Length); string CurrentString = Encoding.ASCII.GetString(CurrentBytes, 0, ReadedLength); Me.OUTPUT_SEND(new string[] { _Details.GetUserDataByPhone, Me.NumarTelefon, CurrentString }); UploadProgress.Progress = i; } } }).Start(); }; Cancel.Click += (object sender, EventArgs e) => { Finish(); }; }
protected override void OnCreate(Bundle savedInstanceState) { RequestWindowFeature(WindowFeatures.NoTitle); Window.SetFlags(WindowManagerFlags.Fullscreen, WindowManagerFlags.Fullscreen); Bundle Extras = Intent.Extras; int BackgroundByteArray = Extras.GetInt("BackgroundUtilizatorMainByteArray"); base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Utilizator_Main); Background = FindViewById <RelativeLayout> (Resource.Id.relativeLayout1); LeftDrawer = FindViewById <ListView> (Resource.Id.left_drawer_listview); Next = FindViewById <Button> (Resource.Id.button1); Container = FindViewById <RelativeLayout> (Resource.Id.relativeLayout3); Cod = FindViewById <EditText> (Resource.Id.editText1); IntroducetiCodul = FindViewById <TextView> (Resource.Id.textView2); UserProfilePic = FindViewById <ImageView> (Resource.Id.imageView1); UserNume = FindViewById <TextView> (Resource.Id.textView1); List <Drawable> DrawableList = new List <Drawable>(); for (int i = 1; i < 5; i++) { DrawableList.Add(DrawableConverter.GetDrawableFromAssets("LB/img" + i.ToString() + ".jpg", this)); } for (int i = 1; i < 8; i++) { DrawableList.Add(DrawableConverter.GetDrawableFromAssets("LoadingBackgrounds/img" + i.ToString() + ".jpg", this)); } Background.Background = DrawableList[BackgroundByteArray]; Cod.Text = new SaveUsingSharedPreferences(this).LoadString(SaveUsingSharedPreferences.Tags.Trip.TipId); //Cod.Text = "c41z1zb6xc"; SetTypeface.Normal.SetTypeFace(this, IntroducetiCodul); SetTypeface.Normal.SetTypeFace(this, Next); SetTypeface.Normal.SetTypeFace(this, Cod); TcpClient Client = new TcpClient(_Details.ServerIP, _Details.LargeFilesPort); NetworkStream ns = Client.GetStream(); _TcpDataExchange.WriteStreamString(ns, CryptDecryptData.CryptData(new string[] { _Details.GetProfilePic, new SaveUsingSharedPreferences(this).LoadString(SaveUsingSharedPreferences.Tags.Login.Username) })); int ReadedBytes; byte[] Buffer = new byte[1000]; MemoryStream ms = new MemoryStream(); while ((ReadedBytes = ns.Read(Buffer, 0, Buffer.Length)) > 0) { ms.Write(Buffer, 0, ReadedBytes); } Client.Close(); ns.Dispose(); Bitmap bitMap = ((BitmapDrawable)DrawableConverter.ByteArrayToDrawable(ms.ToArray(), this)).Bitmap; UserProfilePic.SetImageDrawable(new BitmapDrawable(Resources, RoundedBitmap.MakeRound(bitMap, bitMap.Height / 2))); TcpClient client = new TcpClient(_Details.ServerIP, _Details.LargeFilesPort); NetworkStream Ns = client.GetStream(); _TcpDataExchange.WriteStreamString(Ns, CryptDecryptData.CryptData(new string[] { _Details.GetUserName, new SaveUsingSharedPreferences(this).LoadString(SaveUsingSharedPreferences.Tags.Login.Username) })); string NumeUtilizator = CryptDecryptData.DecryptData(_TcpDataExchange.ReadStreamString(Ns))[0]; UserNume.Text = NumeUtilizator; client.Close(); Ns.Dispose(); SetTypeface.Normal.SetTypeFace(this, UserNume); LeftDrawer.Adapter = new Utilizator_Main_LeftDrawerAdapter(this, new string[] { "Logout" }, Background.Background); Next.Click += (object sender, EventArgs e) => { TcpClient OUTPUT_Client = new TcpClient(_Details.ServerIP, _Details.TripPort_INPUT); NetworkStream OUTPUT_ns = OUTPUT_Client.GetStream(); OUTPUT = new Client(OUTPUT_Client, OUTPUT_ns); string NumePrenume = "nume Prenume"; string NumarTelefon = new SaveUsingSharedPreferences(this).LoadString(SaveUsingSharedPreferences.Tags.Login.Username); string TripId = Cod.Text; _TcpDataExchange.WriteStreamString(OUTPUT_ns, CryptDecryptData.CryptData(new String [] { "TRIPENTER", NumePrenume, NumarTelefon, TripId })); List <string> Messages = new List <string>(); Messages.AddRange(CryptDecryptData.DecryptData(_TcpDataExchange.ReadStreamString(OUTPUT_ns))); Messages.Add(TripId); TcpClient INPUT_Client = new TcpClient(_Details.ServerIP, _Details.TripPort_OUTPUT); NetworkStream INPUT_ns = INPUT_Client.GetStream(); INPUT = new Client(INPUT_Client, INPUT_ns); _TcpDataExchange.WriteStreamString(INPUT_ns, CryptDecryptData.CryptData(new String [] { NumePrenume, NumarTelefon, TripId })); new SaveUsingSharedPreferences(this).Save(SaveUsingSharedPreferences.Tags.Trip.TipId, TripId); Intent StartUtilizatorTrip = new Intent(this, typeof(Utilizator_Trip)); StartUtilizatorTrip.PutExtra("BackgroundByteArray", DrawableConverter.DrawableToByteArray(Background.Background)); StartUtilizatorTrip.PutStringArrayListExtra("TripData", Messages); StartActivity(StartUtilizatorTrip); }; }
public override Android.Views.View GetView(int position, Android.Views.View convertView, Android.Views.ViewGroup parent) { LayoutInflater inflater = context.LayoutInflater; View v = inflater.Inflate(Resource.Layout.Common_LeftDrawer, null, true); RelativeLayout LayoutOptiuni = v.FindViewById <RelativeLayout> (Resource.Id.relativeLayout4); ImageView OptionIconIView = v.FindViewById <ImageView> (Resource.Id.imageView2); TextView OptionTView = v.FindViewById <TextView> (Resource.Id.textView2); SetTypeface.Normal.SetTypeFace(context, OptionTView); OptionTView.Text = Optiuni [position]; OptionIconIView.SetImageDrawable(OptiuniIcon[position]); LayoutOptiuni.Click += (object sender, EventArgs e) => { switch (position) { case 0: { PopupMenu popup = new PopupMenu(context, v); popup.MenuItemClick += (object s, PopupMenu.MenuItemClickEventArgs e1) => { switch (e1.Item.ToString()) { case "Adauga poza": { string Path = Android.OS.Environment.GetExternalStoragePublicDirectory(Android.OS.Environment.DirectoryPictures) + "/temp"; Java.IO.File file = new Java.IO.File(Path, string.Format("temp.jpg", Guid.NewGuid())); Intent i = new Intent(MediaStore.ActionImageCapture); i.PutExtra(MediaStore.ExtraOutput, Android.Net.Uri.FromFile(file)); context.StartActivityForResult(i, 0); } break; case "Vizualizare Galerie": { context.StartActivity(typeof(Utilizator_Trip_Galerie)); } break; } }; MenuInflater menuInflater = popup.MenuInflater; menuInflater.Inflate(Resource.Menu.OptiuniGalerie, popup.Menu); popup.Show(); } break; case 1: { Intent StartModifyAcc = new Intent(context, typeof(Utilizator_Trip_ModifyAccount)); StartModifyAcc.PutExtra("BackgroundByteArray", DrawableConverter.DrawableToByteArray(Background)); context.StartActivity(StartModifyAcc); } break; case 2: { context.StartActivity(typeof(BeSmart_Loading)); } break; case 3: { Intent StartTripInfo = new Intent(context, typeof(Utilizator_Trip_TripInfo)); StartTripInfo.PutExtra("BackgroundByteArray", DrawableConverter.DrawableToByteArray(Background)); context.StartActivity(StartTripInfo); } break; } }; return(v); }
void LoginBtn_Click(object sender, EventArgs e) { string Nume = LoginText.Text; string Parola = ParolaText.Text; TcpClient Client = new TcpClient(_Details.ServerIP, _Details.LoginSignUpNewTripPort); NetworkStream ns = Client.GetStream(); _TcpDataExchange.WriteStreamString(ns, CryptDecryptData.CryptData(new string[] { "LOGIN", Nume, Parola })); string[] Response = CryptDecryptData.DecryptData(_TcpDataExchange.ReadStreamString(ns)); switch (Response[0]) { case "Utilizator": { if (RememberMe.Checked) { SaveUsingSharedPreferences Save = new SaveUsingSharedPreferences(this); Save.Save(SaveUsingSharedPreferences.Tags.Login.Username, Nume); Save.Save(SaveUsingSharedPreferences.Tags.Login.Password, Parola); Intent StartSignUp = new Intent(this, typeof(Utilizator_Main)); StartSignUp.PutExtra("BackgroundUtilizatorMainByteArray", BackID); StartActivity(StartSignUp); } else { Intent StartSignUp = new Intent(this, typeof(Utilizator_Main)); StartSignUp.PutExtra("BackgroundUtilizatorMainByteArray", BackID); StartActivity(StartSignUp); } } break; case "Organizator": { if (Response[1] == "1") { SaveUsingSharedPreferences Save = new SaveUsingSharedPreferences(this); Save.Save(SaveUsingSharedPreferences.Tags.Login.Username, Nume); Save.Save(SaveUsingSharedPreferences.Tags.Login.Password, Parola); Intent StartOrganizatorTrip = new Intent(this, typeof(Organizator_Trip)); StartOrganizatorTrip.PutExtra("BackgroundByteArray", DrawableConverter.DrawableToByteArray(Backgroud.Background)); StartActivity(StartOrganizatorTrip); } else { SaveUsingSharedPreferences Save = new SaveUsingSharedPreferences(this); Save.Save(SaveUsingSharedPreferences.Tags.Login.Username, Nume); Save.Save(SaveUsingSharedPreferences.Tags.Login.Password, Parola); Intent StartOrganizatorMain = new Intent(this, typeof(Organizator_Main)); StartOrganizatorMain.PutExtra("BackgroundUtilizatorMainByteArray", DrawableConverter.DrawableToByteArray(Backgroud.Background)); StartActivity(StartOrganizatorMain); } } break; default: { Toast.MakeText(this, "Ne pare rau,numele utilizatorului sau parola au fost introduse gresit!", ToastLength.Long).Show(); } break; } }
public override Android.Views.View OnCreateView(Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Android.OS.Bundle savedInstanceState) { View v = inflater.Inflate(Layouturi[position], null, true); SaveUsingSharedPreferences Save = new SaveUsingSharedPreferences(context); switch (position) { case 0: { TextView TViewDestinatiePrincipala = v.FindViewById <TextView> (Resource.Id.textView1); TextView TViewTipulParticipantilor = v.FindViewById <TextView> (Resource.Id.textView4); EditText DestinatiePrincipala = v.FindViewById <EditText> (Resource.Id.editText1); RadioButton Elevi = v.FindViewById <RadioButton> (Resource.Id.radioButton1); RadioButton PersoanePrivate = v.FindViewById <RadioButton> (Resource.Id.radioButton3); SetTypeface.Normal.SetTypeFace(context, TViewDestinatiePrincipala); SetTypeface.Normal.SetTypeFace(context, TViewTipulParticipantilor); SetTypeface.Normal.SetTypeFace(context, DestinatiePrincipala); SetTypeface.Normal.SetTypeFace(context, Elevi); SetTypeface.Normal.SetTypeFace(context, PersoanePrivate); DestinatiePrincipala.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) => { Save.Save(SaveUsingSharedPreferences.Tags.NewTrip.DestinatiePrincipala, DestinatiePrincipala.Text); }; Save.Save(SaveUsingSharedPreferences.Tags.NewTrip.TipulParticipantilor, "Elevi"); Elevi.CheckedChange += (object sender, CompoundButton.CheckedChangeEventArgs e) => { if (e.IsChecked) { Save.Save(SaveUsingSharedPreferences.Tags.SetUp.Sex, "Elevi"); } else { Save.Save(SaveUsingSharedPreferences.Tags.SetUp.Sex, "Persoane private"); } }; } break; case 1: { TextView PerioadaExcursieiTView = v.FindViewById <TextView> (Resource.Id.textView1); TextView DataPlecareTView = v.FindViewById <TextView> (Resource.Id.textView2); TextView DataIntoarcereTView = v.FindViewById <TextView> (Resource.Id.textView3); DatePicker DataPlecare = v.FindViewById <DatePicker> (Resource.Id.datePicker1); DatePicker DataIntoarcere = v.FindViewById <DatePicker> (Resource.Id.datePicker2); SetTypeface.Normal.SetTypeFace(context, PerioadaExcursieiTView); SetTypeface.Normal.SetTypeFace(context, DataPlecareTView); SetTypeface.Normal.SetTypeFace(context, DataIntoarcereTView); Save.Save(SaveUsingSharedPreferences.Tags.NewTrip.DataPlecare, System.DateTime.Now.Day.ToString() + "." + System.DateTime.Now.Month.ToString() + "." + System.DateTime.Now.Year.ToString()); DataPlecare.CalendarView.DateChange += (object sender, CalendarView.DateChangeEventArgs e) => { Save.Save(SaveUsingSharedPreferences.Tags.NewTrip.DataPlecare, e.DayOfMonth.ToString() + "." + e.Month.ToString() + "." + e.Year.ToString()); }; Save.Save(SaveUsingSharedPreferences.Tags.NewTrip.DataIntoarcere, System.DateTime.Now.Day.ToString() + "." + System.DateTime.Now.Month.ToString() + "." + System.DateTime.Now.Year.ToString()); DataIntoarcere.CalendarView.DateChange += (object sender, CalendarView.DateChangeEventArgs e) => { Save.Save(SaveUsingSharedPreferences.Tags.NewTrip.DataIntoarcere, e.DayOfMonth.ToString() + "." + e.Month.ToString() + "." + e.Year.ToString()); }; } break; case 2: { TextView LocatiePlecareTView = v.FindViewById <TextView> (Resource.Id.textView1); TextView OraPlecareTview = v.FindViewById <TextView> (Resource.Id.textView2); EditText LocatiePlecare = v.FindViewById <EditText> (Resource.Id.editText1); TimePicker OraPlecare = v.FindViewById <TimePicker> (Resource.Id.timePicker1); OraPlecare.SetIs24HourView(Java.Lang.Boolean.True); SetTypeface.Normal.SetTypeFace(context, LocatiePlecareTView); SetTypeface.Normal.SetTypeFace(context, OraPlecareTview); SetTypeface.Normal.SetTypeFace(context, LocatiePlecare); LocatiePlecare.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) => { Save.Save(SaveUsingSharedPreferences.Tags.NewTrip.LocatiePlecare, LocatiePlecare.Text); }; Save.Save(SaveUsingSharedPreferences.Tags.NewTrip.OraPlecare, System.DateTime.Now.Minute.ToString() + ":" + System.DateTime.Now.Hour.ToString()); OraPlecare.TimeChanged += (object sender, TimePicker.TimeChangedEventArgs e) => { Save.Save(SaveUsingSharedPreferences.Tags.NewTrip.OraPlecare, e.Minute.ToString() + ":" + e.HourOfDay.ToString()); }; } break; case 3: { Button Finalizare = v.FindViewById <Button> (Resource.Id.button1); TextView ObservatiiTView = v.FindViewById <TextView> (Resource.Id.textView1); EditText ObservatiiEText = v.FindViewById <EditText> (Resource.Id.editText1); SetTypeface.Normal.SetTypeFace(context, Finalizare); SetTypeface.Normal.SetTypeFace(context, ObservatiiTView); SetTypeface.Normal.SetTypeFace(context, ObservatiiEText); Finalizare.Click += (object sender, EventArgs e) => { string DestinatiePrincipala = Save.LoadString(SaveUsingSharedPreferences.Tags.NewTrip.DestinatiePrincipala); string TipulParticipantilor = Save.LoadString(SaveUsingSharedPreferences.Tags.NewTrip.TipulParticipantilor); string DataPlecare = Save.LoadString(SaveUsingSharedPreferences.Tags.NewTrip.DataPlecare); string DataIntoarcere = Save.LoadString(SaveUsingSharedPreferences.Tags.NewTrip.DataIntoarcere); string LocatiePlecare = Save.LoadString(SaveUsingSharedPreferences.Tags.NewTrip.LocatiePlecare); string OraPlecare = Save.LoadString(SaveUsingSharedPreferences.Tags.NewTrip.OraPlecare); string Observatii = ObservatiiEText.Text; string NumeOrganizator = "numeOrganizator"; string NumarTelefon = new SaveUsingSharedPreferences(context).LoadString(SaveUsingSharedPreferences.Tags.Login.Username); if (VerificareDate(DestinatiePrincipala, LocatiePlecare)) { TcpClient Client = new TcpClient(_Details.ServerIP, _Details.TripPort_INPUT); NetworkStream ns = Client.GetStream(); _TcpDataExchange.WriteStreamString(ns, CryptDecryptData.CryptData(new string[] { "NEWTRIP", DestinatiePrincipala, TipulParticipantilor, DataPlecare, DataIntoarcere, LocatiePlecare, OraPlecare, Observatii, NumeOrganizator, NumarTelefon })); if (CryptDecryptData.DecryptData(_TcpDataExchange.ReadStreamString(ns)) [0] == "1") { Toast.MakeText(context, "Ala-i bosssss!", ToastLength.Long).Show(); TcpClient client = new TcpClient(_Details.ServerIP, _Details.LargeFilesPort); NetworkStream Ns = client.GetStream(); _TcpDataExchange.WriteStreamString(Ns, CryptDecryptData.CryptData(new string[] { _Details.GetTripId, new SaveUsingSharedPreferences(context).LoadString(SaveUsingSharedPreferences.Tags.Login.Username) })); string TripId = CryptDecryptData.DecryptData(_TcpDataExchange.ReadStreamString(Ns))[0]; new SaveUsingSharedPreferences(context).Save(SaveUsingSharedPreferences.Tags.Trip.TipId, TripId); ns.Dispose(); client.Close(); Intent StartOrganizatorTrip = new Intent(context, typeof(Organizator_Trip)); StartOrganizatorTrip.PutExtra("BackgroundByteArray", DrawableConverter.DrawableToByteArray(Background)); context.StartActivity(StartOrganizatorTrip); } else { Toast.MakeText(context, "Fail!", ToastLength.Long).Show(); context.Finish(); } } }; } break; } return(v); }
protected override void OnCreate(Bundle savedInstanceState) { RequestWindowFeature(WindowFeatures.NoTitle); Window.SetFlags(WindowManagerFlags.Fullscreen, WindowManagerFlags.Fullscreen); Bundle Extras = Intent.Extras; byte[] BackgroundByteArray = Extras.GetByteArray("BackgroundByteArray"); base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Utilizator_Trip_ModifyAccount); ListView RestulDatelor = FindViewById <ListView>(Resource.Id.listView1); RelativeLayout Background = FindViewById <RelativeLayout>(Resource.Id.relativeLayout1); ImageView ProfilePic = FindViewById <ImageView>(Resource.Id.imageView1); ImageView ChangeProfilePic = FindViewById <ImageView>(Resource.Id.imageView2); TextView ChangeProfilePic_TV = FindViewById <TextView>(Resource.Id.textView2); Background.Background = DrawableConverter.ByteArrayToDrawable(BackgroundByteArray, this); SetTypeface.Bold.SetTypeFace(this, ChangeProfilePic_TV); ChangeProfilePic.Click += (object sender, EventArgs e) => { string Path = Android.OS.Environment.GetExternalStoragePublicDirectory(Android.OS.Environment.DirectoryPictures) + "/temp"; Java.IO.File file = new Java.IO.File(Path, string.Format("temp.jpg", Guid.NewGuid())); Intent i = new Intent(MediaStore.ActionImageCapture); i.PutExtra(MediaStore.ExtraOutput, Android.Net.Uri.FromFile(file)); StartActivityForResult(i, 1); //Recreate(); }; Utilizator_Trip.test.ClientGetMessage += (object sender, ClientGetMessageEventArgs e) => { if (e.Messages[0].Equals(_Details.GetUserDataByPhone)) { TcpClient Client = new TcpClient(_Details.ServerIP, _Details.LargeFilesPort); NetworkStream ns = Client.GetStream(); _TcpDataExchange.WriteStreamString(ns, CryptDecryptData.CryptData(new string[] { _Details.GetProfilePic, Me.NumarTelefon })); int ReadedBytes; byte[] Buffer = new byte[1000]; MemoryStream ms = new MemoryStream(); while ((ReadedBytes = ns.Read(Buffer, 0, Buffer.Length)) > 0) { ms.Write(Buffer, 0, ReadedBytes); } Client.Close(); ns.Dispose(); if (!e.Messages[2].Equals(string.Empty)) { Nume = e.Messages[1]; Prenume = e.Messages[2]; Varsta = e.Messages[3]; Sex = e.Messages[4]; Email = e.Messages[5]; RunOnUiThread(() => { RestulDatelor.Adapter = new Utilizator_Trip_ModifyAccount_Adapter(this, new string[] { "Nume:" + Nume, "Prenume:" + Prenume, "Varsta:" + Varsta, "Sex:" + Sex, "E-mail:" + Email }); Bitmap bitMap = ((BitmapDrawable)DrawableConverter.ByteArrayToDrawable(ms.ToArray(), this)).Bitmap; ProfilePic.SetImageDrawable(new BitmapDrawable(Resources, RoundedBitmap.MakeRound(bitMap, bitMap.Height / 2))); }); } } else if (e.Messages[0].Equals(_Details.EditUserInfo)) { switch (e.Messages[1]) { case "1": { RunOnUiThread(() => Toast.MakeText(this, "Succes", ToastLength.Short).Show()); RunOnUiThread(() => Recreate()); } break; case "0": { RunOnUiThread(() => Toast.MakeText(this, "Fail", ToastLength.Short).Show()); } break; } } }; Me = Utilizator_Trip.Me; Me.OUTPUT_SEND(new string[] { _Details.GetUserDataByPhone, Me.NumarTelefon }); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.Inflate(Layouturi[position], container, false); SaveUsingSharedPreferences Save = new SaveUsingSharedPreferences(context); switch (position) { case 0: { TextView Nume_TView = v.FindViewById <TextView> (Resource.Id.textView1); TextView Prenume_TView = v.FindViewById <TextView> (Resource.Id.textView2); TextView Varsta_TView = v.FindViewById <TextView> (Resource.Id.textView3); TextView Sex_TView = v.FindViewById <TextView> (Resource.Id.textView4); RadioButton Masculin = v.FindViewById <RadioButton> (Resource.Id.radioButton1); RadioButton Feminin = v.FindViewById <RadioButton> (Resource.Id.radioButton3); EditText Nume_EText = v.FindViewById <EditText> (Resource.Id.editText1); EditText Prenume_EText = v.FindViewById <EditText> (Resource.Id.editText2); EditText Varsta_EText = v.FindViewById <EditText> (Resource.Id.editText3); Nume_EText.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) => { Save.Save(SaveUsingSharedPreferences.Tags.SetUp.Nume, Nume_EText.Text); }; Prenume_EText.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) => { Save.Save(SaveUsingSharedPreferences.Tags.SetUp.Prenume, Prenume_EText.Text); }; Varsta_EText.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) => { Save.Save(SaveUsingSharedPreferences.Tags.SetUp.Varsta, Varsta_EText.Text); }; Save.Save(SaveUsingSharedPreferences.Tags.SetUp.Sex, "Masculin"); Masculin.CheckedChange += (object sender, CompoundButton.CheckedChangeEventArgs e) => { if (e.IsChecked) { Save.Save(SaveUsingSharedPreferences.Tags.SetUp.Sex, "Masculin"); } else { Save.Save(SaveUsingSharedPreferences.Tags.SetUp.Sex, "Feminin"); } }; SetTypeface.Normal.SetTypeFace(context, Nume_TView); SetTypeface.Normal.SetTypeFace(context, Prenume_TView); SetTypeface.Normal.SetTypeFace(context, Varsta_TView); SetTypeface.Normal.SetTypeFace(context, Sex_TView); SetTypeface.Normal.SetTypeFace(context, Masculin); SetTypeface.Normal.SetTypeFace(context, Feminin); } break; case 1: { TextView Email_TView = v.FindViewById <TextView> (Resource.Id.textView1); TextView NumarTelefon_TView = v.FindViewById <TextView> (Resource.Id.textView2); TextView Mark = v.FindViewById <TextView> (Resource.Id.textView3); TextView TipCont_TView = v.FindViewById <TextView> (Resource.Id.textView4); RadioButton Utilizator = v.FindViewById <RadioButton> (Resource.Id.radioButton1); RadioButton Organizator = v.FindViewById <RadioButton> (Resource.Id.radioButton3); EditText Email_EText = v.FindViewById <EditText> (Resource.Id.editText1); EditText NumarTelefon_EText = v.FindViewById <EditText> (Resource.Id.editText2); SetTypeface.Normal.SetTypeFace(context, Email_TView); SetTypeface.Normal.SetTypeFace(context, NumarTelefon_TView); SetTypeface.Normal.SetTypeFace(context, Mark); SetTypeface.Normal.SetTypeFace(context, TipCont_TView); SetTypeface.Normal.SetTypeFace(context, Utilizator); SetTypeface.Normal.SetTypeFace(context, Organizator); Save.Save(SaveUsingSharedPreferences.Tags.SetUp.TipCont, "Utilizator"); Utilizator.CheckedChange += (object sender, CompoundButton.CheckedChangeEventArgs e) => { if (e.IsChecked) { Save.Save(SaveUsingSharedPreferences.Tags.SetUp.TipCont, "Utilizator"); } else { Save.Save(SaveUsingSharedPreferences.Tags.SetUp.TipCont, "Organizator"); } }; Email_EText.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) => { Save.Save(SaveUsingSharedPreferences.Tags.SetUp.Email, Email_EText.Text); }; NumarTelefon_EText.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) => { Save.Save(SaveUsingSharedPreferences.Tags.SetUp.NumarTelefon, NumarTelefon_EText.Text); }; } break; case 2: { ImageView ChaptaView = v.FindViewById <ImageView> (Resource.Id.imageView1); TextView VIntroducetiCodul = v.FindViewById <TextView> (Resource.Id.textView1); TextView VParola = v.FindViewById <TextView> (Resource.Id.textView2); TextView VConfParola = v.FindViewById <TextView> (Resource.Id.textView3); Button Gata = v.FindViewById <Button> (Resource.Id.button1); EditText Chapta = v.FindViewById <EditText> (Resource.Id.editText1); EditText Parola_EText = v.FindViewById <EditText> (Resource.Id.editText2); EditText ConfParola_Etext = v.FindViewById <EditText> (Resource.Id.editText3); SetTypeface.Normal.SetTypeFace(context, VIntroducetiCodul); SetTypeface.Normal.SetTypeFace(context, Gata); SetTypeface.Normal.SetTypeFace(context, VParola); SetTypeface.Normal.SetTypeFace(context, VConfParola); DisplayChapta displayChapta = new DisplayChapta(5); displayChapta.Create(); string ChaptaText = displayChapta.GetText(); Bitmap b = displayChapta.GetBitmap(); ChaptaView.SetImageBitmap(b); Gata.Click += (object sender, EventArgs e) => { string Nume = Save.LoadString(SaveUsingSharedPreferences.Tags.SetUp.Nume); string Prenume = Save.LoadString(SaveUsingSharedPreferences.Tags.SetUp.Prenume); string Varsta = Save.LoadString(SaveUsingSharedPreferences.Tags.SetUp.Varsta); string Sex = Save.LoadString(SaveUsingSharedPreferences.Tags.SetUp.Sex); string Email = Save.LoadString(SaveUsingSharedPreferences.Tags.SetUp.Email); string TipCont = Save.LoadString(SaveUsingSharedPreferences.Tags.SetUp.TipCont); string NumarTelefon = Save.LoadString(SaveUsingSharedPreferences.Tags.SetUp.NumarTelefon); string Parola = Parola_EText.Text; string ConfParola = ConfParola_Etext.Text; //if (VerificareDate ( // Nume,Prenume,Varsta,Email,NumarTelefon,Parola,ConfParola,Chapta.Text, ChaptaText)) { TcpClient Client = new TcpClient(_Details.ServerIP, _Details.LoginSignUpNewTripPort); NetworkStream ns = Client.GetStream(); _TcpDataExchange.WriteStreamString(ns, CryptDecryptData.CryptData(new string[] { "SIGNUP", Nume, Prenume, Varsta, Sex, Email, NumarTelefon, TipCont, Parola })); if (CryptDecryptData.DecryptData(_TcpDataExchange.ReadStreamString(ns))[0] == "ok") { Toast.MakeText(context, "Ala-i bosssss!", ToastLength.Long).Show(); Intent StartLogin = new Intent(context, typeof(Login)); StartLogin.PutExtra("BackgroundLoginByteArray", DrawableConverter.DrawableToByteArray(context.Background.Background)); context.StartActivity(StartLogin); } else { Toast.MakeText(context, "Fail!", ToastLength.Long).Show(); Intent StartLogin = new Intent(context, typeof(Login)); StartLogin.PutExtra("BackgroundLoginByteArray", DrawableConverter.DrawableToByteArray(context.Background.Background)); context.StartActivity(StartLogin); } //} }; } break; } return(v); }
protected override void OnCreate(Android.OS.Bundle savedInstanceState) { RequestWindowFeature(Android.Views.WindowFeatures.NoTitle); Window.SetFlags(WindowManagerFlags.Fullscreen, WindowManagerFlags.Fullscreen); base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.VerificareCompatibilitate); Backgroud = FindViewById <RelativeLayout> (Resource.Id.relativeLayout1); iView = FindViewById <ImageView> (Resource.Id.imageView1); ConMngr = (ConnectivityManager)GetSystemService(ConnectivityService); SwitchingBackgrounds(); //RenderGif(); CheckInternetThread = new Thread(new ThreadStart(() => { Thread.Sleep(1500); if (CheckInternetConnection().Equals(true)) { Thread.Sleep(1500); if (CheckServerConnection().Equals(true)) { Thread.Sleep(1500); Intent StartLogin = new Intent(this, typeof(Login)); Background = Backgroud.Background; StartLogin.PutExtra("BackgroundByteArray", DrawableConverter.DrawableToByteArray(Backgroud.Background)); SwitchingBackgroundsThread.Abort(); StartActivity(StartLogin); } else { /* AlertDialog.Builder aDiag = new AlertDialog.Builder (this); * aDiag.SetTitle ("Error!"); * aDiag.SetMessage ("Nu s-a putut realiza conexiunea cu serverul!"); * aDiag.SetPositiveButton ("Skip", delegate(object sender, DialogClickEventArgs e) {*/ Intent StartLogin = new Intent(this, typeof(Login)); StartLogin.PutExtra("BackgroundLoginByteArray", DrawableList.IndexOf(Backgroud.Background)); SwitchingBackgroundsThread.Abort(); // GifThread.Abort(); StartActivity(StartLogin); /*}); * * aDiag.SetNegativeButton ("Exit", delegate(object sender, DialogClickEventArgs e) { * RunOnUiThread (() => Toast.MakeText (this, "Couldn't reach the server!Please try again later!", ToastLength.Long).Show ()); * Android.OS.Process.KillProcess (Android.OS.Process.MyPid ()); * }); * * RunOnUiThread (() => aDiag.Show ());*/ } } })); CheckInternetThread.Start(); }