Skip to content

Commit

Permalink
Merge pull request #9 from sanjay7178/faculty_search
Browse files Browse the repository at this point in the history
feat: Add wifi icons for university, hostel, and network
  • Loading branch information
sanjay7178 authored Aug 6, 2024
2 parents 73286a1 + 909a3bc commit e1b0125
Show file tree
Hide file tree
Showing 8 changed files with 107 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,31 @@ public class ProfileFragment extends Fragment {
context.startActivity(intent);
},
null
), new ItemData(
R.drawable.ic_faculty_search,
R.string.faculty_search,
context -> SettingsRepository.openWebViewActivity(
context,
context.getString(R.string.faculty_search),
SettingsRepository.FACULTY_SEARCH_URL
),
null
),
new ItemData(
R.drawable.ic_network_wifi_24,
R.string.wifi_connect,
context -> {
View bottomSheetLayout = View.inflate(context, R.layout.layout_bottom_sheet_wifi, null);
bottomSheetLayout.findViewById(R.id.text_view_university_wifi).setOnClickListener(view -> SettingsRepository.openBrowser(context, SettingsRepository.UNIV_URL));
bottomSheetLayout.findViewById(R.id.text_view_hostel_wifi).setOnClickListener(view -> SettingsRepository.openBrowser(context, SettingsRepository.HOSTEL_URL));

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

new ItemData(
R.drawable.ic_privacy,
R.string.privacy,
Expand All @@ -179,6 +203,7 @@ public class ProfileFragment extends Fragment {
),
null
),

new ItemData(
R.drawable.ic_feedback,
R.string.send_feedback,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public class SettingsRepository {
public static final String APP_BASE_URL = "https://vitstudent.sanjaydev.site";
public static final String APP_ABOUT_URL = APP_BASE_URL + "/about.json";
public static final String APP_PRIVACY_URL = "https://vtopchennai.therealsuji.tk" + "/privacy-policy";

public static final String FACULTY_SEARCH_URL = "https://vitstudent.sanjaydev.site/facultySearch" ;
public static final String DEVELOPER_BASE_URL = "https://sanjay7178.github.io";

public static final String GITHUB_BASE_URL = "https://github.com/sanjay7178/android-vtop-vitap";
Expand All @@ -84,6 +84,10 @@ public class SettingsRepository {
// TODO : VTOP LINK
public static final String VTOP_BASE_URL = "https://vtop.vitap.ac.in/vtop";

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 int THEME_DAY = 1;
public static final int THEME_NIGHT = 2;
public static final int THEME_SYSTEM_DAY = 3;
Expand All @@ -94,6 +98,8 @@ public class SettingsRepository {
public static final int NOTIFICATION_ID_VTOP_DOWNLOAD = 3;
public static final int NOTIFICATION_REFRESH_PAGE = 8 ;



public static int getTheme(Context context) {
String appearance = getSharedPreferences(context).getString("appearance", "system");

Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/ic_faculty_search.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="M12,12.75c1.63,0 3.07,0.39 4.24,0.9c1.08,0.48 1.76,1.56 1.76,2.73L18,18H6l0,-1.61c0,-1.18 0.68,-2.26 1.76,-2.73C8.93,13.14 10.37,12.75 12,12.75zM4,13c1.1,0 2,-0.9 2,-2c0,-1.1 -0.9,-2 -2,-2s-2,0.9 -2,2C2,12.1 2.9,13 4,13zM5.13,14.1C4.76,14.04 4.39,14 4,14c-0.99,0 -1.93,0.21 -2.78,0.58C0.48,14.9 0,15.62 0,16.43V18l4.5,0v-1.61C4.5,15.56 4.73,14.78 5.13,14.1zM20,13c1.1,0 2,-0.9 2,-2c0,-1.1 -0.9,-2 -2,-2s-2,0.9 -2,2C18,12.1 18.9,13 20,13zM24,16.43c0,-0.81 -0.48,-1.53 -1.22,-1.85C21.93,14.21 20.99,14 20,14c-0.39,0 -0.76,0.04 -1.13,0.1c0.4,0.68 0.63,1.46 0.63,2.29V18l4.5,0V16.43zM12,6c1.66,0 3,1.34 3,3c0,1.66 -1.34,3 -3,3s-3,-1.34 -3,-3C9,7.34 10.34,6 12,6z"/>

</vector>
7 changes: 7 additions & 0 deletions app/src/main/res/drawable/ic_hostel_wifi.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<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="M1,11l0,10l5,0l0,-6l4,0l0,6l5,0l0,-10l-7,-5z"/>

<path android:fillColor="@android:color/white" android:pathData="M10,3v1.97l7,5V11h2v2h-2v2h2v2h-2v4h6V3H10zM19,9h-2V7h2V9z"/>

</vector>
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/ic_network_wifi_24.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="M24,8.98C20.93,5.9 16.69,4 12,4C7.31,4 3.07,5.9 0,8.98L12,21v0l0,0L24,8.98zM2.92,9.07C5.51,7.08 8.67,6 12,6s6.49,1.08 9.08,3.07l-1.43,1.43C17.5,8.94 14.86,8 12,8s-5.5,0.94 -7.65,2.51L2.92,9.07z"/>

</vector>
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/ic_university_wifi.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="M20,6h-4L16,4c0,-1.11 -0.89,-2 -2,-2h-4c-1.11,0 -2,0.89 -2,2v2L4,6c-1.11,0 -1.99,0.89 -1.99,2L2,19c0,1.11 0.89,2 2,2h16c1.11,0 2,-0.89 2,-2L22,8c0,-1.11 -0.89,-2 -2,-2zM14,6h-4L10,4h4v2z"/>

</vector>
46 changes: 46 additions & 0 deletions app/src/main/res/layout/layout_bottom_sheet_wifi.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/wifi_connect"
android:textSize="18sp"
android:textStyle="bold" />

<TextView
android:id="@+id/text_view_university_wifi"
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/university_wifi"
android:textSize="16sp" />

<TextView
android:id="@+id/text_view_hostel_wifi"
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/hostel_wifi"
android:textSize="16sp" />

</LinearLayout>
7 changes: 7 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
<string name="sync_data">Sync Data</string>
<string name="notifications">Notifications</string>
<string name="share">Share App</string>
<string name="faculty_search">Faculty Search</string>

<!-- Download Strings: Strings used while downloading data -->
<string name="vtop_service_description">Downloads data from VTOP.</string>
Expand Down Expand Up @@ -128,6 +129,12 @@
<string name="open_issue">Open an issue</string>
<string name="request_feature">Request a feature</string>

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


<!-- Sign Out BottomSheet Strings -->
<string name="sign_out_moodle">Sign out of Moodle</string>
<string name="sign_out_app">Sign out of &app_name;</string>
Expand Down

0 comments on commit e1b0125

Please sign in to comment.