Commit 228bd848 authored by Varun Patil's avatar Varun Patil

Merge branch 'master' into moremisc

parents 3b8d2853 34c61c45
...@@ -68,7 +68,6 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On ...@@ -68,7 +68,6 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
setContentView(R.layout.activity_main); setContentView(R.layout.activity_main);
session = new SessionManager(getApplicationContext()); session = new SessionManager(getApplicationContext());
session.checkLogin(); session.checkLogin();
Toast.makeText(getApplicationContext(), "Log In status: " + session.isLoggedIn(), Toast.LENGTH_LONG).show();
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
...@@ -121,7 +120,11 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On ...@@ -121,7 +120,11 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
nameTextView.setText(currentUser.getUserName()); nameTextView.setText(currentUser.getUserName());
rollNoTextView.setText(currentUser.getUserRollNumber()); rollNoTextView.setText(currentUser.getUserRollNumber());
Picasso.with(this).load(currentUser.getUserProfilePictureUrl()).into(profilePictureImageView); Picasso.with(this)
.load(currentUser.getUserProfilePictureUrl())
.resize(200, 0)
.placeholder(R.drawable.user_placeholder)
.into(profilePictureImageView);
} }
// private void fetchNotifications() { // private void fetchNotifications() {
...@@ -262,6 +265,8 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On ...@@ -262,6 +265,8 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
bundle.putString(Constants.SESSION_ID, session.pref.getString(Constants.SESSION_ID, "Error")); bundle.putString(Constants.SESSION_ID, session.pref.getString(Constants.SESSION_ID, "Error"));
if (fragment instanceof MessMenuFragment) if (fragment instanceof MessMenuFragment)
bundle.putString(Constants.USER_HOSTEL, currentUser.getHostel()); bundle.putString(Constants.USER_HOSTEL, currentUser.getHostel());
if (fragment instanceof SettingsFragment && session.isLoggedIn())
bundle.putString(Constants.USER_ID, currentUser.getUserID());
fragment.setArguments(bundle); fragment.setArguments(bundle);
FragmentManager manager = getSupportFragmentManager(); FragmentManager manager = getSupportFragmentManager();
if (fragment instanceof FeedFragment) if (fragment instanceof FeedFragment)
......
...@@ -17,7 +17,6 @@ public class SessionManager { ...@@ -17,7 +17,6 @@ public class SessionManager {
public SessionManager(Context context) { public SessionManager(Context context) {
this.context = context; this.context = context;
pref = context.getSharedPreferences(Constants.PREF_NAME, PRIVATE_MODE); pref = context.getSharedPreferences(Constants.PREF_NAME, PRIVATE_MODE);
editor = pref.edit();
} }
public void checkLogin() { public void checkLogin() {
...@@ -34,6 +33,7 @@ public class SessionManager { ...@@ -34,6 +33,7 @@ public class SessionManager {
public void createLoginSession(String gcmId, User currentUser, String sessionID) { public void createLoginSession(String gcmId, User currentUser, String sessionID) {
Log.d("SessionManager", "GcmId being stored"); Log.d("SessionManager", "GcmId being stored");
editor = pref.edit();
editor.putBoolean(Constants.IS_LOGGED_IN, true); editor.putBoolean(Constants.IS_LOGGED_IN, true);
editor.putString(Constants.GCM_ID, gcmId); editor.putString(Constants.GCM_ID, gcmId);
editor.putString(Constants.CURRENT_USER, currentUser.toString()); editor.putString(Constants.CURRENT_USER, currentUser.toString());
...@@ -48,4 +48,9 @@ public class SessionManager { ...@@ -48,4 +48,9 @@ public class SessionManager {
public boolean isLoggedIn() { public boolean isLoggedIn() {
return pref.getBoolean(Constants.IS_LOGGED_IN, false); return pref.getBoolean(Constants.IS_LOGGED_IN, false);
} }
public void logout() {
editor = pref.edit();
editor.clear().commit();
}
} }
...@@ -49,7 +49,11 @@ public class UserAdapter extends RecyclerView.Adapter<UserAdapter.ViewHolder> { ...@@ -49,7 +49,11 @@ public class UserAdapter extends RecyclerView.Adapter<UserAdapter.ViewHolder> {
User user = userList.get(position); User user = userList.get(position);
holder.userName.setText(user.getUserName()); holder.userName.setText(user.getUserName());
holder.role.setText(user.getCurrentRole()); holder.role.setText(user.getCurrentRole());
Picasso.with(context).load(user.getUserProfilePictureUrl()).resize(120, 0).into(holder.image); Picasso.with(context)
.load(user.getUserProfilePictureUrl())
.resize(150, 0)
.placeholder(R.drawable.user_placeholder)
.into(holder.image);
} }
......
...@@ -61,6 +61,9 @@ public interface RetrofitInterface { ...@@ -61,6 +61,9 @@ public interface RetrofitInterface {
@GET("news") @GET("news")
Call<List<NewsArticle>> getNews(@Header("Cookie") String sessionID); Call<List<NewsArticle>> getNews(@Header("Cookie") String sessionID);
@GET("logout")
Call<Void> logout(@Header("Cookie") String sessionID);
// @POST("getNotifications/") // @POST("getNotifications/")
// Call<NotificationsResponse> getNotifications(@Body NotificationsRequest notificationsRequest); // Call<NotificationsResponse> getNotifications(@Body NotificationsRequest notificationsRequest);
} }
...@@ -6,13 +6,17 @@ import android.app.ProgressDialog; ...@@ -6,13 +6,17 @@ import android.app.ProgressDialog;
import android.app.TimePickerDialog; import android.app.TimePickerDialog;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.database.Cursor;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.provider.MediaStore;
import android.support.v4.app.ActivityCompat; import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat; import android.support.v4.content.ContextCompat;
import android.support.v4.widget.ImageViewCompat; import android.support.v4.widget.ImageViewCompat;
import android.util.Base64; import android.util.Base64;
import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
...@@ -98,6 +102,17 @@ public class AddEventFragment extends BaseFragment { ...@@ -98,6 +102,17 @@ public class AddEventFragment extends BaseFragment {
// Required empty public constructor // Required empty public constructor
} }
public static String convertImageToString(Bitmap imageBitmap) {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
if (imageBitmap != null) {
imageBitmap.compress(Bitmap.CompressFormat.JPEG, 60, stream);
byte[] byteArray = stream.toByteArray();
return Base64.encodeToString(byteArray, Base64.DEFAULT);
} else {
return null;
}
}
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) { Bundle savedInstanceState) {
...@@ -288,8 +303,52 @@ public class AddEventFragment extends BaseFragment { ...@@ -288,8 +303,52 @@ public class AddEventFragment extends BaseFragment {
super.onActivityResult(requestCode, resultCode, data); super.onActivityResult(requestCode, resultCode, data);
if (requestCode == RESULT_LOAD_IMAGE && resultCode == RESULT_OK && null != data) { if (requestCode == RESULT_LOAD_IMAGE && resultCode == RESULT_OK && null != data) {
Uri selectedImage = data.getData(); Uri selectedImage = data.getData();
String[] filePathColumn = {MediaStore.Images.Media.DATA};
Cursor cursor = getActivity().getContentResolver().query(selectedImage, filePathColumn, null, null, null);
cursor.moveToFirst();
int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
String picturePath = cursor.getString(columnIndex);
cursor.close();
ImageViewCompat.setImageTintList(eventPictureImageView, null); ImageViewCompat.setImageTintList(eventPictureImageView, null);
Picasso.with(getContext()).load(selectedImage).into(eventPictureImageView); Picasso.with(getContext()).load(selectedImage).into(eventPictureImageView);
base64Image = convertImageToString(getScaledBitmap(picturePath, 800, 800));
Log.d(TAG, "onActivityResult: " + base64Image);
}
}
private Bitmap getScaledBitmap(String picturePath, int width, int height) {
BitmapFactory.Options sizeOptions = new BitmapFactory.Options();
sizeOptions.inJustDecodeBounds = true;
BitmapFactory.decodeFile(picturePath, sizeOptions);
int inSampleSize = calculateInSampleSize(sizeOptions, width, height);
sizeOptions.inJustDecodeBounds = false;
sizeOptions.inSampleSize = inSampleSize;
return BitmapFactory.decodeFile(picturePath, sizeOptions);
}
private int calculateInSampleSize(BitmapFactory.Options options, int reqWidth, int reqHeight) {
// Raw height and width of image
final int height = options.outHeight;
final int width = options.outWidth;
int inSampleSize = 1;
if (height > reqHeight || width > reqWidth) {
// Calculate ratios of height and width to requested height and
// width
final int heightRatio = Math.round((float) height / (float) reqHeight);
final int widthRatio = Math.round((float) width / (float) reqWidth);
// Choose the smallest ratio as inSampleSize value, this will
// guarantee
// a final image with both dimensions larger than or equal to the
// requested height and width.
inSampleSize = heightRatio < widthRatio ? heightRatio : widthRatio;
} }
return inSampleSize;
} }
} }
...@@ -291,6 +291,8 @@ public class BodyFragment extends Fragment { ...@@ -291,6 +291,8 @@ public class BodyFragment extends Fragment {
}); });
childrenRecyclerView.setAdapter(childrenAdapter); childrenRecyclerView.setAdapter(childrenAdapter);
childrenRecyclerView.setLayoutManager(new LinearLayoutManager(getContext())); childrenRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
getActivity().findViewById(R.id.loadingPanel).setVisibility(View.GONE);
} }
/** /**
......
...@@ -74,6 +74,7 @@ public class BodyRecyclerViewFragment extends Fragment { ...@@ -74,6 +74,7 @@ public class BodyRecyclerViewFragment extends Fragment {
arguments.putString(Constants.BODY_JSON, new Gson().toJson(body)); arguments.putString(Constants.BODY_JSON, new Gson().toJson(body));
bodyFragment.setArguments(getArguments()); bodyFragment.setArguments(getArguments());
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.replace(R.id.framelayout_for_fragment, bodyFragment, bodyFragment.getTag()); ft.replace(R.id.framelayout_for_fragment, bodyFragment, bodyFragment.getTag());
ft.addToBackStack(bodyFragment.getTag()); ft.addToBackStack(bodyFragment.getTag());
ft.commit(); ft.commit();
......
...@@ -173,6 +173,8 @@ public class CalendarFragment extends BaseFragment { ...@@ -173,6 +173,8 @@ public class CalendarFragment extends BaseFragment {
}); });
eventRecyclerView.setAdapter(eventAdapter); eventRecyclerView.setAdapter(eventAdapter);
eventRecyclerView.setLayoutManager(new LinearLayoutManager(getContext())); eventRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
getActivity().findViewById(R.id.loadingPanel).setVisibility(View.GONE);
} }
} }
...@@ -72,6 +72,7 @@ public class EventRecyclerViewFragment extends Fragment { ...@@ -72,6 +72,7 @@ public class EventRecyclerViewFragment extends Fragment {
arguments.putString(Constants.EVENT_JSON, new Gson().toJson(event)); arguments.putString(Constants.EVENT_JSON, new Gson().toJson(event));
eventFragment.setArguments(getArguments()); eventFragment.setArguments(getArguments());
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.replace(R.id.framelayout_for_fragment, eventFragment, eventFragment.getTag()); ft.replace(R.id.framelayout_for_fragment, eventFragment, eventFragment.getTag());
ft.addToBackStack(eventFragment.getTag()); ft.addToBackStack(eventFragment.getTag());
ft.commit(); ft.commit();
......
...@@ -144,6 +144,7 @@ public class FeedFragment extends BaseFragment { ...@@ -144,6 +144,7 @@ public class FeedFragment extends BaseFragment {
} }
} }
}); });
getActivity().findViewById(R.id.loadingPanel).setVisibility(View.GONE);
} }
private class updateDatabase extends AsyncTask<List<Event>, Void, Integer> { private class updateDatabase extends AsyncTask<List<Event>, Void, Integer> {
......
...@@ -169,6 +169,7 @@ public class MessMenuFragment extends BaseFragment { ...@@ -169,6 +169,7 @@ public class MessMenuFragment extends BaseFragment {
} }
} }
}); });
getActivity().findViewById(R.id.loadingPanel).setVisibility(View.GONE);
} }
private class updateDatabase extends AsyncTask<List<HostelMessMenu>, Void, Integer> { private class updateDatabase extends AsyncTask<List<HostelMessMenu>, Void, Integer> {
......
...@@ -110,6 +110,7 @@ public class NewsFragment extends BaseFragment { ...@@ -110,6 +110,7 @@ public class NewsFragment extends BaseFragment {
} }
} }
}); });
getActivity().findViewById(R.id.loadingPanel).setVisibility(View.GONE);
} }
private void openWebURL(String URL) { private void openWebURL(String URL) {
......
...@@ -111,6 +111,7 @@ public class PlacementBlogFragment extends BaseFragment { ...@@ -111,6 +111,7 @@ public class PlacementBlogFragment extends BaseFragment {
} }
} }
}); });
getActivity().findViewById(R.id.loadingPanel).setVisibility(View.GONE);
} }
private void openWebURL(String URL) { private void openWebURL(String URL) {
......
...@@ -81,6 +81,9 @@ public class ProfileFragment extends BaseFragment { ...@@ -81,6 +81,9 @@ public class ProfileFragment extends BaseFragment {
TextView userEmailIDTextView = getActivity().findViewById(R.id.user_email_profile); TextView userEmailIDTextView = getActivity().findViewById(R.id.user_email_profile);
TextView userContactNumberTextView = getActivity().findViewById(R.id.user_contact_no_profile); TextView userContactNumberTextView = getActivity().findViewById(R.id.user_contact_no_profile);
/** Show tabs */
getActivity().findViewById(R.id.tab_layout).setVisibility(View.VISIBLE);
final List<Role> roleList = user.getUserRoles(); final List<Role> roleList = user.getUserRoles();
RecyclerView userRoleRecyclerView = getActivity().findViewById(R.id.role_recycler_view); RecyclerView userRoleRecyclerView = getActivity().findViewById(R.id.role_recycler_view);
RoleAdapter roleAdapter = new RoleAdapter(roleList, new ItemClickListener() { RoleAdapter roleAdapter = new RoleAdapter(roleList, new ItemClickListener() {
...@@ -90,6 +93,7 @@ public class ProfileFragment extends BaseFragment { ...@@ -90,6 +93,7 @@ public class ProfileFragment extends BaseFragment {
Body roleBody = role.getRoleBodyDetails(); Body roleBody = role.getRoleBodyDetails();
BodyFragment bodyFragment = BodyFragment.newInstance(roleBody); BodyFragment bodyFragment = BodyFragment.newInstance(roleBody);
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.replace(R.id.framelayout_for_fragment, bodyFragment, bodyFragment.getTag()); ft.replace(R.id.framelayout_for_fragment, bodyFragment, bodyFragment.getTag());
ft.addToBackStack(bodyFragment.getTag()); ft.addToBackStack(bodyFragment.getTag());
ft.commit(); ft.commit();
...@@ -99,7 +103,11 @@ public class ProfileFragment extends BaseFragment { ...@@ -99,7 +103,11 @@ public class ProfileFragment extends BaseFragment {
userRoleRecyclerView.setAdapter(roleAdapter); userRoleRecyclerView.setAdapter(roleAdapter);
userRoleRecyclerView.setLayoutManager(new LinearLayoutManager(getContext())); userRoleRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
Picasso.with(getContext()).load(user.getUserProfilePictureUrl()).into(userProfilePictureImageView); Picasso.with(getContext())
.load(user.getUserProfilePictureUrl())
.resize(800, 0)
.placeholder(R.drawable.user_placeholder)
.into(userProfilePictureImageView);
final List<Body> bodyList = user.getUserFollowedBodies(); final List<Body> bodyList = user.getUserFollowedBodies();
final List<Event> eventList = user.getUserGoingEvents(); final List<Event> eventList = user.getUserGoingEvents();
...@@ -123,6 +131,8 @@ public class ProfileFragment extends BaseFragment { ...@@ -123,6 +131,8 @@ public class ProfileFragment extends BaseFragment {
userRollNumberTextView.setText(user.getUserRollNumber()); userRollNumberTextView.setText(user.getUserRollNumber());
userEmailIDTextView.setText(user.getUserEmail()); userEmailIDTextView.setText(user.getUserEmail());
userContactNumberTextView.setText(user.getUserContactNumber()); userContactNumberTextView.setText(user.getUserContactNumber());
getActivity().findViewById(R.id.loadingPanel).setVisibility(View.GONE);
} }
......
package in.ac.iitb.gymkhana.iitbapp.fragment; package in.ac.iitb.gymkhana.iitbapp.fragment;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import com.squareup.picasso.Picasso;
import in.ac.iitb.gymkhana.iitbapp.Constants;
import in.ac.iitb.gymkhana.iitbapp.LoginActivity;
import in.ac.iitb.gymkhana.iitbapp.R; import in.ac.iitb.gymkhana.iitbapp.R;
import in.ac.iitb.gymkhana.iitbapp.SessionManager;
import in.ac.iitb.gymkhana.iitbapp.api.RetrofitInterface;
import in.ac.iitb.gymkhana.iitbapp.api.ServiceGenerator;
import in.ac.iitb.gymkhana.iitbapp.data.User;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
/** /**
* A simple {@link Fragment} subclass. * A simple {@link Fragment} subclass.
* Use the {@link SettingsFragment#newInstance} factory method to
* create an instance of this fragment.
*/ */
public class SettingsFragment extends Fragment { public class SettingsFragment extends Fragment {
User user;
public SettingsFragment() { public SettingsFragment() {
// Required empty public constructor // Required empty public constructor
} }
public static SettingsFragment newInstance(String param1, String param2) { @Override
SettingsFragment fragment = new SettingsFragment(); public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle args = new Bundle(); Bundle savedInstanceState) {
fragment.setArguments(args); // Inflate the layout for this fragment
return fragment; return inflater.inflate(R.layout.fragment_settings, container, false);
} }
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onStart() {
super.onCreate(savedInstanceState); super.onStart();
Bundle bundle = getArguments();
String userID = bundle.getString(Constants.USER_ID);
RetrofitInterface retrofitInterface = ServiceGenerator.createService(RetrofitInterface.class);
retrofitInterface.getUser("sessionid=" + getArguments().getString(Constants.SESSION_ID), userID).enqueue(new Callback<User>() {
@Override
public void onResponse(Call<User> call, Response<User> response) {
if (response.isSuccessful()) {
user = response.body();
populateViews();
}
} }
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, public void onFailure(Call<User> call, Throwable t) {
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_settings, container, false);
} }
});
}
private void populateViews() {
ImageView userProfilePictureImageView = getActivity().findViewById(R.id.user_card_avatar);
TextView userNameTextView = getActivity().findViewById(R.id.user_card_name);
Picasso.with(getContext()).load(user.getUserProfilePictureUrl()).into(userProfilePictureImageView);
userNameTextView.setText(user.getUserName());
Button updateProfileButton = getActivity().findViewById(R.id.settings_update_profile);
Button feedbackButton = getActivity().findViewById(R.id.settings_feedback);
Button aboutButton = getActivity().findViewById(R.id.settings_about);
Button logoutButton = getActivity().findViewById(R.id.settings_logout);
updateProfileButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
openWebURL("https://gymkhana.iitb.ac.in/sso/user");
}
});
feedbackButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
openWebURL("https://insti.app/feedback");
}
});
aboutButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AboutFragment aboutFragment = new AboutFragment();
FragmentManager manager = getActivity().getSupportFragmentManager();
FragmentTransaction transaction = manager.beginTransaction();
transaction.setCustomAnimations(R.anim.slide_in_left, R.anim.slide_out_left, R.anim.slide_in_right, R.anim.slide_out_right);
transaction.replace(R.id.framelayout_for_fragment, aboutFragment, aboutFragment.getTag());
transaction.addToBackStack(aboutFragment.getTag()).commit();
}
});
logoutButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
RetrofitInterface retrofitInterface = ServiceGenerator.createService(RetrofitInterface.class);
retrofitInterface.logout("sessionid=" + getArguments().getString(Constants.SESSION_ID)).enqueue(new Callback<Void>() {
@Override
public void onResponse(Call<Void> call, Response<Void> response) {
if (response.isSuccessful()) {
SessionManager sessionManager = new SessionManager(getContext());
sessionManager.logout();
Intent intent = new Intent(getContext(), LoginActivity.class);
startActivity(intent);
getActivity().finish();
}
//Server Error
}
@Override
public void onFailure(Call<Void> call, Throwable t) {
//Network Error
}
});
}
});
}
private void openWebURL(String URL) {
Intent browse = new Intent(Intent.ACTION_VIEW, Uri.parse(URL));
startActivity(browse);
}
} }
...@@ -111,6 +111,7 @@ public class TrainingBlogFragment extends BaseFragment { ...@@ -111,6 +111,7 @@ public class TrainingBlogFragment extends BaseFragment {
} }
} }
}); });
getActivity().findViewById(R.id.loadingPanel).setVisibility(View.GONE);
} }
private void openWebURL(String URL) { private void openWebURL(String URL) {
......
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,5c1.66,0 3,1.34 3,3s-1.34,3 -3,3 -3,-1.34 -3,-3 1.34,-3 3,-3zM12,19.2c-2.5,0 -4.71,-1.28 -6,-3.22 0.03,-1.99 4,-3.08 6,-3.08 1.99,0 5.97,1.09 6,3.08 -1.29,1.94 -3.5,3.22 -6,3.22z"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M10.09,15.59L11.5,17l5,-5 -5,-5 -1.41,1.41L12.67,11H3v2h9.67l-2.58,2.59zM19,3H5c-1.11,0 -2,0.9 -2,2v4h2V5h14v14H5v-4H3v4c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2V5c0,-1.1 -0.9,-2 -2,-2z"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M20,2L4,2c-1.1,0 -1.99,0.9 -1.99,2L2,22l4,-4h14c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM13,14h-2v-2h2v2zM13,10h-2L11,6h2v4z"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM13,17h-2v-6h2v6zM13,9h-2L11,7h2v2z"/>
</vector>
<?xml version="1.0" encoding="utf-8"?>
<vector
android:height="108dp"
android:width="108dp"
android:viewportHeight="108"
android:viewportWidth="108"
xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#26A69A"
android:pathData="M0,0h108v108h-108z"/>
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,0L19,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M29,0L29,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M39,0L39,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M49,0L49,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M59,0L59,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M69,0L69,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M79,0L79,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M89,0L89,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M99,0L99,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,9L108,9"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,19L108,19"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,29L108,29"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,39L108,39"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,49L108,49"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,59L108,59"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,69L108,69"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,79L108,79"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,89L108,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,99L108,99"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,29L89,29"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,39L89,39"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,49L89,49"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,59L89,59"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,69L89,69"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,79L89,79"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M29,19L29,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M39,19L39,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M49,19L49,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M59,19L59,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M69,19L69,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M79,19L79,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
</vector>
<vector android:height="24dp" android:viewportHeight="2250"
android:viewportWidth="2250" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#c5c5c5"
android:pathData="M0,1125l0,-1125 1125,0 1125,0 0,1125 0,1125 -140,0c-77,0 -140,-3 -140,-6 0,-48 -51,-287 -69,-322 -5,-9 -19,-42 -32,-72 -82,-193 -257,-378 -431,-455 -37,-17 -68,-33 -68,-36 0,-3 17,-15 38,-27 20,-11 56,-40 78,-64 222,-231 179,-606 -89,-771 -102,-63 -154,-79 -267,-79 -154,-1 -248,38 -355,146 -82,83 -119,153 -141,264 -37,187 49,393 209,502 20,14 37,28 37,31 0,4 -20,14 -45,23 -73,28 -195,114 -264,184 -112,117 -177,228 -231,391 -25,76 -34,115 -56,259l-5,32 -139,0 -140,0 0,-1125z" android:strokeColor="#00000000"/>
<path android:fillColor="#fefefe"
android:pathData="M286,2208c32,-228 86,-375 194,-533 77,-111 244,-248 355,-291 25,-9 45,-19 45,-23 0,-3 -17,-17 -37,-31 -160,-109 -246,-315 -209,-502 22,-111 59,-181 141,-264 107,-108 201,-147 355,-146 113,0 165,16 267,79 195,120 281,365 205,584 -36,103 -117,207 -194,251 -21,12 -38,24 -38,27 0,3 31,19 68,36 174,77 349,262 431,455 13,30 27,63 32,72 18,35 69,274 69,322 0,3 -380,6 -845,6l-845,0 6,-42z" android:strokeColor="#00000000"/>
</vector>
...@@ -201,4 +201,16 @@ ...@@ -201,4 +201,16 @@
</LinearLayout> </LinearLayout>
</android.support.v4.widget.NestedScrollView> </android.support.v4.widget.NestedScrollView>
</android.support.v4.widget.SwipeRefreshLayout> </android.support.v4.widget.SwipeRefreshLayout>
<RelativeLayout
android:id="@+id/loadingPanel"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center" >
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true" />
</RelativeLayout>
</FrameLayout> </FrameLayout>
\ No newline at end of file
...@@ -74,4 +74,16 @@ ...@@ -74,4 +74,16 @@
android:src="@android:drawable/ic_input_add" android:src="@android:drawable/ic_input_add"
android:tint="@android:color/black" /> android:tint="@android:color/black" />
<RelativeLayout
android:id="@+id/loadingPanel"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center" >
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true" />
</RelativeLayout>
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -26,4 +26,16 @@ ...@@ -26,4 +26,16 @@
android:layout_margin="16dp" android:layout_margin="16dp"
android:src="@android:drawable/ic_input_add" android:src="@android:drawable/ic_input_add"
android:tint="@android:color/black" /> android:tint="@android:color/black" />
<RelativeLayout
android:id="@+id/loadingPanel"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center" >
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true" />
</RelativeLayout>
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
...@@ -26,4 +30,17 @@ ...@@ -26,4 +30,17 @@
android:layout_height="match_parent" /> android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout> </android.support.v4.widget.SwipeRefreshLayout>
</LinearLayout> </LinearLayout>
<RelativeLayout
android:id="@+id/loadingPanel"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center" >
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true" />
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
...@@ -16,4 +16,16 @@ ...@@ -16,4 +16,16 @@
android:layout_height="match_parent" /> android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout> </android.support.v4.widget.SwipeRefreshLayout>
<RelativeLayout
android:id="@+id/loadingPanel"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center" >
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true" />
</RelativeLayout>
</RelativeLayout> </RelativeLayout>
...@@ -16,4 +16,16 @@ ...@@ -16,4 +16,16 @@
android:layout_height="match_parent" /> android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout> </android.support.v4.widget.SwipeRefreshLayout>
<RelativeLayout
android:id="@+id/loadingPanel"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center" >
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true" />
</RelativeLayout>
</RelativeLayout> </RelativeLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
...@@ -12,14 +16,15 @@ ...@@ -12,14 +16,15 @@
<de.hdodenhof.circleimageview.CircleImageView <de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/user_profile_picture_profile" android:id="@+id/user_profile_picture_profile"
android:layout_width="135dp" android:layout_width="100dp"
android:layout_height="99dp" android:layout_height="100dp"
android:layout_margin="32dp" /> android:layout_margin="20dp"
android:layout_marginRight="15dp" />
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="32dp" android:layout_marginTop="20dp"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
...@@ -64,7 +69,8 @@ ...@@ -64,7 +69,8 @@
android:id="@+id/tab_layout" android:id="@+id/tab_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="40dp" android:layout_height="40dp"
android:background="@color/colorPrimaryDark"> android:background="@color/colorWhite"
android:visibility="invisible">
<android.support.design.widget.TabItem <android.support.design.widget.TabItem
android:id="@+id/following_tab" android:id="@+id/following_tab"
...@@ -85,4 +91,16 @@ ...@@ -85,4 +91,16 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
</LinearLayout> </LinearLayout>
<RelativeLayout
android:id="@+id/loadingPanel"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center" >
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true" />
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".fragment.SettingsFragment"> tools:context=".fragment.SettingsFragment">
<!-- TODO: Update blank fragment layout --> <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="4dp"
card_view:cardCornerRadius="1dp"
card_view:cardElevation="1dp">
<LinearLayout
android:id="@+id/role_card_layout"
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_margin="16dp"
android:orientation="horizontal">
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/user_card_avatar"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_gravity="center"
android:layout_margin="16dp"
android:scaleType="centerCrop" />
<TextView <TextView
android:id="@+id/user_card_name"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:text="@string/hello_blank_fragment" /> android:layout_gravity="center_vertical"
android:textColor="@android:color/black"
android:textSize="18sp" />
</LinearLayout>
</android.support.v7.widget.CardView>
<Button
android:id="@+id/settings_update_profile"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:drawablePadding="16dp"
android:drawableStart="@drawable/baseline_account_circle_black_36"
android:gravity="center_vertical"
android:text="Update Profile"
android:textAllCaps="false"
android:textSize="20sp" />
<Button
android:id="@+id/settings_feedback"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:drawablePadding="16dp"
android:drawableStart="@drawable/baseline_feedback_black_36"
android:gravity="center_vertical"
android:text="Feedback"
android:textAllCaps="false"
android:textSize="20sp" />
<Button
android:id="@+id/settings_about"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:drawablePadding="16dp"
android:drawableStart="@drawable/baseline_info_black_36"
android:gravity="center_vertical"
android:text="About"
android:textAllCaps="false"
android:textSize="20sp" />
<Button
android:id="@+id/settings_logout"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:drawablePadding="16dp"
android:drawableStart="@drawable/baseline_exit_to_app_black_36"
android:gravity="center_vertical"
android:text="Logout"
android:textAllCaps="false"
android:textSize="20sp" />
</FrameLayout> </LinearLayout>
\ No newline at end of file \ No newline at end of file
...@@ -16,4 +16,16 @@ ...@@ -16,4 +16,16 @@
android:layout_height="match_parent" /> android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout> </android.support.v4.widget.SwipeRefreshLayout>
<RelativeLayout
android:id="@+id/loadingPanel"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center" >
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true" />
</RelativeLayout>
</RelativeLayout> </RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
\ No newline at end of file
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