diff --git a/.DS_Store b/.DS_Store
new file mode 100644
index 0000000..211732c
Binary files /dev/null and b/.DS_Store differ
diff --git a/app/.DS_Store b/app/.DS_Store
new file mode 100644
index 0000000..85e8888
Binary files /dev/null and b/app/.DS_Store differ
diff --git a/app/build.gradle b/app/build.gradle
index db147bd..ff84a83 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -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'
}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 8981784..973d2c9 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -18,20 +18,25 @@
android:theme="@style/AppTheme">
-
+ android:theme="@style/AppTheme.NoActionBar">
+
+
() {
+
+ @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 getParams() throws AuthFailureError {
+ Map params = new HashMap();
+
+ 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 data = requestQueue.add(stringRequest);
}
}
diff --git a/app/src/main/java/com/example/saar/ChangeCredentials/ForgotPasswordFragment.java b/app/src/main/java/com/example/saar/ChangeCredentials/ForgotPasswordFragment.java
index f977261..404a92a 100644
--- a/app/src/main/java/com/example/saar/ChangeCredentials/ForgotPasswordFragment.java
+++ b/app/src/main/java/com/example/saar/ChangeCredentials/ForgotPasswordFragment.java
@@ -1,5 +1,7 @@
package com.example.saar.ChangeCredentials;
+import android.app.ProgressDialog;
+import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
@@ -7,21 +9,126 @@
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.OtpActivity;
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 ForgotPasswordFragment extends Fragment {
+ EditText email, rollno;
+ Button forgotPassword;
+ ProgressDialog progressDialog;
+
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
- return inflater.inflate(R.layout.fragment_forgot_password, container, false);
+ View rootView = inflater.inflate(R.layout.fragment_forgot_password, container, false);
+ email = rootView.findViewById(R.id.email_text_forgot_password);
+ rollno = rootView.findViewById(R.id.roll_text_forgot_password);
+ forgotPassword = rootView.findViewById(R.id.forgot_password_button);
+ return rootView;
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
getActivity().setTitle(R.string.forgot_password);
+
+ forgotPassword.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ String email_text = email.getText().toString();
+ String rollno_text = rollno.getText().toString();
+ if (email_text.isEmpty() || rollno_text.isEmpty())
+ Toast.makeText(getContext(), getResources().getString(R.string.enter_all_fields), Toast.LENGTH_LONG).show();
+ else if (Utils.isNetworkConnected(getContext()))
+ requestDatas();
+ else
+ Toast.makeText(getContext(), getString(R.string.no_internet), Toast.LENGTH_LONG).show();
+ }
+ });
+ }
+
+ private void requestDatas() {
+ Utils.closeKeyboard(getView(), getContext());
+ progressDialog = new ProgressDialog(getContext());
+ progressDialog.setMessage("Requesting....");
+ progressDialog.show();
+ StringRequest stringRequest = new StringRequest(Request.Method.POST, Constant.FORGOT_PASSWORD_URL, new Response.Listener() {
+
+ @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 == 204) {
+ Timber.d(getString(R.string.success_forgot_password_request));
+ Toast.makeText(getContext(), getString(R.string.success_forgot_password_request), Toast.LENGTH_LONG).show();
+
+ Intent intent = new Intent(getContext(), OtpActivity.class);
+ intent.putExtra("rollno", rollno.getText().toString());
+ intent.putExtra("forgot_password", "forgot_password");
+ startActivity(intent);
+ } else {
+ Timber.d(getString(R.string.error_Forgot_password));
+ JSONArray jsonArray = jsonObject.getJSONArray("messages");
+ Toast.makeText(getContext(), jsonArray.toString(), Toast.LENGTH_LONG).show();
+ Timber.d(jsonArray.toString());
+ }
+
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+ }, new Response.ErrorListener() {
+ @Override
+ public void onErrorResponse(VolleyError error) {
+ //otp_progress.setVisibility(View.GONE);
+ progressDialog.dismiss();
+ Toast.makeText(getContext(), error.getLocalizedMessage(), Toast.LENGTH_LONG).show();
+ Timber.d(error.toString());
+ }
+
+ }) {
+ protected Map getParams() throws AuthFailureError {
+ Map params = new HashMap();
+ params.put("email", email.getText().toString());
+ params.put("rollno", rollno.getText().toString());
+ return params;
+ }
+ };
+ stringRequest.setRetryPolicy(new DefaultRetryPolicy(
+ 10000,
+ DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
+ DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
+
+ RequestQueue requestQueue = Volley.newRequestQueue(getContext());
+ Request data = requestQueue.add(stringRequest);
}
}
diff --git a/app/src/main/java/com/example/saar/Constant.java b/app/src/main/java/com/example/saar/Constant.java
index f7a1292..e157acc 100644
--- a/app/src/main/java/com/example/saar/Constant.java
+++ b/app/src/main/java/com/example/saar/Constant.java
@@ -8,13 +8,16 @@ public class Constant {
public static final String YOUTUBE_LINK = "https://www.youtube.com/channel/UCoAb1YggffbfgVxQyXaZB-g";
public static final String WEBSITE_LINK = "https://saar.iitp.ac.in/";
public static final String DONATE_LINK = "https://www.onlinesbi.com/sbicollect/icollecthome.htm";
- public static final String BASE_URL = "https://atm1504.in";
+ public static final String BASE_URL = "https://saar-server.000webhostapp.com";
public static final String LOGIN_URL = "https://saar-server.000webhostapp.com/functions/login.php";
public static final String OTP_URL = "https://saar-server.000webhostapp.com/functions/verifyOTP.php";
public static final String SIGNUP_URL = "https://saar-server.000webhostapp.com/functions/signup.php";
public static final String CHANGE_EMAIL_URL = "https://saar-server.000webhostapp.com/functions/changeEmail.php";
public static final String UPDATE_PROFILE_URL = "https://saar-server.000webhostapp.com/functions/updateProfile.php";
- public static final String UPDATE_PROFILE_IMAGE = "https://saar-server.000webhostapp.com/functions/profile_image.php";
+ public static final String UPDATE_PROFILE_IMAGE_URL = "https://saar-server.000webhostapp.com/functions/profile_image.php";
+ public static final String CHANGE_PASSWORD_URL = "https://saar-server.000webhostapp.com/functions/changePassword.php";
+ public static final String RESEND_OTP_URL = "https://saar-server.000webhostapp.com/functions/resendOTP.php";
+ public static final String FORGOT_PASSWORD_URL = "https://saar-server.000webhostapp.com/functions/forgotPassword.php";
//Store user profile data
public static final String LOGIN_STATUS = "login_status";
@@ -39,4 +42,8 @@ public class Constant {
public static final String ACHIEVEMENTS = "achievements";
public static final String IMG_URL = "img_url";
+ //Utility Constants
+ public static final String SUBSCRIBE_NOTIFICATION = "subscribe_notification";
+ public static final String SKIP_LOGIN = "skip_login";
+
}
diff --git a/app/src/main/java/com/example/saar/Gallery/FullScreenImageActivity.java b/app/src/main/java/com/example/saar/Gallery/FullScreenImageActivity.java
new file mode 100644
index 0000000..d92c86d
--- /dev/null
+++ b/app/src/main/java/com/example/saar/Gallery/FullScreenImageActivity.java
@@ -0,0 +1,59 @@
+package com.example.saar.Gallery;
+
+import android.graphics.drawable.ColorDrawable;
+import android.os.Build;
+import android.os.Bundle;
+import android.support.v7.app.AppCompatActivity;
+import android.view.KeyEvent;
+import android.view.MenuItem;
+import android.view.Window;
+import android.view.WindowManager;
+
+import com.bumptech.glide.Glide;
+import com.example.saar.R;
+import com.github.chrisbanes.photoview.PhotoView;
+
+public class FullScreenImageActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ setContentView(R.layout.activity_full_screen_image);
+
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+ getSupportActionBar().setDisplayShowHomeEnabled(true);
+
+ getSupportActionBar().setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.black)));
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ Window window = getWindow();
+ window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
+ window.setStatusBarColor(getResources().getColor(R.color.black));
+ }
+
+ PhotoView image = findViewById(R.id.imageViewPhoto);
+
+ String url = getIntent().getStringExtra("image_url");
+
+ Glide.with(this).load(url)
+ .error(R.drawable.placeholder_image)
+ .into(image);
+
+ }
+
+ public boolean onOptionsItemSelected(MenuItem item) {
+ int id = item.getItemId();
+ if (id == android.R.id.home) {
+ onBackPressed();
+ }
+ return super.onOptionsItemSelected(item);
+ }
+
+ @Override
+ public boolean onKeyDown(int keyCode, KeyEvent event) {
+ if ((keyCode == KeyEvent.KEYCODE_BACK)) {
+ finish();
+ }
+ return super.onKeyDown(keyCode, event);
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/saar/Gallery/GalleryAdapter.java b/app/src/main/java/com/example/saar/Gallery/GalleryAdapter.java
index fa482de..c763e7d 100644
--- a/app/src/main/java/com/example/saar/Gallery/GalleryAdapter.java
+++ b/app/src/main/java/com/example/saar/Gallery/GalleryAdapter.java
@@ -1,6 +1,7 @@
package com.example.saar.Gallery;
import android.content.Context;
+import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
@@ -15,7 +16,7 @@
public class GalleryAdapter extends RecyclerView.Adapter {
- private List photoList;
+ private static List photoList;
private Context context;
public GalleryAdapter(List photoList) {
@@ -53,6 +54,15 @@ public class GalleryViewHolder extends RecyclerView.ViewHolder {
public GalleryViewHolder(View view) {
super(view);
imageView = view.findViewById(R.id.imageview_gallery);
+
+ imageView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Intent intent = new Intent(context, FullScreenImageActivity.class);
+ intent.putExtra("image_url", GalleryAdapter.photoList.get(getLayoutPosition()).getImage_url());
+ context.startActivity(intent);
+ }
+ });
}
}
}
diff --git a/app/src/main/java/com/example/saar/Home/HomeFragment.java b/app/src/main/java/com/example/saar/Home/HomeFragment.java
index 54e45f0..83cabab 100644
--- a/app/src/main/java/com/example/saar/Home/HomeFragment.java
+++ b/app/src/main/java/com/example/saar/Home/HomeFragment.java
@@ -12,6 +12,7 @@
import android.widget.TextView;
import com.example.saar.About.AboutUsFragment;
+import com.example.saar.ChangeCredentials.ForgotPasswordFragment;
import com.example.saar.Contact.ContactFragment;
import com.example.saar.Donate.DonateFragment;
import com.example.saar.Gallery.GalleryFragment;
@@ -24,7 +25,10 @@ public class HomeFragment extends Fragment implements View.OnClickListener {
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
- return inflater.inflate(R.layout.fragment_home, container, false);
+ View rootView = inflater.inflate(R.layout.fragment_home, container, false);
+ rootView.findViewById(R.id.homepage_abhinav_civ).setLayerType(View.LAYER_TYPE_SOFTWARE, null);
+ rootView.findViewById(R.id.homepage_vivek_civ).setLayerType(View.LAYER_TYPE_SOFTWARE, null);
+ return rootView;
}
@Override
diff --git a/app/src/main/java/com/example/saar/Login_SignUp/LoginFragment.java b/app/src/main/java/com/example/saar/Login_SignUp/LoginFragment.java
index adcc941..749b6e0 100644
--- a/app/src/main/java/com/example/saar/Login_SignUp/LoginFragment.java
+++ b/app/src/main/java/com/example/saar/Login_SignUp/LoginFragment.java
@@ -7,7 +7,6 @@
import android.preference.PreferenceManager;
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;
@@ -29,6 +28,7 @@
import com.example.saar.MainActivity;
import com.example.saar.OtpActivity;
import com.example.saar.R;
+import com.example.saar.Utils.Utils;
import org.json.JSONArray;
import org.json.JSONException;
@@ -87,6 +87,8 @@ public void onClick(View v) {
skipLogin.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
+ sharedPreferenceEditor.putBoolean(Constant.SKIP_LOGIN,true);
+ sharedPreferenceEditor.apply();
Intent intent = new Intent(getActivity(), MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
@@ -110,13 +112,17 @@ private void getDatas() {
if (email.isEmpty() || password.isEmpty()) {
Toast.makeText(getContext(), getString(R.string.credential_empty), Toast.LENGTH_LONG).show();
- } else {
+ } else if (Utils.isNetworkConnected(getContext())) {
login();
+ } else {
+ Toast.makeText(getContext(), getString(R.string.no_internet), Toast.LENGTH_LONG).show();
}
}
private void login() {
+ //closing soft Keyboard using Utils class method
+ Utils.closeKeyboard(getView(), getContext());
progressDialog = new ProgressDialog(getContext());
progressDialog.setMessage("Logging in....");
progressDialog.show();
diff --git a/app/src/main/java/com/example/saar/Login_SignUp/LoginSignupActivity.java b/app/src/main/java/com/example/saar/Login_SignUp/LoginSignupActivity.java
index d3ab4ff..ec2cded 100644
--- a/app/src/main/java/com/example/saar/Login_SignUp/LoginSignupActivity.java
+++ b/app/src/main/java/com/example/saar/Login_SignUp/LoginSignupActivity.java
@@ -40,9 +40,6 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
BottomNavigationView navigation = findViewById(R.id.bottom_navigation);
navigation.setOnNavigationItemSelectedListener(this);
- //setting back button in toolbar
- getSupportActionBar().setDisplayHomeAsUpEnabled(true);
- getSupportActionBar().setDisplayShowHomeEnabled(true);
}
}
@@ -75,18 +72,11 @@ private boolean loadFragment(Fragment fragment) {
return false;
}
- @Override
- public boolean onSupportNavigateUp() {
- //handle back button action
- onBackPressed();
- return true;
- }
-
@Override
public void onBackPressed() {
super.onBackPressed();
Intent intent = new Intent(getApplicationContext(), MainActivity.class);
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
- finish();
}
}
diff --git a/app/src/main/java/com/example/saar/Login_SignUp/SignUpFragment.java b/app/src/main/java/com/example/saar/Login_SignUp/SignUpFragment.java
index fc6cfa5..cb2a66f 100644
--- a/app/src/main/java/com/example/saar/Login_SignUp/SignUpFragment.java
+++ b/app/src/main/java/com/example/saar/Login_SignUp/SignUpFragment.java
@@ -1,7 +1,9 @@
package com.example.saar.Login_SignUp;
import android.app.DatePickerDialog;
+import android.app.Dialog;
import android.app.ProgressDialog;
+import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
@@ -11,12 +13,12 @@
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import android.view.Window;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.EditText;
-import android.widget.ProgressBar;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
@@ -32,6 +34,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;
@@ -41,6 +44,7 @@
import java.util.HashMap;
import java.util.Map;
+import okhttp3.internal.Util;
import timber.log.Timber;
public class SignUpFragment extends Fragment {
@@ -50,7 +54,7 @@ public class SignUpFragment extends Fragment {
TextView errorsDisplay;
Spinner spinnerGraduationYear, spinnerEmploymentType, spinnerDegree, spinnerDepartment;
DatePickerDialog.OnDateSetListener setListener;
- Button signupButton;
+ Button signupButton, errorOkButton;
int year, month, day;
String rollno, first_name, last_name, email, phone, fb_link, linkedin_link, password, confirm_password, dob, graduation_year, degree, department;
String employment_type, present_employer, designation, address, country, state, city, achievements;
@@ -108,9 +112,6 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
city_text = rootView.findViewById(R.id.city_edit);
achievements_text = rootView.findViewById(R.id.achievements_edit);
- errorsDisplay = rootView.findViewById(R.id.signup_errors);
- errorsDisplay.setVisibility(View.GONE);
-
return rootView;
}
@@ -184,9 +185,6 @@ public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) {
signupButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
- progressDialog = new ProgressDialog(getContext());
- progressDialog.setMessage("Registering....");
- progressDialog.show();
getDatas();
}
});
@@ -212,10 +210,23 @@ private void getDatas() {
city = city_text.getText().toString();
achievements = achievements_text.getText().toString();
- registerUser();
+ if (rollno.isEmpty() || first_name.isEmpty() || email.isEmpty() || phone.isEmpty() ||
+ password.isEmpty() || confirm_password.isEmpty()) {
+ Toast.makeText(getContext(), getResources().getString(R.string.empty_edittext_in_signup), Toast.LENGTH_LONG).show();
+ } else if (Utils.isNetworkConnected(getContext())) {
+ registerUser();
+ } else {
+ Toast.makeText(getContext(), getString(R.string.no_internet), Toast.LENGTH_LONG).show();
+ }
+
}
private void registerUser() {
+ //closing soft Keyboard using Utils class method
+ Utils.closeKeyboard(getView(), getContext());
+ progressDialog = new ProgressDialog(getContext());
+ progressDialog.setMessage("Registering....");
+ progressDialog.show();
StringRequest stringRequest = new StringRequest(Request.Method.POST, Constant.SIGNUP_URL, new Response.Listener() {
@@ -239,9 +250,7 @@ public void onResponse(String response) {
JSONArray jsonArray = jsonObject.getJSONArray("messages");
Timber.d(getString(R.string.signup_failed));
- Toast.makeText(getContext(), getString(R.string.signup_failed), Toast.LENGTH_LONG).show();
- errorsDisplay.setVisibility(View.VISIBLE);
- errorsDisplay.setText(jsonArray.toString());
+ showDialog(getActivity(), jsonArray.toString());
}
} catch (JSONException e) {
@@ -292,4 +301,23 @@ protected Map getParams() throws AuthFailureError {
RequestQueue requestQueue = Volley.newRequestQueue(getContext());
Request data = requestQueue.add(stringRequest);
}
+
+ public void showDialog(Context context, String mssg) {
+ final Dialog dialog = new Dialog(context);
+ dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
+ dialog.setCancelable(false);
+ dialog.setContentView(R.layout.signup_error_dialog);
+
+ errorsDisplay = dialog.findViewById(R.id.signup_error_text);
+ errorsDisplay.setText(mssg);
+
+ errorOkButton = dialog.findViewById(R.id.dialog_ok);
+ errorOkButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ dialog.dismiss();
+ }
+ });
+ dialog.show();
+ }
}
diff --git a/app/src/main/java/com/example/saar/MainActivity.java b/app/src/main/java/com/example/saar/MainActivity.java
index 25df3bb..1f07108 100644
--- a/app/src/main/java/com/example/saar/MainActivity.java
+++ b/app/src/main/java/com/example/saar/MainActivity.java
@@ -4,10 +4,8 @@
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
-import android.net.Uri;
import android.os.Bundle;
import android.preference.PreferenceManager;
-import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.design.widget.NavigationView;
@@ -36,11 +34,12 @@
import com.example.saar.Share.ShareFragment;
import com.example.saar.Team.TeamFragment;
import com.example.saar.Timeline_Events.TimelineFragment;
-import com.google.android.gms.tasks.OnCompleteListener;
-import com.google.android.gms.tasks.Task;
+import com.example.saar.Utils.Utils;
+import com.example.saar.Video.VideosFragment;
import com.google.firebase.messaging.FirebaseMessaging;
import de.hdodenhof.circleimageview.CircleImageView;
+import timber.log.Timber;
public class MainActivity extends AppCompatActivity
implements NavigationView.OnNavigationItemSelectedListener {
@@ -48,9 +47,10 @@ public class MainActivity extends AppCompatActivity
//creating fragment object
Fragment fragment = null;
SharedPreferences preferences;
- SharedPreferences.Editor editor;
+ SharedPreferences.Editor editor, notifications;
TextView name, email;
CircleImageView circleImageView;
+ NavigationView navigationView;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -60,13 +60,18 @@ protected void onCreate(Bundle savedInstanceState) {
setSupportActionBar(toolbar);
preferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
+
+ if(!preferences.getBoolean(Constant.LOGIN_STATUS,false) && !preferences.getBoolean(Constant.SKIP_LOGIN,false)){
+ startActivity(new Intent(this, LoginSignupActivity.class));
+ }
+
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawer.addDrawerListener(toggle);
toggle.syncState();
- NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
+ navigationView = (NavigationView) findViewById(R.id.nav_view);
Menu nav_item = navigationView.getMenu();
if (preferences.getBoolean(Constant.LOGIN_STATUS, false))
nav_item.findItem(R.id.nav_profile).setVisible(true);
@@ -84,6 +89,7 @@ protected void onCreate(Bundle savedInstanceState) {
LinearLayout header = (LinearLayout) headerview.findViewById(R.id.nav_layout);
name = headerview.findViewById(R.id.nav_header_name);
email = headerview.findViewById(R.id.nav_header_email);
+ header.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
circleImageView = headerview.findViewById(R.id.nav_header_image);
setHeaderData();
header.setOnClickListener(new View.OnClickListener() {
@@ -105,20 +111,27 @@ public void onClick(View v) {
}
private void subscribeForNotification() {
- FirebaseMessaging.getInstance().subscribeToTopic("alumnus")
- .addOnCompleteListener(new OnCompleteListener() {
- @Override
- public void onComplete(@NonNull Task task) {
- String msg = getString(R.string.msg_subscribed);
- if (!task.isSuccessful()) {
- msg = getString(R.string.msg_subscribe_failed);
- }
- Toast.makeText(MainActivity.this, msg, Toast.LENGTH_SHORT).show();
- }
- });
+ notifications = PreferenceManager.getDefaultSharedPreferences(this).edit();
+ if (!preferences.getBoolean(Constant.SUBSCRIBE_NOTIFICATION, false)) {
+ FirebaseMessaging.getInstance().subscribeToTopic("alumnus");
+ if (preferences.getBoolean(Constant.LOGIN_STATUS, false)) {
+ String rollno = preferences.getString(Constant.ROLLNO, "");
+
+ String batch = Utils.getBatch(rollno);
+ String department = Utils.getDepartment(rollno);
+ FirebaseMessaging.getInstance().subscribeToTopic(batch);
+ FirebaseMessaging.getInstance().subscribeToTopic(department);
+ }
+
+ notifications.putBoolean(Constant.SUBSCRIBE_NOTIFICATION, true);
+ notifications.apply();
+ Toast.makeText(MainActivity.this, getString(R.string.msg_subscribed), Toast.LENGTH_SHORT).show();
+ Timber.d("Subscribed to notification.");
+ }
}
private void showHomeFragment() {
+ navigationView.setCheckedItem(R.id.nav_home);
fragment = new HomeFragment();
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.replace(R.id.content_frame, fragment);
@@ -143,17 +156,20 @@ public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main, menu);
MenuItem login = menu.findItem(R.id.action_login_signup);
MenuItem logout = menu.findItem(R.id.action_logout);
- MenuItem change_email=menu.findItem(R.id.action_change_email);
+ MenuItem change_email = menu.findItem(R.id.action_change_email);
+ MenuItem change_password = menu.findItem(R.id.action_change_password);
if (preferences.getBoolean(Constant.LOGIN_STATUS, false)) {
//user is logged in
login.setVisible(false);
logout.setVisible(true);
change_email.setVisible(true);
+ change_password.setVisible(true);
} else {
//user is not logged in
login.setVisible(true);
logout.setVisible(false);
change_email.setVisible(false);
+ change_password.setVisible(false);
}
return true;
}
@@ -175,9 +191,11 @@ public boolean onOptionsItemSelected(MenuItem item) {
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
- clearData();
+ editor = preferences.edit();
+ Utils.unsuscribeFromNotification(preferences.getString(Constant.ROLLNO, ""));
+ Utils.logout(editor, MainActivity.this);
finish();
- startActivity(new Intent(MainActivity.this,LoginSignupActivity.class));
+
}
})
.setNegativeButton("No", new DialogInterface.OnClickListener() {
@@ -191,6 +209,10 @@ public void onClick(DialogInterface dialog, int which) {
Intent intent = new Intent(this, ChangeCredentialsActivity.class);
intent.putExtra("EXTRA", "openChangeEmail");
startActivity(intent);
+ } else if (id == R.id.action_change_password) {
+ Intent intent = new Intent(this, ChangeCredentialsActivity.class);
+ intent.putExtra("EXTRA", "openChangePassword");
+ startActivity(intent);
}
return super.onOptionsItemSelected(item);
@@ -229,11 +251,9 @@ private void displaySelectedScreen(int itemId) {
case R.id.nav_share:
fragment = new ShareFragment();
break;
- case R.id.nav_map:
- //opens map app to display IIT Patna Administration Building
- Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
- Uri.parse("geo:0,0?q=" + getResources().getString(R.string.admin_block)));
- startActivity(intent);
+ case R.id.nav_videos:
+ fragment = new VideosFragment();
+ break;
case R.id.nav_contact_us:
fragment = new ContactFragment();
break;
@@ -263,6 +283,8 @@ private void setHeaderData() {
Glide.with(this)
.load(preferences.getString(Constant.IMG_URL, ""))
.centerCrop()
+ .diskCacheStrategy(DiskCacheStrategy.NONE)
+ .skipMemoryCache(true)
.placeholder(R.drawable.ic_account_circle_black_48dp)
.into(circleImageView);
} else {
@@ -272,34 +294,4 @@ private void setHeaderData() {
circleImageView.setImageResource(R.drawable.ic_account_circle_black_48dp);
}
}
-
- private void clearData() {
- editor = preferences.edit();
- if (preferences.getBoolean(Constant.LOGIN_STATUS, false)) {
- //user is logged in and wants to log out
- editor.putBoolean(Constant.LOGIN_STATUS, false);
- editor.putString(Constant.ROLLNO, "");
- editor.putString(Constant.FIRST_NAME, "");
- editor.putString(Constant.LAST_NAME, "");
- editor.putString(Constant.EMAIL, "");
- editor.putString(Constant.PHONE, "");
- editor.putString(Constant.FB_LINK, "");
- editor.putString(Constant.LINKEDIN_LINK, "");
- editor.putString(Constant.DOB, "");
- editor.putString(Constant.GRADUATION_YEAR, "");
- editor.putString(Constant.DEGREE, "");
- editor.putString(Constant.DEPARTMENT, "");
- editor.putString(Constant.EMPLOYEMENT_TYPE, "");
- editor.putString(Constant.PRESENT_EMPLOYER, "");
- editor.putString(Constant.DESIGNATION, "");
- editor.putString(Constant.ADDRESS, "");
- editor.putString(Constant.COUNTRY, "");
- editor.putString(Constant.CITY, "");
- editor.putString(Constant.STATE, "");
- editor.putString(Constant.ACHIEVEMENTS, "");
- editor.apply();
- Toast.makeText(this, "Logged Out", Toast.LENGTH_LONG).show();
- } else
- Toast.makeText(this, "Not Logged In", Toast.LENGTH_LONG).show();
- }
}
diff --git a/app/src/main/java/com/example/saar/Notifications/FcmMessagingService.java b/app/src/main/java/com/example/saar/Notifications/FcmMessagingService.java
index 96acc1c..c4743d2 100644
--- a/app/src/main/java/com/example/saar/Notifications/FcmMessagingService.java
+++ b/app/src/main/java/com/example/saar/Notifications/FcmMessagingService.java
@@ -10,21 +10,18 @@
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Build;
-import android.support.annotation.NonNull;
import android.support.v4.app.NotificationCompat;
-import android.util.Log;
-import android.widget.Toast;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.ImageRequest;
import com.example.saar.MainActivity;
import com.example.saar.R;
-import com.google.android.gms.tasks.OnCompleteListener;
-import com.google.firebase.messaging.FirebaseMessaging;
import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
+import timber.log.Timber;
+
public class FcmMessagingService extends FirebaseMessagingService {
@Override
@@ -91,6 +88,6 @@ public void onErrorResponse(VolleyError error) {
@Override
public void onNewToken(String token) {
super.onNewToken(token);
- Log.d("FCMTOKEN", "Token- " + token);
+ Timber.d("fcmToken - " + token);
}
}
diff --git a/app/src/main/java/com/example/saar/OtpActivity.java b/app/src/main/java/com/example/saar/OtpActivity.java
index 60aac27..f7d4869 100644
--- a/app/src/main/java/com/example/saar/OtpActivity.java
+++ b/app/src/main/java/com/example/saar/OtpActivity.java
@@ -6,10 +6,10 @@
import android.os.CountDownTimer;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.AppCompatActivity;
+import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
-import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
@@ -21,6 +21,7 @@
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;
+import com.example.saar.ChangeCredentials.ChangeCredentialsActivity;
import com.example.saar.Login_SignUp.LoginSignupActivity;
import com.goodiebag.pinview.Pinview;
@@ -43,20 +44,23 @@ public class OtpActivity extends AppCompatActivity {
private int counter;
Pinview pinview;
FloatingActionButton sendOTP;
- String otpValue, rollno;
+ String otpValue = "", rollno;
ProgressDialog progressDialog;
+ Boolean forgot_password = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_otp);
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+ getSupportActionBar().setDisplayShowHomeEnabled(true);
+
pinview = (Pinview) findViewById(R.id.otpView);
pinview.setPinViewEventListener(new Pinview.PinViewEventListener() {
@Override
public void onDataEntered(Pinview pinview, boolean fromUser) {
- Toast.makeText(getApplicationContext(), pinview.getValue(), Toast.LENGTH_SHORT).show();
otpValue = pinview.getValue();
}
});
@@ -66,18 +70,23 @@ public void onDataEntered(Pinview pinview, boolean fromUser) {
timer = (TextView) findViewById(R.id.timer);
resend = (Button) findViewById(R.id.resend_button);
- setUpTimer();
-
//Test case if user wants to verify after some time
if (getIntent().hasExtra("rollno")) {
rollno = getIntent().getStringExtra("rollno");
getIntent().removeExtra("rollno");
otpRollNo.setVisibility(View.INVISIBLE);
otpRollNo.setText(rollno);
+ setUpTimer();
} else {
otpRollNo.setVisibility(View.VISIBLE);
+ resend.setVisibility(View.VISIBLE);
}
+ if (getIntent().hasExtra("forgot_password")) {
+ forgot_password = true;
+ } else {
+ forgot_password = false;
+ }
//Action to be performed when the sending otp button is pressed
sendOTP = (FloatingActionButton) findViewById(R.id.otp_next);
sendOTP.setOnClickListener(new View.OnClickListener() {
@@ -93,15 +102,87 @@ public void onClick(View v) {
}
});
+ resend.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ resendOTP();
+ }
+ });
+
+ }
+
+ private void resendOTP() {
+ rollno = otpRollNo.getText().toString();
+
+ if (rollno.isEmpty()) {
+ Toast.makeText(this, getString(R.string.rollno_otp), Toast.LENGTH_LONG).show();
+ } else {
+ for (int i = 0; i < pinview.getPinLength(); i++) {
+ pinview.onKey(pinview.getFocusedChild(), KeyEvent.KEYCODE_DEL, new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_DEL));
+ }
+ final ProgressDialog resendProgressDialog = new ProgressDialog(this);
+ resendProgressDialog.setMessage("Resending....");
+ resendProgressDialog.show();
+ StringRequest stringRequest = new StringRequest(Request.Method.POST, Constant.RESEND_OTP_URL, new Response.Listener() {
+
+ @Override
+ public void onResponse(String response) {
+ Timber.d(response);
+ resendProgressDialog.dismiss();
+ resend.setVisibility(View.GONE);
+ setUpTimer();
+ try {
+ JSONObject jsonObject = new JSONObject(response);
+ int status = Integer.parseInt(jsonObject.getString("status"));
+ if (status == 201) {
+ Timber.d(getString(R.string.otp_verified));
+ Toast.makeText(OtpActivity.this, getString(R.string.resend_otp_succesfull), Toast.LENGTH_LONG).show();
+ otpRollNo.setVisibility(View.GONE);
+
+ } else {
+
+ JSONArray jsonArray = jsonObject.getJSONArray("messages");
+ Toast.makeText(OtpActivity.this, jsonArray.toString(), Toast.LENGTH_LONG).show();
+ Timber.d(jsonArray.toString());
+ }
+
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+ }, new Response.ErrorListener() {
+ @Override
+ public void onErrorResponse(VolleyError error) {
+ resendProgressDialog.dismiss();
+ Timber.d(error.toString());
+ }
+
+ }) {
+ protected Map getParams() throws AuthFailureError {
+ Map params = new HashMap();
+ params.put("rollno", rollno);
+ return params;
+ }
+ };
+ stringRequest.setRetryPolicy(new DefaultRetryPolicy(
+ 10000,
+ DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
+ DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
+
+ RequestQueue requestQueue = Volley.newRequestQueue(OtpActivity.this);
+ Request data = requestQueue.add(stringRequest);
+ }
}
private void setUpTimer() {
- new CountDownTimer(30000, 1000) {
+ new CountDownTimer(60000, 1000) {
public void onTick(long millisUntilFinished) {
int time = valueOf(counter);
- time = 30 - time;
- if (time >= 10)
+ time = 60 - time;
+ if (time == 60)
+ timer.setText("1:00");
+ else if (time >= 10)
timer.setText("0:" + time);
else
timer.setText("0:0" + time);
@@ -118,11 +199,11 @@ public void onFinish() {
public void run() {
resend.setVisibility(View.VISIBLE);
}
- }, 30000);
+ }, 60000);
}
private void verifyOTP() {
- progressDialog = new ProgressDialog(getBaseContext());
+ progressDialog = new ProgressDialog(this);
progressDialog.setMessage("Verifying....");
progressDialog.show();
StringRequest stringRequest = new StringRequest(Request.Method.POST, Constant.OTP_URL, new Response.Listener() {
@@ -141,11 +222,21 @@ public void onResponse(String response) {
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
+ } else if (status == 208) {
+ Timber.d(getString(R.string.forgot_password_success));
+ Intent intent = new Intent(OtpActivity.this, ChangeCredentialsActivity.class);
+ intent.putExtra("EXTRA", "openChangePassword");
+ intent.putExtra("rollno", rollno);
+ startActivity(intent);
+
} else {
JSONArray jsonArray = jsonObject.getJSONArray("messages");
Toast.makeText(OtpActivity.this, jsonArray.toString(), Toast.LENGTH_LONG).show();
Timber.d(jsonArray.toString());
+ for (int i = 0; i < pinview.getPinLength(); i++) {
+ pinview.onKey(pinview.getFocusedChild(), KeyEvent.KEYCODE_DEL, new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_DEL));
+ }
}
} catch (JSONException e) {
@@ -164,6 +255,9 @@ protected Map getParams() throws AuthFailureError {
Map params = new HashMap();
params.put("rollno", rollno);
params.put("verification_code", otpValue);
+ if (forgot_password) {
+ params.put("forgot_password", "forgot_password");
+ }
return params;
}
};
diff --git a/app/src/main/java/com/example/saar/Profile/EditProfileFragment.java b/app/src/main/java/com/example/saar/Profile/EditProfileFragment.java
index c998a3a..6d920e3 100644
--- a/app/src/main/java/com/example/saar/Profile/EditProfileFragment.java
+++ b/app/src/main/java/com/example/saar/Profile/EditProfileFragment.java
@@ -5,9 +5,11 @@
import android.app.Fragment;
import android.app.FragmentTransaction;
import android.app.ProgressDialog;
+import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
+import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
@@ -16,15 +18,16 @@
import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.app.ActivityCompat;
+import android.support.v4.content.ContextCompat;
import android.util.Base64;
-import android.util.Log;
+import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
-import android.widget.ImageView;
+import android.widget.ProgressBar;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
@@ -40,7 +43,6 @@
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.example.saar.Constant;
-import com.example.saar.OtpActivity;
import com.example.saar.R;
import org.json.JSONArray;
@@ -59,6 +61,7 @@ public class EditProfileFragment extends Fragment {
Spinner spinnerEmploymentType;
String employment_type;
+ Integer employment_type_position;
FloatingActionButton change_photo_button;
SharedPreferences preferences;
SharedPreferences.Editor sharedPreferenceEditor;
@@ -70,6 +73,7 @@ public class EditProfileFragment extends Fragment {
private static Integer RECORD_REQUEST_CODE = 101;
Bitmap myBitmap;
ProgressDialog progressDialog;
+ ProgressBar progressBar;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
@@ -84,6 +88,8 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
preferences = PreferenceManager.getDefaultSharedPreferences(getActivity());
sharedPreferenceEditor = PreferenceManager.getDefaultSharedPreferences(getActivity()).edit();
+ employment_type_position = spinnerEmploymentTypeArrayAdapter.getPosition(preferences.getString(Constant.EMPLOYEMENT_TYPE, ""));
+
setupViews(rootView);
setUpUi();
@@ -115,6 +121,36 @@ public void onClick(View v) {
}
});
+ rootView.setFocusableInTouchMode(true);
+ rootView.requestFocus();
+
+ rootView.setOnKeyListener(new View.OnKeyListener() {
+ @Override
+ public boolean onKey(View v, int keyCode, KeyEvent event) {
+ if (event.getAction() == KeyEvent.ACTION_DOWN) {
+ if (keyCode == KeyEvent.KEYCODE_BACK) {
+ AlertDialog.Builder alert = new AlertDialog.Builder(getActivity());
+ alert.setMessage("Do you want to exit without saving changes?").setCancelable(false)
+ .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ FragmentTransaction ft = getFragmentManager().beginTransaction();
+ ft.replace(R.id.fragment_profile_container, new ViewProfileFragment());
+ ft.commit();
+ }
+ })
+ .setNegativeButton("No", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ dialog.cancel();
+ }
+ }).show();
+ return true;
+ }
+ }
+ return false;
+ }
+ });
return rootView;
}
@@ -133,6 +169,7 @@ private void setupViews(View rootView) {
state_view = rootView.findViewById(R.id.edit_state);
achievements_view = rootView.findViewById(R.id.edit_achievements);
change_photo_button = rootView.findViewById(R.id.profile_fab);
+ progressBar = rootView.findViewById(R.id.edit_profile_photo_progress);
}
//Function that fills the views with the datas
@@ -155,6 +192,7 @@ private void setUpUi() {
city_view.setText(preferences.getString(Constant.CITY, ""));
state_view.setText(preferences.getString(Constant.STATE, ""));
achievements_view.setText(preferences.getString(Constant.ACHIEVEMENTS, ""));
+ spinnerEmploymentType.setSelection(employment_type_position);
}
@@ -308,13 +346,23 @@ public void onClick(DialogInterface dialog,
}
private void getPhotoFromCamera() {
- Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
- startActivityForResult(intent, CAMERA);
+ if (ContextCompat.checkSelfPermission(getActivity().getApplicationContext(), Manifest.permission.CAMERA)
+ == PackageManager.PERMISSION_DENIED)
+ makeRequest();
+ else {
+ Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
+ startActivityForResult(intent, CAMERA);
+ }
}
private void choosePhotoFromGallery() {
- Intent galIntent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
- startActivityForResult(galIntent, GALLERY);
+ if (ContextCompat.checkSelfPermission(getActivity().getApplicationContext(), Manifest.permission.WRITE_EXTERNAL_STORAGE)
+ == PackageManager.PERMISSION_DENIED)
+ makeRequest();
+ else {
+ Intent galIntent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
+ startActivityForResult(galIntent, GALLERY);
+ }
}
@Override
@@ -351,15 +399,14 @@ public String getStringImage(Bitmap bmp) {
}
private void uploadFile() {
-
- progressDialog = new ProgressDialog(getActivity());
- progressDialog.setMessage("Uploading image....");
- progressDialog.show();
- StringRequest stringRequest = new StringRequest(Request.Method.POST, Constant.UPDATE_PROFILE_IMAGE, new Response.Listener() {
+ progressBar.setVisibility(View.VISIBLE);
+ change_photo_button.hide();
+ StringRequest stringRequest = new StringRequest(Request.Method.POST, Constant.UPDATE_PROFILE_IMAGE_URL, new Response.Listener() {
@Override
public void onResponse(String response) {
- progressDialog.dismiss();
+ progressBar.setVisibility(View.INVISIBLE);
+ change_photo_button.show();
Toast.makeText(getActivity(), response, Toast.LENGTH_LONG).show();
try {
@@ -370,7 +417,7 @@ public void onResponse(String response) {
Toast.makeText(getActivity(), getString(R.string.img_upload_success), Toast.LENGTH_LONG).show();
JSONObject mJsonObject = jsonObject.getJSONObject("messages");
SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(getActivity()).edit();
- editor.putString(Constant.IMG_URL,mJsonObject.getString(Constant.IMG_URL));
+ editor.putString(Constant.IMG_URL, mJsonObject.getString(Constant.IMG_URL));
editor.apply();
Glide.with(getActivity())
.load(preferences.getString(Constant.IMG_URL, ""))
@@ -380,7 +427,7 @@ public void onResponse(String response) {
.placeholder(R.drawable.ic_account_circle_black_48dp)
.into(profile_image_view);
- }else{
+ } else {
Toast.makeText(getActivity(), getString(R.string.img_upload_failure), Toast.LENGTH_LONG).show();
Timber.d(response);
}
@@ -394,7 +441,8 @@ public void onResponse(String response) {
@Override
public void onErrorResponse(VolleyError error) {
- progressDialog.dismiss();
+ progressBar.setVisibility(View.INVISIBLE);
+ change_photo_button.show();
Toast.makeText(getActivity(), error.toString(), Toast.LENGTH_LONG).show();
}
diff --git a/app/src/main/java/com/example/saar/Profile/ProfileActivity.java b/app/src/main/java/com/example/saar/Profile/ProfileActivity.java
index b839653..32fc28a 100644
--- a/app/src/main/java/com/example/saar/Profile/ProfileActivity.java
+++ b/app/src/main/java/com/example/saar/Profile/ProfileActivity.java
@@ -53,6 +53,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
if (id == android.R.id.home) {
if (fragment instanceof ViewProfileFragment) {
Intent parentIntent1 = new Intent(this, MainActivity.class);
+ parentIntent1.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(parentIntent1);
return true;
} else if (fragment instanceof EditProfileFragment) {
diff --git a/app/src/main/java/com/example/saar/Profile/ViewProfileFragment.java b/app/src/main/java/com/example/saar/Profile/ViewProfileFragment.java
index 64a289f..c34b0f7 100644
--- a/app/src/main/java/com/example/saar/Profile/ViewProfileFragment.java
+++ b/app/src/main/java/com/example/saar/Profile/ViewProfileFragment.java
@@ -2,30 +2,21 @@
import android.app.Fragment;
import android.app.FragmentTransaction;
-import android.content.Context;
-import android.content.Intent;
import android.content.SharedPreferences;
-import android.content.res.Resources;
-import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.annotation.Nullable;
-import android.support.v4.content.ContextCompat;
-import android.support.v4.content.res.ResourcesCompat;
-import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
-import android.widget.ImageView;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.example.saar.Constant;
-import com.example.saar.MainActivity;
import com.example.saar.R;
import de.hdodenhof.circleimageview.CircleImageView;
@@ -34,7 +25,7 @@ public class ViewProfileFragment extends Fragment {
CircleImageView profileImage;
TextView name, degree, graduation_year, branch, email, rollno, phone, fb_link, linkedin_link;
- TextView present_employer, designation, address, country, city, state, achievements;
+ TextView present_employer, designation, address, country, city, state, achievements, employment_type;
SharedPreferences preferences;
@Override
@@ -44,7 +35,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
View rootView = inflater.inflate(R.layout.fragment_view_profile, container, false);
setHasOptionsMenu(true);
- preferences=PreferenceManager.getDefaultSharedPreferences(getActivity());
+ preferences = PreferenceManager.getDefaultSharedPreferences(getActivity());
setupUI(rootView);
@@ -53,23 +44,24 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
private void setupUI(View rootView) {
- profileImage=rootView.findViewById(R.id.profile_picture);
- name=rootView.findViewById(R.id.profile_name);
- degree=rootView.findViewById(R.id.profile_degree);
- graduation_year=rootView.findViewById(R.id.profile_graduation_year);
- branch=rootView.findViewById(R.id.branch);
- email=rootView.findViewById(R.id.email);
- rollno=rootView.findViewById(R.id.rollno);
- phone=rootView.findViewById(R.id.phone);
- fb_link=rootView.findViewById(R.id.fb_link);
- linkedin_link=rootView.findViewById(R.id.linkedin_link);
- present_employer=rootView.findViewById(R.id.present_employer);
- designation=rootView.findViewById(R.id.designation);
- address=rootView.findViewById(R.id.address);
- country=rootView.findViewById(R.id.country);
- city=rootView.findViewById(R.id.city);
- state=rootView.findViewById(R.id.state);
- achievements=rootView.findViewById(R.id.achievements);
+ profileImage = rootView.findViewById(R.id.profile_picture);
+ name = rootView.findViewById(R.id.profile_name);
+ degree = rootView.findViewById(R.id.profile_degree);
+ graduation_year = rootView.findViewById(R.id.profile_graduation_year);
+ branch = rootView.findViewById(R.id.branch);
+ email = rootView.findViewById(R.id.email);
+ rollno = rootView.findViewById(R.id.rollno);
+ phone = rootView.findViewById(R.id.phone);
+ fb_link = rootView.findViewById(R.id.fb_link);
+ linkedin_link = rootView.findViewById(R.id.linkedin_link);
+ present_employer = rootView.findViewById(R.id.present_employer);
+ employment_type = rootView.findViewById(R.id.employment_type);
+ designation = rootView.findViewById(R.id.designation);
+ address = rootView.findViewById(R.id.address);
+ country = rootView.findViewById(R.id.country);
+ city = rootView.findViewById(R.id.city);
+ state = rootView.findViewById(R.id.state);
+ achievements = rootView.findViewById(R.id.achievements);
}
@Override
@@ -105,27 +97,88 @@ public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
}
private void fillDetails() {
- if(preferences.getBoolean(Constant.LOGIN_STATUS,false)){
- String full_name=preferences.getString(Constant.FIRST_NAME,"")+ " " + preferences.getString(Constant.LAST_NAME,"");
+ if (preferences.getBoolean(Constant.LOGIN_STATUS, false)) {
+ String full_name = preferences.getString(Constant.FIRST_NAME, "") + " " + preferences.getString(Constant.LAST_NAME, "");
name.setText(full_name);
- degree.setText(preferences.getString(Constant.DEGREE,""));
- graduation_year.setText(preferences.getString(Constant.GRADUATION_YEAR,""));
- branch.setText(preferences.getString(Constant.DEPARTMENT,""));
- email.setText(preferences.getString(Constant.EMAIL,""));
- rollno.setText(preferences.getString(Constant.ROLLNO,""));
- phone.setText(preferences.getString(Constant.PHONE,""));
- fb_link.setText(preferences.getString(Constant.FB_LINK,""));
- linkedin_link.setText(preferences.getString(Constant.LINKEDIN_LINK,""));
- present_employer.setText(preferences.getString(Constant.PRESENT_EMPLOYER,""));
- designation.setText(preferences.getString(Constant.DESIGNATION,""));
- address.setText(preferences.getString(Constant.ADDRESS,""));
- country.setText(preferences.getString(Constant.COUNTRY,""));
- city.setText(preferences.getString(Constant.CITY,""));
- state.setText(preferences.getString(Constant.STATE,""));
- achievements.setText(preferences.getString(Constant.ACHIEVEMENTS,""));
+ degree.setText(preferences.getString(Constant.DEGREE, ""));
+ graduation_year.setText(preferences.getString(Constant.GRADUATION_YEAR, ""));
+ branch.setText(preferences.getString(Constant.DEPARTMENT, ""));
+ email.setText(preferences.getString(Constant.EMAIL, ""));
+ rollno.setText(preferences.getString(Constant.ROLLNO, ""));
+ phone.setText(preferences.getString(Constant.PHONE, ""));
+
+ //checking for empty fields
+ String fb_link_text = preferences.getString(Constant.FB_LINK, "");
+ if (fb_link_text.isEmpty()) {
+ getView().findViewById(R.id.fb_link_layout).setVisibility(View.GONE);
+ getView().findViewById(R.id.fb_link_line).setVisibility(View.GONE);
+ } else
+ fb_link.setText(fb_link_text);
+
+ String linkedin_link_text = preferences.getString(Constant.LINKEDIN_LINK, "");
+ if (linkedin_link_text.isEmpty()) {
+ getView().findViewById(R.id.linkedin_link_layout).setVisibility(View.GONE);
+ getView().findViewById(R.id.linkedin_link_line).setVisibility(View.GONE);
+ } else
+ linkedin_link.setText(linkedin_link_text);
+
+ String present_employer_text = preferences.getString(Constant.PRESENT_EMPLOYER, "");
+ if (present_employer_text.isEmpty()) {
+ getView().findViewById(R.id.present_employer_layout).setVisibility(View.GONE);
+ getView().findViewById(R.id.present_employer_line).setVisibility(View.GONE);
+ } else
+ present_employer.setText(present_employer_text);
+
+ String employment_type_text = preferences.getString(Constant.EMPLOYEMENT_TYPE, "");
+ if (employment_type_text.isEmpty()) {
+ getView().findViewById(R.id.employment_type_layout).setVisibility(View.GONE);
+ getView().findViewById(R.id.employment_type_line).setVisibility(View.GONE);
+ } else
+ employment_type.setText(employment_type_text);
+
+ String designation_text = preferences.getString(Constant.DESIGNATION, "");
+ if (designation_text.isEmpty()) {
+ getView().findViewById(R.id.designation_layout).setVisibility(View.GONE);
+ getView().findViewById(R.id.designation_line).setVisibility(View.GONE);
+ } else
+ designation.setText(designation_text);
+
+ String address_text = preferences.getString(Constant.ADDRESS, "");
+ if (address_text.isEmpty()) {
+ getView().findViewById(R.id.address_layout).setVisibility(View.GONE);
+ getView().findViewById(R.id.address_line).setVisibility(View.GONE);
+ } else
+ address.setText(address_text);
+
+ String country_text = preferences.getString(Constant.COUNTRY, "");
+ if (country_text.isEmpty()) {
+ getView().findViewById(R.id.country_layout).setVisibility(View.GONE);
+ getView().findViewById(R.id.country_line).setVisibility(View.GONE);
+ } else
+ country.setText(country_text);
+
+ String city_text = preferences.getString(Constant.CITY, "");
+ if (city_text.isEmpty()) {
+ getView().findViewById(R.id.city_layout).setVisibility(View.GONE);
+ getView().findViewById(R.id.city_line).setVisibility(View.GONE);
+ } else
+ city.setText(city_text);
+
+ String state_text = preferences.getString(Constant.STATE, "");
+ if (state_text.isEmpty()) {
+ getView().findViewById(R.id.state_layout).setVisibility(View.GONE);
+ getView().findViewById(R.id.state_line).setVisibility(View.GONE);
+ } else
+ state.setText(state_text);
+
+ String achievements_text = preferences.getString(Constant.ACHIEVEMENTS, "");
+ if (achievements_text.isEmpty()) {
+ getView().findViewById(R.id.achievements_layout).setVisibility(View.GONE);
+ } else
+ achievements.setText(achievements_text);
Glide.with(getActivity())
- .load(preferences.getString(Constant.IMG_URL,""))
+ .load(preferences.getString(Constant.IMG_URL, ""))
.centerCrop()
.diskCacheStrategy(DiskCacheStrategy.NONE)
.skipMemoryCache(true)
diff --git a/app/src/main/java/com/example/saar/Retrofit/GetDataService.java b/app/src/main/java/com/example/saar/Retrofit/GetDataService.java
index 0a0f7c6..a0bc210 100644
--- a/app/src/main/java/com/example/saar/Retrofit/GetDataService.java
+++ b/app/src/main/java/com/example/saar/Retrofit/GetDataService.java
@@ -4,14 +4,16 @@
import com.example.saar.Gallery.Gallery;
import java.util.List;
+
import retrofit2.Call;
import retrofit2.http.GET;
//Class with different networking requests using Retrofit
public interface GetDataService {
- @GET("/timeline_sample.json")
+ @GET("/assets/timeline_sample.json")
Call> getAllEvents();
- @GET("/gallery_sample.json")
+
+ @GET("/assets/gallery_sample.json")
Call> getAllPhotos();
}
diff --git a/app/src/main/java/com/example/saar/Team/TeamFragment.java b/app/src/main/java/com/example/saar/Team/TeamFragment.java
index 00b244c..fa1edb3 100644
--- a/app/src/main/java/com/example/saar/Team/TeamFragment.java
+++ b/app/src/main/java/com/example/saar/Team/TeamFragment.java
@@ -26,7 +26,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
// Inflate the layout for this fragment
View rootView = inflater.inflate(R.layout.fragment_team, container, false);
- int IMAGE_ID[] = {R.drawable.vivek_garg, R.drawable.mohit_kishore, R.drawable.hit_vardhan, R.drawable.utkarsh, R.drawable.saar_logo, R.drawable.anuj_shastri, R.drawable.saurabh_gupta,
+ int IMAGE_ID[] = {R.drawable.vivek_garg, R.drawable.mohit_kishore, R.drawable.hit_vardhan, R.drawable.utkarsh, R.drawable.raghu, R.drawable.anuj_shastri, R.drawable.saurabh_gupta,
R.drawable.avinash_singh, R.drawable.himanshu_gupta, R.drawable.vatsal_singhal, R.drawable.adarsh, R.drawable.lavanya_naresh, R.drawable.gaurav_sharma, R.drawable.rakesh_kumar,
R.drawable.diptanil_sarkar, R.drawable.aman_kumar, R.drawable.sahebjeet, R.drawable.aarohan_panda, R.drawable.akash_balaji, R.drawable.anuj_yadav, R.drawable.nischal,
R.drawable.atul_gupta, R.drawable.rahul_verma, R.drawable.gaurav_pratap_singh, R.drawable.aparsh_gupta, R.drawable.somenath_sarkar, R.drawable.pranay, R.drawable.amartya_mondal,
@@ -39,7 +39,8 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
for (int position = 0; position < IMAGE_ID.length; position++) {
CircleImageView circleImageView = rootView.findViewById(IMAGE_VIEW_ID[position]);
- circleImageView.setImageResource(IMAGE_ID[position]);
+ //circleImageView.setImageResource(IMAGE_ID[position]);
+ circleImageView.setImageBitmap(decodeSampledBitmapFromResource(getResources(), IMAGE_ID[position], 70, 70));
}
@@ -74,7 +75,7 @@ public void onClick(View v) {
rootView.findViewById(IMAGE_VIEW_ID[4]).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
- go_to_fb("");
+ go_to_fb("https://www.facebook.com/veerapaneni.raghuvamsi");
}
});
@@ -172,7 +173,7 @@ public void onClick(View v) {
rootView.findViewById(IMAGE_VIEW_ID[18]).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
- go_to_fb("https://www.facebook.com/100004599372405");
+ go_to_fb("https://www.facebook.com/akash.balaji.900");
}
});
@@ -207,7 +208,7 @@ public void onClick(View v) {
rootView.findViewById(IMAGE_VIEW_ID[23]).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
- go_to_fb("");
+ go_to_fb("https://www.facebook.com/profile.php?id=100004723033463");
}
});
diff --git a/app/src/main/java/com/example/saar/Utils/Utils.java b/app/src/main/java/com/example/saar/Utils/Utils.java
new file mode 100644
index 0000000..3b15f88
--- /dev/null
+++ b/app/src/main/java/com/example/saar/Utils/Utils.java
@@ -0,0 +1,94 @@
+package com.example.saar.Utils;
+
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.net.ConnectivityManager;
+import android.net.NetworkInfo;
+import android.view.View;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.Toast;
+
+import com.example.saar.Constant;
+import com.example.saar.Login_SignUp.LoginSignupActivity;
+import com.google.firebase.messaging.FirebaseMessaging;
+
+public class Utils {
+
+ public static void closeKeyboard(View view, Context context) {
+ InputMethodManager inputManager = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
+ if (inputManager != null)
+ inputManager.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.SHOW_FORCED);
+ }
+
+ public static void logout(SharedPreferences.Editor editor, Context context) {
+ //setting all values of shared preferences to empty string
+ //login status is set to false
+ editor.putBoolean(Constant.LOGIN_STATUS, false);
+ editor.putString(Constant.ROLLNO, "");
+ editor.putString(Constant.FIRST_NAME, "");
+ editor.putString(Constant.LAST_NAME, "");
+ editor.putString(Constant.EMAIL, "");
+ editor.putString(Constant.PHONE, "");
+ editor.putString(Constant.FB_LINK, "");
+ editor.putString(Constant.LINKEDIN_LINK, "");
+ editor.putString(Constant.DOB, "");
+ editor.putString(Constant.GRADUATION_YEAR, "");
+ editor.putString(Constant.DEGREE, "");
+ editor.putString(Constant.DEPARTMENT, "");
+ editor.putString(Constant.EMPLOYEMENT_TYPE, "");
+ editor.putString(Constant.PRESENT_EMPLOYER, "");
+ editor.putString(Constant.DESIGNATION, "");
+ editor.putString(Constant.ADDRESS, "");
+ editor.putString(Constant.COUNTRY, "");
+ editor.putString(Constant.CITY, "");
+ editor.putString(Constant.STATE, "");
+ editor.putString(Constant.ACHIEVEMENTS, "");
+ editor.putBoolean(Constant.SKIP_LOGIN,false);
+ editor.apply();
+ Toast.makeText(context, "Logged Out", Toast.LENGTH_LONG).show();
+ context.startActivity(new Intent(context, LoginSignupActivity.class));
+ }
+
+ public static String getDepartment(String rollno) {
+ String year = rollno.substring(0, 2);
+ String dept = rollno.substring(4, 6);
+ return dept + year;
+ }
+
+ public static String getBatch(String rollno) {
+ String year = rollno.substring(0, 2);
+ String category = rollno.substring(2, 4);
+ String value = null;
+
+ if (category.equals("01")) {
+ value = "btech" + year;
+ } else if (category.equals("21")) {
+ value = "phd" + year;
+ } else if (category.equals("11")) {
+ value = "mtech" + year;
+ } else if (category.equals("12")) {
+ value = "msc" + year;
+ } else {
+ value = "unknown";
+ }
+ return value;
+ }
+
+ public static void unsuscribeFromNotification(String rollno) {
+ if (rollno.length() == 8) {
+ FirebaseMessaging.getInstance().unsubscribeFromTopic(getBatch(rollno));
+ FirebaseMessaging.getInstance().unsubscribeFromTopic(getDepartment(rollno));
+ }
+ }
+
+ //Function that returns whether the phone is connected to internet or not
+ public static boolean isNetworkConnected(Context context) {
+
+ ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
+ NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
+ boolean isConnected = activeNetwork != null && activeNetwork.isConnectedOrConnecting();
+
+ return isConnected;
+ }
+}
diff --git a/app/src/main/java/com/example/saar/Video/VideosFragment.java b/app/src/main/java/com/example/saar/Video/VideosFragment.java
new file mode 100644
index 0000000..da8e6e4
--- /dev/null
+++ b/app/src/main/java/com/example/saar/Video/VideosFragment.java
@@ -0,0 +1,58 @@
+package com.example.saar.Video;
+
+import android.content.Intent;
+import android.net.Uri;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.design.widget.FloatingActionButton;
+import android.support.v4.app.Fragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+
+import com.example.saar.R;
+
+public class VideosFragment extends Fragment {
+
+ FloatingActionButton video_1, video_2;
+ String video1Id= "1aW5r8-d2jQ";
+ String video2Id = "WdR0v0pJ4vY";
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ View rootview = inflater.inflate(R.layout.fragment_videos, container, false);
+ video_1 = rootview.findViewById(R.id.video_1);
+ video_2 = rootview.findViewById(R.id.video_2);
+ return rootview;
+ }
+
+ @Override
+ public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
+ //you can set the title for your toolbar here for different fragments different titles
+ getActivity().setTitle(R.string.videos);
+
+ video_1.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ openYoutube(video1Id);
+ }
+ });
+
+ video_2.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ openYoutube(video2Id);
+ }
+ });
+
+
+ }
+
+ public void openYoutube(String videoId){
+ Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("vnd.youtube://" + videoId));
+ startActivity(intent);
+ }
+
+}
diff --git a/app/src/main/res/drawable/edittext_box.xml b/app/src/main/res/drawable/edittext_box.xml
index 0d58056..0281ce8 100644
--- a/app/src/main/res/drawable/edittext_box.xml
+++ b/app/src/main/res/drawable/edittext_box.xml
@@ -1,11 +1,12 @@
-
-
-
-
-
-
-
\ No newline at end of file
+
+ -
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/ic_access_alarm_black_24dp.xml b/app/src/main/res/drawable/ic_access_alarm_black_24dp.xml
new file mode 100644
index 0000000..934b067
--- /dev/null
+++ b/app/src/main/res/drawable/ic_access_alarm_black_24dp.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_date_range_black_24dp.xml b/app/src/main/res/drawable/ic_date_range_black_24dp.xml
new file mode 100644
index 0000000..5ac94e0
--- /dev/null
+++ b/app/src/main/res/drawable/ic_date_range_black_24dp.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_ondemand_video_black_24dp.xml b/app/src/main/res/drawable/ic_ondemand_video_black_24dp.xml
new file mode 100644
index 0000000..b556865
--- /dev/null
+++ b/app/src/main/res/drawable/ic_ondemand_video_black_24dp.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_play_arrow_black_24dp.xml b/app/src/main/res/drawable/ic_play_arrow_black_24dp.xml
new file mode 100644
index 0000000..e135a55
--- /dev/null
+++ b/app/src/main/res/drawable/ic_play_arrow_black_24dp.xml
@@ -0,0 +1,5 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_warning_black_24dp.xml b/app/src/main/res/drawable/ic_warning_black_24dp.xml
new file mode 100644
index 0000000..b3a9e03
--- /dev/null
+++ b/app/src/main/res/drawable/ic_warning_black_24dp.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/marker.xml b/app/src/main/res/drawable/marker.xml
new file mode 100644
index 0000000..994c482
--- /dev/null
+++ b/app/src/main/res/drawable/marker.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/raghu.jpeg b/app/src/main/res/drawable/raghu.jpeg
new file mode 100644
index 0000000..77b683e
Binary files /dev/null and b/app/src/main/res/drawable/raghu.jpeg differ
diff --git a/app/src/main/res/drawable/video_img1.jpg b/app/src/main/res/drawable/video_img1.jpg
new file mode 100644
index 0000000..8ab2d79
Binary files /dev/null and b/app/src/main/res/drawable/video_img1.jpg differ
diff --git a/app/src/main/res/drawable/video_img2.jpg b/app/src/main/res/drawable/video_img2.jpg
new file mode 100644
index 0000000..03c8337
Binary files /dev/null and b/app/src/main/res/drawable/video_img2.jpg differ
diff --git a/app/src/main/res/layout/activity_event_details.xml b/app/src/main/res/layout/activity_event_details.xml
index 17ee010..4ae9dc8 100644
--- a/app/src/main/res/layout/activity_event_details.xml
+++ b/app/src/main/res/layout/activity_event_details.xml
@@ -1,10 +1,11 @@
-
+ android:background="@color/fragments_activities_background_color"
+ android:focusableInTouchMode="true">
+ android:orientation="vertical"
+ android:paddingBottom="@dimen/padding_login_big">
-
-
-
-
-
-
-
-
-
+ android:background="@color/white"
+ android:elevation="@dimen/card_login_elevation"
+ app:cardCornerRadius="@dimen/card_radius">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_full_screen_image.xml b/app/src/main/res/layout/activity_full_screen_image.xml
new file mode 100644
index 0000000..5689aac
--- /dev/null
+++ b/app/src/main/res/layout/activity_full_screen_image.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_otp.xml b/app/src/main/res/layout/activity_otp.xml
index f36c8ed..cd0e40b 100644
--- a/app/src/main/res/layout/activity_otp.xml
+++ b/app/src/main/res/layout/activity_otp.xml
@@ -1,81 +1,90 @@
-
+ android:background="@color/fragments_activities_background_color"
+ tools:context=".OtpActivity">
-
+ android:orientation="vertical"
+ android:paddingBottom="@dimen/donate_padding">
-
+
-
+
-
+
-
+
-
+
-
+
-
-
\ No newline at end of file
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/event_list_row.xml b/app/src/main/res/layout/event_list_row.xml
index cb27433..6c4ae71 100644
--- a/app/src/main/res/layout/event_list_row.xml
+++ b/app/src/main/res/layout/event_list_row.xml
@@ -1,74 +1,81 @@
+ android:paddingStart="@dimen/margin_5dp"
+ android:paddingEnd="@dimen/margin_5dp">
+ app:marker="@drawable/marker"
+ app:markerSize="@dimen/timeline_marker_size"
+ app:startLineColor="@color/colorPrimary" />
+ app:cardCornerRadius="@dimen/card_radius">
+ android:paddingStart="@dimen/timeline_padding_horizontal"
+ android:paddingTop="@dimen/padding_medium"
+ android:paddingEnd="@dimen/timeline_padding_horizontal"
+ android:paddingBottom="@dimen/timeline_padding_horizontal">
+ tools:text="Title" />
-
+
-
+
diff --git a/app/src/main/res/layout/fragment_change_email.xml b/app/src/main/res/layout/fragment_change_email.xml
index d28b2e1..13fce25 100644
--- a/app/src/main/res/layout/fragment_change_email.xml
+++ b/app/src/main/res/layout/fragment_change_email.xml
@@ -1,152 +1,156 @@
-
-
-
-
-
-
+
+
+ android:layout_height="wrap_content"
+ android:paddingBottom="@dimen/padding_medium">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
+
+
-
-
-
-
-
-
-
-
\ No newline at end of file
+ android:layout_height="match_parent"
+ android:padding="@dimen/padding_login_big">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_change_password.xml b/app/src/main/res/layout/fragment_change_password.xml
index 2b34fac..5d7d2ef 100644
--- a/app/src/main/res/layout/fragment_change_password.xml
+++ b/app/src/main/res/layout/fragment_change_password.xml
@@ -1,134 +1,136 @@
-
+ tools:context=".ChangeCredentials.ChangeEmailFragment">
-
+ android:layout_height="wrap_content">
-
-
-
+ android:layout_height="wrap_content"
+ android:paddingBottom="@dimen/padding_medium">
-
+ android:layout_height="@dimen/view_height"
+ android:background="@drawable/round_bottom"
+ android:orientation="vertical" />
-
-
-
-
+ android:layout_marginStart="@dimen/margin_big"
+ android:layout_marginTop="@dimen/change_email_margin"
+ android:layout_marginEnd="@dimen/margin_big"
+ android:layout_marginBottom="@dimen/change_email_margin"
+ android:background="@color/white"
+ app:cardCornerRadius="@dimen/card_radius"
+ app:cardElevation="@dimen/card_elevation">
-
-
+ android:layout_height="match_parent"
+ android:padding="@dimen/padding_login_big">
-
+
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
-
+
+
-
\ No newline at end of file
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_donate.xml b/app/src/main/res/layout/fragment_donate.xml
index 92c7d59..bd961b3 100644
--- a/app/src/main/res/layout/fragment_donate.xml
+++ b/app/src/main/res/layout/fragment_donate.xml
@@ -3,56 +3,58 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
- tools:context=".Donate.DonateFragment"
android:orientation="vertical"
- android:padding="@dimen/padding_medium">
-
-
-
-
-
+ android:background="@color/fragments_activities_background_color"
+ tools:context=".Donate.DonateFragment">
+
+
+
+
+
+ android:textSize="@dimen/textsize_big" />
+ android:textSize="@dimen/textsize_medium" />
-
-
-
-
+ android:padding="@dimen/padding_medium"
+ android:text="@string/donate_now"
+ android:textColor="@color/white"
+ android:textSize="@dimen/textsize_medium" />
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_edit_profile.xml b/app/src/main/res/layout/fragment_edit_profile.xml
index 91a6b45..beeb13f 100644
--- a/app/src/main/res/layout/fragment_edit_profile.xml
+++ b/app/src/main/res/layout/fragment_edit_profile.xml
@@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:background="@color/fragments_activities_background_color"
+ android:background="@color/white"
android:focusableInTouchMode="true">
+
+
-
+ android:layout_marginBottom="@dimen/margin_big">
-
+
+
+
-
-
+ android:layout_marginTop="@dimen/margin_big"
+ android:layout_marginBottom="@dimen/margin_big"
+ android:background="@drawable/edittext_box">
+
+
+
-
+ android:layout_marginBottom="@dimen/margin_big">
+
+
+
-
+ android:layout_marginBottom="@dimen/margin_big">
+
+
+
-
+ android:layout_marginBottom="@dimen/margin_big">
+
+
+
-
+ android:layout_marginBottom="@dimen/margin_big">
+
+
+
-
+ android:layout_marginBottom="@dimen/margin_big">
+
+
+
-
+ android:layout_marginBottom="@dimen/margin_big">
+
+
+
-
+ android:layout_marginBottom="@dimen/margin_big">
+
+
+
-
+ android:layout_marginBottom="@dimen/margin_big">
+
+
+
-
+ android:layout_marginBottom="@dimen/margin_big">
+
+
+
+ tools:context=".ChangeCredentials.ChangeEmailFragment">
-
+ android:layout_height="wrap_content">
-
-
-
-
-
-
-
+ android:layout_height="wrap_content"
+ android:paddingBottom="@dimen/padding_medium">
-
+
-
+ android:layout_centerInParent="true"
+ android:layout_marginStart="@dimen/margin_big"
+ android:layout_marginTop="@dimen/change_email_margin"
+ android:layout_marginEnd="@dimen/margin_big"
+ android:layout_marginBottom="@dimen/change_email_margin"
+ android:background="@color/white"
+ app:cardCornerRadius="@dimen/card_radius"
+ app:cardElevation="@dimen/card_elevation">
-
-
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:padding="@dimen/padding_login_big">
-
+
-
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_gallery.xml b/app/src/main/res/layout/fragment_gallery.xml
index eff8ef3..37bac63 100644
--- a/app/src/main/res/layout/fragment_gallery.xml
+++ b/app/src/main/res/layout/fragment_gallery.xml
@@ -18,9 +18,9 @@
android:visibility="gone" />
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml
index 3fa3c4b..0216c90 100644
--- a/app/src/main/res/layout/fragment_home.xml
+++ b/app/src/main/res/layout/fragment_home.xml
@@ -115,7 +115,8 @@
android:layout_width="@dimen/no_margin"
android:layout_height="match_parent"
android:layout_weight="1"
- android:gravity="center">
+ android:gravity="center"
+ android:id="@+id/homepage_abhinav_civ">
+ android:gravity="center"
+ android:id="@+id/homepage_vivek_civ">
+ android:textColor="@color/black"/>
-
+ android:background="@color/fragments_activities_background_color"
+ tools:context=".ChangeCredentials.ChangeEmailFragment">
-
+ android:layout_height="wrap_content">
-
-
-
+ android:layout_height="wrap_content"
+ android:paddingBottom="@dimen/padding_medium">
+
-
+ android:layout_marginStart="@dimen/margin_big"
+ android:layout_marginTop="@dimen/login_card_margin"
+ android:layout_marginEnd="@dimen/margin_big"
+ android:layout_marginBottom="@dimen/margin_30dp"
+ android:background="@color/white"
+ app:cardCornerRadius="@dimen/card_login_radius"
+ app:cardElevation="@dimen/card_login_elevation">
-
-
+ android:layout_height="match_parent"
+ android:padding="@dimen/padding_login_big">
-
-
-
+
-
-
+
+
-
+
-
+
+
-
+
+
-
+
-
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_share.xml b/app/src/main/res/layout/fragment_share.xml
index 477080c..c38d5a8 100644
--- a/app/src/main/res/layout/fragment_share.xml
+++ b/app/src/main/res/layout/fragment_share.xml
@@ -1,32 +1,39 @@
-
+ android:layout_height="match_parent"
+ android:background="@color/fragments_activities_background_color"
+ tools:context=".Share.ShareFragment">
+ android:layout_height="wrap_content">
-
+ android:layout_height="wrap_content"
+ android:paddingTop="@dimen/padding_medium"
+ android:paddingStart="@dimen/padding_big"
+ android:paddingEnd="@dimen/padding_big"
+ android:paddingBottom="@dimen/share_margin_bottom">
+
-
+
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_sign_up.xml b/app/src/main/res/layout/fragment_sign_up.xml
index ae669f5..ab35171 100644
--- a/app/src/main/res/layout/fragment_sign_up.xml
+++ b/app/src/main/res/layout/fragment_sign_up.xml
@@ -41,16 +41,6 @@
android:paddingEnd="@dimen/padding_medium"
android:paddingBottom="@dimen/padding_login_big">
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_videos.xml b/app/src/main/res/layout/fragment_videos.xml
new file mode 100644
index 0000000..3064337
--- /dev/null
+++ b/app/src/main/res/layout/fragment_videos.xml
@@ -0,0 +1,144 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_view_profile.xml b/app/src/main/res/layout/fragment_view_profile.xml
index cf7b382..c9e4375 100644
--- a/app/src/main/res/layout/fragment_view_profile.xml
+++ b/app/src/main/res/layout/fragment_view_profile.xml
@@ -1,9 +1,8 @@
+ android:orientation="vertical"
+ android:id="@+id/fb_link_layout">
+ android:background="@color/colorLine"
+ android:id="@+id/fb_link_line"/>
+ android:orientation="vertical"
+ android:id="@+id/linkedin_link_layout">
+ android:background="@color/colorLine"
+ android:id="@+id/linkedin_link_line"/>
+ android:orientation="vertical"
+ android:id="@+id/employment_type_layout">
+
+
+
+
+
+
+
+
+
+ android:background="@color/colorLine"
+ android:id="@+id/present_employer_line"/>
+ android:orientation="vertical"
+ android:id="@+id/designation_layout">
+ android:background="@color/colorLine"
+ android:id="@+id/designation_line"/>
+ android:orientation="vertical"
+ android:id="@+id/address_layout">
+ android:background="@color/colorLine"
+ android:id="@+id/address_line"/>
+ android:orientation="vertical"
+ android:id="@+id/country_layout">
+ android:background="@color/colorLine"
+ android:id="@+id/country_line"/>
+ android:orientation="vertical"
+ android:id="@+id/state_layout">
+ android:background="@color/colorLine"
+ android:id="@+id/state_line"/>
+ android:orientation="vertical"
+ android:id="@+id/city_layout">
+ android:background="@color/colorLine"
+ android:id="@+id/city_line"/>
+ android:orientation="vertical"
+ android:id="@+id/achievements_layout">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/menu/activity_main_drawer.xml b/app/src/main/res/menu/activity_main_drawer.xml
index 2eddf2f..31ad412 100644
--- a/app/src/main/res/menu/activity_main_drawer.xml
+++ b/app/src/main/res/menu/activity_main_drawer.xml
@@ -37,9 +37,9 @@
android:title="Share" />
+ android:id="@+id/nav_videos"
+ android:icon="@drawable/ic_ondemand_video_black_24dp"
+ android:title="Videos" />
+
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_saar_square.png b/app/src/main/res/mipmap-hdpi/ic_launcher_saar_square.png
new file mode 100644
index 0000000..33ffd82
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_saar_square.png differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_saar_square.png b/app/src/main/res/mipmap-mdpi/ic_launcher_saar_square.png
new file mode 100644
index 0000000..37e0b09
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_saar_square.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_saar_square.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_saar_square.png
new file mode 100644
index 0000000..431b325
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_saar_square.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_saar_square.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_saar_square.png
new file mode 100644
index 0000000..7d5bfa7
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_saar_square.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_saar_square.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_saar_square.png
new file mode 100644
index 0000000..f7063c6
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_saar_square.png differ
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index 752b20a..de2fb3f 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -5,9 +5,11 @@
#ff6b01
#ffffff
#000000
- #ffffff
+ #f4f4f4
#d9dfe2
#f4f4f4
#00edff
#006fff
+ #ff001d
+ #b0b1b7
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
index 45fea76..1f3692c 100644
--- a/app/src/main/res/values/dimens.xml
+++ b/app/src/main/res/values/dimens.xml
@@ -21,7 +21,7 @@
25dp
1dp
32sp
- 56dp
+ 56dp
250dp
@@ -32,6 +32,11 @@
5dp
10dp
30dp
+ 128dp
+
+
+ 32dp
+ 300dp
8dp
@@ -43,8 +48,9 @@
20sp
- 3dp
- 20dp
+ 2dp
+ 15dp
+ 12dp
200dp
@@ -74,4 +80,13 @@
80dp
+
+ 100dp
+
+
+ 32dp
+
+
+ 40dp
+
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 978f3ae..16f4037 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -9,6 +9,7 @@
Profile
Logout
Change Email
+ Change Password
Share
Connect With Us
Donate Now
@@ -19,9 +20,11 @@
View Profile
Edit Profile
Change Password
- No Internet Connection Found\n\n
- Check Your Connection
+ No Internet Connection Found.\nCheck Your Connection
saar@iitp.ac.in
+ Photo
+ Please enter all fields
+ Videos
Vivek Garg
@@ -124,12 +127,13 @@
Skip Login
SAAR Login
SAAR Sign Up
- Verify your Email ID
+ Verify your OTP
Email or password field cannot be empty.
You have succesfully logged in.
Failed to log in.
+ Please fill all necessary fields for registration
College Roll Number
Name
First Name
@@ -140,12 +144,15 @@
Confirm Password
Date of Birth
Present Employer/ Educational Inst.
+ Employment Type
Designation
Address
Country
State
City
Achievements after Graduation
+ OK
+ Error
- 2012
- 2013
@@ -233,6 +240,9 @@
Failed to verify otp. Please retry.
Successfully registered your account. Please verify your email by entering the OTP send in email.
Failed to register you. Please correct the errors and try again.
+ Roll No field cannot be empty.
+ Succesfully sent the OTP in your email. Please check your email.
+ Failed to resend the otp.
Old Password
@@ -260,5 +270,19 @@
Forgot Password?
We just need your registered email id and college roll number to send you password reset instructions
Reset Password
+ Error requesting to reset your password.
+ Successfully requested to initiate forgot password.
+ We have succesfully verified you. You can now change your password.
+
+
+ Succesfully changed the password.
+ Failed to change the password. Please try again later.
+ New password and Confirm password does not match
+
+
+ Reminiscence : The\nJourney of SAAR, IIT Patna
+ A throwback to all what has been done and a way to express our gratitude for all the love you’ve showered upon us with your support and well wishes.
+ Au Revoir - Class of 2019
+ Here’s the batch of 2019 celebrating their farewell in their own rocking andaaz!
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 22ed55d..43e42cc 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -6,7 +6,6 @@
- @color/colorPrimary
- @color/colorPrimaryDark
- @color/colorAccent
- - @color/colorPrimaryDark