Commit e384e958 authored by Sajal Narang's avatar Sajal Narang

Rename ProfileFragment to UserFragment

parent ed39340d
...@@ -37,9 +37,6 @@ import com.google.firebase.iid.InstanceIdResult; ...@@ -37,9 +37,6 @@ import com.google.firebase.iid.InstanceIdResult;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.squareup.picasso.Picasso; import com.squareup.picasso.Picasso;
import org.json.JSONException;
import org.json.JSONObject;
import app.insti.Constants; import app.insti.Constants;
import app.insti.R; import app.insti.R;
import app.insti.SessionManager; import app.insti.SessionManager;
...@@ -61,7 +58,7 @@ import app.insti.fragment.MyEventsFragment; ...@@ -61,7 +58,7 @@ import app.insti.fragment.MyEventsFragment;
import app.insti.fragment.NewsFragment; import app.insti.fragment.NewsFragment;
import app.insti.fragment.NotificationsFragment; import app.insti.fragment.NotificationsFragment;
import app.insti.fragment.PlacementBlogFragment; import app.insti.fragment.PlacementBlogFragment;
import app.insti.fragment.ProfileFragment; import app.insti.fragment.UserFragment;
import app.insti.fragment.QuickLinksFragment; import app.insti.fragment.QuickLinksFragment;
import app.insti.fragment.SettingsFragment; import app.insti.fragment.SettingsFragment;
import app.insti.fragment.TrainingBlogFragment; import app.insti.fragment.TrainingBlogFragment;
...@@ -227,8 +224,8 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On ...@@ -227,8 +224,8 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
updateFragment(bodyFragment); updateFragment(bodyFragment);
break; break;
case "user": case "user":
ProfileFragment profileFragment = ProfileFragment.newInstance(getID(appLinkData)); UserFragment userFragment = UserFragment.newInstance(getID(appLinkData));
updateFragment(profileFragment); updateFragment(userFragment);
break; break;
case "event": case "event":
RetrofitInterface retrofitInterface = ServiceGenerator.createService(RetrofitInterface.class); RetrofitInterface retrofitInterface = ServiceGenerator.createService(RetrofitInterface.class);
...@@ -331,9 +328,9 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On ...@@ -331,9 +328,9 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
public void onClick(View view) { public void onClick(View view) {
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putString(Constants.USER_ID, currentUser.getUserID()); bundle.putString(Constants.USER_ID, currentUser.getUserID());
ProfileFragment profileFragment = new ProfileFragment(); UserFragment userFragment = new UserFragment();
profileFragment.setArguments(bundle); userFragment.setArguments(bundle);
updateFragment(profileFragment); updateFragment(userFragment);
DrawerLayout drawer = findViewById(R.id.drawer_layout); DrawerLayout drawer = findViewById(R.id.drawer_layout);
drawer.closeDrawer(GravityCompat.START); drawer.closeDrawer(GravityCompat.START);
} }
...@@ -480,8 +477,8 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On ...@@ -480,8 +477,8 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
FragmentTransaction transaction = manager.beginTransaction(); FragmentTransaction transaction = manager.beginTransaction();
/* Animate only for ProfileFragment */ /* Animate only for UserFragment */
if (fragment instanceof ProfileFragment) { if (fragment instanceof UserFragment) {
transaction.setCustomAnimations(R.anim.slide_in_left, R.anim.slide_out_left, R.anim.slide_in_right, R.anim.slide_out_right); transaction.setCustomAnimations(R.anim.slide_in_left, R.anim.slide_out_left, R.anim.slide_in_right, R.anim.slide_out_right);
} }
......
...@@ -324,12 +324,12 @@ public class BodyFragment extends BackHandledFragment { ...@@ -324,12 +324,12 @@ public class BodyFragment extends BackHandledFragment {
User user = users.get(position); User user = users.get(position);
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putString(Constants.USER_ID, user.getUserID()); bundle.putString(Constants.USER_ID, user.getUserID());
ProfileFragment profileFragment = new ProfileFragment(); UserFragment userFragment = new UserFragment();
profileFragment.setArguments(bundle); userFragment.setArguments(bundle);
FragmentTransaction ft = getActivity().getSupportFragmentManager().beginTransaction(); FragmentTransaction ft = getActivity().getSupportFragmentManager().beginTransaction();
ft.setCustomAnimations(R.anim.slide_in_left, R.anim.slide_out_left, R.anim.slide_in_right, R.anim.slide_out_right); ft.setCustomAnimations(R.anim.slide_in_left, R.anim.slide_out_left, R.anim.slide_in_right, R.anim.slide_out_right);
ft.replace(R.id.framelayout_for_fragment, profileFragment, profileFragment.getTag()); ft.replace(R.id.framelayout_for_fragment, userFragment, userFragment.getTag());
ft.addToBackStack(profileFragment.getTag()); ft.addToBackStack(userFragment.getTag());
ft.commit(); ft.commit();
} }
}); });
......
...@@ -212,7 +212,7 @@ public class ExploreFragment extends Fragment { ...@@ -212,7 +212,7 @@ public class ExploreFragment extends Fragment {
User user = users.get(position); User user = users.get(position);
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putString(Constants.USER_ID, user.getUserID()); bundle.putString(Constants.USER_ID, user.getUserID());
updateFragment(new ProfileFragment(), bundle); updateFragment(new UserFragment(), bundle);
} }
}); });
usersRecyclerView.setAdapter(userAdapter); usersRecyclerView.setAdapter(userAdapter);
......
...@@ -92,8 +92,8 @@ public class SettingsFragment extends Fragment { ...@@ -92,8 +92,8 @@ public class SettingsFragment extends Fragment {
getView().findViewById(R.id.role_card_layout).setOnClickListener(new View.OnClickListener() { getView().findViewById(R.id.role_card_layout).setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
ProfileFragment profileFragment = ProfileFragment.newInstance(user.getUserID()); UserFragment userFragment = UserFragment.newInstance(user.getUserID());
((MainActivity)getActivity()).updateFragment(profileFragment); ((MainActivity)getActivity()).updateFragment(userFragment);
} }
}); });
} }
......
...@@ -47,7 +47,7 @@ import retrofit2.Response; ...@@ -47,7 +47,7 @@ import retrofit2.Response;
/** /**
* A simple {@link Fragment} subclass. * A simple {@link Fragment} subclass.
*/ */
public class ProfileFragment extends BackHandledFragment { public class UserFragment extends BackHandledFragment {
private User user; private User user;
// Hold a reference to the current animator, // Hold a reference to the current animator,
...@@ -64,12 +64,12 @@ public class ProfileFragment extends BackHandledFragment { ...@@ -64,12 +64,12 @@ public class ProfileFragment extends BackHandledFragment {
private float startScaleFinal; private float startScaleFinal;
private ImageView userProfilePictureImageView; private ImageView userProfilePictureImageView;
public ProfileFragment() { public UserFragment() {
// Required empty public constructor // Required empty public constructor
} }
public static ProfileFragment newInstance(String userID) { public static UserFragment newInstance(String userID) {
ProfileFragment fragment = new ProfileFragment(); UserFragment fragment = new UserFragment();
Bundle args = new Bundle(); Bundle args = new Bundle();
args.putString(Constants.USER_ID, userID); args.putString(Constants.USER_ID, userID);
fragment.setArguments(args); fragment.setArguments(args);
...@@ -80,7 +80,7 @@ public class ProfileFragment extends BackHandledFragment { ...@@ -80,7 +80,7 @@ public class ProfileFragment extends BackHandledFragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container, public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) { Bundle savedInstanceState) {
// Inflate the layout for this fragment // Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_profile, container, false); return inflater.inflate(R.layout.fragment_user, container, false);
} }
@Override @Override
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
tools:context="app.insti.fragment.ProfileFragment"> tools:context="app.insti.fragment.UserFragment">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment