Skip to content

Commit

Permalink
Merge pull request #11 from sanjay7178/faculty_search
Browse files Browse the repository at this point in the history
feat: Add miscellaneous bottom sheet with faculty ranker and time tab…
  • Loading branch information
sanjay7178 authored Aug 6, 2024
2 parents 2eb0853 + 2f46e3d commit bdf707d
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,21 @@ public class ProfileFragment extends Fragment {
null
),

new ItemData(
R.drawable.ic_miscellaneous,
R.string.miscellaneous,
context -> {
View bottomSheetLayout = View.inflate(context, R.layout.layout_bottom_sheet_miscellaneous, null);
bottomSheetLayout.findViewById(R.id.text_view_time_table_scheduler).setOnClickListener(view -> SettingsRepository.openBrowser(context, SettingsRepository.TIME_TABLE_SCHEDULER_URL));
bottomSheetLayout.findViewById(R.id.text_view_faculty_ranker).setOnClickListener(view -> SettingsRepository.openBrowser(context, SettingsRepository.FACULTY_RANKER_URL));

BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(context);
bottomSheetDialog.setContentView(bottomSheetLayout);
bottomSheetDialog.show();
},
null
),

new ItemData(
R.drawable.ic_privacy,
R.string.privacy,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ public class SettingsRepository {
public static final String UNIV_URL = "http://172.18.10.10:1000/login?" ;
public static final String HOSTEL_URL = "https://hfw.vitap.ac.in:8090/httpclient.html" ;

public static final String FACULTY_RANKER_URL = "https://faculty-ranker.vercel.app/";
public static final String TIME_TABLE_SCHEDULER_URL = "http://vitap-time-table-scheduler.vercel.app/";

public static final int THEME_DAY = 1;
public static final int THEME_NIGHT = 2;
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/ic_miscellaneous.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">

<path android:fillColor="@android:color/white" android:pathData="M19,7H9C7.9,7 7,7.9 7,9v10c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2V9C21,7.9 20.1,7 19,7zM19,9v2H9V9H19zM13,15v-2h2v2H13zM15,17v2h-2v-2H15zM11,15H9v-2h2V15zM17,13h2v2h-2V13zM9,17h2v2H9V17zM17,19v-2h2v2H17zM6,17H5c-1.1,0 -2,-0.9 -2,-2V5c0,-1.1 0.9,-2 2,-2h10c1.1,0 2,0.9 2,2v1h-2V5H5v10h1V17z"/>

</vector>
46 changes: 46 additions & 0 deletions app/src/main/res/layout/layout_bottom_sheet_miscellaneous.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="20dp"
android:paddingTop="20dp"
android:paddingEnd="20dp"
android:paddingBottom="10dp"
android:text="@string/miscellaneous"
android:textSize="18sp"
android:textStyle="bold" />

<TextView
android:id="@+id/text_view_faculty_ranker"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:paddingStart="30dp"
android:paddingTop="18dp"
android:paddingEnd="30dp"
android:paddingBottom="18dp"
android:text="@string/faculty_ranker"
android:textSize="16sp" />

<TextView
android:id="@+id/text_view_time_table_scheduler"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:paddingStart="30dp"
android:paddingTop="18dp"
android:paddingEnd="30dp"
android:paddingBottom="18dp"
android:text="@string/time_table_scheduler"
android:textSize="16sp" />

</LinearLayout>
6 changes: 6 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@
<string name="open_issue">Open an issue</string>
<string name="request_feature">Request a feature</string>

<!-- Miscellaneous BottomSheet Strings -->
<string name="miscellaneous">Miscellaneous</string>
<string name="faculty_ranker">Faculty Ranker</string>
<string name="time_table_scheduler">Time Table Scheduler</string>


<!-- WIFI BottomSheet Strings -->
<string name="wifi_connect">Wifi Connect (Intranet) Beta</string>
<string name="university_wifi">Connect to University Wifi</string>
Expand Down

0 comments on commit bdf707d

Please sign in to comment.