Commit 01db6740 authored by Sajal Narang's avatar Sajal Narang Committed by GitHub

Merge pull request #133 from MayuBhattu/master

Quick Links with basic design
parents f5bbeac7 3cf8b3cc
package app.insti.fragment; package app.insti.fragment;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import app.insti.R; import app.insti.R;
/**
* A simple {@link Fragment} subclass.
*/
public class QLinksFragment extends BaseFragment { public class QLinksFragment extends BaseFragment {
public QLinksFragment() { public QLinksFragment() {
// Required empty public constructor // Required empty public constructor
} }
public void onStart(){
super.onStart();
TextView CMS = getActivity().findViewById(R.id.button_CMS);
TextView CMSMaint = getActivity().findViewById(R.id.button_CMSMaint);
TextView CMSNet = getActivity().findViewById(R.id.button_CMSNet);
TextView ASC = getActivity().findViewById(R.id.button_ASC);
TextView ASCExt = getActivity().findViewById(R.id.button_ASCExt);
TextView Moodle = getActivity().findViewById(R.id.button_Moodle);
TextView Intern = getActivity().findViewById(R.id.button_Internship);
TextView Placement = getActivity().findViewById(R.id.button_Placement);
TextView Library = getActivity().findViewById(R.id.button_Library);
TextView AcadCal = getActivity().findViewById(R.id.button_Acad_calender);
TextView AcadTime = getActivity().findViewById(R.id.button_Acad_timetable);
TextView Holidays = getActivity().findViewById(R.id.button_Holidays);
TextView Circulars = getActivity().findViewById(R.id.button_Circulars);
TextView Courses = getActivity().findViewById(R.id.button_Courselist);
TextView GPO = getActivity().findViewById(R.id.button_GPO);
TextView CAMP = getActivity().findViewById(R.id.button_CAMP);
TextView MSStore = getActivity().findViewById(R.id.button_MSStore);
TextView BigHome = getActivity().findViewById(R.id.button_BigHomeCloud);
TextView FTP = getActivity().findViewById(R.id.button_FTP);
TextView Intercom = getActivity().findViewById(R.id.button_Intercom);
TextView Hospital = getActivity().findViewById(R.id.button_Hospital);
TextView VPN = getActivity().findViewById(R.id.button_VPN);
CMS.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { goToUrl("https://gymkhana.iitb.ac.in/cms_new/"); } });
CMSMaint.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { goToUrl("https://support.iitb.ac.in"); } });
CMSNet.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { goToUrl("https://help-cc.iitb.ac.in/"); } });
ASC.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { goToUrl("https://asc.iitb.ac.in"); } });
ASCExt.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { goToUrl("https://portal.iitb.ac.in/asc"); } });
Moodle.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { goToUrl("https://moodle.iitb.ac.in"); } });
Intern.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { goToUrl("http://placements.iitb.ac.in/internship/login.jsp"); } });
Placement.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { goToUrl("http://placements.iitb.ac.in/placements/login.jsp"); } });
Library.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { goToUrl("http://www.library.iitb.ac.in/"); } });
AcadCal.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { goToUrl("http://www.iitb.ac.in/newacadhome/toacadcalender.jsp"); } });
AcadTime.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { goToUrl("http://www.iitb.ac.in/newacadhome/timetable.jsp"); } });
Holidays.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { goToUrl("http://www.iitb.ac.in/en/about-iit-bombay/iit-bombay-holidays-list"); } });
Circulars.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { goToUrl("http://www.iitb.ac.in/newacadhome/circular.jsp"); } });
Courses.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { goToUrl("https://portal.iitb.ac.in/asc/Courses"); } });
GPO.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { goToUrl("https://gpo.iitb.ac.in"); } });
CAMP.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { goToUrl("https://camp.iitb.ac.in/"); } });
MSStore.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { goToUrl("http://msstore.iitb.ac.in/"); } });
BigHome.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { goToUrl("https://home.iitb.ac.in/"); } });
FTP.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { goToUrl("ftp://ftp.iitb.ac.in/"); } });
Intercom.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { goToUrl("https://portal.iitb.ac.in/TelephoneDirectory/"); } });
Hospital.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { goToUrl("http://www.iitb.ac.in/hospital/"); } });
VPN.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { goToUrl("https://www.cc.iitb.ac.in/engservices/engaccessingiitffromoutside/19-vpn"); } });
}
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_qlinks, container, false);
// Inflate the layout for this fragment return view;
return inflater.inflate(R.layout.fragment_qlinks, container, false);
} }
public void goToUrl (String url) {
Uri uriUrl = Uri.parse(url);
Intent launchBrowser = new Intent(Intent.ACTION_VIEW, uriUrl);
startActivity(launchBrowser);
}
} }
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context="app.insti.fragment.QLinksFragment"> tools:context="app.insti.fragment.QLinksFragment">
<!-- TODO: Update blank fragment layout --> <ScrollView
<TextView android:layout_width="fill_parent"
android:layout_width="match_parent" android:layout_height="wrap_content">
android:layout_height="match_parent" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent">
android:text="@string/hello_blank_fragment" /> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text=" CMS" android:textSize="25sp" />
<TextView
android:id="@+id/button_CMS" android:textSize="@dimen/quick_links_size"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="CMS"/>
<TextView
android:id="@+id/button_CMSMaint" android:textSize="@dimen/quick_links_size"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="CMS - Maintainance"/>
<TextView
android:id="@+id/button_CMSNet" android:textSize="@dimen/quick_links_size"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="CMS - Network"/>
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text=" Academics" android:textSize="25sp" />
<TextView
android:id="@+id/button_ASC" android:textSize="@dimen/quick_links_size"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="ASC"/>
<TextView
android:id="@+id/button_ASCExt" android:textSize="@dimen/quick_links_size"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="External ASC"/>
<TextView
android:id="@+id/button_Moodle" android:textSize="@dimen/quick_links_size"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Moodle"/>
<TextView
android:id="@+id/button_Internship" android:textSize="@dimen/quick_links_size"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Internship Login"/>
<TextView
android:id="@+id/button_Placement" android:textSize="@dimen/quick_links_size"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Placement Login"/>
<TextView
android:id="@+id/button_Library" android:textSize="@dimen/quick_links_size"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Central Library"/>
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text=" Calender" android:textSize="25sp"/>
<TextView
android:id="@+id/button_Acad_calender" android:textSize="@dimen/quick_links_size"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Academic Calender"/>
<TextView
android:id="@+id/button_Acad_timetable" android:textSize="@dimen/quick_links_size"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Academic Timetable"/>
<TextView
android:id="@+id/button_Holidays" android:textSize="@dimen/quick_links_size"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Holidays List"/>
<TextView
android:id="@+id/button_Circulars" android:textSize="@dimen/quick_links_size"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Circulars"/>
<TextView
android:id="@+id/button_Courselist" android:textSize="@dimen/quick_links_size"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="CMS Maintainance"/>
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text=" Services" android:textSize="25sp"/>
<TextView
android:id="@+id/button_GPO" android:textSize="@dimen/quick_links_size"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="GPO"/>
<TextView
android:id="@+id/button_CAMP" android:textSize="@dimen/quick_links_size"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="CAMP"/>
<TextView
android:id="@+id/button_MSStore" android:textSize="@dimen/quick_links_size"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Microsoft Store"/>
<TextView
android:id="@+id/button_BigHomeCloud" android:textSize="@dimen/quick_links_size"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="BigHome Cloud"/>
<TextView
android:id="@+id/button_FTP" android:textSize="@dimen/quick_links_size"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="FTP"/>
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text=" Miscellaneous" android:textSize="25sp"/>
<TextView
android:id="@+id/button_Intercom" android:textSize="@dimen/quick_links_size"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Intercom Extensions"/>
<TextView
android:id="@+id/button_Hospital" android:textSize="@dimen/quick_links_size"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Hospital"/>
<TextView
android:id="@+id/button_VPN" android:textSize="@dimen/quick_links_size"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="VPN Guide"/>
</LinearLayout>
</ScrollView>
</FrameLayout> </FrameLayout>
...@@ -5,4 +5,5 @@ ...@@ -5,4 +5,5 @@
<dimen name="nav_header_vertical_spacing">8dp</dimen> <dimen name="nav_header_vertical_spacing">8dp</dimen>
<dimen name="nav_header_height">176dp</dimen> <dimen name="nav_header_height">176dp</dimen>
<dimen name="fab_margin">16dp</dimen> <dimen name="fab_margin">16dp</dimen>
<dimen name="quick_links_size">18dp</dimen>
</resources> </resources>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment