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;
import com.google.gson.JsonObject;
import com.squareup.picasso.Picasso;
import org.json.JSONException;
import org.json.JSONObject;
import app.insti.Constants;
import app.insti.R;
import app.insti.SessionManager;
......@@ -61,7 +58,7 @@ import app.insti.fragment.MyEventsFragment;
import app.insti.fragment.NewsFragment;
import app.insti.fragment.NotificationsFragment;
import app.insti.fragment.PlacementBlogFragment;
import app.insti.fragment.ProfileFragment;
import app.insti.fragment.UserFragment;
import app.insti.fragment.QuickLinksFragment;
import app.insti.fragment.SettingsFragment;
import app.insti.fragment.TrainingBlogFragment;
......@@ -227,8 +224,8 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
updateFragment(bodyFragment);
break;
case "user":
ProfileFragment profileFragment = ProfileFragment.newInstance(getID(appLinkData));
updateFragment(profileFragment);
UserFragment userFragment = UserFragment.newInstance(getID(appLinkData));
updateFragment(userFragment);
break;
case "event":
RetrofitInterface retrofitInterface = ServiceGenerator.createService(RetrofitInterface.class);
......@@ -331,9 +328,9 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
public void onClick(View view) {
Bundle bundle = new Bundle();
bundle.putString(Constants.USER_ID, currentUser.getUserID());
ProfileFragment profileFragment = new ProfileFragment();
profileFragment.setArguments(bundle);
updateFragment(profileFragment);
UserFragment userFragment = new UserFragment();
userFragment.setArguments(bundle);
updateFragment(userFragment);
DrawerLayout drawer = findViewById(R.id.drawer_layout);
drawer.closeDrawer(GravityCompat.START);
}
......@@ -480,8 +477,8 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
FragmentTransaction transaction = manager.beginTransaction();
/* Animate only for ProfileFragment */
if (fragment instanceof ProfileFragment) {
/* Animate only for UserFragment */
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);
}
......
......@@ -324,12 +324,12 @@ public class BodyFragment extends BackHandledFragment {
User user = users.get(position);
Bundle bundle = new Bundle();
bundle.putString(Constants.USER_ID, user.getUserID());
ProfileFragment profileFragment = new ProfileFragment();
profileFragment.setArguments(bundle);
UserFragment userFragment = new UserFragment();
userFragment.setArguments(bundle);
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.replace(R.id.framelayout_for_fragment, profileFragment, profileFragment.getTag());
ft.addToBackStack(profileFragment.getTag());
ft.replace(R.id.framelayout_for_fragment, userFragment, userFragment.getTag());
ft.addToBackStack(userFragment.getTag());
ft.commit();
}
});
......
......@@ -212,7 +212,7 @@ public class ExploreFragment extends Fragment {
User user = users.get(position);
Bundle bundle = new Bundle();
bundle.putString(Constants.USER_ID, user.getUserID());
updateFragment(new ProfileFragment(), bundle);
updateFragment(new UserFragment(), bundle);
}
});
usersRecyclerView.setAdapter(userAdapter);
......
......@@ -92,8 +92,8 @@ public class SettingsFragment extends Fragment {
getView().findViewById(R.id.role_card_layout).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ProfileFragment profileFragment = ProfileFragment.newInstance(user.getUserID());
((MainActivity)getActivity()).updateFragment(profileFragment);
UserFragment userFragment = UserFragment.newInstance(user.getUserID());
((MainActivity)getActivity()).updateFragment(userFragment);
}
});
}
......
......@@ -47,7 +47,7 @@ import retrofit2.Response;
/**
* A simple {@link Fragment} subclass.
*/
public class ProfileFragment extends BackHandledFragment {
public class UserFragment extends BackHandledFragment {
private User user;
// Hold a reference to the current animator,
......@@ -64,12 +64,12 @@ public class ProfileFragment extends BackHandledFragment {
private float startScaleFinal;
private ImageView userProfilePictureImageView;
public ProfileFragment() {
public UserFragment() {
// Required empty public constructor
}
public static ProfileFragment newInstance(String userID) {
ProfileFragment fragment = new ProfileFragment();
public static UserFragment newInstance(String userID) {
UserFragment fragment = new UserFragment();
Bundle args = new Bundle();
args.putString(Constants.USER_ID, userID);
fragment.setArguments(args);
......@@ -80,7 +80,7 @@ public class ProfileFragment extends BackHandledFragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// 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
......
......@@ -8,7 +8,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="app.insti.fragment.ProfileFragment">
tools:context="app.insti.fragment.UserFragment">
<LinearLayout
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