use of models.Student in project instructure-android by instructure.
the class BaseParentActivity method showMismatchedRegionDialog.
private void showMismatchedRegionDialog(final String regionString, final Context context) {
new AlertDialog.Builder(context).setTitle(R.string.unauthorizedRegion).setMessage(getString(R.string.mismatchedRegionMessage, getReadableRegion(this, regionString))).setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Prefs prefs = new Prefs(BaseParentActivity.this, getString(R.string.app_name_parent));
String parentId = prefs.load(Const.ID, "");
UserManager.getStudentsForParentAirwolf(ApiPrefs.getAirwolfDomain(), parentId, new StatusCallback<List<Student>>() {
@Override
public void onResponse(@NonNull Response<List<Student>> response, @NonNull LinkHeaders linkHeaders, @NonNull ApiType type) {
if (response.body() != null && !response.body().isEmpty()) {
// They have students that they are observing, take them to that activity
startActivity(StudentViewActivity.createIntent(BaseParentActivity.this, response.body()));
overridePendingTransition(0, 0);
finish();
} else {
// Log the user out
new LogoutAsyncTask(BaseParentActivity.this, "").execute();
}
}
});
}
}).setCancelable(false).show();
}
use of models.Student in project instructure-android by instructure.
the class DetailViewActivity method routeFromIntent.
private void routeFromIntent(Intent intent) {
DETAIL_FRAGMENT fragmentType = (DETAIL_FRAGMENT) intent.getExtras().getSerializable(Const.FRAGMENT_TYPE);
if (fragmentType != null) {
Student student = intent.getExtras().getParcelable(Const.STUDENT);
switch(fragmentType) {
case WEEK:
Student user = intent.getExtras().getParcelable(Const.USER);
Course course = (Course) intent.getExtras().getSerializable(Const.COURSE);
if (user != null && course != null) {
addFragment(CourseWeekFragment.newInstance(user, course));
}
break;
case ASSIGNMENT:
Assignment assignment = intent.getExtras().getParcelable(Const.ASSIGNMENT);
String courseName = intent.getExtras().getString(Const.NAME);
addFragment(AssignmentFragment.newInstance(assignment, courseName, student), false);
break;
case ANNOUNCEMENT:
DiscussionTopicHeader announcement = intent.getExtras().getParcelable(Const.ANNOUNCEMENT);
String announcementCourseName = intent.getExtras().getString(Const.NAME);
addFragment(AnnouncementFragment.newInstance(announcement, announcementCourseName, student), false);
break;
case EVENT:
ScheduleItem item = intent.getExtras().getParcelable(Const.SCHEDULE_ITEM);
addFragment(EventFragment.newInstance(item, student), false);
break;
case SYLLABUS:
Course syllabusCourse = (Course) intent.getExtras().getSerializable(Const.COURSE);
addFragment(CourseSyllabusFragment.newInstance(syllabusCourse, student), false);
break;
case ACCOUNT_NOTIFICATION:
AccountNotification accountNotification = intent.getExtras().getParcelable(Const.ACCOUNT_NOTIFICATION);
addFragment(AccountNotificationFragment.newInstance(accountNotification, student));
}
}
}
use of models.Student in project instructure-android by instructure.
the class AlertPresenterTest method setup.
@Before
public void setup() {
presenter = new AlertPresenter(new Student());
alert1 = new Alert();
alert2 = new Alert();
}
use of models.Student in project instructure-android by instructure.
the class CourseListPresenterTest method setUp.
@Before
public void setUp() throws Exception {
course1 = new Course();
course2 = new Course();
Student student = new Student();
presenter = new CourseListPresenter(student);
}
use of models.Student in project instructure-android by instructure.
the class WeekPresenterTest method setUp.
@Before
public void setUp() throws Exception {
Student student = new Student();
student.setStudentId("student_12345");
student.setParentId("parent_12345");
student.setStudentDomain("https://localhost.com");
student.setStudentName("Man in the Yellow Hat");
Course course = new Course();
course.setName("Curious George and the Hidden Course of Doom");
course.setCourseCode("course_12345");
mPresenter = new WeekViewPresenterFactory(student, course).create();
}
Aggregations