Skip to content

Commit

Permalink
Merge pull request tirth5828#11 from foram-patel-0201/master
Browse files Browse the repository at this point in the history
Added Links for events (not final)
  • Loading branch information
tirth5828 authored Oct 16, 2021
2 parents 59519f8 + 64c0682 commit 89b9129
Show file tree
Hide file tree
Showing 2 changed files with 129 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/src/main/java/com/example/us_2_0/EventAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ public View getView(int position, @Nullable View convertView, @NonNull ViewGroup
eventCellTV.setText(eventTitle);
return convertView;
}


}
127 changes: 127 additions & 0 deletions app/src/main/java/com/example/us_2_0/WeekViewActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@
import androidx.recyclerview.widget.RecyclerView;

import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.Toolbar;

import java.time.LocalDate;
import java.time.LocalTime;
Expand All @@ -39,6 +42,127 @@ protected void onCreate(Bundle savedInstanceState)
CalendarUtils.selectedDate = LocalDate.now();
setWeekView();


eventListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if (position==0){
Uri uri = Uri.parse("https://classroom.google.com/c/MjQwNjEwNzU0NzIy/a/MjQwNjEyNjY5NTQ2/details");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
Toast.makeText(getApplicationContext(), "This is just a demo link", Toast.LENGTH_SHORT).show();
} else if (position==1){
Uri uri = Uri.parse("https://classroom.google.com/c/MjQyNTk1MjQwOTYw/a/MTg2MjQ0NzYzOTk2/details");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
Toast.makeText(getApplicationContext(), "This is just a demo link", Toast.LENGTH_SHORT).show();
} else if (position==2){
Uri uri = Uri.parse("https://classroom.google.com/c/MzEzNjcyNjMzNjM0/a/MzI3MTkxOTA0MDQy/details");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
Toast.makeText(getApplicationContext(), "This is just a demo link", Toast.LENGTH_SHORT).show();
}else if (position==3){
Uri uri = Uri.parse("https://classroom.google.com/c/MjQwNjEwNzU0NzIy/a/MjQzNjQ4NTQyMjUy/details");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
Toast.makeText(getApplicationContext(), "This is just a demo link", Toast.LENGTH_SHORT).show();
}else if (position==4){
Uri uri = Uri.parse("https://classroom.google.com/c/MzEzNjcyNjMzNjM0/a/MzI5NDQzOTQ4NTI2/details");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
Toast.makeText(getApplicationContext(), "This is just a demo link", Toast.LENGTH_SHORT).show();
}else if (position==5){
Uri uri = Uri.parse("https://classroom.google.com/c/MjQyNTk1MjQwOTYw/a/MjQ4NzI3NjgyOTk0/details");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
Toast.makeText(getApplicationContext(), "This is just a demo link", Toast.LENGTH_SHORT).show();
}else if (position==6){
Uri uri = Uri.parse("https://classroom.google.com/c/MjQwNjEwNzU0NzIy/a/MTg2MzIxMjAxODM0/details");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
Toast.makeText(getApplicationContext(), "This is just a demo link", Toast.LENGTH_SHORT).show();
}else if (position==7){
Uri uri = Uri.parse("https://betamoodle.iiitvadodara.ac.in/login/index.php");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
Toast.makeText(getApplicationContext(), "This is just a demo link", Toast.LENGTH_SHORT).show();
}else if (position==8){
Uri uri = Uri.parse("https://betamoodle.iiitvadodara.ac.in/login/index.php");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
Toast.makeText(getApplicationContext(), "This is just a demo link", Toast.LENGTH_SHORT).show();
}else if (position==9){
Uri uri = Uri.parse("https://betamoodle.iiitvadodara.ac.in/login/index.php");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
Toast.makeText(getApplicationContext(), "This is just a demo link", Toast.LENGTH_SHORT).show();
}else if (position==10){
Uri uri = Uri.parse("https://meet.google.com/trp-rnxf-uzm");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
Toast.makeText(getApplicationContext(), "This is just a demo link", Toast.LENGTH_SHORT).show();
}else if (position==11){
Uri uri = Uri.parse("https://meet.google.com/trp-rnxf-uzm");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
Toast.makeText(getApplicationContext(), "This is just a demo link", Toast.LENGTH_SHORT).show();
}else if (position==12){
Uri uri = Uri.parse("https://meet.google.com/trp-rnxf-uzm");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
Toast.makeText(getApplicationContext(), "This is just a demo link", Toast.LENGTH_SHORT).show();
}else if (position==13){
Uri uri = Uri.parse("https://meet.google.com/trp-rnxf-uzm");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
Toast.makeText(getApplicationContext(), "This is just a demo link", Toast.LENGTH_SHORT).show();
}else if (position==14){
Uri uri = Uri.parse("https://meet.google.com/trp-rnxf-uzm");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
Toast.makeText(getApplicationContext(), "This is just a demo link", Toast.LENGTH_SHORT).show();
}else if (position==15){
Uri uri = Uri.parse("https://meet.google.com/trp-rnxf-uzm");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
Toast.makeText(getApplicationContext(), "This is just a demo link", Toast.LENGTH_SHORT).show();
}else if (position==16){
Uri uri = Uri.parse("https://meet.google.com/trp-rnxf-uzm");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
Toast.makeText(getApplicationContext(), "This is just a demo link", Toast.LENGTH_SHORT).show();
}else if (position==17){
Uri uri = Uri.parse("https://meet.google.com/trp-rnxf-uzm");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
Toast.makeText(getApplicationContext(), "This is just a demo link", Toast.LENGTH_SHORT).show();
}else if (position==18){
Uri uri = Uri.parse("https://meet.google.com/trp-rnxf-uzm");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
Toast.makeText(getApplicationContext(), "This is just a demo link", Toast.LENGTH_SHORT).show();
}else if (position==19){
Uri uri = Uri.parse("https://meet.google.com/trp-rnxf-uzm");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
Toast.makeText(getApplicationContext(), "This is just a demo link", Toast.LENGTH_SHORT).show();
}else if (position==20){
Uri uri = Uri.parse("https://meet.google.com/trp-rnxf-uzm");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
Toast.makeText(getApplicationContext(), "This is just a demo link", Toast.LENGTH_SHORT).show();
}else if (position==21){
Uri uri = Uri.parse("https://meet.google.com/trp-rnxf-uzm");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
Toast.makeText(getApplicationContext(), "This is just a demo link", Toast.LENGTH_SHORT).show();
}



}
});

Event sampleEvent = new Event("Maths Assignment 1",LocalDate.of(2021,10,16), LocalTime.of(12,00,00));
Event.eventsList.add(sampleEvent);

Expand Down Expand Up @@ -186,4 +310,7 @@ public void newEventAction(View view)
{
startActivity(new Intent(this, EventEditActivity.class));
}



}

0 comments on commit 89b9129

Please sign in to comment.