From 75db76c85f7d330373904ab6e1b607ad1ff12085 Mon Sep 17 00:00:00 2001 From: Vlad Golubev Date: Tue, 3 Feb 2015 23:20:38 +0200 Subject: [PATCH] Extract string resources --- .../main/java/ua/samosfator/moduleok/LoadPageAsyncTask.java | 4 ++-- .../ua/samosfator/moduleok/notification/ScoreChecker.java | 2 +- .../moduleok/notification/ScoreCheckerNotification.java | 4 ++-- app/src/main/res/values/strings.xml | 2 ++ 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/ua/samosfator/moduleok/LoadPageAsyncTask.java b/app/src/main/java/ua/samosfator/moduleok/LoadPageAsyncTask.java index 1258595..c399345 100644 --- a/app/src/main/java/ua/samosfator/moduleok/LoadPageAsyncTask.java +++ b/app/src/main/java/ua/samosfator/moduleok/LoadPageAsyncTask.java @@ -20,8 +20,8 @@ protected String doInBackground(Void... params) { Document mainPage = Jsoup.parse("
"); try { // mainPage = getFromLocalSource(); - mainPage = getFromCustomRemoteSource(); -// mainPage = getFromRemoteSource(); +// mainPage = getFromCustomRemoteSource(); + mainPage = getFromRemoteSource(); } catch (IOException e) { e.printStackTrace(); } diff --git a/app/src/main/java/ua/samosfator/moduleok/notification/ScoreChecker.java b/app/src/main/java/ua/samosfator/moduleok/notification/ScoreChecker.java index 15a7894..476ebe3 100644 --- a/app/src/main/java/ua/samosfator/moduleok/notification/ScoreChecker.java +++ b/app/src/main/java/ua/samosfator/moduleok/notification/ScoreChecker.java @@ -123,7 +123,7 @@ public void run() { } } }; - scoreCheckTimer.schedule(refreshStudentTask, 0, 10000); + scoreCheckTimer.schedule(refreshStudentTask, 0, 2 * 60 * 60 * 1000); System.out.println(scoreCheckTimer); } else { Log.i(TAG, "No modules dates in the near 2 days"); diff --git a/app/src/main/java/ua/samosfator/moduleok/notification/ScoreCheckerNotification.java b/app/src/main/java/ua/samosfator/moduleok/notification/ScoreCheckerNotification.java index 2ddd6a0..ff45dbe 100644 --- a/app/src/main/java/ua/samosfator/moduleok/notification/ScoreCheckerNotification.java +++ b/app/src/main/java/ua/samosfator/moduleok/notification/ScoreCheckerNotification.java @@ -23,8 +23,8 @@ public static void sendNotification() { private static void buildNotification() { mNotificationBuilder = new NotificationCompat.Builder(App.getContext()) .setSmallIcon(R.drawable.ic_launcher) - .setContentTitle("New score available!") - .setContentText("Open MODULE.OK to check it out!"); + .setContentTitle(App.getContext().getString(R.string.notification_new_score_available_title_text)) + .setContentText(App.getContext().getString(R.string.notification_new_score_detailed_text)); Intent resultIntent = new Intent(App.getContext(), MainActivity.class); PendingIntent resultPendingIntent = PendingIntent.getActivity( diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 2e91866..ee70f55 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -42,6 +42,8 @@ Last synced with mod.tanet Surprise! App version + New score available! + Open MODULE.OK to check it out! @string/first_semester_name