Beispiel #1
0
        private void LaunchFile(int index)
        {
            Bundle bundle;

            if (AppConstant.IsQPOffline(SystemPath.GetFileName(semesters[semesterIndex].Years[yearIndex].QuestionPapers[index].FileLink.ToString())))
            {
                bundle = new Bundle();
                bundle.PutBoolean("IsFileOffline", true);
                bundle.PutString("PATH", SystemPath.Combine(AppConstant.QPFolderPath, SystemPath.GetFileName(semesters[semesterIndex].Years[yearIndex].QuestionPapers[index].FileLink.ToString())));
            }
            else
            {
                bundle = new Bundle();
                bundle.PutBoolean("IsFileOffline", false);

                bundle.PutString("URL", semesters[semesterIndex].Years[yearIndex].QuestionPapers[index].FileLink.ToString());
                bundle.PutBoolean("IsFileNotice", false);
            }

            if (Looper.MyLooper() == null)
            {
                Looper.Prepare();
            }

            Android.Content.Intent i = new Android.Content.Intent(this, typeof(PDFViewerActivity));
            i.SetFlags(ActivityFlags.NewTask | ActivityFlags.ClearTop);
            i.PutExtras(bundle);
            StartActivity(i);
        }
Beispiel #2
0
        private void LaunchNotice(int index)
        {
            Bundle bundle;

            Android.Content.Intent i;

            if (notices[index].HasImage)
            {
                if (AppConstant.IsNoticeOffline(SystemPath.GetFileName(notices[index].ImageLink.ToString())))
                {
                    bundle = new Bundle();
                    bundle.PutBoolean("IsFileOffline", true);
                    bundle.PutString("PATH", SystemPath.Combine(AppConstant.NoticePath, SystemPath.GetFileName(notices[index].ImageLink.ToString())));
                }
                else
                {
                    bundle = new Bundle();
                    bundle.PutBoolean("IsFileOffline", false);
                    bundle.PutString("URL", notices[index].ImageLink.ToString());
                }

                i = new Android.Content.Intent(this, typeof(ImageViewerActivity));
            }
            else
            {
                if (AppConstant.IsNoticeOffline(SystemPath.GetFileName(notices[index].FileLink.ToString())))
                {
                    bundle = new Bundle();
                    bundle.PutBoolean("IsFileOffline", true);
                    bundle.PutString("PATH", SystemPath.Combine(AppConstant.NoticePath, SystemPath.GetFileName(notices[index].FileLink.ToString())));
                }
                else
                {
                    bundle = new Bundle();
                    bundle.PutBoolean("IsFileOffline", false);
                    bundle.PutString("URL", notices[index].FileLink.ToString());
                    bundle.PutBoolean("IsFileNotice", true);
                }

                i = new Android.Content.Intent(this, typeof(PDFViewerActivity));
            }

            if (Looper.MyLooper() == null)
            {
                Looper.Prepare();
            }

            i.SetFlags(Android.Content.ActivityFlags.NewTask | Android.Content.ActivityFlags.ClearTop);
            i.PutExtras(bundle);
            this.StartActivity(i);
        }
Beispiel #3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.Main);

            AppConstant.SetUpDirectories();

            SetupTextView();

            InitializeEvents();

            AnimateViews();
        }
        private void ShowOfflineNotices()
        {
            listOffline = AppConstant.GetOfflineNotices();

            if (listOffline.Count == 0)
            {
                new AlertDialog.Builder(new ContextThemeWrapper(this, Resource.Style.Dialog)).SetPositiveButton("OK", (sender, args) => {  })
                .SetCancelable(false)
                .SetMessage("No offline notices found.")
                .SetTitle("Not Found")
                .Show();
            }
            else
            {
                offlineFiles.Adapter = new OfflineFilesAdapter(this, listOffline, "Notices");
                CurrentShowing       = OfflineCategory.Notice;
                offlineFiles.StartLayoutAnimation();
            }
        }