Commit b1de840d authored by Varun Patil's avatar Varun Patil Committed by GitHub

Merge branch 'master' into addevent

parents 37efdfbe 439eef59
...@@ -8,8 +8,8 @@ android { ...@@ -8,8 +8,8 @@ android {
manifestPlaceholders 'appAuthRedirectScheme': 'https' manifestPlaceholders 'appAuthRedirectScheme': 'https'
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 27 targetSdkVersion 27
versionCode 10 versionCode 11
versionName "1.0.5" versionName "1.0.6"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
resValue "string", "google_maps_key", (project.findProperty("GOOGLE_MAPS_API_KEY") ?: "") resValue "string", "google_maps_key", (project.findProperty("GOOGLE_MAPS_API_KEY") ?: "")
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
...@@ -26,13 +26,12 @@ ext { ...@@ -26,13 +26,12 @@ ext {
supportLibVersion = '27.1.1' supportLibVersion = '27.1.1'
playServicesVersion = '15.0.1' playServicesVersion = '15.0.1'
butterKnifeVersion = '8.8.1' butterKnifeVersion = '8.8.1'
appAuthVersion = '0.2.0'
retrofitVersion = '2.3.0' retrofitVersion = '2.3.0'
okhttpVersion = '3.10.0' okhttpVersion = '3.10.0'
picassoVersion = '2.71828' picassoVersion = '2.71828'
archRoomVersion = '1.1.1' archRoomVersion = '1.1.1'
circleImageViewVersion = '2.2.0' circleImageViewVersion = '2.2.0'
markwonVersion = '1.0.4' markwonVersion = '1.0.6'
} }
dependencies { dependencies {
...@@ -42,7 +41,6 @@ dependencies { ...@@ -42,7 +41,6 @@ dependencies {
exclude group: 'com.android.support', module: 'support-annotations' exclude group: 'com.android.support', module: 'support-annotations'
}) })
implementation "com.android.support:appcompat-v7:${supportLibVersion}" implementation "com.android.support:appcompat-v7:${supportLibVersion}"
implementation "net.openid:appauth:${appAuthVersion}"
testImplementation "junit:junit:4.12" testImplementation "junit:junit:4.12"
implementation "com.android.support:design:${supportLibVersion}" implementation "com.android.support:design:${supportLibVersion}"
implementation "com.android.support:support-v4:${supportLibVersion}" implementation "com.android.support:support-v4:${supportLibVersion}"
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<application <application
android:allowBackup="true" android:allowBackup="true"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher_round"
android:label="@string/app_name" android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true" android:supportsRtl="true"
...@@ -20,15 +20,12 @@ ...@@ -20,15 +20,12 @@
android:name="com.google.android.gms.version" android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" /> android:value="@integer/google_play_services_version" />
<!-- The API key for Google Maps-based APIs. -->
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key" />
<!-- FCM styling --> <!-- FCM styling -->
<meta-data <meta-data
android:name="com.google.firebase.messaging.default_notification_icon" android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/ic_lotusgray" /> android:resource="@drawable/ic_lotus_blue" />
<meta-data android:name="com.google.firebase.messaging.default_notification_color"
android:resource="@color/colorPrimary" />
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"
...@@ -97,23 +94,12 @@ ...@@ -97,23 +94,12 @@
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name="net.openid.appauth.RedirectUriReceiverActivity">
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="redirecturi"
android:scheme="https" />
</intent-filter>
</activity>
<service <service
android:name=".notifications.NotificationIntentService" android:name=".notifications.NotificationIntentService"
android:enabled="true" android:enabled="true"
android:exported="false" /> android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE" />
<receiver android:name=".notifications.NotificationEventReceiver" /> <receiver android:name=".notifications.NotificationEventReceiver" />
<receiver android:name=".notifications.NotificationServiceStarterReceiver"> <receiver android:name=".notifications.NotificationServiceStarterReceiver">
...@@ -124,16 +110,6 @@ ...@@ -124,16 +110,6 @@
</intent-filter> </intent-filter>
</receiver> </receiver>
<receiver
android:name="com.google.android.gms.gcm.GcmReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.example.gcm" />
</intent-filter>
</receiver>
<service android:name=".InstiAppFirebaseMessagingService"> <service android:name=".InstiAppFirebaseMessagingService">
<intent-filter> <intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" /> <action android:name="com.google.firebase.MESSAGING_EVENT" />
......
package app.insti; package app.insti;
import android.annotation.TargetApi;
import android.app.Activity; import android.app.Activity;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.graphics.Color;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.support.design.widget.NavigationView; import android.support.design.widget.NavigationView;
...@@ -24,8 +29,13 @@ import android.widget.ImageView; ...@@ -24,8 +29,13 @@ import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.firebase.iid.FirebaseInstanceId;
import com.google.firebase.iid.InstanceIdResult;
import com.squareup.picasso.Picasso; import com.squareup.picasso.Picasso;
import app.insti.api.RetrofitInterface;
import app.insti.api.ServiceGenerator;
import app.insti.api.UnsafeOkHttpClient; import app.insti.api.UnsafeOkHttpClient;
import app.insti.data.Body; import app.insti.data.Body;
import app.insti.data.Event; import app.insti.data.Event;
...@@ -48,6 +58,10 @@ import app.insti.fragment.QuickLinksFragment; ...@@ -48,6 +58,10 @@ 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;
import app.insti.notifications.NotificationEventReceiver; import app.insti.notifications.NotificationEventReceiver;
import okhttp3.OkHttpClient;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import static app.insti.Constants.MY_PERMISSIONS_REQUEST_ACCESS_LOCATION; import static app.insti.Constants.MY_PERMISSIONS_REQUEST_ACCESS_LOCATION;
import static app.insti.Constants.MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE; import static app.insti.Constants.MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE;
...@@ -72,6 +86,12 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On ...@@ -72,6 +86,12 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
initPicasso(); initPicasso();
} catch (IllegalStateException ignored) { } catch (IllegalStateException ignored) {
} }
/* Make notification channel on oreo */
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
createNotificationChannel();
}
setContentView(R.layout.activity_main); setContentView(R.layout.activity_main);
session = new SessionManager(getApplicationContext()); session = new SessionManager(getApplicationContext());
...@@ -100,10 +120,41 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On ...@@ -100,10 +120,41 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
} }
} }
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.O)
NotificationEventReceiver.setupAlarm(getApplicationContext()); NotificationEventReceiver.setupAlarm(getApplicationContext());
} }
@TargetApi(Build.VERSION_CODES.O)
private void createNotificationChannel() {
NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
// The id of the channel.
String id = "INSTIAPP_CHANNEL";
// The user-visible name of the channel.
CharSequence name = "InstiApp";
// The user-visible description of the channel.
String description = "InstiApp Notifications";
int importance = NotificationManager.IMPORTANCE_HIGH;
NotificationChannel mChannel = null;
mChannel = new NotificationChannel(id, name,importance);
// Configure the notification channel.
mChannel.setDescription(description);
mChannel.enableLights(true);
// Sets the notification light color for notifications posted to this
// channel, if the device supports this feature.
mChannel.setLightColor(Color.RED);
mChannel.enableVibration(true);
mChannel.setVibrationPattern(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400});
mNotificationManager.createNotificationChannel(mChannel);
}
private void handleIntent(Intent appLinkIntent) { private void handleIntent(Intent appLinkIntent) {
String appLinkAction = appLinkIntent.getAction(); String appLinkAction = appLinkIntent.getAction();
String appLinkData = appLinkIntent.getDataString(); String appLinkData = appLinkIntent.getDataString();
...@@ -149,12 +200,41 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On ...@@ -149,12 +200,41 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
if (session.isLoggedIn()) { if (session.isLoggedIn()) {
currentUser = User.fromString(session.pref.getString(Constants.CURRENT_USER, "")); currentUser = User.fromString(session.pref.getString(Constants.CURRENT_USER, ""));
updateNavigationView(); updateNavigationView();
updateFCMId();
}
}
/** Update FCM Id and update profile */
private void updateFCMId() {
FirebaseInstanceId.getInstance().getInstanceId().addOnSuccessListener(new OnSuccessListener<InstanceIdResult>() {
@Override
public void onSuccess(InstanceIdResult instanceIdResult) {
String fcmId = instanceIdResult.getToken();
RetrofitInterface retrofitInterface = ServiceGenerator.createService(RetrofitInterface.class);
retrofitInterface.getUserMe(getSessionIDHeader(), fcmId).enqueue(new Callback<User>() {
@Override
public void onResponse(Call<User> call, Response<User> response) {
if (response.isSuccessful()) {
session.createLoginSession(response.body().getUserName(), response.body(), session.getSessionID());
currentUser = response.body();
} else {
session.logout();
currentUser = null;
Toast.makeText(MainActivity.this, "You session has expired!", Toast.LENGTH_LONG).show();
} }
} }
@Override
public void onFailure(Call<User> call, Throwable t) { }
});
}
});
}
private void initNavigationView() { private void initNavigationView() {
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view); NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(this); navigationView.setNavigationItemSelectedListener(this);
navigationView.setCheckedItem(R.id.nav_feed);
} }
private void updateNavigationView() { private void updateNavigationView() {
...@@ -350,7 +430,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On ...@@ -350,7 +430,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
public void initPicasso() { public void initPicasso() {
Picasso.Builder builder = new Picasso.Builder(getApplicationContext()); Picasso.Builder builder = new Picasso.Builder(getApplicationContext());
builder.downloader(new com.squareup.picasso.OkHttp3Downloader(( builder.downloader(new com.squareup.picasso.OkHttp3Downloader((
UnsafeOkHttpClient.getUnsafeOkHttpClient(getApplicationContext()) new OkHttpClient.Builder().build()
))); )));
Picasso built = builder.build(); Picasso built = builder.build();
built.setIndicatorsEnabled(false); built.setIndicatorsEnabled(false);
......
...@@ -32,7 +32,7 @@ public class BodyAdapter extends RecyclerView.Adapter<BodyAdapter.ViewHolder> { ...@@ -32,7 +32,7 @@ public class BodyAdapter extends RecyclerView.Adapter<BodyAdapter.ViewHolder> {
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
context = parent.getContext(); context = parent.getContext();
View v = LayoutInflater.from(context) View v = LayoutInflater.from(context)
.inflate(R.layout.body_card_view, parent, false); .inflate(R.layout.feed_card, parent, false);
final ViewHolder postViewHolder = new ViewHolder(v); final ViewHolder postViewHolder = new ViewHolder(v);
v.setOnClickListener(new View.OnClickListener() { v.setOnClickListener(new View.OnClickListener() {
...@@ -51,7 +51,7 @@ public class BodyAdapter extends RecyclerView.Adapter<BodyAdapter.ViewHolder> { ...@@ -51,7 +51,7 @@ public class BodyAdapter extends RecyclerView.Adapter<BodyAdapter.ViewHolder> {
Body body = bodyList.get(position); Body body = bodyList.get(position);
holder.name.setText(body.getBodyName()); holder.name.setText(body.getBodyName());
holder.description.setText(body.getBodyShortDescription()); holder.description.setText(body.getBodyShortDescription());
Picasso.get().load(body.getBodyImageURL()).into(holder.image); Picasso.get().load(body.getBodyImageURL()).resize(0,200).into(holder.image);
} }
...@@ -67,9 +67,9 @@ public class BodyAdapter extends RecyclerView.Adapter<BodyAdapter.ViewHolder> { ...@@ -67,9 +67,9 @@ public class BodyAdapter extends RecyclerView.Adapter<BodyAdapter.ViewHolder> {
public ViewHolder(View itemView) { public ViewHolder(View itemView) {
super(itemView); super(itemView);
name = (TextView) itemView.findViewById(R.id.body_card_name); name = (TextView) itemView.findViewById(R.id.object_title);
description = (TextView) itemView.findViewById(R.id.body_card_description); description = (TextView) itemView.findViewById(R.id.object_subtitle);
image = (ImageView) itemView.findViewById(R.id.body_card_avatar); image = (ImageView) itemView.findViewById(R.id.object_picture);
} }
} }
......
package app.insti.adapter; package app.insti.adapter;
import android.content.Context; import android.content.Context;
import android.media.Image;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
...@@ -22,15 +23,21 @@ import app.insti.data.Venue; ...@@ -22,15 +23,21 @@ import app.insti.data.Venue;
public class FeedAdapter extends RecyclerView.Adapter<FeedAdapter.ViewHolder> { public class FeedAdapter extends RecyclerView.Adapter<FeedAdapter.ViewHolder> {
private List<Event> posts; private List<Event> events;
private Context context; private Context context;
private ItemClickListener itemClickListener; private ItemClickListener itemClickListener;
public FeedAdapter(List<Event> posts, ItemClickListener itemClickListener) { public FeedAdapter(List<Event> events, ItemClickListener itemClickListener) {
this.posts = posts; this.events = events;
this.itemClickListener = itemClickListener; this.itemClickListener = itemClickListener;
} }
@Override
public int getItemViewType(int position) {
if (position == 0) return 1;
else return 2;
}
@Override @Override
public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) { public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
context = viewGroup.getContext(); context = viewGroup.getContext();
...@@ -44,65 +51,69 @@ public class FeedAdapter extends RecyclerView.Adapter<FeedAdapter.ViewHolder> { ...@@ -44,65 +51,69 @@ public class FeedAdapter extends RecyclerView.Adapter<FeedAdapter.ViewHolder> {
itemClickListener.onItemClick(v, postViewHolder.getAdapterPosition()); itemClickListener.onItemClick(v, postViewHolder.getAdapterPosition());
} }
}); });
return postViewHolder; return postViewHolder;
} }
@Override @Override
public void onBindViewHolder(ViewHolder viewHolder, int i) { public void onBindViewHolder(ViewHolder viewHolder, int i) {
Event currentEvent = posts.get(i); Event currentEvent = events.get(i);
viewHolder.eventTitle.setText(currentEvent.getEventName()); viewHolder.eventTitle.setText(currentEvent.getEventName());
// viewHolder.eventDetails.setText(currentEvent.getEventDescription());
String subtitle = "";
Timestamp timestamp = currentEvent.getEventStartTime(); Timestamp timestamp = currentEvent.getEventStartTime();
if (timestamp != null) { if (timestamp != null) {
Date Date = new Date(timestamp.getTime()); Date Date = new Date(timestamp.getTime());
SimpleDateFormat simpleDateFormatDate = new SimpleDateFormat("dd MMM"); SimpleDateFormat simpleDateFormatDate = new SimpleDateFormat("dd MMM");
SimpleDateFormat simpleDateFormatTime = new SimpleDateFormat("HH:mm a"); SimpleDateFormat simpleDateFormatTime = new SimpleDateFormat("HH:mm a");
viewHolder.eventDate.setText(simpleDateFormatDate.format(Date)); subtitle += simpleDateFormatDate.format(Date) + " | " + simpleDateFormatTime.format(Date);
viewHolder.eventTime.setText(simpleDateFormatTime.format(Date));
} }
StringBuilder eventVenueName = new StringBuilder(); StringBuilder eventVenueName = new StringBuilder();
for (Venue venue : currentEvent.getEventVenues()) { for (Venue venue : currentEvent.getEventVenues()) {
eventVenueName.append(", ").append(venue.getVenueShortName()); eventVenueName.append(", ").append(venue.getVenueShortName());
} }
if (!eventVenueName.toString().equals("")) if (!eventVenueName.toString().equals(""))
viewHolder.eventVenue.setText(eventVenueName.toString().substring(2)); subtitle += " | " + eventVenueName.toString().substring(2);
viewHolder.eventSubtitle.setText(subtitle);
// Fallback to image of first body if event has no image // Fallback to image of first body if event has no image
if (currentEvent.getEventImageURL() == null) { if (currentEvent.getEventImageURL() == null) {
currentEvent.setEventImageURL(currentEvent.getEventBodies().get(0).getBodyImageURL()); currentEvent.setEventImageURL(currentEvent.getEventBodies().get(0).getBodyImageURL());
} }
if (currentEvent.isEventBigImage()) {
viewHolder.eventBigPicture.setVisibility(View.VISIBLE);
viewHolder.eventPicture.setVisibility(View.GONE);
Picasso.get().load(currentEvent.getEventImageURL()).into(viewHolder.eventBigPicture);
} else {
Picasso.get().load(currentEvent.getEventImageURL()).into(viewHolder.eventPicture); Picasso.get().load(currentEvent.getEventImageURL()).into(viewHolder.eventPicture);
} }
}
@Override @Override
public int getItemCount() { public int getItemCount() {
return posts.size(); return events.size();
} }
public class ViewHolder extends RecyclerView.ViewHolder { public class ViewHolder extends RecyclerView.ViewHolder {
private ImageView eventPicture; private ImageView eventPicture;
private TextView eventTitle; private TextView eventTitle;
// private TextView eventDetails; private TextView eventSubtitle;
private TextView eventDate; private ImageView eventBigPicture;
private TextView eventTime;
private TextView eventVenue;
private ImageView eventEnthu;
public ViewHolder(View itemView) { public ViewHolder(View itemView) {
super(itemView); super(itemView);
eventPicture = (ImageView) itemView.findViewById(R.id.event_picture); eventPicture = (ImageView) itemView.findViewById(R.id.object_picture);
eventTitle = (TextView) itemView.findViewById(R.id.event_title); eventTitle = (TextView) itemView.findViewById(R.id.object_title);
// eventDetails = (TextView) itemView.findViewById(R.id.event_details); eventSubtitle = (TextView) itemView.findViewById(R.id.object_subtitle);
eventDate = (TextView) itemView.findViewById(R.id.event_date); eventBigPicture = (ImageView) itemView.findViewById(R.id.big_object_picture);
eventTime = (TextView) itemView.findViewById(R.id.event_time);
eventVenue = (TextView) itemView.findViewById(R.id.event_venue);
} }
} }
public void setPosts(List<Event> posts) { public void setEvents(List<Event> events) {
this.posts = posts; this.events = events;
} }
} }
...@@ -59,6 +59,13 @@ public class NewsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { ...@@ -59,6 +59,13 @@ public class NewsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
itemClickListener.onItemClick(v, postViewHolder.getAdapterPosition()); itemClickListener.onItemClick(v, postViewHolder.getAdapterPosition());
} }
}); });
postViewHolder.articleContent.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
itemClickListener.onItemClick(v, postViewHolder.getAdapterPosition());
}
});
return postViewHolder; return postViewHolder;
} else { } else {
LayoutInflater inflater = LayoutInflater.from(context); LayoutInflater inflater = LayoutInflater.from(context);
......
...@@ -34,7 +34,7 @@ public class NotificationsAdapter extends RecyclerView.Adapter<NotificationsAdap ...@@ -34,7 +34,7 @@ public class NotificationsAdapter extends RecyclerView.Adapter<NotificationsAdap
public Viewholder onCreateViewHolder(ViewGroup viewGroup, int i) { public Viewholder onCreateViewHolder(ViewGroup viewGroup, int i) {
context = viewGroup.getContext(); context = viewGroup.getContext();
LayoutInflater inflater = LayoutInflater.from(context); LayoutInflater inflater = LayoutInflater.from(context);
View notificationView = inflater.inflate(R.layout.body_card_view, viewGroup, false); View notificationView = inflater.inflate(R.layout.feed_card, viewGroup, false);
final Viewholder notificationsViewHolder = new Viewholder(notificationView); final Viewholder notificationsViewHolder = new Viewholder(notificationView);
notificationView.setOnClickListener(new View.OnClickListener() { notificationView.setOnClickListener(new View.OnClickListener() {
...@@ -79,9 +79,9 @@ public class NotificationsAdapter extends RecyclerView.Adapter<NotificationsAdap ...@@ -79,9 +79,9 @@ public class NotificationsAdapter extends RecyclerView.Adapter<NotificationsAdap
public Viewholder(View itemView) { public Viewholder(View itemView) {
super(itemView); super(itemView);
notificationPicture = (ImageView) itemView.findViewById(R.id.body_card_avatar); notificationPicture = (ImageView) itemView.findViewById(R.id.object_picture);
notificationTitle = (TextView) itemView.findViewById(R.id.body_card_name); notificationTitle = (TextView) itemView.findViewById(R.id.object_title);
notificationVerb = (TextView) itemView.findViewById(R.id.body_card_description); notificationVerb = (TextView) itemView.findViewById(R.id.object_subtitle);
} }
} }
} }
...@@ -35,7 +35,7 @@ public class RoleAdapter extends RecyclerView.Adapter<RoleAdapter.ViewHolder> { ...@@ -35,7 +35,7 @@ public class RoleAdapter extends RecyclerView.Adapter<RoleAdapter.ViewHolder> {
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
context = parent.getContext(); context = parent.getContext();
View v = LayoutInflater.from(context) View v = LayoutInflater.from(context)
.inflate(R.layout.role_card, parent, false); .inflate(R.layout.feed_card, parent, false);
final ViewHolder postViewHolder = new ViewHolder(v); final ViewHolder postViewHolder = new ViewHolder(v);
v.setOnClickListener(new View.OnClickListener() { v.setOnClickListener(new View.OnClickListener() {
...@@ -71,9 +71,9 @@ public class RoleAdapter extends RecyclerView.Adapter<RoleAdapter.ViewHolder> { ...@@ -71,9 +71,9 @@ public class RoleAdapter extends RecyclerView.Adapter<RoleAdapter.ViewHolder> {
public ViewHolder(View itemView) { public ViewHolder(View itemView) {
super(itemView); super(itemView);
bodyName = (TextView) itemView.findViewById(R.id.role_card_body); bodyName = (TextView) itemView.findViewById(R.id.object_title);
role = (TextView) itemView.findViewById(R.id.role_card_role); role = (TextView) itemView.findViewById(R.id.object_subtitle);
image = (ImageView) itemView.findViewById(R.id.role_card_avatar); image = (ImageView) itemView.findViewById(R.id.object_picture);
} }
......
...@@ -31,7 +31,7 @@ public class UserAdapter extends RecyclerView.Adapter<UserAdapter.ViewHolder> { ...@@ -31,7 +31,7 @@ public class UserAdapter extends RecyclerView.Adapter<UserAdapter.ViewHolder> {
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
context = parent.getContext(); context = parent.getContext();
View v = LayoutInflater.from(context) View v = LayoutInflater.from(context)
.inflate(R.layout.role_card, parent, false); .inflate(R.layout.feed_card, parent, false);
final ViewHolder postViewHolder = new ViewHolder(v); final ViewHolder postViewHolder = new ViewHolder(v);
v.setOnClickListener(new View.OnClickListener() { v.setOnClickListener(new View.OnClickListener() {
...@@ -69,9 +69,9 @@ public class UserAdapter extends RecyclerView.Adapter<UserAdapter.ViewHolder> { ...@@ -69,9 +69,9 @@ public class UserAdapter extends RecyclerView.Adapter<UserAdapter.ViewHolder> {
public ViewHolder(View itemView) { public ViewHolder(View itemView) {
super(itemView); super(itemView);
userName = (TextView) itemView.findViewById(R.id.role_card_body); userName = (TextView) itemView.findViewById(R.id.object_title);
role = (TextView) itemView.findViewById(R.id.role_card_role); role = (TextView) itemView.findViewById(R.id.object_subtitle);
image = (ImageView) itemView.findViewById(R.id.role_card_avatar); image = (ImageView) itemView.findViewById(R.id.object_picture);
} }
} }
......
...@@ -29,6 +29,9 @@ public interface RetrofitInterface { ...@@ -29,6 +29,9 @@ public interface RetrofitInterface {
@GET("login") @GET("login")
Call<LoginResponse> login(@Query("code") String AUTH_CODE, @Query("redir") String redirectURI, @Query("fcm_id") String fcmID); Call<LoginResponse> login(@Query("code") String AUTH_CODE, @Query("redir") String redirectURI, @Query("fcm_id") String fcmID);
@GET("login")
Call<LoginResponse> login(@Query("code") String AUTH_CODE, @Query("redir") String redirectURI);
@GET("pass-login") @GET("pass-login")
Call<LoginResponse> passwordLogin(@Query("username") String username, @Query("password") String password); Call<LoginResponse> passwordLogin(@Query("username") String username, @Query("password") String password);
...@@ -65,6 +68,12 @@ public interface RetrofitInterface { ...@@ -65,6 +68,12 @@ public interface RetrofitInterface {
@POST("upload") @POST("upload")
Call<ImageUploadResponse> uploadImage(@Header("Cookie") String sessionID, @Body ImageUploadRequest imageUploadRequest); Call<ImageUploadResponse> uploadImage(@Header("Cookie") String sessionID, @Body ImageUploadRequest imageUploadRequest);
@GET("user-me")
Call<User> getUserMe(@Header("Cookie") String sessionID);
@GET("user-me")
Call<User> getUserMe(@Header("Cookie") String sessionID, @Query("fcm_id") String fcmId);
@GET("user-me/ues/{eventID}") @GET("user-me/ues/{eventID}")
Call<Void> updateUserEventStatus(@Header("Cookie") String sessionID, @Path("eventID") String eventID, @Query("status") int status); Call<Void> updateUserEventStatus(@Header("Cookie") String sessionID, @Path("eventID") String eventID, @Query("status") int status);
......
...@@ -2,6 +2,7 @@ package app.insti.data; ...@@ -2,6 +2,7 @@ package app.insti.data;
import android.arch.persistence.room.ColumnInfo; import android.arch.persistence.room.ColumnInfo;
import android.arch.persistence.room.Entity; import android.arch.persistence.room.Entity;
import android.arch.persistence.room.Ignore;
import android.arch.persistence.room.PrimaryKey; import android.arch.persistence.room.PrimaryKey;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
...@@ -65,6 +66,9 @@ public class Event { ...@@ -65,6 +66,9 @@ public class Event {
@SerializedName("user_ues") @SerializedName("user_ues")
int eventUserUes; int eventUserUes;
@Ignore
boolean eventBigImage = false;
public Event(String eventID, String eventStrID, String eventName, String eventDescription, String eventImageURL, Timestamp eventStartTime, Timestamp eventEndTime, boolean allDayEvent, List<Venue> eventVenues, List<Body> eventBodies, int eventInterestedCount, int eventGoingCount, List<User> eventInterested, List<User> eventGoing, String eventWebsiteURL, int eventUserUes) { public Event(String eventID, String eventStrID, String eventName, String eventDescription, String eventImageURL, Timestamp eventStartTime, Timestamp eventEndTime, boolean allDayEvent, List<Venue> eventVenues, List<Body> eventBodies, int eventInterestedCount, int eventGoingCount, List<User> eventInterested, List<User> eventGoing, String eventWebsiteURL, int eventUserUes) {
this.eventID = eventID; this.eventID = eventID;
this.eventStrID = eventStrID; this.eventStrID = eventStrID;
...@@ -216,4 +220,12 @@ public class Event { ...@@ -216,4 +220,12 @@ public class Event {
public String toString() { public String toString() {
return new Gson().toJson(this); return new Gson().toJson(this);
} }
public boolean isEventBigImage() {
return eventBigImage;
}
public void setEventBigImage(boolean eventBigImage) {
this.eventBigImage = eventBigImage;
}
} }
...@@ -72,7 +72,7 @@ public class AboutFragment extends BaseFragment { ...@@ -72,7 +72,7 @@ public class AboutFragment extends BaseFragment {
/* Show team pics */ /* Show team pics */
for (final Map.Entry<Integer, String> entry : team.entrySet()) { for (final Map.Entry<Integer, String> entry : team.entrySet()) {
CircleImageView circleImageView = getActivity().findViewById(entry.getKey()); CircleImageView circleImageView = getActivity().findViewById(entry.getKey());
Picasso.get().load("https://insti.app/team-pics/" + entry.getValue()).into(circleImageView); Picasso.get().load("https://insti.app/team-pics/" + entry.getValue()).resize(0,300).into(circleImageView);
} }
/* Map TextView ids to links */ /* Map TextView ids to links */
......
package app.insti.fragment; package app.insti.fragment;
import android.app.Activity;
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.FragmentTransaction; import android.support.v4.app.FragmentTransaction;
...@@ -13,7 +12,6 @@ import android.text.TextWatcher; ...@@ -13,7 +12,6 @@ import android.text.TextWatcher;
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.view.inputmethod.InputMethodManager;
import android.widget.EditText; import android.widget.EditText;
import com.google.gson.Gson; import com.google.gson.Gson;
...@@ -163,7 +161,7 @@ public class ExploreFragment extends Fragment { ...@@ -163,7 +161,7 @@ public class ExploreFragment extends Fragment {
// Set adapters data // Set adapters data
bodyAdapter.setBodyList(bodies); bodyAdapter.setBodyList(bodies);
eventsAdapter.setPosts(events); eventsAdapter.setEvents(events);
userAdapter.setUserList(users); userAdapter.setUserList(users);
// Notify all adapters // Notify all adapters
......
...@@ -125,6 +125,11 @@ public class FeedFragment extends BaseFragment { ...@@ -125,6 +125,11 @@ public class FeedFragment extends BaseFragment {
fab.setVisibility(View.VISIBLE); fab.setVisibility(View.VISIBLE);
} }
/* Make first event image big */
if (events.size() > 1) {
events.get(0).setEventBigImage(true);
}
final FeedAdapter feedAdapter = new FeedAdapter(events, new ItemClickListener() { final FeedAdapter feedAdapter = new FeedAdapter(events, new ItemClickListener() {
@Override @Override
public void onItemClick(View v, int position) { public void onItemClick(View v, int position) {
......
...@@ -200,6 +200,8 @@ public class MapFragment extends Fragment implements TextWatcher, ...@@ -200,6 +200,8 @@ public class MapFragment extends Fragment implements TextWatcher,
/* Initialize */ /* Initialize */
appDatabase = AppDatabase.getAppDatabase(getContext()); appDatabase = AppDatabase.getAppDatabase(getContext());
editText = (EditText)getView().findViewById(R.id.search);
setFonts();
getAPILocations(); getAPILocations();
new showLocationsFromDB().execute(); new showLocationsFromDB().execute();
...@@ -442,16 +444,26 @@ public class MapFragment extends Fragment implements TextWatcher, ...@@ -442,16 +444,26 @@ public class MapFragment extends Fragment implements TextWatcher,
} }
private void setFonts() { private void setFonts() {
if (getView() == null || getActivity() == null) return;
Typeface regular = Typeface.createFromAsset(getActivity().getAssets(), FONT_REGULAR); Typeface regular = Typeface.createFromAsset(getActivity().getAssets(), FONT_REGULAR);
if (placeNameTextView != null) {
placeNameTextView.setTypeface(regular, Typeface.BOLD); placeNameTextView.setTypeface(regular, Typeface.BOLD);
}
if (placeSubHeadTextView != null) {
placeSubHeadTextView.setTypeface(regular); placeSubHeadTextView.setTypeface(regular);
}
if (editText != null) {
editText.setTypeface(regular); editText.setTypeface(regular);
}
TextView settingsTitle = (TextView) getActivity() TextView settingsTitle = (TextView) getActivity()
.findViewById(R.id.settings_title); .findViewById(R.id.settings_title);
if (settingsTitle != null) {
settingsTitle.setTypeface(regular); settingsTitle.setTypeface(regular);
} }
}
private Runnable setAnchor() { private Runnable setAnchor() {
Runnable runnable = new Runnable() { Runnable runnable = new Runnable() {
......
...@@ -142,7 +142,7 @@ public class ProfileFragment extends BackHandledFragment { ...@@ -142,7 +142,7 @@ public class ProfileFragment extends BackHandledFragment {
Picasso.get() Picasso.get()
.load(user.getUserProfilePictureUrl()) .load(user.getUserProfilePictureUrl())
.resize(800, 0) .resize(500, 0)
.placeholder(R.drawable.user_placeholder) .placeholder(R.drawable.user_placeholder)
.into(userProfilePictureImageView); .into(userProfilePictureImageView);
......
...@@ -2,16 +2,16 @@ package app.insti.notifications; ...@@ -2,16 +2,16 @@ package app.insti.notifications;
import android.app.AlarmManager; import android.app.AlarmManager;
import android.app.PendingIntent; import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.support.v4.content.WakefulBroadcastReceiver;
import android.util.Log; import android.util.Log;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
public class public class
NotificationEventReceiver extends WakefulBroadcastReceiver { NotificationEventReceiver extends BroadcastReceiver {
private static final String ACTION_START_NOTIFICATION_SERVICE = "ACTION_START_NOTIFICATION_SERVICE"; private static final String ACTION_START_NOTIFICATION_SERVICE = "ACTION_START_NOTIFICATION_SERVICE";
private static final String ACTION_DELETE_NOTIFICATION = "ACTION_DELETE_NOTIFICATION"; private static final String ACTION_DELETE_NOTIFICATION = "ACTION_DELETE_NOTIFICATION";
...@@ -57,7 +57,7 @@ NotificationEventReceiver extends WakefulBroadcastReceiver { ...@@ -57,7 +57,7 @@ NotificationEventReceiver extends WakefulBroadcastReceiver {
} }
if (serviceIntent != null) { if (serviceIntent != null) {
startWakefulService(context, serviceIntent); NotificationIntentService.enqueueWork(context, NotificationIntentService.class, 200, serviceIntent);
} }
} }
} }
\ No newline at end of file
package app.insti.notifications; package app.insti.notifications;
import android.app.IntentService;
import android.app.Notification; import android.app.Notification;
import android.app.NotificationManager; import android.app.NotificationManager;
import android.app.PendingIntent; import android.app.PendingIntent;
...@@ -8,8 +7,8 @@ import android.content.Context; ...@@ -8,8 +7,8 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.graphics.BitmapFactory; import android.graphics.BitmapFactory;
import android.net.Uri; import android.net.Uri;
import android.support.v4.app.JobIntentService;
import android.support.v4.app.NotificationCompat; import android.support.v4.app.NotificationCompat;
import android.support.v4.content.WakefulBroadcastReceiver;
import android.util.Log; import android.util.Log;
import java.util.Date; import java.util.Date;
...@@ -28,7 +27,7 @@ import retrofit2.Call; ...@@ -28,7 +27,7 @@ import retrofit2.Call;
import retrofit2.Callback; import retrofit2.Callback;
import retrofit2.Response; import retrofit2.Response;
public class NotificationIntentService extends IntentService { public class NotificationIntentService extends JobIntentService {
private static final String ACTION_START = "ACTION_START"; private static final String ACTION_START = "ACTION_START";
private static final String ACTION_DELETE = "ACTION_DELETE"; private static final String ACTION_DELETE = "ACTION_DELETE";
...@@ -39,7 +38,7 @@ public class NotificationIntentService extends IntentService { ...@@ -39,7 +38,7 @@ public class NotificationIntentService extends IntentService {
private NotificationManager manager; private NotificationManager manager;
public NotificationIntentService() { public NotificationIntentService() {
super(NotificationIntentService.class.getSimpleName()); super();
} }
public static Intent createIntentStartNotificationService(Context context) { public static Intent createIntentStartNotificationService(Context context) {
...@@ -60,7 +59,7 @@ public class NotificationIntentService extends IntentService { ...@@ -60,7 +59,7 @@ public class NotificationIntentService extends IntentService {
} }
@Override @Override
protected void onHandleIntent(Intent intent) { protected void onHandleWork(Intent intent) {
Log.d(getClass().getSimpleName(), "onHandleIntent, started handling a notification event"); Log.d(getClass().getSimpleName(), "onHandleIntent, started handling a notification event");
try { try {
String action = intent.getAction(); String action = intent.getAction();
...@@ -98,9 +97,7 @@ public class NotificationIntentService extends IntentService { ...@@ -98,9 +97,7 @@ public class NotificationIntentService extends IntentService {
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri); Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
startActivity(mapIntent); startActivity(mapIntent);
} }
} finally { } finally { }
WakefulBroadcastReceiver.completeWakefulIntent(intent);
}
} }
private void processDeleteNotification(Intent intent) { private void processDeleteNotification(Intent intent) {
...@@ -124,7 +121,8 @@ public class NotificationIntentService extends IntentService { ...@@ -124,7 +121,8 @@ public class NotificationIntentService extends IntentService {
long timediff = getDateDiff(new Date(), event.getEventStartTime(), TimeUnit.MINUTES); long timediff = getDateDiff(new Date(), event.getEventStartTime(), TimeUnit.MINUTES);
if (timediff <= 30 && timediff > 0) { // Change this to 30*10000 for testing if (timediff <= 30 && timediff > 0) { // Change this to 30*10000 for testing
NOTIFICATION_ID = event.getEventID().hashCode(); NOTIFICATION_ID = event.getEventID().hashCode();
final NotificationCompat.Builder builder = new NotificationCompat.Builder(getApplicationContext());
final NotificationCompat.Builder builder = new NotificationCompat.Builder(getApplicationContext(), "INSTIAPP_CHANNEL");
builder.setContentTitle(event.getEventName()) builder.setContentTitle(event.getEventName())
.setAutoCancel(true) .setAutoCancel(true)
.setColor(getResources().getColor(R.color.colorAccent)) .setColor(getResources().getColor(R.color.colorAccent))
......
<vector android:height="24dp" android:viewportHeight="792"
android:viewportWidth="792" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillAlpha="0.4" android:fillColor="#448aff"
android:pathData="m396.004,170.224l0,0a303.09,303.09 90,0 1,-0.007 428.627l0,0 0,0A303.09,303.09 90,0 1,396.004 170.224Z" android:strokeAlpha="0.4"/>
<path android:fillAlpha="0.4" android:fillColor="#448aff"
android:pathData="m699.09,295.76l-0,0a303.09,303.09 0,0 1,-303.09 303.09l-0,0 -0,0A303.09,303.09 0,0 1,699.09 295.76Z" android:strokeAlpha="0.4"/>
<path android:fillAlpha="0.4" android:fillColor="#448aff"
android:pathData="m92.91,295.76v0A303.09,303.09 0,0 1,396 598.85v0,0A303.09,303.09 0,0 1,92.91 295.76Z" android:strokeAlpha="0.4"/>
<path android:fillAlpha="0.4" android:fillColor="#448aff"
android:pathData="m231.969,202.853l0,0a303.09,303.09 67.5,0 1,164.035 395.997l0,0 0,0A303.09,303.09 67.5,0 1,231.969 202.853Z" android:strokeAlpha="0.4"/>
<path android:fillAlpha="0.4" android:fillColor="#448aff"
android:pathData="m791.997,434.851a302.83,302.83 0,0 1,-396 164,302.83 302.83,0 0,1 396,-164z" android:strokeAlpha="0.4"/>
<path android:fillAlpha="0.4" android:fillColor="#448aff"
android:pathData="m560.025,202.845l0,0a303.09,303.09 112.5,0 1,-164.022 396.002l0,0 0,0A303.09,303.09 112.5,0 1,560.025 202.845Z" android:strokeAlpha="0.4"/>
<path android:fillAlpha="0.4" android:fillColor="#448aff"
android:pathData="M396,598.82C321.742,629.652 241.162,630.1 166.879,599.33 92.595,568.561 30.706,509.1 0,434.79 154.64,370.577 332.04,444.046 396,598.79Z" android:strokeAlpha="0.4"/>
</vector>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="vertical"> android:orientation="vertical">
<WebView
<LinearLayout android:id="@+id/login_webview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_marginBottom="20dp"
android:contentDescription="InstiApp"
android:paddingLeft="100dp"
android:paddingRight="100dp"
android:scaleType="fitEnd"
app:srcCompat="@drawable/lotus" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="InstiApp"
android:textAlignment="center"
android:textSize="28sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="100dp"
android:orientation="vertical"
android:padding="20dp">
<android.support.design.widget.TextInputLayout
android:id="@+id/login_username_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:errorEnabled="true">
<android.support.design.widget.TextInputEditText
android:id="@+id/login_username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="LDAP ID"
android:inputType="text" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="@+id/login_password_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:errorEnabled="true"
app:passwordToggleEnabled="true">
<android.support.design.widget.TextInputEditText
android:id="@+id/login_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Password"
android:inputType="textPassword" />
</android.support.design.widget.TextInputLayout>
<Button
android:id="@+id/login_button"
style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:text="Log In" android:layout_alignParentBottom="true"
android:textColor="@color/primaryTextColor" /> android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
<TextView android:layout_alignParentStart="true"
android:layout_width="match_parent" android:layout_alignParentTop="false"
android:layout_height="wrap_content" android:layout_alignWithParentIfMissing="false">
android:text="or" </WebView>
android:textAlignment="center" />
</LinearLayout>
<TextView \ No newline at end of file
android:id="@+id/login_guest"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="5dp"
android:text="Continue as a Guest"
android:textAlignment="center"
android:textAllCaps="false"
android:textAppearance="@style/TextAppearance.AppCompat.Light.SearchResult.Subtitle" />
</LinearLayout>
</LinearLayout>
</ScrollView>
\ No newline at end of file
<?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="1dp"
card_view:cardElevation="1dp">
<LinearLayout
android:id="@+id/body_card_layout"
android:layout_width="match_parent"
android:layout_height="80dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/body_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/body_card_name"
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/body_card_description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Description"
android:scrollHorizontally="true"
android:ellipsize="end"
android:maxLines="1" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout 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_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="4dp" android:orientation="vertical"
android:layout_marginLeft="8dp" android:background="?android:attr/selectableItemBackground">
android:layout_marginRight="8dp"
android:layout_marginTop="4dp" <ImageView
card_view:cardCornerRadius="1dp" android:id="@+id/big_object_picture"
card_view:cardElevation="1dp"> android:layout_width="match_parent"
android:layout_height="230dp"
android:layout_gravity="center"
android:scaleType="centerCrop"
android:visibility="gone" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical"
android:paddingBottom="4dp"
android:paddingLeft="18dp"
android:paddingRight="10dp"
android:paddingTop="4dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="80dp" android:layout_height="80dp"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/event_picture" android:id="@+id/object_picture"
android:layout_width="80dp" android:layout_width="60dp"
android:layout_height="80dp" android:layout_height="60dp"
android:layout_gravity="center" android:layout_gravity="center"
android:scaleType="centerCrop" /> android:scaleType="centerCrop" />
...@@ -37,10 +44,10 @@ ...@@ -37,10 +44,10 @@
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:id="@+id/event_title" android:id="@+id/object_title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Event Title" android:text="Object Title"
android:textColor="@android:color/black" android:textColor="@android:color/black"
android:textSize="18sp" /> android:textSize="18sp" />
...@@ -50,58 +57,18 @@ ...@@ -50,58 +57,18 @@
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/event_date" android:id="@+id/object_subtitle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="26 May" /> android:text="Subtitle"
android:textSize="16sp"
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" | "
android:textSize="20dp" />
<TextView
android:id="@+id/event_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="6:00 PM" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" | "
android:textSize="20dp" />
<TextView
android:id="@+id/event_venue"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:ellipsize="end" android:ellipsize="end"
android:text="LH 101"
android:scrollHorizontally="true" android:scrollHorizontally="true"
android:maxLines="1"/> android:maxLines="1" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<!--<ImageView-->
<!--android:id="@+id/event_enthu"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_marginRight="20dp"-->
<!--android:layout_height="wrap_content"-->
<!--android:src="@drawable/ic_action_add"-->
<!--android:layout_gravity="center_vertical"/>-->
</LinearLayout> </LinearLayout>
<!--<View-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="2dp"-->
<!--android:background="#adfff6"-->
<!--android:layout_marginLeft="16dp"-->
<!--android:layout_marginRight="16dp">-->
<!--</View>-->
</LinearLayout> </LinearLayout>
</android.support.v7.widget.CardView> </LinearLayout>
\ No newline at end of file \ No newline at end of file
...@@ -105,14 +105,14 @@ ...@@ -105,14 +105,14 @@
android:layout_margin="0dp" android:layout_margin="0dp"
android:layout_weight="1" android:layout_weight="1"
android:text="FOLLOW" android:text="FOLLOW"
android:textColor="@color/secondaryTextColor" /> android:textColor="@color/secondaryTextColor"
android:foreground="?attr/selectableItemBackground"
android:clickable="true" />
</LinearLayout> </LinearLayout>
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="#aaa"> android:background="#aaa">
</View> </View>
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
android:layout_marginEnd="10dp" android:layout_marginEnd="10dp"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:layout_marginTop="12dp" android:layout_marginTop="12dp"
android:textColor="#777" android:textColor="#333"
android:textSize="16sp" /> android:textSize="16sp" />
<TextView <TextView
......
...@@ -185,12 +185,51 @@ ...@@ -185,12 +185,51 @@
android:textColor="@color/secondaryTextColor" /> android:textColor="@color/secondaryTextColor" />
</LinearLayout> </LinearLayout>
</android.support.v7.widget.CardView>
<LinearLayout
style="?android:attr/buttonBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="@+id/going_button"
style="?android:attr/buttonBarButtonStyle"
android:textAllCaps="false"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="0dp"
android:layout_weight="1"
android:text="GOING"
android:textColor="@color/secondaryTextColor"
android:foreground="?attr/selectableItemBackground"
android:clickable="true" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#aaa">
</View>
<TextView
android:id="@+id/event_page_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="0dp"
android:layout_weight="1"
android:text="INTERESTED"
android:textColor="@color/secondaryTextColor"
android:foreground="?attr/selectableItemBackground"
android:clickable="true" />
</LinearLayout>
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="#aaa"> android:background="#aaa">
</View> </View>
...@@ -203,7 +242,7 @@ ...@@ -203,7 +242,7 @@
android:layout_marginEnd="10dp" android:layout_marginEnd="10dp"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:layout_marginTop="12dp" android:layout_marginTop="12dp"
android:textColor="#777" android:textColor="#333"
android:textSize="16sp" /> android:textSize="16sp" />
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
...@@ -212,6 +251,12 @@ ...@@ -212,6 +251,12 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp" /> android:layout_marginTop="10dp" />
<android.support.v7.widget.RecyclerView
android:id="@+id/body_card_recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp" />
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:background="@null" android:background="@null"
android:dropDownHeight="0dp" android:dropDownHeight="0dp"
android:fontFamily="sans-serif-light" android:fontFamily="sans-serif"
android:hint="Search" android:hint="Search"
android:imeOptions="actionSearch" android:imeOptions="actionSearch"
android:inputType="textNoSuggestions" android:inputType="textNoSuggestions"
......
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/container_profile" android:id="@+id/container_profile"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:background="@color/colorWhite">
<LinearLayout xmlns:tools="http://schemas.android.com/tools" <LinearLayout xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -33,7 +34,8 @@ ...@@ -33,7 +34,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="2dp" android:layout_marginBottom="2dp"
android:textSize="20sp" android:textSize="20sp"
android:textStyle="bold" /> android:fontFamily="sans-serif-light"
android:textColor="@color/secondaryTextColor"/>
<TextView <TextView
android:id="@+id/user_rollno_profile" android:id="@+id/user_rollno_profile"
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<TextView <TextView
android:id="@+id/button_CMSMaint" android:id="@+id/button_CMSMaint"
style="@style/QuickLink" style="@style/QuickLink"
android:text="CMS - Maintainance" /> android:text="CMS - Maintenance" />
<TextView <TextView
android:id="@+id/button_CMSNet" android:id="@+id/button_CMSNet"
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
<TextView <TextView
android:id="@+id/button_Courselist" android:id="@+id/button_Courselist"
style="@style/QuickLink" style="@style/QuickLink"
android:text="CMS Maintainance" /> android:text="Course List" />
<TextView <TextView
style="@style/QuickLinksHeading" style="@style/QuickLinksHeading"
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout 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_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="4dp" android:layout_marginBottom="4dp"
android:layout_marginLeft="8dp" android:layout_marginLeft="8dp"
android:layout_marginRight="8dp" android:layout_marginRight="8dp"
android:layout_marginTop="4dp" android:layout_marginTop="4dp"
card_view:cardCornerRadius="1dp" android:background="#f2f2f2">
card_view:cardElevation="1dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -60,4 +58,4 @@ ...@@ -60,4 +58,4 @@
android:textColor="#000000" android:textColor="#000000"
android:textColorLink="@color/colorPrimary" /> android:textColorLink="@color/colorPrimary" />
</LinearLayout> </LinearLayout>
</android.support.v7.widget.CardView> </LinearLayout>
\ No newline at end of file
<?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="1dp"
card_view:cardElevation="1dp">
<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"
android:scrollHorizontally="true"
android:ellipsize="end"
android:maxLines="1" />
</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