-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
71ac948
commit 67ded62
Showing
8 changed files
with
153 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package net.harimurti.tv; | ||
|
||
import android.annotation.SuppressLint; | ||
import android.app.Application; | ||
import android.content.Context; | ||
|
||
public class App extends Application { | ||
@SuppressLint("StaticFieldLeak") | ||
protected static Context context = null; | ||
|
||
@Override | ||
public void onCreate() { | ||
super.onCreate(); | ||
context = this; | ||
} | ||
|
||
public static Context getContext() { | ||
return context; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package net.harimurti.tv.data; | ||
|
||
import java.util.List; | ||
|
||
public class Release | ||
{ | ||
public int versionCode; | ||
public String versionName; | ||
public List<String> changelog; | ||
public String downloadUrl; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package net.harimurti.tv.extra; | ||
|
||
import android.content.SharedPreferences; | ||
import android.preference.PreferenceManager; | ||
|
||
import net.harimurti.tv.App; | ||
|
||
import java.util.Calendar; | ||
import java.util.Date; | ||
|
||
public class Preferences { | ||
private static final String LAST_CHECK_UPDATE = "LAST_CHECK_UPDATE"; | ||
|
||
private SharedPreferences preferences; | ||
private SharedPreferences.Editor editor; | ||
|
||
public Preferences() { | ||
preferences = PreferenceManager.getDefaultSharedPreferences(App.getContext()); | ||
} | ||
|
||
public void setLastCheckUpdate() { | ||
Calendar nextday = Calendar.getInstance(); | ||
nextday.add(Calendar.DATE, 1); | ||
nextday.set(Calendar.HOUR_OF_DAY, 0); | ||
|
||
editor = preferences.edit(); | ||
editor.putLong(LAST_CHECK_UPDATE, nextday.getTimeInMillis()); | ||
editor.apply(); | ||
} | ||
|
||
public boolean isCheckedUpdate() { | ||
try { | ||
Calendar last = Calendar.getInstance(); | ||
last.setTimeInMillis(preferences.getLong(LAST_CHECK_UPDATE, 0)); | ||
Date dateLast = last.getTime(); | ||
|
||
Calendar now = Calendar.getInstance(); | ||
now.set(Calendar.HOUR_OF_DAY, 0); | ||
Date dateNow = now.getTime(); | ||
|
||
return dateLast.after(dateNow); | ||
} | ||
catch (Exception ignore) { | ||
return false; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,23 @@ | ||
<resources> | ||
<string name="app_name">Nonton TV</string> | ||
|
||
<!-- some text --> | ||
<string name="something_went_wrong">Ada sesuatu yang salah!!!</string> | ||
<string name="source_offline">Siaran tidak dapat diakses!!!</string> | ||
<string name="text_auto_retry">akan dicoba ulang otomatis dalam 5</string> | ||
<string name="text_auto_retry_second">akan dicoba ulang otomatis dalam %d</string> | ||
<string name="text_auto_retry_now">akan dicoba ulang otomatis sekarang</string> | ||
<string name="no_network">Tidak ada koneksi internet!!!</string> | ||
|
||
<!-- json link --> | ||
<string name="json_playlist">https://github.com/hariimurti/NontonTV/raw/master/json/playlist.json</string> | ||
<string name="json_release">https://github.com/hariimurti/NontonTV/raw/master/json/release.json</string> | ||
|
||
<!-- alert update --> | ||
<string name="alert_new_update">Pembaharuan!!!</string> | ||
<string name="alert_download">Unduh</string> | ||
<string name="alert_close">Tutup</string> | ||
<string name="message_update">Versi\n• Terpasang : %s (%d)\n• Terkini : %s (%d)\n\nPerubahan :</string> | ||
<string name="message_update_changelog">\n• %s</string> | ||
<string name="message_update_no_changelog">\n• lain-lain</string> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#Thu Apr 09 21:57:50 ICT 2020 | ||
VERSION_MINOR=0 | ||
VERSION_CODE=372 | ||
#Fri Apr 10 09:42:44 ICT 2020 | ||
VERSION_MINOR=1 | ||
VERSION_CODE=384 | ||
VERSION_MAJOR=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"versionCode": 327, | ||
"versionName": "v1.0", | ||
"changelog": ["rilisan pertama", "upto 87 channel"], | ||
"downloadUrl": "https://github.com/hariimurti/NontonTV/releases/download/v1.0/net.harimurti.tv_v1.0_b327.apk" | ||
"versionCode": 384, | ||
"versionName": "v1.1", | ||
"changelog": ["perbaikan ssl error (android 4.4)", "pemberitahuan pembaharuan", "perubahan lain"], | ||
"downloadUrl": "https://github.com/hariimurti/NontonTV/releases/download/v1.1/net.harimurti.tv_v1.1_b384.apk" | ||
} |