Skip to content

Commit

Permalink
Merge pull request #35 from virresh/temp_merges
Browse files Browse the repository at this point in the history
Temp merges
  • Loading branch information
virresh authored Nov 18, 2019
2 parents 42f67f7 + e1ba23b commit 57e6771
Show file tree
Hide file tree
Showing 65 changed files with 1,487 additions and 803 deletions.
3 changes: 3 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ dependencies {
implementation 'com.squareup.okhttp3:okhttp:4.2.0'
implementation 'com.neovisionaries:nv-websocket-client:2.9'
implementation 'org.webrtc:google-webrtc:1.0.28513'
implementation 'com.codemybrainsout.rating:ratingdialog:1.0.8'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.0'
implementation 'com.google.firebase:firebase-messaging:20.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.google.firebase:firebase-messaging:20.0.0'

}
52 changes: 27 additions & 25 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,20 @@
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:replace="android:allowBackup">

<!-- [START fcm_default_icon] -->
<!-- Set custom default icon. This is used when no icon is set for incoming notification messages.
See README(https://goo.gl/l4GJaQ) for more. -->
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/app_logo" />
<!-- Set color used with incoming notification messages. This is used when no color is set for the incoming
notification message. See README(https://goo.gl/6BKBk7) for more. -->
<meta-data
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="@color/colorAccent" />
<!-- [END fcm_default_icon] -->
<!-- [START fcm_default_channel] -->
<meta-data
android:name="com.google.firebase.messaging.default_notification_channel_id"
android:value="@string/default_notification_channel_id" />
<!-- [END fcm_default_channel] -->

<activity android:name=".Activities.IndividualProposalActivity"></activity>
<activity android:name=".Activities.EditProposalActivity" /> <!-- [START fcm_default_icon] -->
<!--
Set custom default icon. This is used when no icon is set for incoming notification messages.
See README(https://goo.gl/l4GJaQ) for more.
-->
<activity android:name=".Activities.UserDashboard" />

<activity android:name=".Activities.ProposalInformationActivity" />
<activity android:name=".Activities.MenteeOptionsActivity" />
<!--
Set color used with incoming notification messages. This is used when no color is set for the incoming
notification message. See README(https://goo.gl/6BKBk7) for more.
-->
<activity android:name=".Activities.ProposalInformationActivity" /> <!-- [END fcm_default_icon] -->
<!-- [START fcm_default_channel] -->
<activity android:name=".Activities.MenteeOptionsActivity" /> <!-- [END fcm_default_channel] -->
<activity android:name=".Activities.MentorOptionsActivity" />
<activity android:name=".Activities.MentorMeetings" />
<activity android:name=".Activities.MenteeMeetings" />
Expand All @@ -48,6 +39,17 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/app_logo" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="@color/colorAccent" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_channel_id"
android:value="@string/default_notification_channel_id" />

<service
android:name=".FireBaseFCMService"
android:exported="false">
Expand All @@ -56,11 +58,11 @@
</intent-filter>
</service>
</application>
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.INTERNET" />

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
package com.mobilecomputing.sahayak.Activities;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.ItemTouchHelper;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.SearchView;

import com.google.android.material.snackbar.Snackbar;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.mobilecomputing.sahayak.Adapters.EditProposalAdapter;
import com.mobilecomputing.sahayak.JavaClasses.Proposal;
import com.mobilecomputing.sahayak.JavaClasses.EditProposalLab;
import com.mobilecomputing.sahayak.JavaClasses.SwipeToDelete;
import com.mobilecomputing.sahayak.R;

import java.util.List;

import static com.mobilecomputing.sahayak.Fragments.proposalShowFragment.TAG;

public class EditProposalActivity extends AppCompatActivity {
public static List<Proposal> proposals;
EditProposalAdapter mAdapter;
SearchView searchView;
RecyclerView mentorProposalView;
EditProposalLab proposalLab;
View view;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_edit_proposal);
view = findViewById(R.id.edit_proposal);
LinearLayoutManager linearLayoutManager;

mentorProposalView = (RecyclerView) findViewById(R.id.edit_proposal);
mentorProposalView.setLayoutManager(new LinearLayoutManager(this));
linearLayoutManager = new LinearLayoutManager(this);
proposalLab = EditProposalLab.get(getApplicationContext());
proposals = proposalLab.getProposals();

mAdapter = new EditProposalAdapter(this, proposals,proposalLab);
mAdapter.setClickListener(new EditProposalAdapter.ItemClickListener() {
@Override
public void onItemClick(View view, int position) {
Proposal p = mAdapter.getItem(position);
// Intent intent = new Intent(EditProposalActivity.this, IndividualProposalActivity.class);
// startActivity(intent);
}
});
mentorProposalView.setAdapter(mAdapter);
enableSwipeToDeleteAndUndo();
}
public void enableSwipeToDeleteAndUndo(){
SwipeToDelete swipeToDeleteCallback = new SwipeToDelete(this) {
@Override
public void onSwiped(@NonNull RecyclerView.ViewHolder viewHolder, int i) {


int position = viewHolder.getAdapterPosition();
Proposal item = mAdapter.getItem(position);
Log.d(TAG,"Delete Position" + Integer.toString(position));
mAdapter.removeProposal(item,position);


Snackbar snackbar = Snackbar
.make(view, "Item was removed from the list.", Snackbar.LENGTH_LONG);
snackbar.setAction("UNDO", new View.OnClickListener() {
@Override
public void onClick(View view) {

mAdapter.restoreItem(item, position);
}
});

snackbar.setActionTextColor(Color.YELLOW);
snackbar.show();

}
};

ItemTouchHelper itemTouchhelper = new ItemTouchHelper(swipeToDeleteCallback);
itemTouchhelper.attachToRecyclerView(mentorProposalView);
}


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.mobilecomputing.sahayak.Activities;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

import com.mobilecomputing.sahayak.R;

public class IndividualProposalActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_individual_proposal);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
import com.mobilecomputing.sahayak.R;
import java.text.Format;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class MenteeMeetings extends AppCompatActivity {

Expand All @@ -33,7 +35,8 @@ public class MenteeMeetings extends AppCompatActivity {
RecyclerView mRecyclerView;
FirebaseDatabase mFirebaseDatabase;
DatabaseReference mRef;
Format formatter = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
Format formatter = new SimpleDateFormat("EEEE, MMM d");
SimpleDateFormat formatterDuration = new SimpleDateFormat("h:mm a");
String date_string;
String currentUser = FirebaseAuth.getInstance().getCurrentUser().getEmail();

Expand Down Expand Up @@ -78,9 +81,16 @@ private void firebaseSearch(String searchText) {
) {
@Override
protected void populateViewHolder(ViewHolder viewHolder, Session session, int position) {
Date start = session.getInteractionDate();
Calendar startCalendar = Calendar.getInstance();
startCalendar.setTime(start);
startCalendar.add(Calendar.MINUTE, session.getDuration());
Date end = startCalendar.getTime();

String duration = formatterDuration.format(start)+" - "+formatterDuration.format(end);

viewHolder.setDetails(getApplicationContext(), session.getTeacher(), session.getStudent(),
formatter.format(session.getInteractionDate()),
Integer.toString(session.getDuration()), session.getSkill()
formatter.format(start), duration, session.getSkill()
);
}

Expand Down Expand Up @@ -125,9 +135,17 @@ protected void onStart() {
) {
@Override
protected void populateViewHolder(ViewHolder viewHolder, Session session, int position) {
Date start = session.getInteractionDate();
Calendar startCalendar = Calendar.getInstance();
startCalendar.setTime(start);
startCalendar.add(Calendar.MINUTE, session.getDuration());
Date end = startCalendar.getTime();

String duration = formatterDuration.format(start)+" - "+formatterDuration.format(end);

viewHolder.setDetails(getApplicationContext(), session.getTeacher(), session.getStudent(),
formatter.format(session.getInteractionDate()),
Integer.toString(session.getDuration()), session.getSkill());
formatter.format(start), duration, session.getSkill()
);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import java.io.ByteArrayOutputStream;
import java.text.Format;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class MentorMeetings extends AppCompatActivity {

Expand All @@ -34,7 +36,8 @@ public class MentorMeetings extends AppCompatActivity {
RecyclerView mRecyclerView;
FirebaseDatabase mFirebaseDatabase;
DatabaseReference mRef;
Format formatter = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
Format formatter = new SimpleDateFormat("EEEE, MMM d");
SimpleDateFormat formatterDuration = new SimpleDateFormat("h:mm a");
String date_string;
String currentUser = FirebaseAuth.getInstance().getCurrentUser().getEmail();

Expand Down Expand Up @@ -81,9 +84,16 @@ private void firebaseSearch(String searchText) {
) {
@Override
protected void populateViewHolder(ViewHolder viewHolder, Session session, int position) {
Date start = session.getInteractionDate();
Calendar startCalendar = Calendar.getInstance();
startCalendar.setTime(start);
startCalendar.add(Calendar.MINUTE, session.getDuration());
Date end = startCalendar.getTime();

String duration = formatterDuration.format(start)+" - "+formatterDuration.format(end);

viewHolder.setDetails(getApplicationContext(), session.getTeacher(), session.getStudent(),
formatter.format(session.getInteractionDate()),
Integer.toString(session.getDuration()), session.getSkill()
formatter.format(start), duration, session.getSkill()
);
}

Expand Down Expand Up @@ -127,9 +137,17 @@ protected void onStart() {
) {
@Override
protected void populateViewHolder(ViewHolder viewHolder, Session session, int position) {
viewHolder.setDetails(getApplicationContext(), session.getTeacher(), session.getStudent(),
formatter.format(session.getInteractionDate()),
Integer.toString(session.getDuration()), session.getSkill());
Date start = session.getInteractionDate();
Calendar startCalendar = Calendar.getInstance();
startCalendar.setTime(start);
startCalendar.add(Calendar.MINUTE, session.getDuration());
Date end = startCalendar.getTime();

String duration = formatterDuration.format(start)+" - "+formatterDuration.format(end);

viewHolder.setDetails(getApplicationContext(), session.getTeacher(), session.getStudent(),
formatter.format(start), duration, session.getSkill()
);
}

@Override
Expand Down
Loading

0 comments on commit 57e6771

Please sign in to comment.