Commit aa89fa7d authored by Varun Patil's avatar Varun Patil

Merge branch 'master' into morestuff

parents b23aaf0d b5c1aa9d
......@@ -19,4 +19,5 @@ public class Constants {
public static final int STATUS_GOING = 2;
public static final int STATUS_INTERESTED = 1;
public static final int STATUS_NOT_GOING = 0;
public static final String BODY_JSON= "body_json";
}
......@@ -3,6 +3,7 @@ package in.ac.iitb.gymkhana.iitbapp;
import android.annotation.TargetApi;
import android.app.PendingIntent;
import android.app.ProgressDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
......@@ -52,6 +53,7 @@ public class LoginActivity extends AppCompatActivity {
private AuthorizationService mAuthService;
private BroadcastReceiver mRegistrationBroadcastReceiver;
private boolean isReceiverRegistered;
private ProgressDialog progressDialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
......@@ -162,17 +164,18 @@ public class LoginActivity extends AppCompatActivity {
}
private void handleAuthorizationResponse(@NonNull Intent intent) {
progressDialog = new ProgressDialog(this);
progressDialog.setMessage("Logging In");
progressDialog.setCancelable(false);
progressDialog.setIndeterminate(true);
progressDialog.show();
AuthorizationResponse response = AuthorizationResponse.fromIntent(intent);
AuthorizationException error = AuthorizationException.fromIntent(intent);
if (response != null) {
authCode = response.authorizationCode;
Log.d(TAG, "Received AuthorizationResponse: " + "AuthCode: " + authCode);
Toast.makeText(this,
"AuthCode: " + authCode, Toast.LENGTH_SHORT)
.show();
if (checkPlayServices()) {
Intent registerIntent = new Intent(this, RegistrationIntentService.class);
startService(registerIntent);
}
......@@ -234,7 +237,7 @@ public class LoginActivity extends AppCompatActivity {
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(i);
progressDialog.dismiss();
//Save credentials in AccountManager to keep user logged in
//Go to MainActivity
}
......
......@@ -63,7 +63,7 @@ public class FeedAdapter extends RecyclerView.Adapter<FeedAdapter.ViewHolder> {
}
StringBuilder eventVenueName = new StringBuilder();
for (Venue venue : currentEvent.getEventVenues()) {
eventVenueName.append(", ").append(venue.getVenueName());
eventVenueName.append(", ").append(venue.getVenueShortName());
}
if (!eventVenueName.toString().equals(""))
viewHolder.eventVenue.setText(eventVenueName.toString().substring(2));
......
......@@ -8,7 +8,13 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import in.ac.iitb.gymkhana.iitbapp.ItemClickListener;
import in.ac.iitb.gymkhana.iitbapp.R;
......@@ -47,7 +53,22 @@ public class NewsAdapter extends RecyclerView.Adapter<NewsAdapter.ViewHolder> {
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
NewsArticle article = newsArticles.get(position);
Markwon.setMarkdown(holder.articleTitle, article.getTitle());
holder.articlePublished.setText(article.getPublished());
holder.articleBody.setText(article.getBody().getBodyName());
try {
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX", Locale.US);
Date publishedDate = dateFormat.parse(article.getPublished());
Calendar calendar = Calendar.getInstance();
calendar.setTime(publishedDate);
DateFormat displayFormat;
if (calendar.get(Calendar.YEAR) == Calendar.getInstance().get(Calendar.YEAR)) {
displayFormat = new SimpleDateFormat("EEE, MMM d, HH:mm", Locale.US);
} else {
displayFormat = new SimpleDateFormat("EEE, MMM d, ''yy, HH:mm", Locale.US);
}
holder.articlePublished.setText(displayFormat.format(publishedDate));
} catch (ParseException e) {
e.printStackTrace();
}
Markwon.setMarkdown(holder.articleContent, article.getContent());
}
......@@ -58,6 +79,7 @@ public class NewsAdapter extends RecyclerView.Adapter<NewsAdapter.ViewHolder> {
public class ViewHolder extends RecyclerView.ViewHolder {
private TextView articleTitle;
private TextView articleBody;
private TextView articlePublished;
private TextView articleContent;
......@@ -65,6 +87,7 @@ public class NewsAdapter extends RecyclerView.Adapter<NewsAdapter.ViewHolder> {
super(itemView);
articleTitle = (TextView) itemView.findViewById(R.id.article_title);
articleBody = (TextView) itemView.findViewById(R.id.article_body);
articlePublished = (TextView) itemView.findViewById(R.id.article_published);
articleContent = (TextView) itemView.findViewById(R.id.article_content);
}
......
......@@ -7,7 +7,13 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import in.ac.iitb.gymkhana.iitbapp.ItemClickListener;
import in.ac.iitb.gymkhana.iitbapp.R;
......@@ -45,7 +51,21 @@ public class PlacementBlogAdapter extends RecyclerView.Adapter<PlacementBlogAdap
public void onBindViewHolder(ViewHolder holder, int position) {
PlacementBlogPost post = posts.get(position);
Markwon.setMarkdown(holder.postTitle, post.getTitle());
holder.postPublished.setText(post.getPublished());
try {
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX", Locale.US);
Date publishedDate = dateFormat.parse(post.getPublished());
Calendar calendar = Calendar.getInstance();
calendar.setTime(publishedDate);
DateFormat displayFormat;
if (calendar.get(Calendar.YEAR) == Calendar.getInstance().get(Calendar.YEAR)) {
displayFormat = new SimpleDateFormat("EEE, MMM d, HH:mm", Locale.US);
} else {
displayFormat = new SimpleDateFormat("EEE, MMM d, ''yy, HH:mm", Locale.US);
}
holder.postPublished.setText(displayFormat.format(publishedDate));
} catch (ParseException e) {
holder.postPublished.setText(post.getPublished());
}
Markwon.setMarkdown(holder.postContent, post.getContent());
}
......
package in.ac.iitb.gymkhana.iitbapp.adapter;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.squareup.picasso.Picasso;
import java.util.List;
import in.ac.iitb.gymkhana.iitbapp.ItemClickListener;
import in.ac.iitb.gymkhana.iitbapp.R;
import in.ac.iitb.gymkhana.iitbapp.data.Body;
import in.ac.iitb.gymkhana.iitbapp.data.Role;
public class RoleAdapter extends RecyclerView.Adapter<RoleAdapter.ViewHolder>{
private List<Role> roleList;
private ItemClickListener itemClickListener;
private Context context;
public RoleAdapter(List<Role> roleList, ItemClickListener itemClickListener){
this.roleList = roleList;
this.itemClickListener = itemClickListener;
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
context = parent.getContext();
View v = LayoutInflater.from(context)
.inflate(R.layout.role_card,parent,false);
final ViewHolder postViewHolder = new ViewHolder(v);
v.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
itemClickListener.onItemClick(view,postViewHolder.getAdapterPosition());
}
});
return postViewHolder;
}
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
Role role = roleList.get(position);
Body roleBody = role.getRoleBodyDetails();
holder.bodyName.setText(roleBody.getBodyName());
holder.role.setText(role.getRoleName());
Picasso.with(context).load(roleBody.getBodyImageURL()).into(holder.image);
}
@Override
public int getItemCount() {
return roleList.size();
}
public class ViewHolder extends RecyclerView.ViewHolder {
public TextView bodyName;
public TextView role;
public ImageView image;
public ViewHolder(View itemView) {
super(itemView);
bodyName = (TextView) itemView.findViewById(R.id.role_card_body);
role = (TextView) itemView.findViewById(R.id.role_card_role);
image = (ImageView) itemView.findViewById(R.id.role_card_avatar);
}
}
}
......@@ -7,7 +7,13 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import in.ac.iitb.gymkhana.iitbapp.ItemClickListener;
import in.ac.iitb.gymkhana.iitbapp.R;
......@@ -45,7 +51,21 @@ public class TrainingBlogAdapter extends RecyclerView.Adapter<TrainingBlogAdapte
public void onBindViewHolder(ViewHolder holder, int position) {
TrainingBlogPost post = posts.get(position);
Markwon.setMarkdown(holder.postTitle, post.getTitle());
holder.postPublished.setText(post.getPublished());
try {
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX", Locale.US);
Date publishedDate = dateFormat.parse(post.getPublished());
Calendar calendar = Calendar.getInstance();
calendar.setTime(publishedDate);
DateFormat displayFormat;
if (calendar.get(Calendar.YEAR) == Calendar.getInstance().get(Calendar.YEAR)) {
displayFormat = new SimpleDateFormat("EEE, MMM d, HH:mm", Locale.US);
} else {
displayFormat = new SimpleDateFormat("EEE, MMM d, ''yy, HH:mm", Locale.US);
}
holder.postPublished.setText(displayFormat.format(publishedDate));
} catch (ParseException e) {
holder.postPublished.setText(post.getPublished());
}
Markwon.setMarkdown(holder.postContent, post.getContent());
}
......
......@@ -16,6 +16,30 @@ public class Venue {
@ColumnInfo(name = "name")
@SerializedName("name")
String venueName;
@ColumnInfo(name = "short_name")
@SerializedName("short_name")
String venueShortName;
@ColumnInfo(name = "description")
@SerializedName("description")
String venueDescripion;
@ColumnInfo(name = "parent")
@SerializedName("parent")
String venueParentId;
@ColumnInfo(name = "parent_relation")
@SerializedName("parent_relation")
String venueParentRelation;
@ColumnInfo(name = "group_id")
@SerializedName("group_id")
Integer venueGroupId;
@ColumnInfo(name = "pixel_x")
@SerializedName("pixel_x")
Integer venuePixelX;
@ColumnInfo(name = "pixel_y")
@SerializedName("pixel_y")
Integer venuePixelY;
@ColumnInfo(name = "reusable")
@SerializedName("reusable")
Boolean venueReusable;
@ColumnInfo(name = "lat")
@SerializedName("lat")
double venueLatitude;
......@@ -23,9 +47,17 @@ public class Venue {
@SerializedName("lng")
double venueLongitude;
public Venue(String venueID, String venueName, double venueLatitude, double venueLongitude) {
public Venue(String venueID, String venueName, String venueShortName, String venueDescripion, String venueParentId, String venueParentRelation, Integer venueGroupId, Integer venuePixelX, Integer venuePixelY, Boolean venueReusable, double venueLatitude, double venueLongitude) {
this.venueID = venueID;
this.venueName = venueName;
this.venueShortName = venueShortName;
this.venueDescripion = venueDescripion;
this.venueParentId = venueParentId;
this.venueParentRelation = venueParentRelation;
this.venueGroupId = venueGroupId;
this.venuePixelX = venuePixelX;
this.venuePixelY = venuePixelY;
this.venueReusable = venueReusable;
this.venueLatitude = venueLatitude;
this.venueLongitude = venueLongitude;
}
......@@ -61,4 +93,68 @@ public class Venue {
public void setVenueLongitude(double venueLongitude) {
this.venueLongitude = venueLongitude;
}
public String getVenueShortName() {
return venueShortName;
}
public void setVenueShortName(String venueShortName) {
this.venueShortName = venueShortName;
}
public String getVenueDescripion() {
return venueDescripion;
}
public void setVenueDescripion(String venueDescripion) {
this.venueDescripion = venueDescripion;
}
public String getVenueParentId() {
return venueParentId;
}
public void setVenueParentId(String venueParentId) {
this.venueParentId = venueParentId;
}
public String getVenueParentRelation() {
return venueParentRelation;
}
public void setVenueParentRelation(String venueParentRelation) {
this.venueParentRelation = venueParentRelation;
}
public Integer getVenueGroupId() {
return venueGroupId;
}
public void setVenueGroupId(Integer venueGroupId) {
this.venueGroupId = venueGroupId;
}
public Integer getVenuePixelX() {
return venuePixelX;
}
public void setVenuePixelX(Integer venuePixelX) {
this.venuePixelX = venuePixelX;
}
public Integer getVenuePixelY() {
return venuePixelY;
}
public void setVenuePixelY(Integer venuePixelY) {
this.venuePixelY = venuePixelY;
}
public Boolean getVenueReusable() {
return venueReusable;
}
public void setVenueReusable(Boolean venueReusable) {
this.venueReusable = venueReusable;
}
}
......@@ -9,6 +9,7 @@ import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v4.widget.SwipeRefreshLayout;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
......@@ -47,13 +48,14 @@ import ru.noties.markwon.Markwon;
public class BodyFragment extends Fragment {
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_BODY = "body";
private AppDatabase appDatabase;
String TAG = "BodyFragment";
// TODO: Rename and change types of parameters
private Body min_body;
private SwipeRefreshLayout bodySwipeRefreshLayout;
public BodyFragment() {
......@@ -71,7 +73,7 @@ public class BodyFragment extends Fragment {
public static BodyFragment newInstance(Body arg_body) {
BodyFragment fragment = new BodyFragment();
Bundle args = new Bundle();
args.putString(ARG_BODY, new Gson().toJson(arg_body));
args.putString(Constants.BODY_JSON, new Gson().toJson(arg_body));
fragment.setArguments(args);
return fragment;
}
......@@ -80,7 +82,7 @@ public class BodyFragment extends Fragment {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
min_body = new Gson().fromJson(getArguments().getString(ARG_BODY), Body.class);
min_body = new Gson().fromJson(getArguments().getString(Constants.BODY_JSON), Body.class);
}
}
......@@ -97,6 +99,13 @@ public class BodyFragment extends Fragment {
} else {
updateBody();
}
bodySwipeRefreshLayout=getActivity().findViewById(R.id.body_swipe_refresh_layout);
bodySwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
updateBody();
}
});
}
private void updateBody() {
......@@ -110,11 +119,13 @@ public class BodyFragment extends Fragment {
appDatabase.dbDao().insertBody(body);
displayBody(body);
bodySwipeRefreshLayout.setRefreshing(false);
}
}
@Override
public void onFailure(Call<Body> call, Throwable t) {
bodySwipeRefreshLayout.setRefreshing(false);
// Network Error
}
});
......
......@@ -108,7 +108,7 @@ public class EventFragment extends BaseFragment {
StringBuilder eventVenueName = new StringBuilder();
for (Venue venue : event.getEventVenues()) {
eventVenueName.append(", ").append(venue.getVenueName());
eventVenueName.append(", ").append(venue.getVenueShortName());
}
final List<Body> bodyList = event.getEventBodies();
......
......@@ -3,6 +3,9 @@ package in.ac.iitb.gymkhana.iitbapp.fragment;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
......@@ -11,10 +14,16 @@ import android.widget.TextView;
import com.squareup.picasso.Picasso;
import java.util.List;
import in.ac.iitb.gymkhana.iitbapp.Constants;
import in.ac.iitb.gymkhana.iitbapp.ItemClickListener;
import in.ac.iitb.gymkhana.iitbapp.R;
import in.ac.iitb.gymkhana.iitbapp.adapter.RoleAdapter;
import in.ac.iitb.gymkhana.iitbapp.api.RetrofitInterface;
import in.ac.iitb.gymkhana.iitbapp.api.ServiceGenerator;
import in.ac.iitb.gymkhana.iitbapp.data.Body;
import in.ac.iitb.gymkhana.iitbapp.data.Role;
import in.ac.iitb.gymkhana.iitbapp.data.User;
import retrofit2.Call;
import retrofit2.Callback;
......@@ -68,6 +77,24 @@ public class ProfileFragment extends BaseFragment {
TextView userEmailIDTextView = getActivity().findViewById(R.id.user_email_profile);
TextView userContactNumberTextView = getActivity().findViewById(R.id.user_contact_no_profile);
final List<Role> roleList = user.getUserRoles();
RecyclerView userRoleRecyclerView = getActivity().findViewById(R.id.role_recycler_view);
RoleAdapter roleAdapter = new RoleAdapter(roleList, new ItemClickListener() {
@Override
public void onItemClick(View v, int position) {
Role role = roleList.get(position);
Body roleBody = role.getRoleBodyDetails();
BodyFragment bodyFragment = BodyFragment.newInstance(roleBody);
FragmentTransaction ft = getActivity().getSupportFragmentManager().beginTransaction();
ft.replace(R.id.framelayout_for_fragment, bodyFragment, bodyFragment.getTag());
ft.addToBackStack(bodyFragment.getTag());
ft.commit();
}
});
userRoleRecyclerView.setAdapter(roleAdapter);
userRoleRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
Picasso.with(getContext()).load(user.getUserProfilePictureUrl()).into(userProfilePictureImageView);
userNameTextView.setText(user.getUserName());
userRollNumberTextView.setText(user.getUserRollNumber());
......
......@@ -7,16 +7,22 @@
android:orientation="vertical"
tools:context=".fragment.BodyFragment">
<android.support.v4.widget.NestedScrollView
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/body_swipe_refresh_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:id="@+id/body_picture"
android:layout_width="match_parent"
......@@ -127,6 +133,7 @@
android:layout_marginTop="10dp"
android:nestedScrollingEnabled="false" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</android.support.v4.widget.SwipeRefreshLayout>
</FrameLayout>
\ No newline at end of file
......@@ -2,49 +2,87 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:orientation="vertical"
tools:context="in.ac.iitb.gymkhana.iitbapp.fragment.ProfileFragment">
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/user_profile_picture_profile"
android:layout_width="160dp"
android:layout_height="160dp"
android:layout_margin="32dp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:orientation="vertical">
android:orientation="horizontal">
<TextView
android:id="@+id/user_name_profile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:textSize="20sp"
android:textStyle="bold" />
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/user_profile_picture_profile"
android:layout_width="135dp"
android:layout_height="99dp"
android:layout_margin="32dp" />
<TextView
android:id="@+id/user_rollno_profile"
android:layout_width="match_parent"
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:textSize="16sp" />
android:layout_marginTop="32dp"
android:orientation="vertical">
<TextView
android:id="@+id/user_name_profile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="@+id/user_rollno_profile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:textSize="16sp" />
<TextView
android:id="@+id/user_email_profile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:textSize="16sp" />
<TextView
android:id="@+id/user_contact_no_profile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:textSize="16sp" />
</LinearLayout>
<TextView
android:id="@+id/user_email_profile"
android:layout_width="match_parent"
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/role_recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<android.support.design.widget.TabLayout
android:id="@+id/tab_layout"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="@color/colorPrimaryDark">
<android.support.design.widget.TabItem
android:id="@+id/following_tab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:textSize="16sp" />
android:text="Following" />
<TextView
android:id="@+id/user_contact_no_profile"
android:layout_width="match_parent"
<android.support.design.widget.TabItem
android:id="@+id/events_tab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:textSize="16sp" />
</LinearLayout>
android:text="Events" />
</android.support.design.widget.TabLayout>
<android.support.v4.view.ViewPager
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
......@@ -24,10 +24,24 @@
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="@+id/article_published"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/article_body"
android:layout_marginEnd="8dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#000000"
android:textStyle="bold" />
<TextView
android:id="@+id/article_published"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<TextView
android:id="@+id/article_content"
......
<?xml version="1.0" encoding="utf-8"?>
<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="4dp"
card_view:cardElevation="4dp">
<LinearLayout
android:id="@+id/role_card_layout"
android:layout_width="match_parent"
android:layout_height="80dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/role_card_avatar"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_gravity="center"
android:scaleType="centerCrop" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="12dp"
android:layout_marginRight="12dp"
android:layout_weight="3"
android:orientation="vertical">
<TextView
android:id="@+id/role_card_body"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Organization"
android:textColor="@android:color/black"
android:textSize="18sp" />
<TextView
android:id="@+id/role_card_role"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Role" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
\ 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