Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make master branch more stable #234

Merged
merged 66 commits into from
Jun 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
677262e
Change profile photo update progress bar
oindrilabhadra78 Jun 9, 2019
60e7ddf
Added Label for Edittext
somenath1435 Jun 9, 2019
f0d3426
added margin
somenath1435 Jun 9, 2019
49b850c
Cache skip in Glide
somenath1435 Jun 9, 2019
ede7682
Merge pull request #154 from dsciitpatna/profile-photo
atm1504 Jun 10, 2019
3fe4839
Merge pull request #155 from dsciitpatna/label_edittext
atm1504 Jun 10, 2019
76d352a
Merge pull request #161 from dsciitpatna/cache_glide
atm1504 Jun 10, 2019
1ddca86
Edit Profile back button handled
oindrilabhadra78 Jun 10, 2019
efd1cf4
Merge pull request #162 from dsciitpatna/back-press
atm1504 Jun 10, 2019
dae755a
feat: Implement group notificatio
atm1504 Jun 10, 2019
9d8fcb5
Merge pull request #163 from dsciitpatna/atm_group_notification
atm1504 Jun 10, 2019
a4ca918
feat: Implement change password api
atm1504 Jun 10, 2019
f19a4a1
Added Utils class
somenath1435 Jun 10, 2019
bfa9d06
reformat lines spacing
atm1504 Jun 10, 2019
10e7a7a
typo fix
atm1504 Jun 10, 2019
285b68c
Merge pull request #168 from dsciitpatna/atm_change_password
atm1504 Jun 10, 2019
4c7aa65
Removed unnecessary toast
somenath1435 Jun 10, 2019
bd7d8f9
Merge pull request #169 from dsciitpatna/utils
atm1504 Jun 10, 2019
5594a70
feat: Implement resend OTP API
atm1504 Jun 10, 2019
603ec36
Merge pull request #171 from dsciitpatna/atm_resend_api
atm1504 Jun 10, 2019
1414492
feat: Refactor logout, unsubscribe notification
atm1504 Jun 10, 2019
6126dc2
reformat spacing
atm1504 Jun 10, 2019
563411e
Merge pull request #176 from dsciitpatna/atm_code_refactor
atm1504 Jun 10, 2019
dbbb86f
Added back button in otp activity
somenath1435 Jun 11, 2019
8f462bd
Removed back button in Login page
somenath1435 Jun 11, 2019
5ee3ec3
Merge pull request #177 from dsciitpatna/otp_back_button
atm1504 Jun 11, 2019
ec4aa4b
Merge pull request #178 from dsciitpatna/login_remove_back_button
atm1504 Jun 11, 2019
072df24
feat: Handle offline mode in login signup
atm1504 Jun 11, 2019
70e2804
Merge pull request #182 from dsciitpatna/atm_no_internet_handle
atm1504 Jun 11, 2019
dcea18b
Handled empty edittext
somenath1435 Jun 12, 2019
36b1970
fix: Display employment type
atm1504 Jun 12, 2019
073d121
Merge pull request #185 from dsciitpatna/atm_employment_type_spinner
atm1504 Jun 12, 2019
c2d0e15
changed some fields
somenath1435 Jun 12, 2019
455f456
Merge pull request #183 from dsciitpatna/edittext_empty_signup
atm1504 Jun 12, 2019
ced30b9
View fullscreen gallery image
oindrilabhadra78 Jun 13, 2019
ee616b3
Add signup error dialog
oindrilabhadra78 Jun 13, 2019
58d8f26
empty edittext
somenath1435 Jun 13, 2019
eadacfc
Fixed Nav issue on back pressed
somenath1435 Jun 13, 2019
f8ece47
Handle back from profile page
somenath1435 Jun 13, 2019
e6c4fa5
Merge pull request #192 from dsciitpatna/empty_editext_other_pages
atm1504 Jun 14, 2019
a9e1709
Merge pull request #195 from dsciitpatna/nav_issue_home
atm1504 Jun 14, 2019
e0565fe
Merge pull request #197 from dsciitpatna/profile_back
atm1504 Jun 14, 2019
e1c2ea8
Merge branch 'development' into error-dialog
atm1504 Jun 14, 2019
c0fbc06
Merge pull request #193 from dsciitpatna/error-dialog
atm1504 Jun 14, 2019
545f4f6
Add scrollview
oindrilabhadra78 Jun 14, 2019
db7cdd0
Handled Orientation Change in Fragments
somenath1435 Jun 14, 2019
b40cfb4
Merge pull request #198 from dsciitpatna/scroll
atm1504 Jun 14, 2019
251cc0a
Merge pull request #200 from dsciitpatna/fragment_orientation
atm1504 Jun 15, 2019
a9ecf3e
Updated Retrofit link (#202)
somenath1435 Jun 15, 2019
998fe07
Added Videos Fragment (#203)
somenath1435 Jun 15, 2019
3807eb9
feat: Implement forgot password feature (#206)
atm1504 Jun 15, 2019
d09a7b3
Enhance UI of event details page (#208)
oindrilabhadra78 Jun 15, 2019
7f39d01
Visibility in View Profile incase of empty fields (#209)
somenath1435 Jun 15, 2019
55190d6
feat: Add videos of saar (#211)
atm1504 Jun 15, 2019
487054d
remove toast (#215)
oindrilabhadra78 Jun 15, 2019
640b2a9
Added Square Logo (#216)
somenath1435 Jun 15, 2019
88f8666
fix: skip press issue in login page (#218)
atm1504 Jun 15, 2019
a0279dc
Enhance ui of video fragment (#219)
oindrilabhadra78 Jun 16, 2019
d2c2237
Revert "fix: skip press issue in login page (#218)" (#220)
atm1504 Jun 16, 2019
b069b16
fix: Few UI improvements (#222)
somenath1435 Jun 17, 2019
de2f2b6
Otp pin (#223)
oindrilabhadra78 Jun 17, 2019
4dbbacc
remove log messages (#225)
oindrilabhadra78 Jun 17, 2019
e84e7ef
Mainactivity as opening screen (#230)
somenath1435 Jun 19, 2019
31ee997
patch: CircleImageView issue (#231)
somenath1435 Jun 19, 2019
391c850
fix: Check Permission properly (#227)
somenath1435 Jun 19, 2019
753da89
feat: Implement skip login feature (#233)
atm1504 Jun 20, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
Binary file added app/.DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ dependencies {
implementation 'com.android.volley:volley:1.1.1'
implementation 'com.jakewharton.timber:timber:4.7.0'
implementation 'com.github.GoodieBag:Pinview:v1.3'
implementation 'com.github.chrisbanes:PhotoView:2.1.3'
}
15 changes: 10 additions & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,25 @@
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".Login_SignUp.LoginSignupActivity"
android:windowSoftInputMode="adjustPan">
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Gallery.FullScreenImageActivity"
android:label="@string/photo" />
<activity
android:name=".Login_SignUp.LoginSignupActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".Profile.ProfileActivity"
android:parentActivityName=".MainActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ChangeCredentials.ChangeCredentialsActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ protected void onCreate(Bundle savedInstanceState) {
}else if (getIntent().getStringExtra("EXTRA").equals("openChangeEmail")){
ft.replace(R.id.fragment_credentials_container, new ChangeEmailFragment());
ft.commit();
} else if (getIntent().getStringExtra("EXTRA").equals("openChangePassword")){
ft.replace(R.id.fragment_credentials_container, new ChangePasswordFragment());
ft.commit();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand All @@ -25,6 +24,7 @@
import com.example.saar.Constant;
import com.example.saar.OtpActivity;
import com.example.saar.R;
import com.example.saar.Utils.Utils;

import org.json.JSONArray;
import org.json.JSONException;
Expand All @@ -46,11 +46,11 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View rootView = inflater.inflate(R.layout.fragment_change_email, container, false);
old_email=rootView.findViewById(R.id.old_email_text);
new_email=rootView.findViewById(R.id.new_email_text);
password=rootView.findViewById(R.id.password_text);
rollno=rootView.findViewById(R.id.roll_text);
emailChangeButton=rootView.findViewById(R.id.email_change_button);
old_email = rootView.findViewById(R.id.old_email_text);
new_email = rootView.findViewById(R.id.new_email_text);
password = rootView.findViewById(R.id.password_text);
rollno = rootView.findViewById(R.id.roll_text);
emailChangeButton = rootView.findViewById(R.id.email_change_button);
return rootView;
}

Expand All @@ -62,12 +62,24 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
emailChangeButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
requestEmailChange();
String old_email_text = old_email.getText().toString();
String new_email_text = new_email.getText().toString();
String password_text = password.getText().toString();
String roll_text = rollno.getText().toString();

if (old_email_text.isEmpty() || new_email_text.isEmpty() || password_text.isEmpty() || roll_text.isEmpty())
Toast.makeText(getContext(), getResources().getString(R.string.enter_all_fields), Toast.LENGTH_LONG).show();
else if (Utils.isNetworkConnected(getContext())) {
requestEmailChange();
} else {
Toast.makeText(getContext(), getString(R.string.no_internet), Toast.LENGTH_LONG).show();
}
}
});
}

private void requestEmailChange() {
Utils.closeKeyboard(getView(), getContext());
progressDialog = new ProgressDialog(getActivity());
progressDialog.setMessage("Sending request....");
progressDialog.show();
Expand All @@ -77,7 +89,6 @@ private void requestEmailChange() {
public void onResponse(String response) {
progressDialog.dismiss();
Timber.d(response);
Log.d("KHANKI","Response - " +response);
try {
JSONObject jsonObject = new JSONObject(response);
int status = Integer.parseInt(jsonObject.getString("status"));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,162 @@
package com.example.saar.ChangeCredentials;

import android.app.ProgressDialog;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

import com.android.volley.AuthFailureError;
import com.android.volley.DefaultRetryPolicy;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;
import com.example.saar.Constant;
import com.example.saar.Login_SignUp.LoginSignupActivity;
import com.example.saar.R;
import com.example.saar.Utils.Utils;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.HashMap;
import java.util.Map;

import timber.log.Timber;

public class ChangePasswordFragment extends Fragment {

EditText old_password, new_password, confirm_new_password;
Button reset_password;
ProgressDialog progressDialog;
SharedPreferences preferences;
SharedPreferences.Editor editor;
Boolean forgot_password = false;
String rollno;

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_change_password, container, false);
View rootView = inflater.inflate(R.layout.fragment_change_password, container, false);
old_password = rootView.findViewById(R.id.chng_old_password);
new_password = rootView.findViewById(R.id.chng_new_password);
confirm_new_password = rootView.findViewById(R.id.chng_confirm_new_password);
reset_password = rootView.findViewById(R.id.password_reset_button);
preferences = PreferenceManager.getDefaultSharedPreferences(getActivity());
editor = PreferenceManager.getDefaultSharedPreferences(getContext()).edit();
return rootView;
}

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
getActivity().setTitle(R.string.change_password_fragment);

if(getActivity().getIntent().hasExtra("rollno")){
forgot_password=true;
old_password.setText("Dummy");
view.findViewById(R.id.oldPasswordInputLayout).setVisibility(View.GONE);
rollno=getActivity().getIntent().getStringExtra("rollno");
}

reset_password.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String old_password_text = old_password.getText().toString();
String new_password_text = new_password.getText().toString();
String confirm_new_password_text = confirm_new_password.getText().toString();

if (old_password_text.isEmpty() || new_password_text.isEmpty() || confirm_new_password_text.isEmpty())
Toast.makeText(getContext(), getResources().getString(R.string.enter_all_fields), Toast.LENGTH_LONG).show();
else if (!(new_password_text.equals(confirm_new_password_text)))
Toast.makeText(getContext(), getResources().getString(R.string.password_mismatch), Toast.LENGTH_LONG).show();
else if (Utils.isNetworkConnected(getContext())) {
resetPassword();
} else {
Toast.makeText(getContext(), getString(R.string.no_internet), Toast.LENGTH_LONG).show();
}
}
});
}

private void resetPassword() {
Utils.closeKeyboard(getView(), getContext());
progressDialog = new ProgressDialog(getContext());
progressDialog.setMessage("Resetting....");
progressDialog.show();
StringRequest stringRequest = new StringRequest(Request.Method.POST, Constant.CHANGE_PASSWORD_URL, new Response.Listener<String>() {

@Override
public void onResponse(String response) {
Timber.d(response);
progressDialog.dismiss();
try {
JSONObject jsonObject = new JSONObject(response);
int status = Integer.parseInt(jsonObject.getString("status"));
if (status == 207) {
Toast.makeText(getContext(), getString(R.string.change_password_succesfull), Toast.LENGTH_LONG).show();
if(preferences.getBoolean(Constant.LOGIN_STATUS,false)){
Utils.unsuscribeFromNotification(preferences.getString(Constant.ROLLNO, ""));
Utils.logout(editor, getContext());
}else{
Intent intent = new Intent(getContext(), LoginSignupActivity.class);
startActivity(intent);
}

} else {

JSONArray jsonArray = jsonObject.getJSONArray("messages");
Toast.makeText(getActivity(), jsonArray.toString(), Toast.LENGTH_LONG).show();
Timber.d(jsonArray.toString());
}

} catch (JSONException e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
progressDialog.dismiss();
Timber.d(error.toString());
}

}) {
protected Map<String, String> getParams() throws AuthFailureError {
Map<String, String> params = new HashMap<String, String>();

params.put("old_password", old_password.getText().toString());
params.put("new_password", new_password.getText().toString());
params.put("confirm_password", confirm_new_password.getText().toString());
if(forgot_password){
params.put("forgot_password","forgot_password");
params.put("rollno",rollno);
}else{
params.put("rollno", preferences.getString(Constant.ROLLNO, ""));
}
return params;
}
};
stringRequest.setRetryPolicy(new DefaultRetryPolicy(
10000,
DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));

RequestQueue requestQueue = Volley.newRequestQueue(getContext());
Request<String> data = requestQueue.add(stringRequest);
}
}
Loading