forked from Disroot/disapp
Migration to status.disroot.org
Update Gradle + SDK
This commit is contained in:
parent
ef5591324e
commit
a516d2d699
20 changed files with 156 additions and 370 deletions
|
@ -1,32 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="WizardSettings">
|
||||
<option name="children">
|
||||
<map>
|
||||
<entry key="vectorWizard">
|
||||
<value>
|
||||
<PersistentState>
|
||||
<option name="children">
|
||||
<map>
|
||||
<entry key="vectorAssetStep">
|
||||
<value>
|
||||
<PersistentState>
|
||||
<option name="values">
|
||||
<map>
|
||||
<entry key="assetSourceType" value="FILE" />
|
||||
<entry key="outputName" value="ic_settings" />
|
||||
<entry key="sourceFile" value="$PROJECT_DIR$/../DisIcons/v2/ic_settings.svg" />
|
||||
</map>
|
||||
</option>
|
||||
</PersistentState>
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
</PersistentState>
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
Binary file not shown.
Binary file not shown.
|
@ -1,116 +0,0 @@
|
|||
<component name="ProjectCodeStyleConfiguration">
|
||||
<code_scheme name="Project" version="173">
|
||||
<codeStyleSettings language="XML">
|
||||
<indentOptions>
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||
</indentOptions>
|
||||
<arrangement>
|
||||
<rules>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>xmlns:android</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>xmlns:.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:id</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:name</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>name</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>style</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>ANDROID_ATTRIBUTE_ORDER</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>.*</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
</rules>
|
||||
</arrangement>
|
||||
</codeStyleSettings>
|
||||
</code_scheme>
|
||||
</component>
|
|
@ -1,12 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RunConfigurationProducerService">
|
||||
<option name="ignoredProducers">
|
||||
<set>
|
||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
|
||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
|
||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
|
@ -1,13 +1,13 @@
|
|||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
compileSdkVersion 28
|
||||
compileSdk 32
|
||||
defaultConfig {
|
||||
applicationId "org.disroot.disrootapp"
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 28
|
||||
versionCode 26
|
||||
versionName "2.0.3"
|
||||
targetSdkVersion 32
|
||||
versionCode 27
|
||||
versionName "2.0.4"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
buildTypes {
|
||||
|
@ -16,13 +16,14 @@ android {
|
|||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
namespace 'org.disroot.disrootapp'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
//noinspection GradleCompatible
|
||||
implementation 'com.android.support:appcompat-v7:28.0.0'
|
||||
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
|
||||
implementation 'com.android.support.constraint:constraint-layout:2.0.4'
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
||||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
|
||||
|
@ -46,9 +47,9 @@ repositories {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
|
||||
implementation 'com.android.support.constraint:constraint-layout:2.0.4'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.android.support.constraint:constraint-layout:+'
|
||||
implementation 'com.android.support.constraint:constraint-layout:2.0.4'
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.disroot.disrootapp">
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
|
@ -33,9 +32,10 @@
|
|||
android:exported="false" />
|
||||
|
||||
<activity
|
||||
android:name=".ui.SplashScreenActivity"
|
||||
android:name="org.disroot.disrootapp.ui.SplashScreenActivity"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name">
|
||||
android:label="@string/app_name"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
|
@ -43,10 +43,11 @@
|
|||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".ui.MainActivity"
|
||||
android:name="org.disroot.disrootapp.ui.MainActivity"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:hardwareAccelerated="true"
|
||||
android:label="@string/dashboard">
|
||||
android:label="@string/dashboard"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
|
@ -80,6 +81,10 @@
|
|||
<data
|
||||
android:host="searx.disroot.org"
|
||||
android:scheme="https" />
|
||||
|
||||
<data
|
||||
android:host="status.disroot.org"
|
||||
android:scheme="https" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
|
@ -101,6 +106,7 @@
|
|||
android:theme="@style/DisTheme" />
|
||||
<activity
|
||||
android:name="wsdfhjxc.taponium.MainActivity"
|
||||
android:exported="true"
|
||||
android:label="@string/title_activity_tap"
|
||||
android:screenOrientation="portrait">
|
||||
<intent-filter>
|
||||
|
|
|
@ -37,7 +37,7 @@ public class StatusService extends Service {
|
|||
//status report
|
||||
public SharedPreferences checkDate;
|
||||
// URL to get data JSON
|
||||
static String incidenturl0 ="https://state.disroot.org/api/v1/incidents?sort=id&order=desc";
|
||||
static String incidenturl0 ="https://status.disroot.org/issues/index.json";
|
||||
ArrayList<HashMap<String, String>> messageList;
|
||||
ArrayList<HashMap<String, String>> getDate;
|
||||
|
||||
|
@ -85,13 +85,13 @@ public class StatusService extends Service {
|
|||
if (jsonStrincidents0 != null) {//Incidaetnts page
|
||||
try {
|
||||
JSONObject jsonObj = new JSONObject(jsonStrincidents0);
|
||||
JSONArray data = jsonObj.getJSONArray("data");
|
||||
JSONArray data = jsonObj.getJSONArray("pages");
|
||||
int a=0;
|
||||
JSONObject o = data.getJSONObject(a);
|
||||
String callid = o.getString("id");
|
||||
String updated = o.getString("updated_at");
|
||||
String title = o.getString("title");
|
||||
String updated = o.getString("lastMod");
|
||||
HashMap<String, String> date = new HashMap<>();
|
||||
date.put("id", callid);
|
||||
date.put("title", title);
|
||||
date.put("updated", updated);
|
||||
getDate.add(date);
|
||||
String stateDate = date.put( "updated", updated );
|
||||
|
@ -100,7 +100,7 @@ public class StatusService extends Service {
|
|||
assert dateStored != null;
|
||||
if (dateStored.equals( "" ))
|
||||
{
|
||||
checkDate.edit().putString( "storeDate", stateDate).apply();
|
||||
checkDate.edit().putString( "storeDate", "stateDate").apply();
|
||||
//return null;
|
||||
}
|
||||
else {
|
||||
|
@ -114,7 +114,7 @@ public class StatusService extends Service {
|
|||
return null;
|
||||
}
|
||||
else
|
||||
Log.e(TAG, "updated json(service)");
|
||||
Log.e(TAG, dateStored+"updated json(service)"+stateDate);
|
||||
}
|
||||
return null;
|
||||
|
||||
|
@ -139,24 +139,24 @@ public class StatusService extends Service {
|
|||
HttpHandler sh = new HttpHandler();
|
||||
String jsonStrincidents0 = sh.makeServiceCall(incidenturl0);
|
||||
JSONObject jsonObj = new JSONObject(jsonStrincidents0);
|
||||
JSONArray data = jsonObj.getJSONArray("data");
|
||||
JSONArray data = jsonObj.getJSONArray("pages");
|
||||
int a=0;
|
||||
JSONObject o = data.getJSONObject(a);
|
||||
String name = o.getString( "name" );
|
||||
String message = o.getString( "message" );
|
||||
String title = o.getString( "title" );
|
||||
String permalink = o.getString( "permalink" );
|
||||
HashMap<String, String> date = new HashMap<>();
|
||||
date.put("name", name);
|
||||
date.put("message", message);
|
||||
date.put("title", title);
|
||||
date.put("permalink", permalink);
|
||||
getDate.add(date);
|
||||
Log.e(TAG, "message: " + name);
|
||||
Log.e(TAG, "message: " + title+" link "+permalink);
|
||||
|
||||
Intent goState = new Intent( StatusService.this, StateMessagesActivity.class);
|
||||
PendingIntent launchStateMessages = PendingIntent.getActivity(StatusService.this,0, goState, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
@SuppressLint("UnspecifiedImmutableFlag") PendingIntent launchStateMessages = PendingIntent.getActivity(StatusService.this,0, goState, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
|
||||
NotificationManager notificationManager = (NotificationManager) this.getSystemService( Context.NOTIFICATION_SERVICE);
|
||||
NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle();
|
||||
|
||||
inboxStyle.addLine(message);
|
||||
inboxStyle.addLine(permalink);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
// I would suggest that you use IMPORTANCE_DEFAULT instead of IMPORTANCE_HIGH
|
||||
NotificationChannel channel = new NotificationChannel(CHANNEL_ID, CHANNEL_NAME, NotificationManager.IMPORTANCE_HIGH);
|
||||
|
@ -172,8 +172,8 @@ public class StatusService extends Service {
|
|||
.setOngoing(true)
|
||||
.setSmallIcon(R.drawable.ic_state)
|
||||
.setContentTitle( getString( R.string.NotificationTitle ) )
|
||||
.setContentText(name)//get text Title from json :-)
|
||||
.setContentInfo(message)//get text message from json :-)
|
||||
.setContentText(title)//get text Title from json :-)
|
||||
.setContentInfo(permalink)//get text message from json :-)
|
||||
.setContentIntent(launchStateMessages);
|
||||
Uri alarmSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
|
||||
notificationBuilder.setSound(alarmSound)
|
||||
|
|
|
@ -1941,23 +1941,30 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
|
|||
JSONObject jsonObj = new JSONObject(jsonStringcomponents);
|
||||
|
||||
// Getting JSON Array node
|
||||
JSONArray data = jsonObj.getJSONArray("data");
|
||||
JSONArray data = jsonObj.getJSONArray("systems");
|
||||
|
||||
// looping through All data
|
||||
for (int i = 0; i < data.length(); i++) {
|
||||
JSONObject c = data.getJSONObject(i);
|
||||
|
||||
String id = c.getString("id");
|
||||
String name = c.getString("name");
|
||||
String description = c.getString("description");
|
||||
|
||||
// tmp hash map for single service
|
||||
HashMap<String, String> serviceDetails = new HashMap<>();
|
||||
|
||||
//String id = c.getString("id");
|
||||
String name = c.getString("name");
|
||||
//String description = c.getString("description");
|
||||
|
||||
// tmp hash map for single service
|
||||
|
||||
// adding each child node to HashMap key => value
|
||||
serviceDetails.put("id", id);
|
||||
//serviceDetails.put("id", id);
|
||||
serviceDetails.put("name", name);
|
||||
serviceDetails.put("description", description);
|
||||
if (c.has("description")&&!c.isNull("description")){
|
||||
String description = c.getString("description");
|
||||
serviceDetails.put("description", description);
|
||||
}
|
||||
else {
|
||||
serviceDetails.put("description", "No Description");
|
||||
}
|
||||
//serviceDetails.put("description", description);
|
||||
|
||||
// adding service to service list
|
||||
componentList.add(serviceDetails);
|
||||
|
@ -1998,7 +2005,11 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
|
|||
HashMap<String, String> hashmap= (HashMap<String, String>) componentList.get(a);
|
||||
String hash = hashmap.get("name");
|
||||
switch (hash) {
|
||||
case "Email Service":
|
||||
case "Notes":
|
||||
notes = hashmap.get("notes");
|
||||
getNotes(notes);
|
||||
break;
|
||||
case "Mail Server":
|
||||
email = hashmap.get("description");
|
||||
getEmail(email);
|
||||
break;
|
||||
|
@ -2010,14 +2021,10 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
|
|||
forum = hashmap.get("description");
|
||||
getForum(forum);
|
||||
break;
|
||||
case "Etherpad":
|
||||
case "Pad":
|
||||
etherpad = hashmap.get("description");
|
||||
getEtherpad(etherpad);
|
||||
break;
|
||||
case "Ethercalc":
|
||||
ethercalc = hashmap.get("description");
|
||||
getEthercalc(ethercalc);
|
||||
break;
|
||||
case "Bin":
|
||||
bin = hashmap.get("description");
|
||||
getBin(bin);
|
||||
|
@ -2030,11 +2037,7 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
|
|||
searx = hashmap.get("description");
|
||||
getSearx(searx);
|
||||
break;
|
||||
case "Polls":
|
||||
polls = hashmap.get("description");
|
||||
getPolls(polls);
|
||||
break;
|
||||
case "Taiga":
|
||||
case "Project board":
|
||||
taiga = hashmap.get("description");
|
||||
getTaiga(taiga);
|
||||
break;
|
||||
|
@ -2042,15 +2045,11 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
|
|||
user = hashmap.get("description");
|
||||
getUser(user);
|
||||
break;
|
||||
case "XMPP":
|
||||
case "XMPP Chat server":
|
||||
xmpp = hashmap.get("description");
|
||||
getXmpp(xmpp);
|
||||
break;
|
||||
case "Nextcloud Notes":
|
||||
notes = hashmap.get("description");
|
||||
getNotes(notes);
|
||||
break;
|
||||
case "Git Service":
|
||||
case "Git":
|
||||
git = hashmap.get("description");
|
||||
getGit(git);
|
||||
break;
|
||||
|
|
|
@ -39,8 +39,8 @@ public class StateActivity extends AppCompatActivity {
|
|||
private ListView lv;
|
||||
|
||||
// URL to get data JSON
|
||||
static String url = "https://state.disroot.org/api/v1/components?sort=status";
|
||||
static String url1 = "https://state.disroot.org/api/v1/components?sort=status&page=2";
|
||||
static String url = "https://status.disroot.org/index.json";
|
||||
//static String url1 = "https://state.disroot.org/api/v1/components?sort=status&page=2";
|
||||
|
||||
ArrayList<HashMap<String, String>> stateList;
|
||||
|
||||
|
@ -124,7 +124,7 @@ public class StateActivity extends AppCompatActivity {
|
|||
|
||||
// Making a request to url and getting response
|
||||
String jsonStr0 = sh.makeServiceCall(url);
|
||||
String jsonStr1 = sh.makeServiceCall(url1);
|
||||
//String jsonStr1 = sh.makeServiceCall(url1);
|
||||
|
||||
Log.e(TAG, "Response from url: " + jsonStr0);
|
||||
|
||||
|
@ -133,28 +133,29 @@ public class StateActivity extends AppCompatActivity {
|
|||
JSONObject jsonObj = new JSONObject(jsonStr0);
|
||||
|
||||
// Getting JSON Array node
|
||||
JSONArray data = jsonObj.getJSONArray("data");
|
||||
JSONArray data = jsonObj.getJSONArray("systems");
|
||||
|
||||
// looping through All data
|
||||
for (int i = 0; i < data.length(); i++) {
|
||||
JSONObject c = data.getJSONObject(i);
|
||||
HashMap<String, String> service = new HashMap<>();
|
||||
if (c.has("description")&&!c.isNull("description")){
|
||||
String description = c.getString("description");
|
||||
service.put("description", description);
|
||||
}
|
||||
else {
|
||||
service.put("description", "No Description");
|
||||
}
|
||||
|
||||
String id = c.getString("id");
|
||||
String name = c.getString("name");
|
||||
String description = c.getString("description");
|
||||
String updated_at = c.getString("updated_at");
|
||||
String lastUpdated = "Last Updated: " + updated_at + '"';
|
||||
String status_name = c.getString("status_name");
|
||||
String category = c.getString("category");
|
||||
String status = c.getString("status");
|
||||
|
||||
// tmp hash map for single service
|
||||
HashMap<String, String> service = new HashMap<>();
|
||||
|
||||
// adding each child node to HashMap key => value
|
||||
service.put("id", id);
|
||||
service.put("name", name);
|
||||
service.put("description", description);
|
||||
service.put("updated_at", lastUpdated);
|
||||
service.put("status_name", status_name);
|
||||
service.put("category", category);
|
||||
service.put("status", status);
|
||||
|
||||
// adding service to service list
|
||||
stateList.add(service);
|
||||
|
@ -171,7 +172,7 @@ public class StateActivity extends AppCompatActivity {
|
|||
}
|
||||
});
|
||||
}
|
||||
}if (jsonStr1 != null) {//next page
|
||||
}/*if (jsonStr1 != null) {//next page
|
||||
try {
|
||||
JSONObject jsonObj = new JSONObject(jsonStr1);
|
||||
|
||||
|
@ -214,7 +215,7 @@ public class StateActivity extends AppCompatActivity {
|
|||
}
|
||||
});
|
||||
}
|
||||
}else {
|
||||
}*/else {
|
||||
Log.e(TAG, "Couldn't get json from server.");
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
|
@ -238,68 +239,32 @@ public class StateActivity extends AppCompatActivity {
|
|||
|
||||
//Updating parsed JSON data into ListView
|
||||
ListAdapter adapter = new SimpleAdapter(
|
||||
StateActivity.this, stateList,
|
||||
R.layout.list_item, new String[]{"name", "description", "updated_at",
|
||||
"status_name"}, new int[]{R.id.name,
|
||||
R.id.description,R.id.updated_at, R.id.status_name})
|
||||
StateActivity.this, stateList, R.layout.list_item,
|
||||
new String[]{"name", "description", "category","status"},
|
||||
new int[]{R.id.name,R.id.description,R.id.lastMod, R.id.status_name})
|
||||
|
||||
//Change Color based on Status
|
||||
{
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
View v = super.getView(position, convertView, parent);
|
||||
//Name Email
|
||||
TextView nameMail = v.findViewById(R.id.name);
|
||||
String nameMailValue = nameMail.getText().toString();
|
||||
switch (nameMailValue) {
|
||||
case "Email Service":
|
||||
nameMail.setText(R.string.EmailService);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
//Name WebMail
|
||||
TextView nameWebmail = v.findViewById(R.id.name);
|
||||
String nameWebmailValue = nameWebmail.getText().toString();
|
||||
switch (nameWebmailValue) {
|
||||
case "WebMail Service":
|
||||
nameWebmail.setText(R.string.WebmailService);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
//Name Cloud
|
||||
TextView nameCloud = v.findViewById(R.id.name);
|
||||
String nameCloudValue = nameCloud.getText().toString();
|
||||
switch (nameCloudValue) {
|
||||
case "WebMail Service":
|
||||
nameCloud.setText(R.string.Cloud);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
//Make Last updated translatable
|
||||
TextView updated = v.findViewById(R.id.updated_at);
|
||||
String updatedValue = updated.getText().toString();
|
||||
if (updatedValue.startsWith("Last Updated: ")){
|
||||
updated.setText(updatedValue.replace("Last Updated: ",getText(R.string.LastUpdated)));
|
||||
}
|
||||
|
||||
//Status
|
||||
TextView status = v.findViewById(R.id.status_name);
|
||||
String statusValue = status.getText().toString();
|
||||
switch (statusValue) {
|
||||
case "Operational":
|
||||
case "ok":
|
||||
status.setTextColor(Color.GREEN);
|
||||
status.setText(R.string.Operational);
|
||||
break;
|
||||
case "Major Outage":
|
||||
case "down":
|
||||
status.setTextColor(Color.RED);
|
||||
status.setText(R.string.MajorOutage);
|
||||
status.setText(R.string.down);
|
||||
break;
|
||||
case "Performance Issues":
|
||||
status.setText(R.string.PerformanceIssues);
|
||||
status.setTextColor(Color.YELLOW);
|
||||
default:
|
||||
status.setTextColor(Color.RED);
|
||||
break;
|
||||
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import android.annotation.SuppressLint;
|
|||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.net.Uri;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
|
@ -37,7 +38,7 @@ public class StateMessagesActivity extends AppCompatActivity {
|
|||
private ListView lv;
|
||||
|
||||
// URL to get data JSON
|
||||
static String incidenturl0 ="https://state.disroot.org/api/v1/incidents?sort=id&order=desc";
|
||||
static String incidenturl0 ="https://status.disroot.org/issues/index.json";
|
||||
|
||||
ArrayList<HashMap<String, String>> messageList;
|
||||
ArrayList<HashMap<String, String>> getDate;
|
||||
|
@ -125,31 +126,27 @@ public class StateMessagesActivity extends AppCompatActivity {
|
|||
JSONObject jsonObj = new JSONObject(jsonStrincidents0);
|
||||
|
||||
// Getting JSON Array node
|
||||
JSONArray data = jsonObj.getJSONArray("data");
|
||||
JSONArray data = jsonObj.getJSONArray("pages");
|
||||
|
||||
// looping through All data
|
||||
for (int i = 0; i < data.length(); i++) {
|
||||
JSONObject c = data.getJSONObject(i);
|
||||
|
||||
String id = c.getString("id");
|
||||
String name = c.getString("name");
|
||||
String message = c.getString("message");
|
||||
String scheduled_at = c.getString("scheduled_at");
|
||||
String scheduledAt = "Scheduled at: " + '"' + scheduled_at + '"';
|
||||
String updated_at = c.getString("updated_at");
|
||||
String lastUpdated = "Last Updated: " + updated_at + '"';
|
||||
String human_status = c.getString("human_status");
|
||||
//String id = c.getString("id");
|
||||
String title = c.getString("title");
|
||||
String link = c.getString("permalink");
|
||||
Boolean resolved = c.getBoolean( "resolved" );
|
||||
String lastMod = c.getString("lastMod");
|
||||
String lastUpdated = "Last Updated: " + lastMod + '"';
|
||||
|
||||
// tmp hash map for single service
|
||||
HashMap<String, String> service = new HashMap<>();
|
||||
|
||||
// adding each child node to HashMap key => value
|
||||
service.put("id", id);
|
||||
service.put("name", name);
|
||||
service.put("message", message);
|
||||
service.put("scheduled_at", scheduledAt);
|
||||
service.put("updated_at", lastUpdated);
|
||||
service.put("human_status", human_status);
|
||||
service.put("title", title);
|
||||
service.put("moreInfo", link);
|
||||
service.put("resolved", resolved.toString());
|
||||
service.put("lastMod", lastUpdated);
|
||||
|
||||
// adding service to service list
|
||||
messageList.add(service);
|
||||
|
@ -191,83 +188,55 @@ public class StateMessagesActivity extends AppCompatActivity {
|
|||
//Updating parsed JSON data into ListView
|
||||
ListAdapter adapter = new SimpleAdapter(
|
||||
StateMessagesActivity.this, messageList,
|
||||
R.layout.list_item, new String[]{"name","message", "updated_at", "scheduled_at", "human_status"}, new int[]{R.id.name, R.id.message,
|
||||
R.id.updated_at, R.id.scheduled_at, R.id.human_status})
|
||||
|
||||
//Change Color based on Status
|
||||
R.layout.list_item, new String[]{"title","moreInfo", "lastMod", "resolved", "status"}, new int[]{R.id.name, R.id.message,
|
||||
R.id.lastMod, R.id.resolved, R.id.status})
|
||||
{
|
||||
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
View v = super.getView(position, convertView, parent);
|
||||
//Name Email
|
||||
TextView nameMail = v.findViewById(R.id.name);
|
||||
String nameMailValue = nameMail.getText().toString();
|
||||
switch (nameMailValue) {
|
||||
case "Email Service":
|
||||
nameMail.setText(R.string.EmailService);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
//Name WebMail
|
||||
TextView nameWebmail = v.findViewById(R.id.name);
|
||||
String nameWebmailValue = nameWebmail.getText().toString();
|
||||
switch (nameWebmailValue) {
|
||||
case "WebMail Service":
|
||||
nameWebmail.setText(R.string.WebmailService);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
//Name Cloud
|
||||
TextView nameCloud = v.findViewById(R.id.name);
|
||||
String nameCloudValue = nameCloud.getText().toString();
|
||||
switch (nameCloudValue) {
|
||||
case "WebMail Service":
|
||||
nameCloud.setText(R.string.Cloud);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Make links work
|
||||
TextView link = v.findViewById( R.id.message );
|
||||
String linkValue = link.getText().toString();
|
||||
link.setText( R.string.more_info);
|
||||
v.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
public void onClick(View arg0) {
|
||||
|
||||
Uri uri = Uri.parse( linkValue);
|
||||
Intent statusLink = new Intent(Intent.ACTION_VIEW, Uri.parse(String.valueOf(uri)));
|
||||
startActivity(statusLink);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
//Make Last updated translatable
|
||||
TextView updated = v.findViewById(R.id.updated_at);
|
||||
TextView updated = v.findViewById(R.id.lastMod );
|
||||
String updatedValue = updated.getText().toString();
|
||||
if (updatedValue.startsWith("Last Updated: ")){
|
||||
updated.setText(updatedValue.replace("Last Updated: ",getText(R.string.LastUpdated)));
|
||||
}
|
||||
//Make Scheduled at translatable
|
||||
TextView scheduled = v.findViewById(R.id.scheduled_at);
|
||||
String scheduledValue = scheduled.getText().toString();
|
||||
if (scheduledValue.startsWith("Scheduled at: ")){
|
||||
scheduled.setText(scheduledValue.replace("Scheduled at: ",getText(R.string.ScheduledAt)));
|
||||
}
|
||||
TextView resolved = v.findViewById(R.id.resolved );
|
||||
String resolvedValue = resolved.getText().toString();
|
||||
//Human_status
|
||||
TextView humanStatus = v.findViewById(R.id.human_status);
|
||||
TextView humanStatus = v.findViewById(R.id.status );
|
||||
String humanStatusValue = humanStatus.getText().toString();
|
||||
switch (humanStatusValue) {
|
||||
case "Fixed":
|
||||
Log.e("status", "status: "+humanStatusValue);
|
||||
switch (resolvedValue) {
|
||||
case "true":
|
||||
humanStatus.setTextColor(Color.GREEN);
|
||||
humanStatus.setText(R.string.Fixed);
|
||||
scheduled.setVisibility(View.GONE );
|
||||
resolved.setVisibility(View.GONE );
|
||||
break;
|
||||
case "Scheduled":
|
||||
humanStatus.setTextColor(Color.YELLOW);
|
||||
humanStatus.setText(R.string.Scheduled);
|
||||
scheduled.setVisibility(View.VISIBLE );
|
||||
break;
|
||||
case "Investigating":
|
||||
case "false":
|
||||
humanStatus.setTextColor(Color.RED);
|
||||
scheduled.setVisibility(View.GONE );
|
||||
break;
|
||||
case "Watching":
|
||||
scheduled.setVisibility(View.GONE );
|
||||
humanStatus.setTextColor(Color.YELLOW);
|
||||
humanStatus.setText(R.string.Investigating);
|
||||
break;
|
||||
case "Identified":
|
||||
scheduled.setVisibility(View.GONE );
|
||||
humanStatus.setTextColor(Color.RED);
|
||||
humanStatus.setText(R.string.Identified);
|
||||
humanStatus.setText(R.string.down);
|
||||
resolved.setVisibility(View.GONE );
|
||||
break;
|
||||
}
|
||||
return v;
|
||||
|
|
|
@ -71,5 +71,5 @@ public class Constants {
|
|||
public static final int INPUT_FILE_REQUEST_CODE = 1;//file upload
|
||||
public static final int FILECHOOSER_RESULTCODE = 1;//file upload
|
||||
public static final String TAG = MainActivity.class.getSimpleName();
|
||||
public static final String components = "https://state.disroot.org/api/v1/components?per_page=40";
|
||||
public static final String components = "https://status.disroot.org/index.json";
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
tools:context="org.disroot.disrootapp.ui.AboutActivity$AboutFragment">
|
||||
tools:context="org.disroot.disrootapp.ui.AboutActivity">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
android:layout_marginBottom="@dimen/activity_vertical_margin"
|
||||
android:layout_marginLeft="@dimen/activity_horizontal_margin"
|
||||
android:layout_marginRight="@dimen/activity_horizontal_margin"
|
||||
tools:context="org.disroot.disrootapp.ui.AboutActivity$HelpFragment">
|
||||
tools:context="org.disroot.disrootapp.ui.AboutActivity">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
android:layout_marginLeft="@dimen/activity_horizontal_margin"
|
||||
android:layout_marginRight="@dimen/activity_horizontal_margin"
|
||||
android:paddingBottom="@dimen/activity_horizontal_margin"
|
||||
tools:context="org.disroot.disrootapp.ui.AboutActivity$LicenseFragment">
|
||||
tools:context="org.disroot.disrootapp.ui.AboutActivity">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
android:textColor="#ffffff" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/updated_at"
|
||||
android:id="@+id/lastMod"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="2dip"
|
||||
|
@ -43,13 +43,13 @@
|
|||
android:textColor="#ffffff" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/scheduled_at"
|
||||
android:id="@+id/resolved"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#ffffff" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/human_status"
|
||||
android:id="@+id/status"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#ffffff" />
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<resources>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="app_name">Disroot App</string>
|
||||
<string name="action_home">Home</string>
|
||||
<string name="action_mail">Mail</string>
|
||||
|
@ -67,7 +67,7 @@
|
|||
<string name="SpreadTheWordBtn">Share the app</string>
|
||||
<string name="DisrootWeb">Disroot web</string>
|
||||
<string name="FirstTitle">Last couple of things!</string>
|
||||
<string name="FirstInfo">• By doing a long press on each icon you can get extra information… \n\n• The app can sync with the status page of Disroot. This means that you will receive realtime updates on issues, downtimes, scheduled maintenace and others published via https://state.disroot.org\nWe recommend to turn off battery optimization and allow Disroot app to run in the background. If you\'re not sure, you can always change the setting from the Disroot app menu later.</string>
|
||||
<string name="FirstInfo">• By doing a long press on each icon you can get extra information… \n\n• The app can sync with the status page of Disroot. This means that you will receive realtime updates on issues, downtimes, scheduled maintenace and others published via https://status.disroot.org\nWe recommend to turn off battery optimization and allow Disroot app to run in the background. If you\'re not sure, you can always change the setting from the Disroot app menu later.</string>
|
||||
<string name="DiasporaTitle">Diaspora* Settings</string>
|
||||
<string name="DiasporaInfo">Distributed and decentralized social network. Post, share, like, create communities.\n\nUsername:\n your_diaspora_username@pod.disroot.org\n\nPassword:\n your_diaspora_password</string>
|
||||
<string name="PadInfo">With Etherpad write articles, press releases, to-do lists, etc. together with friends, fellow students or colleagues, all working on the same document at the same time.\nNo registration is required.</string>
|
||||
|
@ -175,4 +175,6 @@
|
|||
<string name="translatorsTitle">Translators:</string>
|
||||
<string name="artworksTitle">Artwork:</string>
|
||||
<string name="Fixed">Risolto</string>
|
||||
<string name="down" tools:ignore="MissingTranslation">Down!</string>
|
||||
<string name="more_info" tools:ignore="MissingTranslation">Tippen Sie für weitere Informationen</string>
|
||||
</resources>
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<changelog>
|
||||
<release version="2.0.3" versioncode="26" >
|
||||
<release version="2.0.4" versioncode="27" >
|
||||
<change>Migration to new cState "https://status.disroot.org"</change>
|
||||
<change>Updated SDK and gradle</change>
|
||||
</release>
|
||||
<release version="2.0.4" versioncode="27" >
|
||||
<change>Changed to new git repo</change>
|
||||
<change>Updated Constant variables with new git URL</change>
|
||||
</release>
|
||||
|
|
|
@ -6,7 +6,7 @@ buildscript {
|
|||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.2.1'
|
||||
classpath 'com.android.tools.build:gradle:7.3.0'
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
|
|
6
gradle/wrapper/gradle-wrapper.properties
vendored
6
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,6 +1,6 @@
|
|||
#Fri Oct 28 07:31:51 CEST 2022
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
|
||||
distributionPath=wrapper/dists
|
||||
distributionSha256Sum=9af7345c199f1731c187c96d3fe3d31f5405192a42046bafa71d846c3d9adacb
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
|
Loading…
Reference in a new issue