0% found this document useful (0 votes)
3 views15 pages

Combined Java Code Explained

The document provides a detailed explanation of Java code for an Android application, specifically focusing on the MainActivity, AttendanceAdapter, and EventsAdapter classes. It includes line-by-line comments that describe the purpose and functionality of each part of the code. The code facilitates navigation between different fragments and manages attendance data within the app.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views15 pages

Combined Java Code Explained

The document provides a detailed explanation of Java code for an Android application, specifically focusing on the MainActivity, AttendanceAdapter, and EventsAdapter classes. It includes line-by-line comments that describe the purpose and functionality of each part of the code. The code facilitates navigation between different fragments and manages attendance data within the app.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Combined Java Code with Line-by-Line

Explanation

[Link]
package [Link]; // explanation: this line is part of app logic

import [Link]; // explanation: this line is part of app logic

import [Link]; // explanation: this line is part of app logic


import [Link]; // explanation: this line is part of app logic
import [Link]; // explanation: this line is part of app logic
import [Link]; // explanation: this line is part of app logic

import [Link]; // explanation: this lin


import [Link]; // explanation: this line is part o
import [Link]; // explanation: this line is part of ap
import [Link]; // explanation: this line is part of app
import [Link]; // explanation: this line is part of app
import [Link]; // explanation: this line is part of app
import [Link]; // explanation: this line is part of

/** // explanation: this line is part of app logic


* Single-activity host that swaps fragments via the BottomNavigationView. // explanation: this li
* Survives configuration changes by restoring the last selected tab id. // explanation: this line
*/ // explanation: this line is part of app logic
public class MainActivity extends AppCompatActivity { // explanation: this line is part of app log

private static final String STATE_TAB_ID = "state_tab_id"; // explanation: this line is part o

private BottomNavigationView bottomNav; // explanation: this line is part of app logic

@Override // explanation: this line is part of app logic


protected void onCreate(Bundle savedInstanceState) { // explanation: this line is part of app
[Link](savedInstanceState); // explanation: this line is part of app logic
setContentView([Link].activity_main); // explanation: this line is part of app logic

bottomNav = findViewById([Link].bottom_nav); // explanation: this line is part of app logic


[Link](item -> { // explanation: this line is part of app log
switchTo([Link]()); // explanation: this line is part of app logic
return true; // explanation: this line is part of app logic
}); // explanation: this line is part of app logic

int initialId = savedInstanceState != null // explanation: this line is part of app logic
? [Link](STATE_TAB_ID, [Link].nav_home) // explanation: this line
: [Link].nav_home; // explanation: this line is part of app logic

[Link](initialId); // explanation: this line is part of app logic


} // explanation: this line is part of app logic

@Override // explanation: this line is part of app logic


protected void onSaveInstanceState(@NonNull Bundle outState) { // explanation: this line is pa
[Link](outState); // explanation: this line is part of app logic
if (bottomNav != null) { // explanation: this line is part of app logic
[Link](STATE_TAB_ID, [Link]()); // explanation: this lin
} // explanation: this line is part of app logic
} // explanation: this line is part of app logic

/** Public so HomeFragment shortcut buttons can navigate. */ // explanation: this line is part
public void navigateTo(int navItemId) { // explanation: this line is part of app logic
if (bottomNav != null) [Link](navItemId); // explanation: this line i
} // explanation: this line is part of app logic

private void switchTo(int itemId) { // explanation: this line is part of app logic
Fragment frag; // explanation: this line is part of app logic
if (itemId == [Link].nav_home) frag = new HomeFragment(); // explanation: this li
else if (itemId == [Link].nav_timetable) frag = new TimetableFragment(); // explanation: th
else if (itemId == [Link].nav_attendance) frag = new AttendanceFragment(); // explanation: t
else if (itemId == [Link].nav_events) frag = new EventsFragment(); // explanation: this
else if (itemId == [Link].nav_rooms) frag = new RoomsFragment(); // explanation: this l
else if (itemId == [Link].nav_mess) frag = new MessFragment(); // explanation: this li
else frag = new HomeFragment(); // explanation: this l

FragmentTransaction tx = getSupportFragmentManager().beginTransaction(); // explanation: t


[Link]([Link].fade_in, [Link].fade_out); // explanation: this line is part
[Link]([Link].fragment_container, frag); // explanation: this line is part of app logic
[Link](); // explanation: this line is part of app logic
} // explanation: this line is part of app logic
} // explanation: this line is part of app logic

[Link]
package [Link]; // explanation: this line is part of app logic

import [Link]; // explanation: this line is part of app logic


import [Link]; // explanation: this line is part of app logic
import [Link]; // explanation: this line is part of app logic
import [Link]; // explanation: this line is part of app logic
import [Link]; // explanation: this line is part of app logic
import [Link]; // explanation: this line is part of app logic

import [Link]; // explanation: this line is part of app logic


import [Link]; // explanation: this line is part of app logic

import [Link].R; // explanation: this line is part of app logic


import [Link]; // explanation: this line is part of app
import [Link]; // explanation: this line is part of app logic
import [Link]; // explanation: this line is part of app logic

public class AttendanceAdapter extends [Link]<[Link]> { // explanation

public interface OnChangeListener { void onChanged(); } // explanation: this line is part of a

private final AttendanceManager am; // explanation: this line is part of app logic
private final OnChangeListener listener; // explanation: this line is part of app logic

public AttendanceAdapter(AttendanceManager am, OnChangeListener l) { // explanation: this line


[Link] = am; [Link] = l; // explanation: this line is part of app logic
} // explanation: this line is part of app logic

@NonNull // explanation: this line is part of app logic


@Override // explanation: this line is part of app logic
public VH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { // explanation: this l
return new VH([Link]([Link]()) // explanation: this line is part o
.inflate([Link].item_attendance, parent, false)); // explanation: this line is p
} // explanation: this line is part of app logic

@Override // explanation: this line is part of app logic


public void onBindViewHolder(@NonNull VH h, int position) { // explanation: this line is part
final String code = CampusData.TRACKED_SUBJECTS.get(position); // explanation: this line i
final Subject s = [Link](code); // explanation: this line is part of app
if (s == null) return; // explanation: this line is part of app logic
[Link](s, code); // explanation: this line is part of app logic
} // explanation: this line is part of app logic

@Override public int getItemCount() { return CampusData.TRACKED_SUBJECTS.size(); } // explanat

class VH extends [Link] { // explanation: this line is part of app logic


final TextView tvCode, tvName, tvFaculty, tvAttended, tvTotal, tvPercent, tvHint; // expla
final ProgressBar progress; // explanation: this line is part of app logic
final View strip; // explanation: this line is part of app logic

VH(@NonNull View v) { // explanation: this line is part of app logic


super(v); // explanation: this line is part of app logic
tvCode = [Link]([Link].tv_code); // explanation: this line is part of app logic
tvName = [Link]([Link].tv_name); // explanation: this line is part of app logic
tvFaculty = [Link]([Link].tv_faculty); // explanation: this line is part of app
tvAttended = [Link]([Link].tv_attended); // explanation: this line is part of ap
tvTotal = [Link]([Link].tv_total); // explanation: this line is part of app logi
tvPercent = [Link]([Link].tv_percent); // explanation: this line is part of app
tvHint = [Link]([Link].tv_hint); // explanation: this line is part of app logic
progress = [Link]([Link]); // explanation: this line is part of app log
strip = [Link]([Link].color_strip); // explanation: this line is part of app log
} // explanation: this line is part of app logic

void bind(Subject s, String code) { // explanation: this line is part of app logic
[Link]([Link]); // explanation: this line is part of app logic
[Link]([Link]); // explanation: this line is part of app logic
[Link]([Link]); // explanation: this line is part of app logic
[Link]([Link]); // explanation: this line is part of app logic
refresh(code); // explanation: this line is part of app logic

[Link]([Link].btn_att_minus).setOnClickListener(v -> { // explanation: th


[Link](code, -1); refresh(code); [Link](); // explanatio
}); // explanation: this line is part of app logic
[Link]([Link].btn_att_plus).setOnClickListener(v -> { // explanation: thi
[Link](code, +1); refresh(code); [Link](); // explanatio
}); // explanation: this line is part of app logic
[Link]([Link].btn_tot_minus).setOnClickListener(v -> { // explanation: th
[Link](code, -1); refresh(code); [Link](); // explanation:
}); // explanation: this line is part of app logic
[Link]([Link].btn_tot_plus).setOnClickListener(v -> { // explanation: thi
[Link](code, +1); refresh(code); [Link](); // explanation:
}); // explanation: this line is part of app logic
[Link]([Link].btn_present).setOnClickListener(v -> { // explanation: this
[Link](code); refresh(code); [Link](); // explanation: this li
}); // explanation: this line is part of app logic
[Link]([Link].btn_absent).setOnClickListener(v -> { // explanation: this
[Link](code); refresh(code); [Link](); // explanation: this lin
}); // explanation: this line is part of app logic
} // explanation: this line is part of app logic

void refresh(String code) { // explanation: this line is part of app logic


int a = [Link](code); // explanation: this line is part of app logic
int t = [Link](code); // explanation: this line is part of app logic
int pct = [Link](a, t); // explanation: this line is part of app lo
[Link]([Link](a)); // explanation: this line is part of app logic
[Link]([Link](t)); // explanation: this line is part of app logic
[Link](pct + "%"); // explanation: this line is part of app logic
[Link](pct); // explanation: this line is part of app logic

int color = pct >= 75 ? 0xFF34D399 : pct >= 65 ? 0xFFFBBF24 : 0xFFF87171; // explanati
[Link](color); // explanation: this line is part of app logic
[Link]().setColorFilter(color, [Link].SRC_IN); // expla
[Link](buildHint(a, t, pct)); // explanation: this line is part of app logic
[Link](pct >= 75 ? 0xFF34D399 : 0xFFF87171); // explanation: this line is
} // explanation: this line is part of app logic

String buildHint(int a, int t, int pct) { // explanation: this line is part of app logic
if (t == 0) return "Start tracking by marking your first class above"; // explanation:
if (pct >= 75) { // explanation: this line is part of app logic
int skip = 0; // explanation: this line is part of app logic
while ((float) a / (t + skip + 1) >= 0.75f) skip++; // explanation: this line is p
return "■ You can skip " + skip + " more class" + (skip != 1 ? "es" : "") + " and st
} // explanation: this line is part of app logic
int need = 0; // explanation: this line is part of app logic
while (t + need == 0 || (float) (a + need) / (t + need) < 0.75f) need++; // explanatio
return "■■ Attend the next " + need + " class" + (need != 1 ? "es" : "") + " to reach 75
} // explanation: this line is part of app logic
} // explanation: this line is part of app logic
} // explanation: this line is part of app logic

[Link]
package [Link]; // explanation: this line is part of app logic

import [Link]; // explanation: this line is part of app logic


import [Link]; // explanation: this line is part of app logic
import [Link]; // explanation: this line is part of app logic
import [Link]; // explanation: this line is part of app logic

import [Link]; // explanation: this line is part of app logic


import [Link]; // explanation: this line is part of app logic

import [Link].R; // explanation: this line is part of app logic


import [Link]; // explanation: this line is part of app logic

import [Link]; // explanation: this line is part of app logic


import [Link]; // explanation: this line is part of app logic
import [Link]; // explanation: this line is part of app logic
import [Link]; // explanation: this line is part of app logic
public class EventsAdapter extends [Link]<[Link]> { // explanation: this l

private List<CampusEvent> data; // explanation: this line is part of app logic

public EventsAdapter(List<CampusEvent> data) { [Link] = data; } // explanation: this line i

public void setData(List<CampusEvent> data) { // explanation: this line is part of app logic
[Link] = data; // explanation: this line is part of app logic
notifyDataSetChanged(); // explanation: this line is part of app logic
} // explanation: this line is part of app logic

@NonNull // explanation: this line is part of app logic


@Override // explanation: this line is part of app logic
public VH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { // explanation: this l
return new VH([Link]([Link]()) // explanation: this line is part o
.inflate([Link].item_event, parent, false)); // explanation: this line is part o
} // explanation: this line is part of app logic

@Override // explanation: this line is part of app logic


public void onBindViewHolder(@NonNull VH h, int position) { [Link]([Link](position)); } // e

@Override public int getItemCount() { return [Link](); } // explanation: this line is part

static class VH extends [Link] { // explanation: this line is part of app log
final TextView tvDay, tvMonth, tvWeekday, tvTitle, tvDesc, tvTime, tvVenue, tvCategory; //
final View strip; // explanation: this line is part of app logic
VH(@NonNull View v) { // explanation: this line is part of app logic
super(v); // explanation: this line is part of app logic
tvDay = [Link]([Link].tv_day); // explanation: this line is part of app logic
tvMonth = [Link]([Link].tv_month); // explanation: this line is part of app logi
tvWeekday = [Link]([Link].tv_weekday); // explanation: this line is part of app
tvTitle = [Link]([Link].tv_title); // explanation: this line is part of app logi
tvDesc = [Link]([Link].tv_desc); // explanation: this line is part of app logic
tvTime = [Link]([Link].tv_time); // explanation: this line is part of app logic
tvVenue = [Link]([Link].tv_venue); // explanation: this line is part of app logi
tvCategory = [Link]([Link].tv_category); // explanation: this line is part of ap
strip = [Link]([Link].color_strip); // explanation: this line is part of app log
} // explanation: this line is part of app logic
void bind(CampusEvent e) { // explanation: this line is part of app logic
try { // explanation: this line is part of app logic
Date d = new SimpleDateFormat("yyyy-MM-dd", [Link]).parse([Link]); // expl
[Link](new SimpleDateFormat("d", [Link]).format(d)); // explanation
[Link](new SimpleDateFormat("MMM", [Link]).format(d).toUpperCase(Loc
[Link](new SimpleDateFormat("EEE", [Link]).format(d).toUpperCase(L
} catch (Exception ignored) { // explanation: this line is part of app logic
[Link]("--"); [Link](""); [Link](""); // explanation: t
} // explanation: this line is part of app logic
[Link]([Link]); // explanation: this line is part of app logic
[Link]([Link]); // explanation: this line is part of app logic
[Link]("■ " + [Link]); // explanation: this line is part of app logic
[Link]("■ " + [Link]); // explanation: this line is part of app logic
[Link]([Link]); // explanation: this line is part of app logic
[Link](colorFor([Link])); // explanation: this line is part of a
} // explanation: this line is part of app logic
int colorFor(String cat) { // explanation: this line is part of app logic
switch (cat) { // explanation: this line is part of app logic
case "Hackathon": return 0xFFD946EF; // explanation: this line is part of app logi
case "Workshop": return 0xFF22D3EE; // explanation: this line is part of app logi
case "Seminar": return 0xFF34D399; // explanation: this line is part of app logi
case "Cultural": return 0xFFF59E0B; // explanation: this line is part of app logi
case "Sports": return 0xFFF87171; // explanation: this line is part of app logi
default: return 0xFF6366F1; // explanation: this line is part of app logi
} // explanation: this line is part of app logic
} // explanation: this line is part of app logic
} // explanation: this line is part of app logic
} // explanation: this line is part of app logic

[Link]
package [Link]; // explanation: this line is part of app logic

import [Link]; // explanation: this line is part of app logic


import [Link]; // explanation: this line is part of app logic
import [Link]; // explanation: this line is part of app logic
import [Link]; // explanation: this line is part of app logic
import [Link]; // explanation: this line is part of app logic

import [Link]; // explanation: this line is part of app logic


import [Link]; // explanation: this line is part of app logic

import [Link].R; // explanation: this line is part of app logic


import [Link]; // explanation: this line is part of app logic
import [Link]; // explanation: this line is part of app logic

import [Link]; // explanation: this line is part of app logic


import [Link]; // explanation: this line is part of app logic

public class MessAdapter extends [Link]<[Link]> { // explanation: this line

private static final List<String> MEALS = // explanation: this line is part of app logic
[Link]("Breakfast", "Lunch", "Snacks", "Dinner"); // explanation: this line is
private static final List<String> EMOJIS = // explanation: this line is part of app logic
[Link]("■", "■", "■", "■"); // explanation: this line is part of app logic
private static final int[] COLORS = // explanation: this line is part of app logic
{ 0xFFF59E0B, 0xFF34D399, 0xFFF87171, 0xFF818CF8 }; // explanation: this line is part

private MealMenu menu; // explanation: this line is part of app logic


private String day; // explanation: this line is part of app logic

public MessAdapter(MealMenu menu, String day) { // explanation: this line is part of app logic
[Link] = menu; [Link] = day; // explanation: this line is part of app logic
} // explanation: this line is part of app logic

public void setMenu(MealMenu m, String d) { // explanation: this line is part of app logic
[Link] = m; [Link] = d; // explanation: this line is part of app logic
notifyDataSetChanged(); // explanation: this line is part of app logic
} // explanation: this line is part of app logic

@NonNull // explanation: this line is part of app logic


@Override // explanation: this line is part of app logic
public VH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { // explanation: this l
return new VH([Link]([Link]()) // explanation: this line is part o
.inflate([Link].item_meal, parent, false)); // explanation: this line is part of
} // explanation: this line is part of app logic

@Override // explanation: this line is part of app logic


public void onBindViewHolder(@NonNull VH h, int position) { // explanation: this line is part
if (menu == null) return; // explanation: this line is part of app logic
String name = [Link](position); // explanation: this line is part of app logic
List<String> items; // explanation: this line is part of app logic
List<String> defaults; // explanation: this line is part of app logic
String timing; // explanation: this line is part of app logic
switch (position) { // explanation: this line is part of app logic
case 0: items = [Link]; defaults = MessData.DEFAULT_BREAKFAST; // explanation:
timing = "Sunday".equals(day) ? MessData.SUNDAY_BREAKFAST_TIMING : [Link]
case 1: items = [Link]; defaults = MessData.DEFAULT_LUNCH; // explanation: thi
timing = MessData.LUNCH_TIMING; break; // explanation: this line is part of ap
case 2: items = [Link]; defaults = MessData.DEFAULT_SNACKS; // explanation: th
timing = MessData.SNACKS_TIMING; break; // explanation: this line is part of a
default:items = [Link]; defaults = MessData.DEFAULT_DINNER; // explanation: th
timing = MessData.DINNER_TIMING; break; // explanation: this line is part of a
} // explanation: this line is part of app logic
[Link](name, [Link](position), timing, items, defaults, COLORS[position]); // explanat
} // explanation: this line is part of app logic

@Override public int getItemCount() { return menu == null ? 0 : 4; } // explanation: this line

static class VH extends [Link] { // explanation: this line is part of app log
final TextView tvEmoji, tvName, tvTiming; // explanation: this line is part of app logic
final LinearLayout itemsBox, defaultsBox; // explanation: this line is part of app logic
final View strip; // explanation: this line is part of app logic
VH(@NonNull View v) { // explanation: this line is part of app logic
super(v); // explanation: this line is part of app logic
tvEmoji = [Link]([Link].tv_emoji); // explanation: this line is part of app logi
tvName = [Link]([Link].tv_meal); // explanation: this line is part of app logic
tvTiming = [Link]([Link].tv_timing); // explanation: this line is part of app lo
itemsBox = [Link]([Link].items_box); // explanation: this line is part of app lo
defaultsBox = [Link]([Link].defaults_box); // explanation: this line is part of
strip = [Link]([Link].color_strip); // explanation: this line is part of app log
} // explanation: this line is part of app logic
void bind(String name, String emoji, String timing, List<String> items, List<String> defaults
[Link](emoji); // explanation: this line is part of app logic
[Link](name); // explanation: this line is part of app logic
[Link](timing); // explanation: this line is part of app logic
[Link](color); // explanation: this line is part of app logic

[Link](); // explanation: this line is part of app logic


for (String it : items) { // explanation: this line is part of app logic
TextView tv = new TextView([Link]()); // explanation: this line is pa
[Link]("• " + it); // explanation: this line is part of app logic
[Link](0xFFE2E8F0); // explanation: this line is part of app logic
[Link](14); // explanation: this line is part of app logic
[Link](0, dp(itemsBox, 3), 0, dp(itemsBox, 3)); // explanation: this line i
[Link](tv); // explanation: this line is part of app logic
} // explanation: this line is part of app logic
[Link](); // explanation: this line is part of app logic
for (String d : defaults) { // explanation: this line is part of app logic
TextView tv = new TextView([Link]()); // explanation: this line is
[Link](d); // explanation: this line is part of app logic
[Link](10); // explanation: this line is part of app logic
[Link](0xFFCBD5E1); // explanation: this line is part of app logic
[Link](dp(defaultsBox, 8), dp(defaultsBox, 3), dp(defaultsBox, 8), dp(defaults
[Link]([Link].chip_idle); // explanation: this line is part
[Link] lp = new [Link]( // explanation: this
[Link].WRAP_CONTENT, [Link].WRAP_CONTEN
[Link](dp(defaultsBox, 6)); // explanation: this line is part of app logi
[Link] = dp(defaultsBox, 4); // explanation: this line is part of app logic
[Link](lp); // explanation: this line is part of app logic
[Link](tv); // explanation: this line is part of app logic
} // explanation: this line is part of app logic
} // explanation: this line is part of app logic
int dp(View v, int x) { return [Link](x * [Link]().getDisplayMetrics().density);
} // explanation: this line is part of app logic
} // explanation: this line is part of app logic

[Link]
package [Link]; // explanation: this line is part of app logic

import [Link]; // explanation: this line is part of app logic


import [Link]; // explanation: this line is part of app logic
import [Link]; // explanation: this line is part of app logic
import [Link]; // explanation: this line is part of app logic
import [Link]; // explanation: this line is part of app logic

import [Link]; // explanation: this line is part of app logic


import [Link]; // explanation: this line is part of app logic

import [Link].R; // explanation: this line is part of app logic


import [Link]; // explanation: this line is part of app logic

import [Link]; // explanation: this line is part of app logic

public class RoomsAdapter extends [Link]<[Link]> { // explanation: this lin

private List<Room> data; // explanation: this line is part of app logic

public RoomsAdapter(List<Room> data) { [Link] = data; } // explanation: this line is part o

public void setData(List<Room> data) { // explanation: this line is part of app logic
[Link] = data; // explanation: this line is part of app logic
notifyDataSetChanged(); // explanation: this line is part of app logic
} // explanation: this line is part of app logic

@NonNull // explanation: this line is part of app logic


@Override // explanation: this line is part of app logic
public VH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { // explanation: this l
return new VH([Link]([Link]()) // explanation: this line is part o
.inflate([Link].item_room, parent, false)); // explanation: this line is part of
} // explanation: this line is part of app logic

@Override // explanation: this line is part of app logic


public void onBindViewHolder(@NonNull VH h, int position) { [Link]([Link](position)); } // e

@Override public int getItemCount() { return [Link](); } // explanation: this line is part

static class VH extends [Link] { // explanation: this line is part of app log
final TextView tvName, tvNumber, tvType, tvBuilding, tvCapacity; // explanation: this line
final LinearLayout facilities; // explanation: this line is part of app logic
final View strip; // explanation: this line is part of app logic
VH(@NonNull View v) { // explanation: this line is part of app logic
super(v); // explanation: this line is part of app logic
tvName = [Link]([Link].tv_name); // explanation: this line is part of app logic
tvNumber = [Link]([Link].tv_number); // explanation: this line is part of app lo
tvType = [Link]([Link].tv_type); // explanation: this line is part of app logic
tvBuilding = [Link]([Link].tv_building); // explanation: this line is part of ap
tvCapacity = [Link]([Link].tv_capacity); // explanation: this line is part of ap
facilities = [Link]([Link]); // explanation: this line is part of app
strip = [Link]([Link].color_strip); // explanation: this line is part of app log
} // explanation: this line is part of app logic
void bind(Room r) { // explanation: this line is part of app logic
[Link]([Link]); // explanation: this line is part of app logic
[Link]("#" + [Link]); // explanation: this line is part of app logic
[Link]([Link]); // explanation: this line is part of app logic
[Link]("■■ " + [Link]); // explanation: this line is part of app logi
if ([Link] > 0) { // explanation: this line is part of app logic
[Link]([Link]); // explanation: this line is part of app l
[Link]("■ Capacity: " + [Link]); // explanation: this line is par
} else [Link]([Link]); // explanation: this line is part of app l
[Link](colorFor([Link])); // explanation: this line is part of app l

[Link](); // explanation: this line is part of app logic


for (String f : [Link]) { // explanation: this line is part of app logic
TextView tv = new TextView([Link]()); // explanation: this line is
[Link](f); // explanation: this line is part of app logic
[Link](10); // explanation: this line is part of app logic
[Link](0xFFCBD5E1); // explanation: this line is part of app logic
[Link](dp(facilities, 8), dp(facilities, 3), dp(facilities, 8), dp(facilities,
[Link]([Link].chip_idle); // explanation: this line is part
[Link] lp = new [Link]( // explanation: this
[Link].WRAP_CONTENT, [Link].WRAP_CONTEN
[Link](dp(facilities, 6)); // explanation: this line is part of app logic
[Link] = dp(facilities, 4); // explanation: this line is part of app logic
[Link](lp); // explanation: this line is part of app logic
[Link](tv); // explanation: this line is part of app logic
} // explanation: this line is part of app logic
} // explanation: this line is part of app logic
int colorFor(String t) { // explanation: this line is part of app logic
switch (t) { // explanation: this line is part of app logic
case "Classroom": return 0xFF7B83EB; // explanation: this line is part of app log
case "Lab": return 0xFFF39C5A; // explanation: this line is part of app log
case "Auditorium": return 0xFFF59E0B; // explanation: this line is part of app log
case "Facility": return 0xFF34D399; // explanation: this line is part of app log
default: return 0xFF6366F1; // explanation: this line is part of app log
} // explanation: this line is part of app logic
} // explanation: this line is part of app logic
int dp(View v, int x) { return [Link](x * [Link]().getDisplayMetrics().density);
} // explanation: this line is part of app logic
} // explanation: this line is part of app logic

[Link]
package [Link]; // explanation: this line is part of app logic

import [Link]; // explanation: this line is part of app logic


import [Link]; // explanation: this line is part of app logic
import [Link]; // explanation: this line is part of app logic
import [Link]; // explanation: this line is part of app logic

import [Link]; // explanation: this line is part of app logic


import [Link]; // explanation: this line is part of app logic

import [Link].R; // explanation: this line is part of app logic


import [Link]; // explanation: this line is part of app logic
import [Link]; // explanation: this line is part of app logic
import [Link]; // explanation: this line is part of app logic

import [Link]; // explanation: this line is part of app logic

public class TimetableAdapter extends [Link]<[Link]> { // explanati

public static final int TYPE_CLASS = 0; // explanation: this line is part of app logic
public static final int TYPE_BREAK = 1; // explanation: this line is part of app logic
public static final int TYPE_FREE = 2; // explanation: this line is part of app logic

public static class Row { // explanation: this line is part of app logic
public final int type; // explanation: this line is part of app logic
public final ClassEntry entry; // nullable // explanation: this line is part of app logi
public final String time; // explanation: this line is part of app logic
private Row(int type, ClassEntry entry, String time) { // explanation: this line is part o
[Link] = type; [Link] = entry; [Link] = time; // explanation: this line is p
} // explanation: this line is part of app logic
public static Row classRow(ClassEntry e, String t) { return new Row(TYPE_CLASS, e, t); } /
public static Row breakRow(String t) { return new Row(TYPE_BREAK, null, t); }
public static Row freeRow(String t) { return new Row(TYPE_FREE, null, t); }
} // explanation: this line is part of app logic

private List<Row> data; // explanation: this line is part of app logic

public TimetableAdapter(List<Row> data) { [Link] = data; } // explanation: this line is par

public void setData(List<Row> data) { // explanation: this line is part of app logic
[Link] = data; // explanation: this line is part of app logic
notifyDataSetChanged(); // explanation: this line is part of app logic
} // explanation: this line is part of app logic

@Override // explanation: this line is part of app logic


public int getItemViewType(int position) { return [Link](position).type; } // explanation: t

@NonNull // explanation: this line is part of app logic


@Override // explanation: this line is part of app logic
public [Link] onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { /
LayoutInflater inf = [Link]([Link]()); // explanation: this line i
switch (viewType) { // explanation: this line is part of app logic
case TYPE_BREAK: return new BreakVH([Link]([Link].item_timetable_break, parent, fa
case TYPE_FREE: return new FreeVH ([Link]([Link].item_timetable_free, parent, fa
default: return new ClassVH([Link]([Link].item_timetable_class, parent, fa
} // explanation: this line is part of app logic
} // explanation: this line is part of app logic

@Override // explanation: this line is part of app logic


public void onBindViewHolder(@NonNull [Link] h, int position) { // explanatio
Row r = [Link](position); // explanation: this line is part of app logic
if (h instanceof ClassVH) ((ClassVH) h).bind(r); // explanation: this line is part of app
else if (h instanceof BreakVH) ((BreakVH) h).bind(r); // explanation: this line is part of
else if (h instanceof FreeVH) ((FreeVH) h).bind(r); // explanation: this line is part of a
} // explanation: this line is part of app logic

@Override public int getItemCount() { return [Link](); } // explanation: this line is part

static class ClassVH extends [Link] { // explanation: this line is part of ap


final TextView tvCode, tvName, tvFaculty, tvRoom, tvTime, tvBatch, tvLab; // explanation:
final View strip; // explanation: this line is part of app logic
ClassVH(View v) { // explanation: this line is part of app logic
super(v); // explanation: this line is part of app logic
tvCode = [Link]([Link].tv_code); // explanation: this line is part of app logic
tvName = [Link]([Link].tv_name); // explanation: this line is part of app logic
tvFaculty = [Link]([Link].tv_faculty); // explanation: this line is part of app
tvRoom = [Link]([Link].tv_room); // explanation: this line is part of app logic
tvTime = [Link]([Link].tv_time); // explanation: this line is part of app logic
tvBatch = [Link]([Link].tv_batch); // explanation: this line is part of app logi
tvLab = [Link]([Link].tv_lab); // explanation: this line is part of app logic
strip = [Link]([Link].color_strip); // explanation: this line is part of app log
} // explanation: this line is part of app logic
void bind(Row r) { // explanation: this line is part of app logic
ClassEntry e = [Link]; // explanation: this line is part of app logic
Subject s = [Link]([Link]); // explanation: this line is part
if (s == null) return; // explanation: this line is part of app logic
[Link]([Link]); // explanation: this line is part of app logic
[Link]([Link]); // explanation: this line is part of app logic
[Link]("■■■ " + [Link]); // explanation: this line is part of app logic
[Link]("■ " + [Link]); // explanation: this line is part of app logic
[Link]([Link]); // explanation: this line is part of app logic
if ([Link] != null && !"All".equals([Link])) { // explanation: this line is part of
[Link]([Link]); [Link]([Link]); // explanation: thi
} else [Link]([Link]); // explanation: this line is part of app logi
[Link]([Link] ? [Link] : [Link]); // explanation: this line is
[Link]([Link]); // explanation: this line is part of app logic
} // explanation: this line is part of app logic
} // explanation: this line is part of app logic

static class BreakVH extends [Link] { // explanation: this line is part of ap


final TextView tvTime; // explanation: this line is part of app logic
BreakVH(View v) { super(v); tvTime = [Link]([Link].tv_time); } // explanation: this
void bind(Row r) { [Link]([Link]); } // explanation: this line is part of app logi
} // explanation: this line is part of app logic

static class FreeVH extends [Link] { // explanation: this line is part of app
final TextView tvTime; // explanation: this line is part of app logic
FreeVH(View v) { super(v); tvTime = [Link]([Link].tv_time); } // explanation: this l
void bind(Row r) { [Link]([Link]); } // explanation: this line is part of app logi
} // explanation: this line is part of app logic
} // explanation: this line is part of app logic

[Link]
package [Link]; // explanation: this line is part of app logic

import [Link]; // explanation: this line is part of app logic


import [Link]; // explanation: this line is part of app logic

import [Link]; // explanation: this line is part of app logic


import [Link]; // explanation: this line is part of app logic

/** // explanation: this line is part of app logic


* Persists attendance records (attended/total) per subject in SharedPreferences. // explanation:
* // explanation: this line is part of app logic
* Storage scheme (per subject code): // explanation: this line is part of app logic
* key = "att_<CODE>_attended" -> int // explanation: this line is part of app logic
* key = "att_<CODE>_total" -> int // explanation: this line is part of app logic
*/ // explanation: this line is part of app logic
public class AttendanceManager { // explanation: this line is part of app logic

private static final String PREFS = "iiitn_attendance_prefs"; // explanation: this line is par
private static final String SEEDED_FLAG = "seeded_v1"; // explanation: this line is part of ap

private final SharedPreferences prefs; // explanation: this line is part of app logic

public AttendanceManager(Context ctx) { // explanation: this line is part of app logic


[Link] = [Link]() // explanation: this line is part of app logic
.getSharedPreferences(PREFS, Context.MODE_PRIVATE); // explanation: this line is p
seedIfNeeded(); // explanation: this line is part of app logic
} // explanation: this line is part of app logic

private void seedIfNeeded() { // explanation: this line is part of app logic


if ([Link](SEEDED_FLAG, false)) return; // explanation: this line is part of app
[Link] e = [Link](); // explanation: this line is part of app logic
// Sensible starting values so the UI isn't empty. // explanation: this line is part of ap
[Link]("att_AC_attended", 18); [Link]("att_AC_total", 22); // explanation: this line
[Link]("att_DSP_attended", 20); [Link]("att_DSP_total", 24); // explanation: this line
[Link]("att_CS_attended", 14); [Link]("att_CS_total", 20); // explanation: this line
[Link]("att_CAO_attended", 16); [Link]("att_CAO_total", 20); // explanation: this line
[Link]("att_EM_attended", 19); [Link]("att_EM_total", 22); // explanation: this line
[Link]("att_ITW_attended", 10); [Link]("att_ITW_total", 12); // explanation: this line
[Link](SEEDED_FLAG, true); // explanation: this line is part of app logic
[Link](); // explanation: this line is part of app logic
} // explanation: this line is part of app logic

public int getAttended(String code) { // explanation: this line is part of app logic
return [Link]("att_" + code + "_attended", 0); // explanation: this line is part of
} // explanation: this line is part of app logic

public int getTotal(String code) { // explanation: this line is part of app logic
return [Link]("att_" + code + "_total", 0); // explanation: this line is part of app
} // explanation: this line is part of app logic

/** // explanation: this line is part of app logic


* Updates attendance for a subject, clamped so attended >= 0, // explanation: this line is pa
* total >= 0, and attended <= total. // explanation: this line is part of app logic
*/ // explanation: this line is part of app logic
public void update(String code, int attended, int total) { // explanation: this line is part o
if (total < 0) total = 0; // explanation: this line is part of app logic
if (attended < 0) attended = 0; // explanation: this line is part of app logic
if (attended > total) attended = total; // explanation: this line is part of app logic
[Link]() // explanation: this line is part of app logic
.putInt("att_" + code + "_attended", attended) // explanation: this line is part o
.putInt("att_" + code + "_total", total) // explanation: this line is part of app
.apply(); // explanation: this line is part of app logic
} // explanation: this line is part of app logic

public void markPresent(String code) { // explanation: this line is part of app logic
update(code, getAttended(code) + 1, getTotal(code) + 1); // explanation: this line is part
} // explanation: this line is part of app logic

public void markAbsent(String code) { // explanation: this line is part of app logic
update(code, getAttended(code), getTotal(code) + 1); // explanation: this line is part of
} // explanation: this line is part of app logic

public void incrementAttended(String code, int delta) { // explanation: this line is part of a
update(code, getAttended(code) + delta, getTotal(code)); // explanation: this line is part
} // explanation: this line is part of app logic

public void incrementTotal(String code, int delta) { // explanation: this line is part of app
update(code, getAttended(code), getTotal(code) + delta); // explanation: this line is part
} // explanation: this line is part of app logic

/** Returns map in TRACKED_SUBJECTS order. */ // explanation: this line is part of app logic
public Map<String, int[]> getAll() { // explanation: this line is part of app logic
Map<String, int[]> map = new LinkedHashMap<>(); // explanation: this line is part of app l
for (String code : CampusData.TRACKED_SUBJECTS) { // explanation: this line is part of app
[Link](code, new int[]{ getAttended(code), getTotal(code) }); // explanation: this li
} // explanation: this line is part of app logic
return map; // explanation: this line is part of app logic
} // explanation: this line is part of app logic

public int getOverallPercent() { // explanation: this line is part of app logic


int a = 0, t = 0; // explanation: this line is part of app logic
for (String code : CampusData.TRACKED_SUBJECTS) { // explanation: this line is part of app
a += getAttended(code); // explanation: this line is part of app logic
t += getTotal(code); // explanation: this line is part of app logic
} // explanation: this line is part of app logic
return t == 0 ? 0 : [Link]((a * 100f) / t); // explanation: this line is part of app l
} // explanation: this line is part of app logic

public static int percent(int attended, int total) { // explanation: this line is part of app
return total == 0 ? 0 : [Link]((attended * 100f) / total); // explanation: this line i
} // explanation: this line is part of app logic
} // explanation: this line is part of app logic

[Link]
package [Link]; // explanation: this line is part of app logic

import [Link]; // explanation: this line is part of app logic

import [Link]; // explanation: this line is part of app logic


import [Link]; // explanation: this line is part of app logic
import [Link]; // explanation: this line is part of app logic
import [Link]; // explanation: this line is part of app logic
import [Link]; // explanation: this line is part of app logic
import [Link]; // explanation: this line is part of app logic

/** // explanation: this line is part of app logic


* Central repository for all static IIIT Nagpur campus data: // explanation: this line is part of
* subjects, weekly timetable, time slots, rooms and events. // explanation: this line is part of
* // explanation: this line is part of app logic
* Designed so that future versions can swap any of these sources // explanation: this line is par
* for a Firebase/Room backend without changing the UI layer. // explanation: this line is part of
*/ // explanation: this line is part of app logic
public final class CampusData { // explanation: this line is part of app logic

private CampusData() { /* no instances */ } // explanation: this line is part of app logic

/* ---------------------- Subjects ---------------------- */ // explanation: this line is part

public static final Map<String, Subject> SUBJECTS = new LinkedHashMap<>(); // explanation: thi

static { // explanation: this line is part of app logic


[Link]("AC", new Subject("AC", "Analog Communication", // explanation: thi
"Dr. B.V. Naik", "201", [Link]("#F4C430"), fal
[Link]("DSP", new Subject("DSP", "Digital Signal Processing", // explanation
"Dr. Parul Sahare", "202", [Link]("#F39C5A"), fal
[Link]("CS", new Subject("CS", "Control Systems", // explanation: this lin
"Dr. Rajnish Kumar", "203", [Link]("#3FBF7F"), fal
[Link]("CAO", new Subject("CAO", "Computer Architecture & Organization", //
"Dr. Mayur Parate", "204", [Link]("#7B83EB"), fal
[Link]("EM", new Subject("EM", "Engineering Mathematics", // explanation:
"Dr. Girish Ghivela", "201", [Link]("#E8675F"), fal
[Link]("ITW", new Subject("ITW", "IT Workshop Lab", // explanation: this lin
"Dr. Roshani Hukare", "ITW Lab", [Link]("#62B5E5"), tru
[Link]("DSP-LAB", new Subject("DSP-LAB", "DSP Lab", // explanation: this line is par
"Dr. Parul Sahare", "Signal Processing Lab", [Link]("#F39C5A"), tru
[Link]("AC-LAB", new Subject("AC-LAB", "AC Lab", // explanation: this line is part
"Dr. B.V. Naik", "Communication Lab", [Link]("#F4C430"), tru
} // explanation: this line is part of app logic

/** Subjects for which we track attendance. */ // explanation: this line is part of app logic
public static final List<String> TRACKED_SUBJECTS = // explanation: this line is part of app l
[Link]("AC", "DSP", "CS", "CAO", "EM", "ITW"); // explanation: this line is par

/* ---------------------- Time slots ---------------------- */ // explanation: this line is pa

public static final List<String> TIME_SLOTS = [Link]( // explanation: this line is part
"9:00 - 10:55", // explanation: this line is part of app logic
"11:00 - 12:55", // explanation: this line is part of app logic
"13:00 - 13:55", // BREAK // explanation: this line is part of app logic
"14:00 - 14:55", // explanation: this line is part of app logic
"15:00 - 15:55", // explanation: this line is part of app logic
"16:00 - 16:55" // explanation: this line is part of app logic
); // explanation: this line is part of app logic

public static final int BREAK_SLOT_INDEX = 2; // explanation: this line is part of app logic

/* ---------------------- Days ---------------------- */ // explanation: this line is part of

public static final List<String> WORKING_DAYS = [Link]( // explanation: this line is pa


"Monday", "Tuesday", "Wednesday", "Thursday", "Friday" // explanation: this line is pa
); // explanation: this line is part of app logic

/* ---------------------- Timetable ---------------------- */ // explanation: this line is par

/** // explanation: this line is part of app logic


* Map of day -> list of slots (size = TIME_SLOTS.size()). // explanation: this line is part o
* Each slot is a list of ClassEntry (multiple entries when batches split). // explanation: th
* An empty list means a free period. // explanation: this line is part of app logic
*/ // explanation: this line is part of app logic
public static final Map<String, List<List<ClassEntry>>> TIMETABLE = new LinkedHashMap<>(); //

static { // explanation: this line is part of app logic


// Monday // explanation: this line is part of app logic
List<List<ClassEntry>> monday = newEmptyDay(); // explanation: this line is part of app lo
[Link](1, [Link]( // explanation: this line is part of app logic
new ClassEntry("DSP-LAB", "B1", 1, "Monday"), // explanation: this line is part of
new ClassEntry("ITW", "B2", 1, "Monday"))); // explanation: this line is part
[Link](3, [Link](new ClassEntry("AC", "All", 3, "Monday"))); // ex
[Link](4, [Link](new ClassEntry("DSP", "All", 4, "Monday"))); // ex
[Link](5, [Link](new ClassEntry("CS", "All", 5, "Monday"))); // ex
[Link]("Monday", monday); // explanation: this line is part of app logic

// Tuesday // explanation: this line is part of app logic


List<List<ClassEntry>> tuesday = newEmptyDay(); // explanation: this line is part of app l
[Link](0, [Link](new ClassEntry("ITW", "B1", 0, "Tuesday")));
[Link](1, [Link](new ClassEntry("AC-LAB", "B1", 1, "Tuesday")));
[Link](3, [Link](new ClassEntry("DSP", "All", 3, "Tuesday")));
[Link](4, [Link](new ClassEntry("CAO", "All", 4, "Tuesday")));
[Link](5, [Link](new ClassEntry("AC", "All", 5, "Tuesday")));
[Link]("Tuesday", tuesday); // explanation: this line is part of app logic

// Wednesday // explanation: this line is part of app logic


List<List<ClassEntry>> wednesday = newEmptyDay(); // explanation: this line is part of app
[Link](1, [Link](new ClassEntry("AC-LAB", "B2", 1, "Wednesday")));
[Link](3, [Link](new ClassEntry("DSP", "All", 3, "Wednesday")));
[Link](4, [Link](new ClassEntry("CAO", "All", 4, "Wednesday")));
[Link](5, [Link](new ClassEntry("EM", "All", 5, "Wednesday")));
[Link]("Wednesday", wednesday); // explanation: this line is part of app logic
// Thursday // explanation: this line is part of app logic
List<List<ClassEntry>> thursday = newEmptyDay(); // explanation: this line is part of app
[Link](1, [Link]( // explanation: this line is part of app logic
new ClassEntry("ITW", "B1", 1, "Thursday"), // explanation: this line is part of a
new ClassEntry("ITW", "B2", 1, "Thursday"))); // explanation: this line is part of
[Link](3, [Link](new ClassEntry("CAO", "All", 3, "Thursday"))); /
[Link](4, [Link](new ClassEntry("EM", "All", 4, "Thursday"))); /
[Link](5, [Link](new ClassEntry("CS", "All", 5, "Thursday"))); /
[Link]("Thursday", thursday); // explanation: this line is part of app logic

// Friday // explanation: this line is part of app logic


List<List<ClassEntry>> friday = newEmptyDay(); // explanation: this line is part of app lo
[Link](0, [Link](new ClassEntry("DSP-LAB", "B2", 0, "Friday"))); /
[Link](3, [Link](new ClassEntry("CS", "All", 3, "Friday"))); /
[Link](4, [Link](new ClassEntry("EM", "All", 4, "Friday"))); /
[Link](5, [Link](new ClassEntry("AC", "All", 5, "Friday"))); /
[Link]("Friday", friday); // explanation: this line is part of app logic
} // explanation: this line is part of app logic

private static List<List<ClassEntry>> newEmptyDay() { // explanation: this line is part of app


List<List<ClassEntry>> day = new ArrayList<>(); // explanation: this line is part of app l
for (int i = 0; i < TIME_SLOTS.size(); i++) { // explanation: this line is part of app log
[Link](new ArrayList<ClassEntry>()); // explanation: this line is part of app logic
} // explanation: this line is part of app logic
return day; // explanation: this line is part of app logic
} // explanation: this line is part of app logic

/* ---------------------- Rooms ---------------------- */ // explanation: this line is part of

public static final List<Room> ROOMS = new ArrayList<>(); // explanation: this line is part of

static { // explanation: this line is part of app logic


[Link](new Room("Lecture Hall 201", "201", "Academic Block", "Classroom", 80, // explan
[Link]("Projector", "AC", "Smart Board", "AC, EM Classes"))); // explanatio
[Link](new Room("Lecture Hall 202", "202", "Academic Block", "Classroom", 80, // explan
[Link]("Projector", "AC", "DSP Classes"))); // explanation: this line is pa
[Link](new Room("Lecture Hall 203", "203", "Academic Block", "Classroom", 60, // explan
[Link]("Projector", "AC", "CS / AIML Classes"))); // explanation: this line
[Link](new Room("Lecture Hall 204", "204", "Academic Block", "Classroom", 60, // explan
[Link]("Projector", "AC", "CAO / DSA Classes"))); // explanation: this line
[Link](new Room("Signal Processing Lab", "SPL-1", "ECE Block", "Lab", 40, // explanatio
[Link]("MATLAB", "DSP Kits", "Oscilloscopes", "DSP Lab"))); // explanation:
[Link](new Room("Communication Lab", "CL-1", "ECE Block", "Lab", 40, // explanation: th
[Link]("Function Gen.", "CRO", "Modulators", "AC Lab"))); // explanation: t
[Link](new Room("ITW Lab", "ITW-1", "CSE Block", "Lab", 50, // explanation: this line i
[Link]("Workstations", "Linux/Windows", "ITW Lab"))); // explanation: this
[Link](new Room("Central Library", "LIB", "Library Block", "Facility", 300, // explanat
[Link]("Books", "E-Resources", "Reading Hall", "Wi-Fi"))); // explanation:
[Link](new Room("Main Auditorium", "AUD", "Admin Block", "Auditorium", 500, // explanat
[Link]("Stage", "PA System", "Projector"))); // explanation: this line is p
[Link](new Room("Sports Complex", "SPRT", "Sports Block", "Facility", 0, // explanation
[Link]("Gym", "Indoor Games", "Outdoor Courts"))); // explanation: this lin
} // explanation: this line is part of app logic

/* ---------------------- Events ---------------------- */ // explanation: this line is part o

public static final List<CampusEvent> EVENTS = new ArrayList<>(); // explanation: this line is

static { // explanation: this line is part of app logic


[Link](new CampusEvent("e1", "Hack-IIITN 2026", "2026-05-12", "9:00 AM", // explanatio
"Main Auditorium", // explanation: this line is part of app logic
"48-hour flagship hackathon. Build, ship and pitch innovative solutions. Cash prizes
"Hackathon")); // explanation: this line is part of app logic
[Link](new CampusEvent("e2", "Guest Lecture: Quantum Computing", "2026-04-28", "3:00 PM",
"Lecture Hall 201", // explanation: this line is part of app logic
"An insightful talk by Dr. A. Sharma (IIT-B) on the future of quantum computing in In
"Seminar")); // explanation: this line is part of app logic
[Link](new CampusEvent("e3", "ML Workshop with TensorFlow", "2026-05-02", "10:00 AM",
"ITW Lab", // explanation: this line is part of app logic
"Hands-on session covering CNNs, RNNs and deploying models. Bring your laptop!", /
"Workshop")); // explanation: this line is part of app logic
[Link](new CampusEvent("e4", "Spectrum '26 - Cultural Fest", "2026-05-20", "5:00 PM",
"Open Air Theatre", // explanation: this line is part of app logic
"The annual cultural extravaganza featuring music, dance, drama and celebrity nights.
"Cultural")); // explanation: this line is part of app logic
[Link](new CampusEvent("e5", "Inter-Branch Cricket League", "2026-04-30", "8:00 AM", /
"Sports Complex", // explanation: this line is part of app logic
"ECE vs CSE finals - come cheer for your branch!", // explanation: this line is pa
"Sports")); // explanation: this line is part of app logic
[Link](new CampusEvent("e6", "Embedded Systems Workshop", "2026-05-05", "11:00 AM", //
"Communication Lab", // explanation: this line is part of app logic
"Learn ESP32, IoT prototyping and PCB basics with industry experts.", // explanati
"Workshop")); // explanation: this line is part of app logic
} // explanation: this line is part of app logic
} // explanation: this line is part of app logic

[Link]
package [Link]; // explanation: this line is part of app logic

/** // explanation: this line is part of app logic


* Represents a campus event/seminar/workshop/hackathon. // explanation: this line is part of app
*/ // explanation: this line is part of app logic
public class CampusEvent { // explanation: this line is part of app logic
public final String id; // explanation: this line is part of app logic
public final String title; // explanation: this line is part of app logic
public final String date; // yyyy-MM-dd // explanation: this line is part of app logi
public final String time; // explanation: this line is part of app logic
public final String venue; // explanation: this line is part of app logic
public final String description; // explanation: this line is part of app logic
public final String category; // Hackathon, Workshop, Seminar, Cultural, Sports // explan

public CampusEvent(String id, String title, String date, String time, // explanation: this lin
String venue, String description, String category) { // explanation: this l
[Link] = id; // explanation: this line is part of app logic
[Link] = title; // explanation: this line is part of app logic
[Link] = date; // explanation: this line is part of app logic
[Link] = time; // explanation: this line is part of app logic
[Link] = venue; // explanation: this line is part of app logic
[Link] = description; // explanation: this line is part of app logic
[Link] = category; // explanation: this line is part of app logic
} // explanation: this line is part of app logic
} // explanation: this line is part of app logic

[Link]
package [Link]; // explanation: this line is part of app logic

/** // explanation: this line is part of app logic


* Represents a single scheduled class (one cell of the timetable). // explanation: this line is p
*/ // explanation: this line is part of app logic
public class ClassEntry { // explanation: this line is part of app logic
public final String subjectCode; // explanation: this line is part of app logic
public final String batch; // "All", "B1", "B2" // explanation: this line is part of ap
public final int slotIndex; // index into CampusData.TIME_SLOTS // explanation: this lin
public final String day; // Monday..Friday // explanation: this line is part of app l

public ClassEntry(String subjectCode, String batch, int slotIndex, String day) { // explanatio
[Link] = subjectCode; // explanation: this line is part of app logic
[Link] = batch; // explanation: this line is part of app logic
[Link] = slotIndex; // explanation: this line is part of app logic
[Link] = day; // explanation: this line is part of app logic
} // explanation: this line is part of app logic
} // explanation: this line is part of app logic

[Link]
package [Link]; // explanation: this line is part of app logic

import [Link]; // explanation: this line is part of app logic

/** // explanation: this line is part of app logic


* Represents the four meals of a single day in the mess. // explanation: this line is part of app
*/ // explanation: this line is part of app logic
public class MealMenu { // explanation: this line is part of app logic
public final List<String> breakfast; // explanation: this line is part of app logic
public final List<String> lunch; // explanation: this line is part of app logic
public final List<String> snacks; // explanation: this line is part of app logic
public final List<String> dinner; // explanation: this line is part of app logic

public MealMenu(List<String> breakfast, List<String> lunch, // explanation: this line is part


List<String> snacks, List<String> dinner) { // explanation: this line is part
[Link] = breakfast; // explanation: this line is part of app logic
[Link] = lunch; // explanation: this line is part of app logic
[Link] = snacks; // explanation: this line is part of app logic
[Link] = dinner; // explanation: this line is part of app logic
} // explanation: this line is part of app logic
} // explanation: this line is part of app logic

[Link]
package [Link]; // explanation: this line is part of app logic

import [Link]; // explanation: this line is part of app logic


import [Link]; // explanation: this line is part of app logic
import [Link]; // explanation: this line is part of app logic
import [Link]; // explanation: this line is part of app logic

/** // explanation: this line is part of app logic


* Mess menu effective from 23-04-2026. // explanation: this line is part of app logic
*/ // explanation: this line is part of app logic
public final class MessData { // explanation: this line is part of app logic

private MessData() { } // explanation: this line is part of app logic

public static final List<String> ALL_DAYS = [Link]( // explanation: this line is part o
"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" // explan
); // explanation: this line is part of app logic

public static final String BREAKFAST_TIMING = "7:30 - 9:30 AM"; // explanation: this line is p
public static final String LUNCH_TIMING = "12:00 - 2:00 PM"; // explanation: this line is
public static final String SNACKS_TIMING = "5:30 - 6:30 PM"; // explanation: this line is p
public static final String DINNER_TIMING = "7:30 - 9:30 PM"; // explanation: this line is p
public static final String SUNDAY_BREAKFAST_TIMING = "8:00 - 10:00 AM"; // explanation: this l

public static final List<String> DEFAULT_BREAKFAST = // explanation: this line is part of app
[Link]("Milk", "Tea", "Coffee", "Bread", "Butter", "Jam"); // explanation: this
public static final List<String> DEFAULT_LUNCH = // explanation: this line is part of app logi
[Link]("Onion", "Salt", "Chilli Powder"); // explanation: this line is part of
public static final List<String> DEFAULT_SNACKS = // explanation: this line is part of app log
[Link]("Tea", "Coffee", "Nimbu Pani / Sharbat"); // explanation: this line is p
public static final List<String> DEFAULT_DINNER = // explanation: this line is part of app log
[Link]("Onion", "Lemon", "Ghee", "Salt", "Chilli Powder"); // explanation: this

public static final Map<String, MealMenu> MENU = new LinkedHashMap<>(); // explanation: this l

static { // explanation: this line is part of app logic


[Link]("Monday", new MealMenu( // explanation: this line is part of app logic
[Link]("Methi Paratha, Sabji", "Seasonal Fruit"), // explanation: this line
[Link]("Aaloo Matar", "Daal Tadka", "Chapati", "Veg Pulao", "Salad, Aachar", "
[Link]("Bread Pakoda (2pc)", "Hari & Laal Chutney"), // explanation: this l
[Link]("Mix Veg (Dry)", "Daal", "Chapati", "Rice", "Salad, Aachar"))); // e

[Link]("Tuesday", new MealMenu( // explanation: this line is part of app logic


[Link]("Aaloo Puri", "Sprouts"), // explanation: this line is part of app l
[Link]("Desi Chana Gravy", "Daal", "Chapati", "Matar Rice", "Salad, Aachar", "
[Link]("Maggi"), // explanation: this line is part of app logic
[Link]("Bhindi / Cabbage", "Chapati", "Rice", "Salad, Aachar", "Halwa / Fruit

[Link]("Wednesday", new MealMenu( // explanation: this line is part of app logic


[Link]("Veg Uttapam", "Sambar, Chutney", "Seasonal Fruits"), // explanation
[Link]("Kadhi Pakoda", "Aalu Gajar", "Chapati", "Rice", "Salad, Aachar, Papad"
[Link]("Pani Puri"), // explanation: this line is part of app logic
[Link]("Kadhai Paneer", "Chapati", "Jeera Rice", "Daal Tadka", "Salad, Aachar"

[Link]("Thursday", new MealMenu( // explanation: this line is part of app logic


[Link]("Poha-Sev", "Chana Curry", "Sprouts"), // explanation: this line is
[Link]("Soya Wadi", "Massori Daal", "Chapati", "Rice", "Salad, Aachar", "Lassi
[Link]("Vada Pav (2pc) / Dhokla", "Hari & Laal Chutney"), // explanation: t
[Link]("Sukhe Chane", "Kadhi", "Puri", "Rice", "Aachar, Salad", "Rasgulla / Gu

[Link]("Friday", new MealMenu( // explanation: this line is part of app logic


[Link]("Vada", "Sambar, Chutney", "Seasonal Fruits"), // explanation: this
[Link]("Aaloo Gobi / Seasonal Veg", "Moong Daal", "Chapati", "Matar Rice", "Sa
[Link]("Sandwich", "Hari & Laal Chutney"), // explanation: this line is par
[Link]("Sev Tamatar", "Daal", "Chapati", "Jeera Rice", "Salad, Aachar, Thecha"

[Link]("Saturday", new MealMenu( // explanation: this line is part of app logic


[Link]("Aaloo Paratha, Curd", "Sprouts"), // explanation: this line is part
[Link]("Rajma", "Chapati", "Veg Biryani", "Salad, Aachar, Papad", "Chach"),
[Link]("Poha-Sev"), // explanation: this line is part of app logic
[Link]("Veg Kofta", "Mix Daal", "Chapati", "Rice", "Salad, Aachar"))); // e

[Link]("Sunday", new MealMenu( // explanation: this line is part of app logic


[Link]("Masala Dosa", "Sambar, Chutney", "Seasonal Fruits"), // explanation
[Link]("Chole-Puri", "Moong Daal", "Rice", "Salad, Aachar, Papad", "Boondi Rai
[Link]("Oreo Biscuits", "Chips", "Cupcake", "Cream Roll"), // explanation:
[Link]("Paneer Butter Masala", "Daal Fry", "Chapati", "Jeera Rice", "Salad, Aa
} // explanation: this line is part of app logic
} // explanation: this line is part of app logic

[Link]
package [Link]; // explanation: this line is part of app logic

import [Link]; // explanation: this line is part of app logic

/** // explanation: this line is part of app logic


* Represents a physical room/facility on campus. // explanation: this line is part of app logic
*/ // explanation: this line is part of app logic
public class Room { // explanation: this line is part of app logic
public final String name; // explanation: this line is part of app logic
public final String number; // explanation: this line is part of app logic
public final String building; // explanation: this line is part of app logic
public final String type; // Classroom, Lab, Auditorium, Facility // explanation: thi
public final int capacity; // 0 if unknown // explanation: this line is part of app lo
public final List<String> facilities; // explanation: this line is part of app logic

public Room(String name, String number, String building, String type, // explanation: this lin
int capacity, List<String> facilities) { // explanation: this line is part of app
[Link] = name; // explanation: this line is part of app logic
[Link] = number; // explanation: this line is part of app logic
[Link] = building; // explanation: this line is part of app logic
[Link] = type; // explanation: this line is part of app logic
[Link] = capacity; // explanation: this line is part of app logic
[Link] = facilities; // explanation: this line is part of app logic
} // explanation: this line is part of app logic
} // explanation: this line is part of app logic

[Link]
package [Link]; // explanation: this line is part of app logic

/** // explanation: this line is part of app logic


* Represents an academic subject (theory or lab) in the IIIT Nagpur curriculum. // explanation: t
*/ // explanation: this line is part of app logic
public class Subject { // explanation: this line is part of app logic
public final String code; // explanation: this line is part of app logic
public final String name; // explanation: this line is part of app logic
public final String faculty; // explanation: this line is part of app logic
public final String room; // explanation: this line is part of app logic
public final int color; // ARGB color int for card tint // explanation: this line is par
public final boolean isLab; // explanation: this line is part of app logic

public Subject(String code, String name, String faculty, String room, int color, boolean isLab) {
[Link] = code; // explanation: this line is part of app logic
[Link] = name; // explanation: this line is part of app logic
[Link] = faculty; // explanation: this line is part of app logic
[Link] = room; // explanation: this line is part of app logic
[Link] = color; // explanation: this line is part of app logic
[Link] = isLab; // explanation: this line is part of app logic
} // explanation: this line is part of app logic
} // explanation: this line is part of app logic

You might also like