If you think the Android project AndroIUT listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
package com.iutdijon.androiut2.iut.activities;
//fromwww.java2s.comimport android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.Window;
import com.iutdijon.androiut2.R;
import com.iutdijon.androiut2.ade.activities.ADEActivity;
import com.iutdijon.androiut2.ftp.activities.FTPActivity;
import com.iutdijon.androiut2.global.AndroIUTApplication;
import com.iutdijon.androiut2.iut.data.account.UserAccount;
import com.iutdijon.androiut2.mail.activities.MailActivity;
import com.iutdijon.androiut2.schooling.activities.SchoolingTabActivity;
import com.iutdijon.androiut2.util.IOUtils;
import com.iutdijon.androiut2.util.UIUtil;
/**
* Menu principal de l'application, permettant d'acc?der aux diff?rents services de l'application
* @author Morgan Funtowicz
*
*/publicclass HomeActivity extends Activity {
@Override
protectedvoid onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_home);
//On bloque l'acc?s aux notes/absences pour les professeurs
if(AndroIUTApplication.getInstance().getAccount().getType().equalsIgnoreCase(UserAccount.TEACHER_ACCOUNT) || AndroIUTApplication.getInstance().getAccount().isRestricted()){
findViewById(R.id.marks_btn).setClickable(false);
UIUtil.showMessage(this, R.string.restricted_mode_info);
}
}
/**
* D?marre le service des emails
* @param target Le bouton emails dans l'IHM
*/publicvoid startEmailService(View target){
Intent emails_service = new Intent(this, MailActivity.class);
startActivity(emails_service);
}
/**
* D?marre le service du planning
* @param target Le bouton du planning dans l'IHM
*/publicvoid startADEService(View target){
Intent ade_service = new Intent(this, ADEActivity.class);
startActivity(ade_service);
}
/**
* D?marre le service du FTP
* @param target Le bouton FTP dans l'IHM
*/publicvoid startFTPService(View target){
if(IOUtils.isUniversityWifi(this)){
UIUtil.showMessage(this, R.string.ftp_on_university_wifi_disable);
}else{
Intent ftp_service = new Intent(this, FTPActivity.class);
startActivity(ftp_service);
}
}
/**
* D?mmare le service scolarit?
* @param target Le bouton Scolarit? dans l'IHM
*/publicvoid startSchoolingService(View target){
Intent schooling_service = new Intent(this, SchoolingTabActivity.class);
startActivity(schooling_service);
}
@Override
publicboolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_home, menu);
return true;
}
}