From 6a0285dfa72405ce5b295726a10a3692bc3adb34 Mon Sep 17 00:00:00 2001 From: massimiliano Date: Thu, 16 May 2019 11:44:41 +0200 Subject: [PATCH 01/14] Fixed notification for android 8 and higher --- .idea/caches/gradle_models.ser | Bin 153192 -> 153263 bytes .idea/codeStyles/Project.xml | 29 ------------------ app/build.gradle | 4 +-- .../disroot/disrootapp/ui/MainActivity.java | 29 +++++++++++++++--- app/src/main/res/xml/changelog_master.xml | 4 +++ 5 files changed, 31 insertions(+), 35 deletions(-) delete mode 100644 .idea/codeStyles/Project.xml diff --git a/.idea/caches/gradle_models.ser b/.idea/caches/gradle_models.ser index 56f2fe689ff4e39d1384b50219c1d1d1cdad9db9..857d320cce77837c547b16222a603b0136df8818 100644 GIT binary patch delta 4482 zcmd5=dr(x@8Q*i*7vhMrAS};aU_}s@-GzM+B!V{J3lOz5O&aZG_oCPZ*JbgY0P0k& z84bA;PLvv46;0GcDR!>fPNK%DM2S)pt4WNKsMTrOftY4&w4vv_SMRkmnbz%J{pUA_ z?|i@C_d4fX;P(FT18;{P?9nP)7(;e`wP+#Z_fZPE2XvgY&7Wi8I?8{P z9APtC%$D(jQ}hQ_r@-fi5JDeNoa6>iOyYb@1XodEFbh68jMY`cGBwpTH7*asxbhut zyEWIr+AK`2ld-woE?d5>+Gcl=;)6&R)v(CBg!PYqEJ*jsiq=uuOKm^<2~D@?VY>Q< zSu+2gWpdUREcXtRuDtrfW*b-eS^<~B#$^e4n5k<{jmv7Y=COG+AJ&~`t!DFCPqo|S zw&vPus$DiGXI&SKe*0JvQF%F!rIKUKciLRme7DtM%dfH3Fs!@A>9N=t3(MMASG9}D zXB|!^7fR8Okiss-ikxNK)1L_0WJ>1$mJNqCrEs4=n;U8kE>9v_PmEn?S}2vb22#1( zhlF6RCr;6s<7XR$@_dc$n_13qCFG8`o;7gVH$pDbcrKoMwltCRd2&Lik}$*3=%6-@R)kS^QTfRHD_scI>=Yp->=hu+9#Xv4zkqrq<(q z>~e$EussX{Dw{FI%~DMxozC_p#uWM&o0=UeBXHWgY!3@;!*zx6p3 zRH0YJ-MMsk@6XXX6$-X>(&inzQ^4=2L1(n+Flq6lrTiC*&?hQ%nq2r2IY{$TRLEPF zpmr6y#B~L{ylWNuwF=$jERA-q`R!tU`f7Apg}x!^E1Kwq^{9y7vL5xTuqKS&;ioyv z?g{+2o6sDs*ag0spk2^_k@t{;8#rCazrGDpaS1ItwiD&?8+M{HS~(3?Ksxr&R!n{i zRfO?L-Dvx4K0$*wqX@QZ*1z$>xEYujJ)`_`aY$tU(T!uE1N(0?GufuO3 z4%~F4B^s|Zef&r%EK-)gBpG!e+b+uHCQ{k8-W^|)ibPyMUXH<~Xs0N9JBG^c6W8sd z@e0#wNugGjT_YLmK(BX{J3bySAEUt%{ZCR>nlQ=uDQJBv5Hhra z)hD|R7Y&y*GryIMYEm4Jqeq1cd$M^L(I?>eG^ODy4^q0Xd`i(Nh^YbwkD1vSYR|6=F=ni6q=W<)mYyTqk>#N^%=PEqUsEI8ipG8{FN+7rm~t0D*Fpj%AG-F8^BFRV#eYQM9(oil|5tWw_#rz4o_5d z%JQ#D@^69s8d3g68kPS8R#dd5Q}v6PbZF9puR1ET<0baHz}_gbw}XQwQM;y%f_gH*EC2>nk-h1CG8hG63!z-S6uc$YLL03q&Va^8ydZKJT#u64lvQveeHvH{Eh zHh>}u3K1Y3#VTL@wBzHr!rBSsS~i}fXys-4quR7ywxCNm;ay$!|r SKA;#w2AnvSU+cg(QvL;AQCT?v delta 4472 zcmd5;YgiQ58Qyc;8xXlIcUhLZg1S3q~nY^Mg9vRIk|7-!3N*qz{+ccb; zSv1fjCYUN*w(>GtRe424h0D%Vux7?w$vPQ_!&z2YnPFiWv)Nk3GImm9rY=7#RCDKx zG-{FT>nQSuXrJ@GwuQPJ_EVRk2}2&U!9H&Gvt7lfxD#x$a`nW5Eu8mHSsYUtIZzZe z(p;03VVoAH#bzmI>`rT?)#+gDOc`5cHJ3YGjNQ&9)Q6!X-D}ZvUzTZ%-Rm*i*m9>c zqpI9uc2fHpjtsNI>M*rRpWFiXYMp`W z^jQU7kE|C|#Bv=wdO<8MO(fL@Br;u3Zq;t8t*l#s6{dx5=H0>Vq|<;hdv3e|F2>$KhLqQC&A??n;*%d zRux($q>$WT~= z)Oi#QgteeCJ!w8t>_9p~Hua+W2)h~SH24Dbtr^9=vrMqvquSe=yLYokEN=-)AXzQF zaa=qbMUYdyq7Ef!xN!20o*ayOep&ULa-(OVhdW*5@e^I+rrNq*ZS1jM_F`js z#)tMz3b?)OQiDRFz(4=428rv2?<#caV*aWcHzRUdix&jIhgLD(T@ty^#!v9WL)F?O z&lhu-*D6fh1-}?_APBc9Ckz|=Z&DtN_bco1d?yJH!5>GDWxnqKE}k!7CJbN5ZM;@U z?uFpd5&puZ3_)J}KGUHlfJ_L*N&SPx3tNtdiGl6YI*a9CAbF=B)>Udkgh@FbDm~-n zhaP@Gyz#y51(KdoDqWX=YdxPEIRkW(#x_?z90k>XUVX5-2FaiUn1TJ97cW- zkE4`}<7ah|_3=29EYsmpXoEQQTOHntHo;g&)`#IGDJLH(^$C*X)t^W~9j&2#og7P` zvQy%46nQ!v2ck3NMk)<><8Ul#38(5iMD=^&RDCauH=;TcABn?)J(AQskUAtvwI<`} zKDOy~~t*K=o5mb!{S!3d;GR?V+5Q zDLOr#NS&UFre!`CrITauqEz+YC7G)-rArF_4zxQ&?ZgDSr&lx+?vtSj)UvT3)w&5< zIO)C0Xs zbo;)6(riuOZSD%O*IaX1O(lM8Y5@JC7fQs6%& z@@t~$YWl{_X(X>i)78u}Jhqw|sk}yB&3vHKhJ)^|3#Igebw&3`V<@HT;wfEf66G41 zE;WgAJB`QIorPp-EUmsM zfznH)OrK1jA_aM%4-)Bq^dy5?PyTpLPMj(pMV^7S=%7TLMCR(TKbe|{1A^slI13s! zQDeKFS|~E@bdnGC)WTPZv=y_&smvt$#(1U5|B$ORNx|r_eWfhB(%wQeSUN z#iK!D|ilR6XxXb0iy1YC!%Vx^t}Gmh6lzv zVi9AFH<#F|8k(_mNzFc+W}U@<^Fz{})>5gX7h{+1Ds!OCfgAL;(TP9-i) zIE(*%3?7BLbRIkB`BL}&ad-bp=&w;YUtqy6B6N|QPsanveJjp(U8D=u&IFh)bfgh3 zS%sPYgdy01i}MVs1~^f_OAsFokPnaTe6 - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index d9c26a0..5484be9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,8 +6,8 @@ android { applicationId "org.disroot.disrootapp" minSdkVersion 15 targetSdkVersion 28 - versionCode 17 - versionName "1.1.4" + versionCode 18 + versionName "1.1.5" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { diff --git a/app/src/main/java/org/disroot/disrootapp/ui/MainActivity.java b/app/src/main/java/org/disroot/disrootapp/ui/MainActivity.java index 713d45f..f9ab67b 100644 --- a/app/src/main/java/org/disroot/disrootapp/ui/MainActivity.java +++ b/app/src/main/java/org/disroot/disrootapp/ui/MainActivity.java @@ -5,6 +5,7 @@ import android.annotation.SuppressLint; import android.annotation.TargetApi; import android.app.AlertDialog; import android.app.DownloadManager; +import android.app.NotificationChannel; import android.app.NotificationManager; import android.app.PendingIntent; import android.app.ProgressDialog; @@ -1945,6 +1946,8 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL //Notification private void sendNotification() throws JSONException { + String CHANNEL_ID = "316865431"; + String CHANNEL_NAME = "StateNotification"; HttpHandler sh = new HttpHandler(); String jsonStrincidents0 = sh.makeServiceCall(incidenturl0); JSONObject jsonObj = new JSONObject(jsonStrincidents0); @@ -1960,8 +1963,22 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL Intent goState = new Intent(MainActivity.this, StateMessagesActivity.class); PendingIntent launchStateMessages = PendingIntent.getActivity(MainActivity.this,0, goState, PendingIntent.FLAG_UPDATE_CURRENT); - NotificationCompat.Builder mBuilder = - new NotificationCompat.Builder(this) + + NotificationManager notificationManager = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE); + NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle(); + + inboxStyle.addLine(message); + 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); + channel.enableVibration(true); + channel.setLightColor(Color.MAGENTA); + channel.enableLights(true); + channel.setVibrationPattern(new long[]{50,500,100,300,50,300}); + notificationManager.createNotificationChannel(channel); + } + + NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(getApplicationContext(), CHANNEL_ID) .setAutoCancel( true ) .setOngoing(true) .setSmallIcon(R.drawable.ic_state) @@ -1970,12 +1987,16 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL .setContentInfo(message)//get text message from json :-) .setContentIntent(launchStateMessages); Uri alarmSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); - mBuilder.setSound(alarmSound) + notificationBuilder.setSound(alarmSound) .setVibrate(new long[]{50,500,100,300,50,300}) .setLights(Color.MAGENTA, 3000, 3000); NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); - mNotificationManager.notify(001, mBuilder.build()); + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){ + notificationBuilder.setChannelId(CHANNEL_ID); + } + + notificationManager.notify(CHANNEL_ID, 1, notificationBuilder.build()); } //show snackbar to avoid exit on backpress diff --git a/app/src/main/res/xml/changelog_master.xml b/app/src/main/res/xml/changelog_master.xml index 291e957..64c3097 100644 --- a/app/src/main/res/xml/changelog_master.xml +++ b/app/src/main/res/xml/changelog_master.xml @@ -1,5 +1,9 @@ + + Notifications works on Android 8 and higher now + Updated Serbian translation + Fixed App closing when pressing go back Edited state error message From 2251d58e229e495b49b723fd6ad5282eccee71e3 Mon Sep 17 00:00:00 2001 From: massimiliano Date: Fri, 17 May 2019 10:24:53 +0200 Subject: [PATCH 02/14] Added Disroot purple light notification --- .idea/caches/build_file_checksums.ser | Bin 534 -> 534 bytes .../org/disroot/disrootapp/ui/MainActivity.java | 8 ++++---- app/src/main/res/xml/changelog_master.xml | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser index 2da3581a490812f77f3dc5bb52cfcd2a2d96fa48..07c88e644804024850df829678f57dc2013d0d5b 100644 GIT binary patch delta 34 scmV+-0NwwV1eOGlmj!CX*(E)(oM{0OZr22>*!WWb;$9@_W}XCUc>Jjj-~a#s delta 34 scmV+-0NwwV1eOGlmj!5rpfKIBoM{0OD3u1cuBp;mtnjFi%wZ-3c>miEV*mgE diff --git a/app/src/main/java/org/disroot/disrootapp/ui/MainActivity.java b/app/src/main/java/org/disroot/disrootapp/ui/MainActivity.java index f9ab67b..3197c87 100644 --- a/app/src/main/java/org/disroot/disrootapp/ui/MainActivity.java +++ b/app/src/main/java/org/disroot/disrootapp/ui/MainActivity.java @@ -1913,7 +1913,7 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL checkDate.edit().putString( "storeDate", stateDate).apply(); //return null; } - else if (!stateDate.equals( dateStored )&& !stateDate.equals( "" ))//dateStored + else if (!stateDate.equals( "2" )&& !stateDate.equals( "" ))//dateStored { checkDate.edit().putString( "storeDate", stateDate).apply(); Log.e(TAG, "date: " + dateStored); @@ -1946,7 +1946,7 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL //Notification private void sendNotification() throws JSONException { - String CHANNEL_ID = "316865431"; + String CHANNEL_ID = "3168654312"; String CHANNEL_NAME = "StateNotification"; HttpHandler sh = new HttpHandler(); String jsonStrincidents0 = sh.makeServiceCall(incidenturl0); @@ -1972,7 +1972,7 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL // I would suggest that you use IMPORTANCE_DEFAULT instead of IMPORTANCE_HIGH NotificationChannel channel = new NotificationChannel(CHANNEL_ID, CHANNEL_NAME, NotificationManager.IMPORTANCE_HIGH); channel.enableVibration(true); - channel.setLightColor(Color.MAGENTA); + channel.setLightColor(Color.rgb( 80,22,45 )); channel.enableLights(true); channel.setVibrationPattern(new long[]{50,500,100,300,50,300}); notificationManager.createNotificationChannel(channel); @@ -1989,7 +1989,7 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL Uri alarmSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); notificationBuilder.setSound(alarmSound) .setVibrate(new long[]{50,500,100,300,50,300}) - .setLights(Color.MAGENTA, 3000, 3000); + .setLights(Color.BLUE, 3000, 3000); NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){ diff --git a/app/src/main/res/xml/changelog_master.xml b/app/src/main/res/xml/changelog_master.xml index 64c3097..07610af 100644 --- a/app/src/main/res/xml/changelog_master.xml +++ b/app/src/main/res/xml/changelog_master.xml @@ -2,6 +2,7 @@ Notifications works on Android 8 and higher now + Added Disroot purple light notification Updated Serbian translation From 017594555c5a2d0695c1d015c2ef7c4ba208eba7 Mon Sep 17 00:00:00 2001 From: massimiliano Date: Fri, 17 May 2019 10:32:23 +0200 Subject: [PATCH 03/14] restored value stored date --- app/src/main/java/org/disroot/disrootapp/ui/MainActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/disroot/disrootapp/ui/MainActivity.java b/app/src/main/java/org/disroot/disrootapp/ui/MainActivity.java index 3197c87..41703ae 100644 --- a/app/src/main/java/org/disroot/disrootapp/ui/MainActivity.java +++ b/app/src/main/java/org/disroot/disrootapp/ui/MainActivity.java @@ -1913,7 +1913,7 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL checkDate.edit().putString( "storeDate", stateDate).apply(); //return null; } - else if (!stateDate.equals( "2" )&& !stateDate.equals( "" ))//dateStored + else if (!stateDate.equals( dateStored )&& !stateDate.equals( "" ))//dateStored { checkDate.edit().putString( "storeDate", stateDate).apply(); Log.e(TAG, "date: " + dateStored); From bf26676ec9f39f7a077cababf8dc225830a4d82d Mon Sep 17 00:00:00 2001 From: massimiliano Date: Wed, 22 May 2019 16:45:27 +0200 Subject: [PATCH 04/14] Notifications as service --- .idea/caches/build_file_checksums.ser | Bin 534 -> 534 bytes app/build.gradle | 4 +- app/src/main/AndroidManifest.xml | 7 + .../org/disroot/disrootapp/StatusService.java | 184 ++++++++++++++++++ .../disroot/disrootapp/ui/MainActivity.java | 177 +---------------- app/src/main/res/xml/changelog_master.xml | 3 + 6 files changed, 200 insertions(+), 175 deletions(-) create mode 100644 app/src/main/java/org/disroot/disrootapp/StatusService.java diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser index 07c88e644804024850df829678f57dc2013d0d5b..4d9f80324160804f74c144625da035ea1039d815 100644 GIT binary patch delta 15 XcmbQnGL2=z43_(;w`XmfQ^g1XG>-=2 delta 15 XcmbQnGL2=z43;A|Rc$xUsbT~GFwO=j diff --git a/app/build.gradle b/app/build.gradle index 5484be9..93ca716 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,8 +6,8 @@ android { applicationId "org.disroot.disrootapp" minSdkVersion 15 targetSdkVersion 28 - versionCode 18 - versionName "1.1.5" + versionCode 19 + versionName "1.1.6" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index ff5dcba..3e69325 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -15,6 +15,11 @@ android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/DisTheme"> + + + + diff --git a/app/src/main/java/org/disroot/disrootapp/StatusService.java b/app/src/main/java/org/disroot/disrootapp/StatusService.java new file mode 100644 index 0000000..486b23d --- /dev/null +++ b/app/src/main/java/org/disroot/disrootapp/StatusService.java @@ -0,0 +1,184 @@ +package org.disroot.disrootapp; + +import android.annotation.SuppressLint; +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.app.Service; +import android.content.Context; +import android.content.Intent; +import android.content.SharedPreferences; +import android.graphics.Color; +import android.media.RingtoneManager; +import android.net.Uri; +import android.os.AsyncTask; +import android.os.Build; +import android.os.IBinder; +import android.support.v4.app.NotificationCompat; +import android.util.Log; +import android.widget.Toast; + +import org.disroot.disrootapp.ui.StateMessagesActivity; +import org.disroot.disrootapp.utils.HttpHandler; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Timer; +import java.util.TimerTask; + +import static android.support.constraint.motion.MotionScene.TAG; + +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"; + ArrayList> messageList; + ArrayList> getDate; + + public StatusService() { + } + + @Override + public IBinder onBind(Intent intent) { + // TODO: Return the communication channel to the service. + throw new UnsupportedOperationException( "Not yet implemented" ); + + } + @Override + public void onCreate() { + super.onCreate(); + + //Status report + messageList = new ArrayList<>(); + getDate = new ArrayList<>(); + checkDate = getSharedPreferences("storeDate", Context.MODE_PRIVATE); + + //Check json for updates + Timer timer = new Timer(); + timer.schedule(new TimerTask() { + @Override + public void run() { + new StatusService.GetList().execute(); + } + }, 100, 100000);//100000=100sec + + + } + //status report + @SuppressLint("StaticFieldLeak") + class GetList extends AsyncTask { + + @Override + protected Void doInBackground(Void... arg0) { + HttpHandler sh = new HttpHandler(); + + String jsonStrincidents0 = sh.makeServiceCall(incidenturl0); + + Log.e(TAG, "Response from url(Service): " + incidenturl0); + + if (jsonStrincidents0 != null) {//Incidaetnts page + try { + JSONObject jsonObj = new JSONObject(jsonStrincidents0); + JSONArray data = jsonObj.getJSONArray("data"); + int a=0; + JSONObject o = data.getJSONObject(a); + String callid = o.getString("id"); + String updated = o.getString("updated_at"); + HashMap date = new HashMap<>(); + date.put("id", callid); + date.put("updated", updated); + getDate.add(date); + String stateDate = date.put( "updated", updated ); + String dateStored= checkDate.getString( "storeDate","" ); + + if (dateStored.equals( "" )) + { + checkDate.edit().putString( "storeDate", stateDate).apply(); + //return null; + } + else if (!stateDate.equals( dateStored )&& !stateDate.equals( "" ))//dateStored + { + checkDate.edit().putString( "storeDate", stateDate).apply(); + Log.e(TAG, "date: " + dateStored); + Log.e(TAG, "date2: " + stateDate); + sendNotification();//Call notification + return null; + } + else + Log.e(TAG, "updated json(service)"); + return null; + + } catch (final JSONException e) { + Log.e(TAG, "Json parsing error: " + e.getMessage()); + Toast.makeText(getApplicationContext(), + "Json parsing error: " + e.getMessage(), + Toast.LENGTH_LONG) + .show(); + } + }else { + Log.e(TAG, "Couldn't get json from server."); + } + return null; + } + } + + //Notification + private void sendNotification() throws JSONException { + String CHANNEL_ID = "3168654312"; + String CHANNEL_NAME = "StateNotification"; + HttpHandler sh = new HttpHandler(); + String jsonStrincidents0 = sh.makeServiceCall(incidenturl0); + JSONObject jsonObj = new JSONObject(jsonStrincidents0); + JSONArray data = jsonObj.getJSONArray("data"); + int a=0; + JSONObject o = data.getJSONObject(a); + String name = o.getString( "name" ); + String message = o.getString( "message" ); + HashMap date = new HashMap<>(); + date.put("name", name); + date.put("message", message); + Log.e(TAG, "message: " + name); + + Intent goState = new Intent( StatusService.this, StateMessagesActivity.class); + 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); + 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); + channel.enableVibration(true); + channel.setLightColor( Color.rgb( 80,22,45 )); + channel.enableLights(true); + channel.setVibrationPattern(new long[]{50,500,100,300,50,300}); + notificationManager.createNotificationChannel(channel); + } + + NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(getApplicationContext(), CHANNEL_ID) + .setAutoCancel( true ) + .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 :-) + .setContentIntent(launchStateMessages); + Uri alarmSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); + notificationBuilder.setSound(alarmSound) + .setVibrate(new long[]{50,500,100,300,50,300}) + .setLights(Color.BLUE, 3000, 3000); + NotificationManager mNotificationManager = + (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){ + notificationBuilder.setChannelId(CHANNEL_ID); + } + + notificationManager.notify(CHANNEL_ID, 1, notificationBuilder.build()); + } +} diff --git a/app/src/main/java/org/disroot/disrootapp/ui/MainActivity.java b/app/src/main/java/org/disroot/disrootapp/ui/MainActivity.java index 41703ae..fa4e290 100644 --- a/app/src/main/java/org/disroot/disrootapp/ui/MainActivity.java +++ b/app/src/main/java/org/disroot/disrootapp/ui/MainActivity.java @@ -1,24 +1,16 @@ package org.disroot.disrootapp.ui; import android.Manifest; -import android.annotation.SuppressLint; import android.annotation.TargetApi; import android.app.AlertDialog; import android.app.DownloadManager; -import android.app.NotificationChannel; -import android.app.NotificationManager; -import android.app.PendingIntent; -import android.app.ProgressDialog; -import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.graphics.Bitmap; import android.graphics.Color; -import android.media.RingtoneManager; import android.net.Uri; -import android.os.AsyncTask; import android.os.Build; import android.os.Bundle; import android.os.Environment; @@ -30,7 +22,6 @@ import android.support.annotation.RequiresApi; import android.support.design.widget.Snackbar; import android.support.v4.app.ActivityCompat; import android.support.v4.app.FragmentManager; -import android.support.v4.app.NotificationCompat; import android.support.v4.content.ContextCompat; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v7.app.AppCompatActivity; @@ -60,20 +51,15 @@ import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.FrameLayout; import android.widget.ImageButton; -import android.widget.ListView; import android.widget.ProgressBar; import android.widget.ScrollView; import android.widget.Toast; import org.disroot.disrootapp.R; -//import org.disroot.disrootapp.service.CachetService; +import org.disroot.disrootapp.StatusService; import org.disroot.disrootapp.utils.Constants; -import org.disroot.disrootapp.utils.HttpHandler; import org.disroot.disrootapp.webviews.DisWebChromeClient; -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; import java.io.File; import java.io.IOException; @@ -84,9 +70,6 @@ import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Timer; -import java.util.TimerTask; - import de.cketti.library.changelog.ChangeLog; @SuppressWarnings("ALL") @@ -121,15 +104,6 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL private CookieManager cookieManager; - //status report - private ProgressDialog pDialog; - private ListView lv; - public SharedPreferences checkDate; - // URL to get data JSON - static String incidenturl0 ="https://state.disroot.org/api/v1/incidents?sort=id&order=desc"; - ArrayList> messageList; - ArrayList> getDate; - @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -668,34 +642,9 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL } }); - //Status report - messageList = new ArrayList<>(); - getDate = new ArrayList<>(); - - lv = findViewById(R.id.list); - - checkDate = getSharedPreferences("storeDate", Context.MODE_PRIVATE); - - //Check json for updates - Timer timer = new Timer(); - timer.schedule(new TimerTask() { - @Override - public void run() { - runOnUiThread(new Runnable() { - - @Override - public void run() { - new MainActivity.GetList().execute(); - } - }); - } - }, 100, 100000);//100000=100sec - - // start CachetService - //Intent intent = new Intent(this, CachetService.class); - // Put some data for use by the IntentService - //intent.putExtra("foo", "bar"); - //startService(intent); + //Status service + Intent intent = new Intent( MainActivity.this, StatusService.class); + startService(intent); } @@ -1881,124 +1830,6 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL startActivity(intent); } - //status report - @SuppressLint("StaticFieldLeak") - class GetList extends AsyncTask { - - @Override - protected Void doInBackground(Void... arg0) { - HttpHandler sh = new HttpHandler(); - - String jsonStrincidents0 = sh.makeServiceCall(incidenturl0); - - Log.e(TAG, "Response from url: " + incidenturl0); - - if (jsonStrincidents0 != null) {//Incidaetnts page - try { - JSONObject jsonObj = new JSONObject(jsonStrincidents0); - JSONArray data = jsonObj.getJSONArray("data"); - int a=0; - JSONObject o = data.getJSONObject(a); - String callid = o.getString("id"); - String updated = o.getString("updated_at"); - HashMap date = new HashMap<>(); - date.put("id", callid); - date.put("updated", updated); - getDate.add(date); - String stateDate = date.put( "updated", updated ); - String dateStored= checkDate.getString( "storeDate","" ); - - if (dateStored.equals( "" )) - { - checkDate.edit().putString( "storeDate", stateDate).apply(); - //return null; - } - else if (!stateDate.equals( dateStored )&& !stateDate.equals( "" ))//dateStored - { - checkDate.edit().putString( "storeDate", stateDate).apply(); - Log.e(TAG, "date: " + dateStored); - Log.e(TAG, "date2: " + stateDate); - sendNotification();//Call notification - return null; - } - else - Log.e(TAG, "updated json"); - return null; - - } catch (final JSONException e) { - Log.e(TAG, "Json parsing error: " + e.getMessage()); - runOnUiThread(new Runnable() { - @Override - public void run() { - Toast.makeText(getApplicationContext(), - "Json parsing error: " + e.getMessage(), - Toast.LENGTH_LONG) - .show(); - } - }); - } - }else { - Log.e(TAG, "Couldn't get json from server."); - } - return null; - } - } - - //Notification - private void sendNotification() throws JSONException { - String CHANNEL_ID = "3168654312"; - String CHANNEL_NAME = "StateNotification"; - HttpHandler sh = new HttpHandler(); - String jsonStrincidents0 = sh.makeServiceCall(incidenturl0); - JSONObject jsonObj = new JSONObject(jsonStrincidents0); - JSONArray data = jsonObj.getJSONArray("data"); - int a=0; - JSONObject o = data.getJSONObject(a); - String name = o.getString( "name" ); - String message = o.getString( "message" ); - HashMap date = new HashMap<>(); - date.put("name", name); - date.put("message", message); - Log.e(TAG, "message: " + name); - - Intent goState = new Intent(MainActivity.this, StateMessagesActivity.class); - PendingIntent launchStateMessages = PendingIntent.getActivity(MainActivity.this,0, goState, PendingIntent.FLAG_UPDATE_CURRENT); - - NotificationManager notificationManager = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE); - NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle(); - - inboxStyle.addLine(message); - 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); - channel.enableVibration(true); - channel.setLightColor(Color.rgb( 80,22,45 )); - channel.enableLights(true); - channel.setVibrationPattern(new long[]{50,500,100,300,50,300}); - notificationManager.createNotificationChannel(channel); - } - - NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(getApplicationContext(), CHANNEL_ID) - .setAutoCancel( true ) - .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 :-) - .setContentIntent(launchStateMessages); - Uri alarmSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); - notificationBuilder.setSound(alarmSound) - .setVibrate(new long[]{50,500,100,300,50,300}) - .setLights(Color.BLUE, 3000, 3000); - NotificationManager mNotificationManager = - (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); - if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){ - notificationBuilder.setChannelId(CHANNEL_ID); - } - - notificationManager.notify(CHANNEL_ID, 1, notificationBuilder.build()); - } - //show snackbar to avoid exit on backpress @Override public void onBackPressed() { diff --git a/app/src/main/res/xml/changelog_master.xml b/app/src/main/res/xml/changelog_master.xml index 07610af..98a019b 100644 --- a/app/src/main/res/xml/changelog_master.xml +++ b/app/src/main/res/xml/changelog_master.xml @@ -1,5 +1,8 @@ + + Notifications works as a service now + Notifications works on Android 8 and higher now Added Disroot purple light notification From 4ae16cc3d6f682d8a95a92ff8ef85115c59d56f2 Mon Sep 17 00:00:00 2001 From: massimiliano Date: Sun, 26 May 2019 01:01:54 +0200 Subject: [PATCH 05/14] Battery optimization promt at launch for updating and fresh install. Added battery optimization shortcut in menu. Launch service on boot --- .idea/assetWizardSettings.xml | 4 +- .idea/caches/build_file_checksums.ser | Bin 534 -> 534 bytes app/src/main/AndroidManifest.xml | 13 +++- .../disrootapp/StatusBroadcastReceiver.java | 16 +++++ .../org/disroot/disrootapp/StatusService.java | 4 +- .../disroot/disrootapp/ui/MainActivity.java | 64 +++++++++++++++++- app/src/main/res/drawable/ic_battery.xml | 6 ++ app/src/main/res/menu/menu_main.xml | 4 ++ app/src/main/res/values-es/strings.xml | 11 +-- app/src/main/res/values-fr/strings.xml | 7 +- app/src/main/res/values-it/strings.xml | 7 +- app/src/main/res/values-nl/strings.xml | 7 +- app/src/main/res/values-pt/strings.xml | 7 +- app/src/main/res/values-sr/strings.xml | 7 +- app/src/main/res/values/strings.xml | 7 +- app/src/main/res/xml/changelog_master.xml | 3 + 16 files changed, 143 insertions(+), 24 deletions(-) create mode 100644 app/src/main/java/org/disroot/disrootapp/StatusBroadcastReceiver.java create mode 100644 app/src/main/res/drawable/ic_battery.xml diff --git a/.idea/assetWizardSettings.xml b/.idea/assetWizardSettings.xml index 1da7075..08dc549 100644 --- a/.idea/assetWizardSettings.xml +++ b/.idea/assetWizardSettings.xml @@ -14,8 +14,8 @@ diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser index 4d9f80324160804f74c144625da035ea1039d815..e27eb3d115adae4364d271495f957a9ea4ca6f62 100644 GIT binary patch delta 33 pcmbQnGL2=z43>|Qel8p5WHJhxnw$@f?mZtFwsAx0jL(IWD*)cU4wV1^ delta 33 rcmV++0N($W1eOGlm;~Qt+nTYQX#o*#*95EB_)`GlUL@&eo&;)m|L_km diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 3e69325..1be8a03 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -6,6 +6,8 @@ + + + + + + + + + android:exported="true" /> = Build.VERSION_CODES.O){ notificationBuilder.setChannelId(CHANNEL_ID); } diff --git a/app/src/main/java/org/disroot/disrootapp/ui/MainActivity.java b/app/src/main/java/org/disroot/disrootapp/ui/MainActivity.java index fa4e290..225ddc5 100644 --- a/app/src/main/java/org/disroot/disrootapp/ui/MainActivity.java +++ b/app/src/main/java/org/disroot/disrootapp/ui/MainActivity.java @@ -4,9 +4,11 @@ import android.Manifest; import android.annotation.TargetApi; import android.app.AlertDialog; import android.app.DownloadManager; +import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; +import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.graphics.Bitmap; import android.graphics.Color; @@ -16,7 +18,9 @@ import android.os.Bundle; import android.os.Environment; import android.os.Handler; import android.os.Parcelable; +import android.os.PowerManager; import android.provider.MediaStore; +import android.provider.Settings; import android.support.annotation.NonNull; import android.support.annotation.RequiresApi; import android.support.design.widget.Snackbar; @@ -646,8 +650,31 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL Intent intent = new Intent( MainActivity.this, StatusService.class); startService(intent); + + + //delete after version 1.1.6 + PackageInfo info = null; + try { + info = getPackageManager().getPackageInfo(getPackageName(), 0); + } catch (PackageManager.NameNotFoundException e) { + // bad times + Log.e("MyApplication", "couldn't get package info!"); + } + + if (info == null) { + // can't do anything + return; + } + + if (!firstStart.getBoolean("update", false)&&info.firstInstallTime != info.lastUpdateTime) { + showOptimzationInfo(); + firstStart.edit().putBoolean("update", true).apply(); + return; + } } + + //Dialog windows private void showChoose() { AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this); @@ -702,10 +729,41 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL builder.setCancelable(false); builder.setTitle(R.string.FirstTitle); builder.setMessage(getString(R.string.FirstInfo)); - builder.setPositiveButton(R.string.global_ok, null); + builder.setPositiveButton(R.string.global_ok, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + showOptimzation(); + } + }); builder.show(); } + private void showOptimzation() { + Intent intent = new Intent(); + String packageName = getPackageName(); + PowerManager pm = (PowerManager) getSystemService( Context.POWER_SERVICE); + if (pm.isIgnoringBatteryOptimizations(packageName)) + intent.setAction(Settings.ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS); + else { + intent.setAction(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS); + intent.setData(Uri.parse("package:" + packageName)); + } + startActivity(intent); + } + + private void showOptimzationInfo() { + AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this); + builder.setCancelable(false); + builder.setTitle(R.string.OptimizationTitle); + builder.setMessage(getString(R.string.OptimizationInfo)); + builder.setPositiveButton(R.string.global_ok, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + showOptimzation(); + } + }); + builder.show(); + } @Override public boolean onLongClick(View view) { Toast.makeText(view.getContext(), R.string.activity_main_share_info, Toast.LENGTH_LONG).show(); @@ -1390,6 +1448,9 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL webView.loadUrl(url); return true; } + case R.id.action_optimization: + showOptimzation(); + return true; case R.id.action_about: Intent goAbout = new Intent(MainActivity.this, AboutActivity.class); MainActivity.this.startActivity(goAbout); @@ -1821,7 +1882,6 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL } } - // public void shareCurrentPage() { Intent intent = new Intent(Intent.ACTION_SEND); intent.setAction(Intent.ACTION_SEND); diff --git a/app/src/main/res/drawable/ic_battery.xml b/app/src/main/res/drawable/ic_battery.xml new file mode 100644 index 0000000..7e5383e --- /dev/null +++ b/app/src/main/res/drawable/ic_battery.xml @@ -0,0 +1,6 @@ + + + diff --git a/app/src/main/res/menu/menu_main.xml b/app/src/main/res/menu/menu_main.xml index 1720097..9330959 100644 --- a/app/src/main/res/menu/menu_main.xml +++ b/app/src/main/res/menu/menu_main.xml @@ -31,6 +31,10 @@ android:icon="@drawable/ic_clear_cookies" android:id="@+id/action_clear_cookies" android:title="@string/action_clear_cookies" /> + Cargando… OK ¿Necesitas más ayuda? - Cuéntame más... + Cuéntame más… AboutActivity Configuración de Correo: @@ -79,8 +79,8 @@ Comenta a tus amigos y familia sobre Disroot. O por qué no escribir en un blog sobre tu experiencia. Nos encantaría conocerla. Compartir la aplicación Sitio de Disroot - Casi lo olvido… - Haciendo una presión larga sobre el ícono de cada aplicación, puedes ver información extra sobre ella. + Casi lo olvido… + Haciendo una presión larga sobre el ícono de cada aplicación, puedes ver información extra sobre ella. Configuración de Diaspora* Red social distribuida y descentralizada. Publica, comparte, crea comunidades.\nUsuario: tu_usuario_de_Diaspora@pod.disroot.org\nContraseña: tu_contraseña_de_diaspora EtherPad @@ -118,7 +118,7 @@ \ \ • Estado de Matrix \ \ • Estado de Hubzilla/Diaspora*/Mastodon \ \ • Actualización de estados por email - \ \ • Feed RSS de los Estados + We recommend to turn off battery optimization and allow Disroot app to run in background. If you\'re not sure, you can always change the setting from the menu of the Disroot app later. ¡Tienes dos clientes XMPP instalados! Por favor, elige el cliente que quieres usar para Disroot Recordar mi elección @@ -158,4 +158,7 @@ Para continuar, primero necesitas instalar Notas.\nPor favor, selecciona Instalar para continuar con la instalación desde F-Droid. Para continuar, primero necesitas instalar Padland.\nPor favor, selecciona Instalar para continuar desde F-Droid. do you want to exit? + Battery optimization + Battery optimization + With this update the app can sync with the status page of Disroot. This means you will receive realtime updates on issues, downtimes, scheduled maintenace and others published via https://state.disroot.org diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index c6da110..13a5ada 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -101,8 +101,8 @@ Parlez de Disroot à vos amis et à votre famille ! Pourquoi ne bloguez-vous pas sur vos expériences \? Nous adorerions recevoir de vos nouvelles ! Partager l\'application Disroot web - J\'allais presque oublier - Vous pouvez appuyer longuement sur chaque icône pour afficher des informations supplémentaires … + J\'allais presque oublier + Vous pouvez appuyer longuement sur chaque icône pour afficher des informations supplémentaires … Paramètres Diaspora* Réseau social distribué et décentralisé. Postez, partagez, aimez, créez des communautés. \n @@ -195,4 +195,7 @@ Notes Pour continuer, vous devez d\'abord installer Padland.\nVeuillez sélectionner Installer pour continuer l\'installation avec F-Droid. do you want to exit? + Battery optimization + We recommend to turn off battery optimization and allow Disroot app to run in background. If you\'re not sure, you can always change the setting from the menu of the Disroot app later. + With this update the app can sync with the status page of Disroot. This means you will receive realtime updates on issues, downtimes, scheduled maintenace and others published via https://state.disroot.org diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 76bbd59..eaf25a7 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -78,8 +78,8 @@ Racconta ai tuoi amici e familiari di Disroot! Perché non scrivi sul tuo blog le tue esperienze? Ci farebbe molto piacere sentirti! Condividi la app Disroot web - Quasi dimenticavo - È possibile premere a lungo su ogni icona per visualizzare informazioni aggiuntive.… + Le Ultime cose! + • È possibile premere a lungo su ogni icona per visualizzare informazioni aggiuntive… \n\n• L\'applicazione può sincronizzarsi con la pagina di stato di Disroot. Questo significa che riceverai in tempo reale aggiornamenti su problemi, tempi di inattività, manutenzione programmata e altri aggiornamenti pubblicati su https://state.disroot.org\nSi consiglia di disattivare l\'ottimizzazione della batteria e consentire all\'applicazione Disroot di funzionare in background. Se non si è sicuri, è sempre possibile modificare le impostazioni dal menu dell\'applicazione Disroot in un secondo momento. Impostazioni Diaspora* Rete sociale distribuita e decentralizzata. Pubblicare, condividere, tipo, creare comunità.\n\nNome utente:\n il_tuo_nome_utente_diaspora_@pod.disroot.org\n\nPassword:\n la_tua_password_diaspora Con Etherpad scrivere articoli, comunicati stampa, liste di cose da fare, ecc. insieme ad amici, compagni di studio o colleghi, tutti che lavorano sullo stesso documento allo stesso tempo.\nNon è richiesta alcuna registrazione. @@ -157,4 +157,7 @@ Note Per continuare è necessario installare Padland.\nSelezionate installa per continuare con l\'installazione su F-Droid. Vuoi veramente uscire? + Battery optimization + Battery optimization + Con questo aggiornamento l\'applicazione può sincronizzarsi con la pagina di stato di Disroot. Questo significa che riceverai in tempo reale gli aggiornamenti sui problemi, i tempi di inattività, la manutenzione programmata e altri aggiornamenti pubblicati su https://state.disroot.org\nSi consiglia di disattivare l\'ottimizzazione della batteria e consentire all\'applicazione Disroot di funzionare in background. Se non si è sicuri, è sempre possibile modificare le impostazioni dal menu dell\'applicazione Disroot in un secondo momento. diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 3247e86..b3e55c5 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -79,8 +79,8 @@ Vertel je vrienden en familie over Disroot! Waarom blogt je niet over jou ervaringen? We horen graag van je! Deel de app Disroot web - Ik vergat bijna - Je kan op elk pictogram lang drukken om jou extra informatie te tonen… + De laatste paar dingen! + • Je kan op elk pictogram lang drukken om jou extra informatie te tonen…• De app kan synchroniseren met de statuspagina van Disroot. Dit betekent dat u realtime updates ontvangt over issues, downtimes, gepland onderhoud en andere zaken die gepubliceerd worden via https://state.disroot.org\nWe raden aan om de batterijoptimalisatie uit te schakelen en de Disroot app op de achtergrond te laten draaien. Als u niet zeker bent, kunt u de instelling later altijd nog wijzigen vanuit het Disroot app menu. Diaspora* Instellingen Gedistribueerd en gedecentraliseerd sociaal netwerk. Plaatsen, delen, liken, gemeenschappen creëren.\n\nGebruikersnaam:\n jou_diaspora_gebruikersnaam@pod.disroot.org\n\nWachtwoord:\n jou_diaspora_wachtwoord Met Etherpad schrijf artikelen, persberichten, to-do lijsten, etc. samen met vrienden, medestudenten of collega\'s, die allemaal op hetzelfde moment aan hetzelfde document werken.\nEr is geen registratie vereist. @@ -159,4 +159,7 @@ Notes Om verder te gaan moet u eerst Padland installeren.\nSelecteer Installeren om verder te gaan met de installatie op F-Droid. Will je de app verlaten? + Battery optimization + Battery optimization + Met deze update kan de app synchroniseren met de statuspagina van Disroot. Dit betekent dat u realtime updates ontvangt over issues, downtime, gepland onderhoud en andere zaken die gepubliceerd worden via https://state.disroot.org\nWe raden aan om de batterijoptimalisatie uit te schakelen en de Disroot app op de achtergrond te laten draaien. Als u niet zeker bent, kunt u de instelling later altijd nog wijzigen vanuit het Disroot app menu. diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 886962e..7a9a4fc 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -78,8 +78,8 @@ Conta aos teus amigos e famelga acerca do Disroot! Porque não escrever um post acerca da tua experiência com o Disroot? Adoraríamos ouvir da tua parte! Partilhar a app Disroot web - Quase que me esquecia - Podes carregar por alguns segundos em cada ícone para aparecer informação extra… + Quase que me esquecia + Podes carregar por alguns segundos em cada ícone para aparecer informação extra… Definições do Diaspora* Rede social Distribuída e Descentralizada. Postar, partilhar, criar comunidades.\n\nUsername:\n o_seu_nome_de_utilizador_no_diaspora@pod.disroot.org\n\nPassword:\n a_sua_password_diaspora Com o Etherpad pode escrever artigos, comunicados de imprensa, listas de tarefas, etc. em conjunto com outras pessoas, amigos, colegas, todos a trabalhar no mesmo documento ao mesmo tempo.\nNão é necessário ter uma conta de utilizador para usar. @@ -157,4 +157,7 @@ Notes To continue you need to install Padland first.\nPlease select install to continue with the installatin on F-Droid. do you want to exit? + Battery optimization + We recommend to turn off battery optimization and allow Disroot app to run in background. If you\'re not sure, you can always change the setting from the menu of the Disroot app later. + With this update the app can sync with the status page of Disroot. This means you will receive realtime updates on issues, downtimes, scheduled maintenace and others published via https://state.disroot.org diff --git a/app/src/main/res/values-sr/strings.xml b/app/src/main/res/values-sr/strings.xml index 1a0a8e9..2c44087 100644 --- a/app/src/main/res/values-sr/strings.xml +++ b/app/src/main/res/values-sr/strings.xml @@ -79,8 +79,8 @@ Obavestite prijatelje i porodicu o Disroot platformi! Zašto ne biste napisali blog o vašim iskustvima? Srdačno očekujemo vaše mišljenje! Podelite aplikaciju Disroot sajt - Umalo da zaboravim - Duži pritisak na bilo koju ikonicu prikazaće dodatne informacije… + Umalo da zaboravim + Duži pritisak na bilo koju ikonicu prikazaće dodatne informacije… Diaspora* podešavanja Raspodeljena i decentralizovana društvena mreža. Objavite, delite, stvarajte zajednice.\n\nKorisnik:\n vaše_diaspora_korisničko_ime@pod.disroot.org\n\nLozinka:\n vaša_diaspora_lozinka Pomoću Etherpad-a pišite članke, medijske objave, podsetnike, itd. Zajedno sa prijateljima, kolegama sa fakulteta ili saradnicima, možete istovremeno raditi na određenom dokumentu.\nRegistracija nije potrebna. @@ -158,4 +158,7 @@ Beleške Za nastavak je potrebno instalirati aplikaciju Padland.\nIzaberite \'instaliraj\' i preuzmite aplikaciju pomoću F-Droid-a. do you want to exit? + Battery optimization + We recommend to turn off battery optimization and allow Disroot app to run in background. If you\'re not sure, you can always change the setting from the menu of the Disroot app later. + With this update the app can sync with the status page of Disroot. This means you will receive realtime updates on issues, downtimes, scheduled maintenace and others published via https://state.disroot.org diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 6f614bd..baa6fbb 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -78,8 +78,8 @@ Tell your friends and family about Disroot! Why don\'t you blog about your experiences? We\'d love to hear from you! Share the app Disroot web - I almost forgot - You can do a long press on each icon to show you extra information… + Last couple of things! + • 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. Diaspora* Settings 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 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. @@ -158,4 +158,7 @@ Notes To continue you need to install Padland first.\nPlease select install to continue with the installation on F-Droid. Do you want to exit? + Battery optimization + Battery optimization + With this update the app can sync with the status page of Disroot. This means 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 background. If you\'re not sure, you can always change the setting from the menu of the Disroot app later. diff --git a/app/src/main/res/xml/changelog_master.xml b/app/src/main/res/xml/changelog_master.xml index 98a019b..e8b4fcd 100644 --- a/app/src/main/res/xml/changelog_master.xml +++ b/app/src/main/res/xml/changelog_master.xml @@ -2,6 +2,9 @@ Notifications works as a service now + Added shortcut to battery optimizations in menu + Prompt for battery optimization to give user choice on first launch + Launch status service on boot time when battery optimization is turned off Notifications works on Android 8 and higher now From 5668ae224957918f88ff2bf5c784fc50ec1ff09c Mon Sep 17 00:00:00 2001 From: massimiliano Date: Sun, 26 May 2019 01:03:11 +0200 Subject: [PATCH 06/14] added changelog to 1.2.0 --- app/src/main/res/xml/changelog_master.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/xml/changelog_master.xml b/app/src/main/res/xml/changelog_master.xml index e8b4fcd..628cbc1 100644 --- a/app/src/main/res/xml/changelog_master.xml +++ b/app/src/main/res/xml/changelog_master.xml @@ -1,6 +1,6 @@ - + Notifications works as a service now Added shortcut to battery optimizations in menu Prompt for battery optimization to give user choice on first launch From bd61dccd062e6bb3097255fa3f0f948aaf44e5b6 Mon Sep 17 00:00:00 2001 From: meaz Date: Sun, 26 May 2019 08:49:25 +0200 Subject: [PATCH 07/14] French translation of Battery optimization change --- app/src/main/res/values-fr/strings.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 13a5ada..7477ff7 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -101,8 +101,8 @@ Parlez de Disroot à vos amis et à votre famille ! Pourquoi ne bloguez-vous pas sur vos expériences \? Nous adorerions recevoir de vos nouvelles ! Partager l\'application Disroot web - J\'allais presque oublier - Vous pouvez appuyer longuement sur chaque icône pour afficher des informations supplémentaires … + Dernière chose ! + • En appuyant longuement sur chaque icône, vous pouvez obtenir des informations supplémentaires... \n\n• ; L\'application peut se synchroniser avec la page de statut de Disroot. Cela signifie que vous recevrez des mises à jour en temps réel sur les problèmes, les temps d\'arrêt, la maintenance programmée et d\'autres problèmes publiés via https://state.disroot.org\nNous vous recommandons de désactiver l\'optimisation de la batterie et d\'autoriser l\'application Disroot à fonctionner en arrière-plan. Si vous n\'êtes pas sûr, vous pouvez toujours changer le réglage à partir du menu de l\'application Disroot plus tard. Paramètres Diaspora* Réseau social distribué et décentralisé. Postez, partagez, aimez, créez des communautés. \n @@ -194,8 +194,8 @@ Pour continuer, vous devez d\'abord installer Notes.\nVeuillez sélectionner Installer pour continuer l\'installation avec F-Droid. Notes Pour continuer, vous devez d\'abord installer Padland.\nVeuillez sélectionner Installer pour continuer l\'installation avec F-Droid. - do you want to exit? - Battery optimization - We recommend to turn off battery optimization and allow Disroot app to run in background. If you\'re not sure, you can always change the setting from the menu of the Disroot app later. - With this update the app can sync with the status page of Disroot. This means you will receive realtime updates on issues, downtimes, scheduled maintenace and others published via https://state.disroot.org + Voulez-vous quitter? + Optimisation de la batterie + Nous vous recommandons de désactiver l\'optimisation de la batterie et d\'autoriser l\'exécution de l\'application Disroot en arrière-plan. Si vous n\'êtes pas sûr, vous pouvez toujours changer le réglage à partir du menu de l\'application Disroot plus tard. + Avec cette mise à jour, l\'application peut se synchroniser avec la page de statut de Disroot. Cela signifie que vous recevrez des mises à jour en temps réel sur les problèmes, les temps d'arrêt, la maintenance programmée et d\'autres informations publiées via https://state.disroot.org From 1fdf27cd5037e4bd8988b0fe8593b0eb2e44c2b3 Mon Sep 17 00:00:00 2001 From: massimiliano Date: Sun, 26 May 2019 12:12:05 +0200 Subject: [PATCH 08/14] Corrected errors in strings and changed to version 1.2.0 --- .idea/caches/build_file_checksums.ser | Bin 534 -> 534 bytes app/build.gradle | 2 +- app/src/main/res/values-es/strings.xml | 4 ++-- app/src/main/res/values-fr/strings.xml | 6 +++--- app/src/main/res/values-it/strings.xml | 4 ++-- app/src/main/res/values-nl/strings.xml | 4 ++-- app/src/main/res/values-pt/strings.xml | 8 ++++---- app/src/main/res/values-sr/strings.xml | 4 ++-- app/src/main/res/values/strings.xml | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser index e27eb3d115adae4364d271495f957a9ea4ca6f62..5a00c900c3d9ae6374ed9977a6e39b54fbf51861 100644 GIT binary patch delta 33 rcmV++0N($W1eOGlm<02k@cXfxX#o)(w)k?{Sua0t2+gOo)o$8&5JnKS delta 33 pcmbQnGL2=z43>|Qel8p5WHJhxnw$@f?mZtFwsAx0jL(IWD*)cU4wV1^ diff --git a/app/build.gradle b/app/build.gradle index 93ca716..561c97d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,7 +7,7 @@ android { minSdkVersion 15 targetSdkVersion 28 versionCode 19 - versionName "1.1.6" + versionName "1.2.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 8d3917d..b487290 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -159,6 +159,6 @@ Para continuar, primero necesitas instalar Padland.\nPor favor, selecciona Instalar para continuar desde F-Droid. do you want to exit? Battery optimization - Battery optimization - With this update the app can sync with the status page of Disroot. This means you will receive realtime updates on issues, downtimes, scheduled maintenace and others published via https://state.disroot.org + Battery optimization! + With this update the app can sync with the status page of Disroot. This means 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 background. If you\'re not sure, you can always change the setting from the menu of the Disroot app later. diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 7477ff7..dfce1f5 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -102,7 +102,7 @@ Partager l\'application Disroot web Dernière chose ! - • En appuyant longuement sur chaque icône, vous pouvez obtenir des informations supplémentaires... \n\n• ; L\'application peut se synchroniser avec la page de statut de Disroot. Cela signifie que vous recevrez des mises à jour en temps réel sur les problèmes, les temps d\'arrêt, la maintenance programmée et d\'autres problèmes publiés via https://state.disroot.org\nNous vous recommandons de désactiver l\'optimisation de la batterie et d\'autoriser l\'application Disroot à fonctionner en arrière-plan. Si vous n\'êtes pas sûr, vous pouvez toujours changer le réglage à partir du menu de l\'application Disroot plus tard. + Paramètres Diaspora* Réseau social distribué et décentralisé. Postez, partagez, aimez, créez des communautés. \n @@ -196,6 +196,6 @@ Pour continuer, vous devez d\'abord installer Padland.\nVeuillez sélectionner Installer pour continuer l\'installation avec F-Droid. Voulez-vous quitter? Optimisation de la batterie - Nous vous recommandons de désactiver l\'optimisation de la batterie et d\'autoriser l\'exécution de l\'application Disroot en arrière-plan. Si vous n\'êtes pas sûr, vous pouvez toujours changer le réglage à partir du menu de l\'application Disroot plus tard. - Avec cette mise à jour, l\'application peut se synchroniser avec la page de statut de Disroot. Cela signifie que vous recevrez des mises à jour en temps réel sur les problèmes, les temps d'arrêt, la maintenance programmée et d\'autres informations publiées via https://state.disroot.org + Optimisation de la batterie! + Avec cette mise à jour, l\'application peut se synchroniser avec la page de statut de Disroot. Cela signifie que vous recevrez des mises à jour en temps réel sur les problèmes, les temps d\'arrêt, la maintenance programmée et d\'autres informations publiées via https://state.disroot.org\nNous vous recommandons de désactiver l\'optimisation de la batterie et d\'autoriser l\'exécution de l\'application Disroot en arrière-plan. Si vous n\'êtes pas sûr, vous pouvez toujours changer le réglage à partir du menu de l\'application Disroot plus tard. diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index eaf25a7..c0b46cc 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -157,7 +157,7 @@ Note Per continuare è necessario installare Padland.\nSelezionate installa per continuare con l\'installazione su F-Droid. Vuoi veramente uscire? - Battery optimization - Battery optimization + Ottimizzazione batteria + Ottimizzazione batteria! Con questo aggiornamento l\'applicazione può sincronizzarsi con la pagina di stato di Disroot. Questo significa che riceverai in tempo reale gli aggiornamenti sui problemi, i tempi di inattività, la manutenzione programmata e altri aggiornamenti pubblicati su https://state.disroot.org\nSi consiglia di disattivare l\'ottimizzazione della batteria e consentire all\'applicazione Disroot di funzionare in background. Se non si è sicuri, è sempre possibile modificare le impostazioni dal menu dell\'applicazione Disroot in un secondo momento. diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index b3e55c5..0dfb177 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -159,7 +159,7 @@ Notes Om verder te gaan moet u eerst Padland installeren.\nSelecteer Installeren om verder te gaan met de installatie op F-Droid. Will je de app verlaten? - Battery optimization - Battery optimization + Batterij optimalisatie + Batterij optimalisatie! Met deze update kan de app synchroniseren met de statuspagina van Disroot. Dit betekent dat u realtime updates ontvangt over issues, downtime, gepland onderhoud en andere zaken die gepubliceerd worden via https://state.disroot.org\nWe raden aan om de batterijoptimalisatie uit te schakelen en de Disroot app op de achtergrond te laten draaien. Als u niet zeker bent, kunt u de instelling later altijd nog wijzigen vanuit het Disroot app menu. diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 7a9a4fc..e12d4e7 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -36,11 +36,11 @@ Definições Nextcloud Mantenha os seus dados sincronizados e seguros. Com o Nextcloud pode partilhar os seus ficheiros calendários, contactos e mais.\n\nHost:\n https://cloud.disroot.org\n\nNome de utilizador:\n O_seu_nome_de_utilizador_disroot\n\nPassword:\n a_sua_password_do_disroot. Bem Vindo - O Disroot é uma plataforma baseada nos princípios de liberdade, privacidade, federação e descentralização que fornece serviços online.\nEsta aplicação é como um Canivete Suiço para a plataforma Disroot, feito pela comunidade para a comunidade.\nSe não tem uma conta Disroot pode utilizar esta aplicação para aceder a todos os serviços do Disroot que não precisam de uma conta de utilizador:\n \ \ \ • Etherpad\n \ \ \ • Ethercalc\n \ \ \ • Private bin\n \ \ \ • Upload\n \ \ \ • Poll\n \ \ \ • Searx\n \ \ \ • Diaspora* (requer uma conta apenas para o Diaspora)\n\nA aplicação pode pedir que instale outras aplicações adicionais. Nós recomendamos vivamente que instale o F-Droid - uma loja de aplicações livres e open source - porque nem todas as aplicações podem ser encontradas na Play Store Google e o F-Droid é mais focado na privacidade (sem tracking, sem preciso criar conta de utilizador) pode descarregar o F-droid carregando no ícone F-droid.\n + O Disroot é uma plataforma baseada nos princípios de liberdade, privacidade, federação e descentralização que fornece serviços online.\nEsta aplicação é como um Canivete Suíço para a plataforma Disroot, feito pela comunidade para a comunidade.\nSe não tem uma conta Disroot pode utilizar esta aplicação para aceder a todos os serviços do Disroot que não precisam de uma conta de utilizador:\n \ \ \ • Etherpad\n \ \ \ • Ethercalc\n \ \ \ • Private bin\n \ \ \ • Upload\n \ \ \ • Poll\n \ \ \ • Searx\n \ \ \ • Diaspora* (requer uma conta apenas para o Diaspora)\n\nA aplicação pode pedir que instale outras aplicações adicionais. Nós recomendamos vivamente que instale o F-Droid - uma loja de aplicações livres e open source - porque nem todas as aplicações podem ser encontradas na Play Store Google e o F-Droid é mais focado na privacidade (sem tracking, sem preciso criar conta de utilizador) pode descarregar o F-droid carregando no ícone F-droid.\n Ajuda Licença - Defenições + Definições Licença GNU LGPLv3.0 License - Haciendo una presión larga sobre el ícono de cada aplicación, puedes ver información extra sobre ella. + Un par de cosas más... + • Haciendo una presión larga sobre cada ícono, puedes obtener información adicional… \n\n• La aplicación puede sincronizar con la página de estado de Disroot. Esto significa que recibirás actualizaciones en tiempo real sobre inconvenientes, caídas, mantenimientos programados y otros que fueran publicados a través de https://state.disroot.org\nRecomendamos apagar la optimización de batería y permitir a la aplicación de Disroot correr en segundo plano. Si no estás seguro, siempre puedes volver a cambiar la configuración desde el menu de la aplicación de Disroot. Configuración de Diaspora* Red social distribuida y descentralizada. Publica, comparte, crea comunidades.\nUsuario: tu_usuario_de_Diaspora@pod.disroot.org\nContraseña: tu_contraseña_de_diaspora EtherPad From 674d4267e2e59ef6c7d9383b86195dc894a3ec10 Mon Sep 17 00:00:00 2001 From: massimiliano Date: Sun, 26 May 2019 19:57:00 +0200 Subject: [PATCH 10/14] updated spanish translation --- app/src/main/res/values-es/strings.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 4643a0d..19144e6 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -79,7 +79,7 @@ Comenta a tus amigos y familia sobre Disroot. O por qué no escribir en un blog sobre tu experiencia. Nos encantaría conocerla. Compartir la aplicación Sitio de Disroot - Un par de cosas más... + Un par de cosas más… • Haciendo una presión larga sobre cada ícono, puedes obtener información adicional… \n\n• La aplicación puede sincronizar con la página de estado de Disroot. Esto significa que recibirás actualizaciones en tiempo real sobre inconvenientes, caídas, mantenimientos programados y otros que fueran publicados a través de https://state.disroot.org\nRecomendamos apagar la optimización de batería y permitir a la aplicación de Disroot correr en segundo plano. Si no estás seguro, siempre puedes volver a cambiar la configuración desde el menu de la aplicación de Disroot. Configuración de Diaspora* Red social distribuida y descentralizada. Publica, comparte, crea comunidades.\nUsuario: tu_usuario_de_Diaspora@pod.disroot.org\nContraseña: tu_contraseña_de_diaspora @@ -158,7 +158,7 @@ Para continuar, primero necesitas instalar Notas.\nPor favor, selecciona Instalar para continuar con la instalación desde F-Droid. Para continuar, primero necesitas instalar Padland.\nPor favor, selecciona Instalar para continuar desde F-Droid. do you want to exit? - Battery optimization - Battery optimization! - With this update the app can sync with the status page of Disroot. This means 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 background. If you\'re not sure, you can always change the setting from the menu of the Disroot app later. + Optimización de la batería + Optimización de la batería! + Con esta nueva versión la aplicación puede sincronizar con la página de estado de Disroot. Esto significa que recibirás actualizaciones en tiempo real sobre inconvenientes, caídas, mantenimientos programados y otros que fueran publicados a través de https://state.disroot.org\nRecomendamos apagar la optimización de batería y permitir a la aplicación de Disroot correr en segundo plano. Si no estás seguro, siempre puedes volver a cambiar la configuración desde el menu de la aplicación de Disroot. From 6ff297ba010dc45b51a447b4ea1a5a566b6a4a85 Mon Sep 17 00:00:00 2001 From: massimiliano Date: Mon, 27 May 2019 11:15:33 +0200 Subject: [PATCH 11/14] Changed refresh rato to every 30min to look up for changes in state. --- app/src/main/java/org/disroot/disrootapp/StatusService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/disroot/disrootapp/StatusService.java b/app/src/main/java/org/disroot/disrootapp/StatusService.java index 72fd7ca..ff15b21 100644 --- a/app/src/main/java/org/disroot/disrootapp/StatusService.java +++ b/app/src/main/java/org/disroot/disrootapp/StatusService.java @@ -65,7 +65,7 @@ public class StatusService extends Service { public void run() { new StatusService.GetList().execute(); } - }, 100, 100000);//100000=100sec + }, 100, 1800000);//100000=100sec } From 8d803896d45197213234c32822b142f1b8b4190f Mon Sep 17 00:00:00 2001 From: massimiliano Date: Tue, 28 May 2019 18:27:50 +0200 Subject: [PATCH 12/14] Added de translation file for jh and added ja as contributor. --- app/src/main/res/values-de/strings.xml | 164 +++++++++++++++++++++++++ app/src/main/res/values/strings.xml | 2 +- 2 files changed, 165 insertions(+), 1 deletion(-) create mode 100644 app/src/main/res/values-de/strings.xml diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml new file mode 100644 index 0000000..e256c65 --- /dev/null +++ b/app/src/main/res/values-de/strings.xml @@ -0,0 +1,164 @@ + + Disroot App + Home + Mail + Cloud + Diaspora* + Forum + Chat + Etherpad + EtherCalc + Private bin + Upload + Searx + Poll + Board + Password + State + How to + + About + Exit + Share + Reload + + + Actions + Share link info + Loading… + OK + Need more help? + Tell me more + AboutActivity + + Mail Settings + IMAP: disroot.org\nSSL Port 993\nAuthentication: Normal\nPassword\n\nSMTP: disroot.org\nSTARTTLS Port 587\nAuthentication: Normal\nPassword\n\nPOP: disroot.org\nSSL Port 995\nAuthentication: Normal\nPassword + Nextcloud Settings + Keep your data synchronized and safe. With Nextcloud you can share your files, calendars, contacts and more.\n\nHost:\n https://cloud.disroot.org\n\nUsername:\n your_disroot_username\n\nPassword:\n your_disroot_password. + Welcome + Disroot is a platform providing online services based on principles of freedom, privacy, federation and decentralization.\nThis app is like your Swiss Army knife to the Disroot platform, made by the community for the community.\nIf you don\'t have a Disroot account you can still use this app to access all the Disroot services that do not require an account:\n \ \ \ • Etherpad\n \ \ \ • Ethercalc\n \ \ \ • Private bin\n \ \ \ • Upload\n \ \ \ • Poll\n \ \ \ • Searx\n \ \ \ • Diaspora* (requires a Diaspora only account)\n\nThe app may require you to install additional apps. We highly recommend you install F-Droid - a free and open source app marketplace - as not all apps can be found on Google\'s Play Store and F-Droid is more privacy oriented (no tracking, no account needed) you can download it by tapping on the F-droid icon.\n + + Help + License + Settings + License + GNU LGPLv3.0 License + + + + + + + Maintainers + This app is currently being developed and maintained by\n\n + https://disroot.org + * Disroot Community (Disroot): + Contributors + • muppeth:\n Disroot admin\n\n • antilopa:\n Disroot admin\n\n • Massimiliano:\n Developer\n\n • Fede:\n Content contributor\n\n • Meaz:\n Content contributor\n\n • maryjane:\n Content contributor\n\n • userdebug:\n Content contributor\n\n • jh:\n Content contributor\n\n + F-Droid + Third-Party Libraries + ckChangelog: Apache License 2.0\n\nTaponium: GNU General Public License v3.0 + Miscellaneous + We used Diolinux as our starting base to create this app. Go check it out, it\'s free software as well! + Tell me more + Application + App Version: %1$s + Device: + Contribute + Disroot app is developed free as in Freedom and follows the ideas of the Disroot Foundation. If you want to contribute, go ahead! Currently we are a very small team, so we greatly appreciate any kind of help! + Get the source + Translate + The app is not available in your language? You can change that! Why don\'t you help us by translating it? + Let me translate + Give Feedback! + Disroot app is still in development, so if you have suggestions or any kind of feedback, please let us know! + Report Bugs + Chat with us + Spread the word! + Tell your friends and family about Disroot! Why don\'t you blog about your experiences? We\'d love to hear from you! + Share the app + Disroot web + Last couple of things! + • 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. + Diaspora* Settings + 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 + 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. + EtherPad Info + XMPP Settings\n + Conversations is a free, standard and open-source decentralized and federated instant messaging application for chatting with contacts or within groups.\n\nJabber ID :\n Your full Disroot email address\n\nPassword :\n Your Disroot password + With EtherCalc work together on inventories, survey forms, list management, brainstorming sessions and more!\nNo registration is required. + EtherCalc Info + PrivateBin Help + PrivateBin is an open-source online pastebin and discussion board. Data is encrypted/decrypted in the browser so that the server has zero knowledge of hosted data. Just paste a text, click “Send”, set expiration (and other features) and share the URL.\nNo registration is required. + Upload (powered by Lufi) Info + Upload is a file hosting software that temporarily stores encrypted files so you can share them with others using a link. All files are encrypted before they leave your computer meaning server has zero knowledge of hosted data.\nNo registration is required. + Searx Info + Searx is an anonymous multi search engine platform, aggregating the results of other search engines while not storing information about its users. No tracking, profiling, no data mining by big corporations. \nNo registration is required. + Polls Help + Framadate is an online service for planning an appointment or making a decision quickly and easily.\nNo registration is required. + Project Management Board Info + Taiga is a project management tool, developed for programmers, designers and startups working with agile methodology in mind. It can however be applied to virtually any project or group, even outside of IT realm. + User Password Management Help + Use our User Self Service Center to manage your user and password data + State Info + Page to see the current state of Disroot services. Here you can see if any service has a problem, if there are any performance issues, as well as get to know when we schedule maintenance in which time some services might be unavailable.\n\nAlternative ways to get State updates: + State on XMPP + How to Info + Our page with howtos and tutorials to help you find your way around the various Disroot services. + About Info + This is the about page of this app + Forum Help + Discourse is a fully open-source modern approach to discussion forums. It offers everything your community, group or collective needs to create their communication platform. + Did you really just try the long press on the logo? + Why? It\'s just a logo.\nDon\'t be too curious ;-) + Disroot rules \\o/ + Logo + \ \ • State on xmpp + \ \ • State on Matrix + \ \ • State on Hubzilla/diaspora/mastodon + \ \ • State updates via email + \ \ • State RSS feed + You have two XMPP clients installed! + Please choose the client you want to use for Disroot + Remember my choice + Conversations + Pix-Art Messenger + Forget my choice + Forget chat client! + TapActivity + Clear cookies + Installation request + To continue you need to install Dandelion first.\nPlease select install to continue with the installation on F-Droid. + Cancel + Install + To continue you need to install K9-Mail first.\nPlease select install to continue with the installation on F-Droid. + To continue you need to install the Nextcloud app first.\nPlease select install to continue with the installation on F-Droid. + To continue you need to install Conversations first.\nPlease select install to continue with the installation on F-Droid. + StateActivity + Disroot state + Operational + Major Outage + Email Service + "Last updated: \" + WebMail Service + Cloud + Performance Issues + No issues + Some systems are experiencing issues + Show State messages + Show Service State + Scheduled at: \ + Message from Disroot State! + Scheduled + Investigating + Identified + Nextcloud Notes Info + The notes app is a distraction free notes taking app for Nextcloud.\n\nServer Address:\n https://cloud.disroot.org\n\nUsername:\n your_disroot_username\n\nPassword:\n your_disroot_password + To continue you need to install Notes first.\nPlease select install to continue with the installation on F-Droid. + Notes + To continue you need to install Padland first.\nPlease select install to continue with the installation on F-Droid. + Do you want to exit? + Battery optimization + Battery optimization! + With this update the app can sync with the status page of Disroot. This means 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 background. If you\'re not sure, you can always change the setting from the menu of the Disroot app later. + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c526d3a..d5b3a74 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -54,7 +54,7 @@ https://disroot.org * Disroot Community (Disroot): Contributors - • muppeth:\n Disroot admin\n\n • antilopa:\n Disroot admin\n\n • Massimiliano:\n Developer\n\n • Fede:\n Content contributor\n\n • Meaz:\n Content contributor\n\n • maryjane:\n Content contributor\n\n • userdebug:\n Content contributor\n\n + • muppeth:\n Disroot admin\n\n • antilopa:\n Disroot admin\n\n • Massimiliano:\n Developer\n\n • Fede:\n Content contributor\n\n • Meaz:\n Content contributor\n\n • maryjane:\n Content contributor\n\n • userdebug:\n Content contributor\n\n • jh:\n Content contributor\n\n F-Droid Third-Party Libraries ckChangelog: Apache License 2.0\n\nTaponium: GNU General Public License v3.0 From b92f13c4946d3a3975f7dba2cf03eb2c3d41b454 Mon Sep 17 00:00:00 2001 From: JJ Date: Tue, 28 May 2019 20:53:18 +0200 Subject: [PATCH 13/14] Replace strings.xml --- app/src/main/res/values-de/strings.xml | 38 +++++++++++++------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index e256c65..04c8cdf 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -11,32 +11,32 @@ Private bin Upload Searx - Poll - Board - Password - State - How to + Umfrage //or should not be translated? + Board // would name that KANBAN or TAIGA + Passwort + Status + How to //best trans will be tutorial, but inconsistent then - About + Über Exit - Share - Reload + Teilen //share with or via? or only share + neu laden - Actions - Share link info - Loading… + Actions //? something like functions? + Teile link informationen //link info or link? + lädt… OK - Need more help? - Tell me more - AboutActivity + weitere Hilfe + weitere Infos + AboutActivity //? - Mail Settings - IMAP: disroot.org\nSSL Port 993\nAuthentication: Normal\nPassword\n\nSMTP: disroot.org\nSTARTTLS Port 587\nAuthentication: Normal\nPassword\n\nPOP: disroot.org\nSSL Port 995\nAuthentication: Normal\nPassword - Nextcloud Settings - Keep your data synchronized and safe. With Nextcloud you can share your files, calendars, contacts and more.\n\nHost:\n https://cloud.disroot.org\n\nUsername:\n your_disroot_username\n\nPassword:\n your_disroot_password. + E-Mail Einstellungen + IMAP: disroot.org\nSSL Port 993\nAuthentifizierung: normales\nPasswort\n\nSMTP: disroot.org\nSTARTTLS Port 587\nAuthentifizierung: normales\nPasswort\n\nPOP: disroot.org\nSSL Port 995\nAuthentifizierung: normales\nPasswort + Nextcloud Einstellungen + Sichere deine Daten und synchronisiere sie. Mit Nextcloud kannst du Dateien, Kalender, Kontakte und mehr mit anderen teilen.\n\nHost:\n https://cloud.disroot.org\n\nBenutzername:\n "dein Disroot Benutzername"\n\nPasswort:\n "dein Disroot Passwort". Welcome - Disroot is a platform providing online services based on principles of freedom, privacy, federation and decentralization.\nThis app is like your Swiss Army knife to the Disroot platform, made by the community for the community.\nIf you don\'t have a Disroot account you can still use this app to access all the Disroot services that do not require an account:\n \ \ \ • Etherpad\n \ \ \ • Ethercalc\n \ \ \ • Private bin\n \ \ \ • Upload\n \ \ \ • Poll\n \ \ \ • Searx\n \ \ \ • Diaspora* (requires a Diaspora only account)\n\nThe app may require you to install additional apps. We highly recommend you install F-Droid - a free and open source app marketplace - as not all apps can be found on Google\'s Play Store and F-Droid is more privacy oriented (no tracking, no account needed) you can download it by tapping on the F-droid icon.\n + Disroot ist eine Plattform, auf der Online-Dienste angeboten werden, die auf den Prinzipien von Freiheit, Privatsphäre, Gemeinschaft und Dezentralisierung basieren.\nDiese App ist wie ein Schweizer Taschenmesser für die Disroot-Plattform, von der Community für die Community.\nWenn du kein Disroot-Account hast, kannst du diese App trotzdem nutzen, um auf alle Disroot-Dienste zuzugreifen, die kein Konto erfordern:\n \ \ \ • Etherpad\n \ \ \ • Ethercalc\n \ \ \ • Private bin\n \ \ \ • Upload\n \ \ \ • Poll\n \ \ \ • Searx\n \ \ \ • Diaspora* (separater Diaspora Account benötigt)\n\nDie App kann Sie danach fragen weitere Apps zu installieren. Wir empfehlen F-Droid zu installieren - einen kostenlosen und quelloffenen App-Katalog - da nicht alle verwendeten Apps im Google Play Store zu finden sind und F-Droid außerdem mehr auf Datenschutz ausgerichtet ist (kein Tracking, kein Account erforderlich). Sie können F-Droid herunterladen, indem Sie auf das F-Droid-Symbol klicken.\n Help License From 76f255b39c841f78b6b43c0daa93b65ca961a889 Mon Sep 17 00:00:00 2001 From: massimiliano Date: Wed, 29 May 2019 21:37:05 +0200 Subject: [PATCH 14/14] optimized statusService code --- .../org/disroot/disrootapp/StatusService.java | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/org/disroot/disrootapp/StatusService.java b/app/src/main/java/org/disroot/disrootapp/StatusService.java index ff15b21..8b97d81 100644 --- a/app/src/main/java/org/disroot/disrootapp/StatusService.java +++ b/app/src/main/java/org/disroot/disrootapp/StatusService.java @@ -96,21 +96,25 @@ public class StatusService extends Service { String stateDate = date.put( "updated", updated ); String dateStored= checkDate.getString( "storeDate","" ); + assert dateStored != null; if (dateStored.equals( "" )) { checkDate.edit().putString( "storeDate", stateDate).apply(); //return null; } - else if (!stateDate.equals( dateStored)&& !stateDate.equals( "" ))//dateStored - { - checkDate.edit().putString( "storeDate", stateDate).apply(); - Log.e(TAG, "date: " + dateStored); - Log.e(TAG, "date2: " + stateDate); - sendNotification();//Call notification - return null; + else { + assert stateDate != null; + if (!stateDate.equals( dateStored )&& !stateDate.equals( "" ))//dateStored + { + checkDate.edit().putString( "storeDate", stateDate).apply(); + Log.e(TAG, "date: " + dateStored); + Log.e(TAG, "date2: " + stateDate); + sendNotification();//Call notification + return null; + } + else + Log.e(TAG, "updated json(service)"); } - else - Log.e(TAG, "updated json(service)"); return null; } catch (final JSONException e) { @@ -142,6 +146,7 @@ public class StatusService extends Service { HashMap date = new HashMap<>(); date.put("name", name); date.put("message", message); + getDate.add(date); Log.e(TAG, "message: " + name); Intent goState = new Intent( StatusService.this, StateMessagesActivity.class);