From 1a7f177cd2b8ace8f818d1d76fe10024230ff72b Mon Sep 17 00:00:00 2001 From: Sagi Dayan Date: Sat, 9 Jul 2016 18:28:31 +0300 Subject: [PATCH 1/4] Fixed The Fucking Email Buggit push --- .../sagi/thesocialnotework/SettingsFragment.java | 8 +++----- .../matan/ara/sagi/thesocialnotework/User.java | 13 ++----------- app/src/main/res/layout/fragment_settings.xml | 2 +- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/app/src/main/java/com/android_app/matan/ara/sagi/thesocialnotework/SettingsFragment.java b/app/src/main/java/com/android_app/matan/ara/sagi/thesocialnotework/SettingsFragment.java index 96e09cb..3946a47 100644 --- a/app/src/main/java/com/android_app/matan/ara/sagi/thesocialnotework/SettingsFragment.java +++ b/app/src/main/java/com/android_app/matan/ara/sagi/thesocialnotework/SettingsFragment.java @@ -65,14 +65,11 @@ public class SettingsFragment extends Fragment implements View.OnClickListener, this.parent = (MainActivity)getActivity(); Utils.showLoadingDialog(parent, "Just a sec...", ""); this.user = parent.getUser(); - Log.d(TAG, "onCreateView: "+user.toString()); this.cameraBtn = (ImageButton) view.findViewById(R.id.btn_camera); this.cameraBtn.setOnClickListener(this); this.avatarImage = (ImageView) view.findViewById(R.id.settings_userAvater_iamgeView); this.txt_email = (EditText)view.findViewById(R.id.txt_email); - this.txt_email.addTextChangedListener(this); this.txt_password = (EditText)view.findViewById(R.id.txt_password); - this.txt_password.addTextChangedListener(this); this.txt_username = (EditText)view.findViewById(R.id.txt_username); this.lbl_num_of_notes = (TextView)view.findViewById(R.id.lbl_num_of_notes); this.lbl_num_of_liked = (TextView)view.findViewById(R.id.lbl_num_of_liked); @@ -85,12 +82,13 @@ public class SettingsFragment extends Fragment implements View.OnClickListener, Utils.URLtoImageView(avatarImage, user.getAvatar()); this.txt_username.setText(""+user.getUsername()); this.txt_password.setText(""+user.getPassword()); - Log.d(TAG, "onCreateView: The FUCKING EMAIL IS --------------->>>" + user.getEmail()); - this.txt_email.setText(""+user.getEmail()); + this.txt_email.setText(""+parent.getUser().getEmail()); this.lbl_num_of_notes.setText(""+user.getNumber_of_notes()); //TODO this.lbl_num_of_liked.setText(""+user.getLiked_notes().size()); + this.txt_password.addTextChangedListener(this); + this.txt_email.addTextChangedListener(this); Utils.dismissLoadingDialog(); return view; diff --git a/app/src/main/java/com/android_app/matan/ara/sagi/thesocialnotework/User.java b/app/src/main/java/com/android_app/matan/ara/sagi/thesocialnotework/User.java index c295897..d288010 100644 --- a/app/src/main/java/com/android_app/matan/ara/sagi/thesocialnotework/User.java +++ b/app/src/main/java/com/android_app/matan/ara/sagi/thesocialnotework/User.java @@ -63,6 +63,7 @@ public class User { break; } } + Log.d(TAG, "User: Constructor Created:\n"+this.toString()); } public int getNumber_of_notes() { @@ -90,7 +91,7 @@ public class User { } public String getEmail() { - return email; + return this.email; } public void setEmail(String email) { @@ -109,18 +110,11 @@ public class User { return username; } - public void setUsername(String username) { - this.username = username; - } public Vector getLiked_notes() { return liked_notes; } - public void setLiked_notes(Vector liked_notes) { - this.liked_notes = liked_notes; - } - private void createArrayNotes(String s) { Log.d(TAG, "createArrayNotes:" + s); String[] noteIds = s.split("\\|"); @@ -128,7 +122,6 @@ public class User { Log.d(TAG, "createArrayNotes: Note ID " + i + ": " + noteIds[i]); liked_notes.add(noteIds[i]); } - Log.d(TAG, "createArrayNotes: =================: == Done With Note IDS"); } public String Serialise(){ @@ -151,13 +144,11 @@ public class User { } public void updateUser(final MainActivity activity){ - Log.d(TAG, "updateUser: ================================"); VolleyUtilSingleton.getInstance(activity).post(Utils.BASE_URL + "/user/upsert", this.toJSON(), new Response.Listener() { @Override public void onResponse(JSONObject response) { try { if(response.get("status").equals("OK")){ - Log.d(TAG, "onResponse: In OKOKOKOK"); activity.updateNavAvatar(); Utils.updateUserSharedPref(self.Serialise()); activity.updateNavAvatar(); diff --git a/app/src/main/res/layout/fragment_settings.xml b/app/src/main/res/layout/fragment_settings.xml index ae25b3d..93ada70 100644 --- a/app/src/main/res/layout/fragment_settings.xml +++ b/app/src/main/res/layout/fragment_settings.xml @@ -47,7 +47,7 @@ android:ems="10" android:id="@+id/txt_email" android:hint="Email" - android:inputType="none|text" /> + android:inputType="textEmailAddress" /> Date: Sat, 9 Jul 2016 18:31:43 +0300 Subject: [PATCH 2/4] Button collor in the settings --- app/src/main/res/layout/fragment_settings.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/res/layout/fragment_settings.xml b/app/src/main/res/layout/fragment_settings.xml index 93ada70..b27e161 100644 --- a/app/src/main/res/layout/fragment_settings.xml +++ b/app/src/main/res/layout/fragment_settings.xml @@ -130,7 +130,9 @@ android:id="@+id/btn_save" android:layout_alignParentBottom="true" android:layout_alignParentEnd="true" - android:layout_marginEnd="29dp" /> + android:layout_marginEnd="29dp" + android:background="@color/colorPrimary" + android:textColor="#ffffff" /> From 7b0856e9039dca17c553b0f0ec2e411f429f198e Mon Sep 17 00:00:00 2001 From: Sagi Dayan Date: Sat, 9 Jul 2016 18:33:38 +0300 Subject: [PATCH 3/4] Settings: UI tweak --- app/src/main/res/layout/fragment_settings.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/res/layout/fragment_settings.xml b/app/src/main/res/layout/fragment_settings.xml index b27e161..ff2536e 100644 --- a/app/src/main/res/layout/fragment_settings.xml +++ b/app/src/main/res/layout/fragment_settings.xml @@ -132,7 +132,8 @@ android:layout_alignParentEnd="true" android:layout_marginEnd="29dp" android:background="@color/colorPrimary" - android:textColor="#ffffff" /> + android:textColor="#ffffff" + android:padding="10dp" /> From 9651eba02c61d12eeee3e02c551e2c20e7176be2 Mon Sep 17 00:00:00 2001 From: Sagi Dayan Date: Sat, 9 Jul 2016 18:35:06 +0300 Subject: [PATCH 4/4] Fixed Personal title when coming back to the fragment --- .../matan/ara/sagi/thesocialnotework/MainActivity.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/android_app/matan/ara/sagi/thesocialnotework/MainActivity.java b/app/src/main/java/com/android_app/matan/ara/sagi/thesocialnotework/MainActivity.java index 449c4c0..6b0988f 100644 --- a/app/src/main/java/com/android_app/matan/ara/sagi/thesocialnotework/MainActivity.java +++ b/app/src/main/java/com/android_app/matan/ara/sagi/thesocialnotework/MainActivity.java @@ -161,7 +161,8 @@ public class MainActivity extends AppCompatActivity ft.replace(R.id.fragment_container, gmapFragment); ft.commit(); } else if (id == R.id.nav_personal) { - + toolbar.setTitle("Personal Notes"); + setSupportActionBar(toolbar); Log.d(TAG, "Before going to personal"); ft.replace(R.id.fragment_container, personalFragment); ft.commit();