Compare commits

...

15 Commits

Author SHA1 Message Date
massimiliano c43bbcfe53 Update app/src/main/res/xml/changelog_master.xml 2024-05-08 22:47:42 +02:00
massi 46df8de140 update tag 2024-05-04 08:32:42 +02:00
massi 3ceab4b54f Remove State service + Back press fix 2024-04-26 23:02:57 +02:00
massi e2190b8de1 Removal of Board and Forum 2023-11-17 00:31:49 +01:00
massi d51efa8b89 Correction of informative state messages 2022-11-25 20:34:00 +01:00
massi 310f84dbcd Corrected Changelog typo
Updated to v2.0.6
2022-10-29 20:40:51 +02:00
massi c45bc87e7c Updated to v2.0.5
Corrected need more help link for notes
2022-10-29 20:29:44 +02:00
massi 250173e35f Updated to v2.0.5
Corrected need more help link for notes
2022-10-29 20:25:47 +02:00
massi f8c86d66f7 Solved installed apps check for Android 11 and higher 2022-10-29 09:09:46 +02:00
massi 6587ec084d Corrected need more help link for notes 2022-10-29 08:38:02 +02:00
massi caa9cb34c0 updated cryptpad icon 2022-10-29 08:30:27 +02:00
massi 4a91810cd9 Removed all Polls strings and translations 2022-10-29 02:07:30 +02:00
massi c4e8167efc Added Cryptpad
Removed Calc
Removed Polls
Refractor
Improved ui state
2022-10-29 02:01:02 +02:00
massi f01c6cb893 Correct new version changelog typo 2022-10-28 20:59:18 +02:00
massi a516d2d699 Migration to status.disroot.org
Update Gradle + SDK
2022-10-28 20:52:08 +02:00
49 changed files with 678 additions and 1352 deletions

View File

@ -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.

View File

@ -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>

View File

@ -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>

View File

@ -10,11 +10,10 @@
It also can be used to access all the **Disroot** services that do not require an account:
* Etherpad
* Ethercalc
* Cryptpad
* Calls
* Private bin
* Upload
* Polls
* Searx
#### Supported languages:

View File

@ -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 33
versionName "2.1.1"
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'
}

View File

@ -1,13 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.disroot.disrootapp">
<manifest xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android">
<uses-feature
android:name="android.hardware.camera"
android:required="false" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
tools:ignore="ScopedStorage" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"
tools:ignore="QueryAllPackagesPermission" />
<application
android:allowBackup="true"
@ -16,8 +23,11 @@
android:icon="@drawable/ic_app_logo"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/DisTheme">
android:theme="@style/DisTheme"
android:dataExtractionRules="@xml/data_extraction_rules"
tools:targetApi="s">
<!--// status service disabled
<receiver
android:name=".StatusBroadcastReceiver"
android:enabled="true"
@ -26,16 +36,15 @@
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<service
android:name=".StatusService"
android:enabled="true"
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:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@ -43,10 +52,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" />
@ -60,26 +70,21 @@
android:host="upload.disroot.org"
android:scheme="https" />
<data
android:host="forum.disroot.org"
android:scheme="https" />
<data
android:host="calc.disroot.org"
android:host="cryptpad.disroot.org"
android:scheme="https" />
<data
android:host="bin.disroot.org"
android:scheme="https" />
<data
android:host="poll.disroot.org"
android:scheme="https" />
<data
android:host="upload.disroot.org"
android:scheme="https" />
<data
android:host="board.disroot.org"
android:scheme="https" />
<data
android:host="searx.disroot.org"
android:scheme="https" />
<data
android:host="status.disroot.org"
android:scheme="https" />
</intent-filter>
</activity>
<activity
@ -91,16 +96,19 @@
android:name=".ui.StateActivity"
android:label="@string/title_activity_state"
android:theme="@style/DisTheme" />
<!--// status service disabled
<activity
android:name=".ui.StateMessagesActivity"
android:label="@string/title_activity_state"
android:theme="@style/DisTheme" />
-->
<activity
android:name=".ui.SettingsActivity"
android:label="@string/settings"
android:theme="@style/DisTheme" />
<activity
android:name="wsdfhjxc.taponium.MainActivity"
android:exported="true"
android:label="@string/title_activity_tap"
android:screenOrientation="portrait">
<intent-filter>

View File

@ -1,11 +1,13 @@
package org.disroot.disrootapp;
import android.annotation.SuppressLint;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
public class StatusBroadcastReceiver extends BroadcastReceiver {
@SuppressLint("UnsafeProtectedBroadcastReceiver")
@Override
public void onReceive(Context context, Intent intent) {

View File

@ -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;
@ -78,20 +78,20 @@ public class StatusService extends Service {
protected Void doInBackground(Void... arg0) {
HttpHandler sh = new HttpHandler();
String jsonStrincidents0 = sh.makeServiceCall(incidenturl0);
String jsonStringIdents0 = sh.makeServiceCall( incidentUrl0 );
Log.e(TAG, "Response from url(Service): " + incidenturl0);
Log.e(TAG, "Response from url(Service): " + incidentUrl0 );
if (jsonStrincidents0 != null) {//Incidaetnts page
if (jsonStringIdents0 != null) {//Incidents page
try {
JSONObject jsonObj = new JSONObject(jsonStrincidents0);
JSONArray data = jsonObj.getJSONArray("data");
JSONObject jsonObj = new JSONObject(jsonStringIdents0);
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, stateDate+"updated json(service)"+dateStored);
}
return null;
@ -137,26 +137,26 @@ public class StatusService extends Service {
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");
String jsonStringIdents0 = sh.makeServiceCall( incidentUrl0 );
JSONObject jsonObj = new JSONObject(jsonStringIdents0);
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)

View File

@ -1,6 +1,7 @@
package org.disroot.disrootapp.ui;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
@ -43,12 +44,7 @@ public class AboutActivity extends AppCompatActivity {
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
toolbar.setNavigationIcon(R.drawable.ic_arrow_back);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
toolbar.setNavigationOnClickListener( v -> onBackPressed() );
// Create the adapter that will return a fragment for each of the three
// primary sections of the activity.
/*
@ -59,7 +55,7 @@ public class AboutActivity extends AppCompatActivity {
may be best to switch to a
{@link android.support.v4.app.FragmentStatePagerAdapter}.
*/
SectionsPagerAdapter mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
SectionsPagerAdapter mSectionsPagerAdapter = new SectionsPagerAdapter( getSupportFragmentManager() );
// Set up the ViewPager with the sections adapter.
/*
@ -74,16 +70,11 @@ public class AboutActivity extends AppCompatActivity {
tabLayout.addOnTabSelectedListener(new TabLayout.ViewPagerOnTabSelectedListener(mViewPager));
FloatingActionButton fab = findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Uri uri = Uri.parse(Constants.URL_SUPPORT);
Intent support = new Intent(Intent.ACTION_VIEW, Uri.parse(String.valueOf(uri)));
startActivity(support);
// Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
// .setAction("Action", null).show();
}
});
fab.setOnClickListener( view -> {
Uri uri = Uri.parse(Constants.URL_SUPPORT);
Intent support = new Intent(Intent.ACTION_VIEW, Uri.parse(String.valueOf(uri)));
startActivity(support);
} );
}
@ -137,6 +128,7 @@ public class AboutActivity extends AppCompatActivity {
return fragment;
}
@SuppressLint("SetTextI18n")
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
@ -151,67 +143,49 @@ public class AboutActivity extends AppCompatActivity {
final Button ContributeBtn = rootView.findViewById(R.id.ContributeBtn);//ContributeBtn
ContributeBtn.setOnClickListener(new View.OnClickListener()
{
public void onClick(View arg0) {
Uri uri = Uri.parse(Constants.URL_SOURCE);
Intent code = new Intent(Intent.ACTION_VIEW, Uri.parse(String.valueOf(uri)));
startActivity(code);
}
});
ContributeBtn.setOnClickListener( arg0 -> {
Uri uri = Uri.parse(Constants.URL_SOURCE);
Intent code = new Intent(Intent.ACTION_VIEW, Uri.parse(String.valueOf(uri)));
startActivity(code);
} );
final Button TranslateBtn = rootView.findViewById(R.id.TranslateBtn);//TranslateBtn
TranslateBtn.setOnClickListener(new View.OnClickListener()
{
public void onClick(View arg0) {
Uri uri = Uri.parse(Constants.URL_TRANSLATE);
Intent translate = new Intent(Intent.ACTION_VIEW, Uri.parse(String.valueOf(uri)));
startActivity(translate);
}
});
TranslateBtn.setOnClickListener( arg0 -> {
Uri uri = Uri.parse(Constants.URL_TRANSLATE);
Intent translate = new Intent(Intent.ACTION_VIEW, Uri.parse(String.valueOf(uri)));
startActivity(translate);
} );
final Button FeedbackBtn1;//FeedbackBtn1
FeedbackBtn1 = rootView.findViewById(R.id.FeedbackBtn1);
FeedbackBtn1.setOnClickListener(new View.OnClickListener()
{
public void onClick(View arg0) {
Uri uri = Uri.parse(Constants.URL_BUGS);
Intent feedback1 = new Intent(Intent.ACTION_VIEW, Uri.parse(String.valueOf(uri)));
startActivity(feedback1);
}
});
FeedbackBtn1.setOnClickListener( arg0 -> {
Uri uri = Uri.parse(Constants.URL_BUGS);
Intent feedback1 = new Intent(Intent.ACTION_VIEW, Uri.parse(String.valueOf(uri)));
startActivity(feedback1);
} );
final Button FeedbackBtn2 = rootView.findViewById(R.id.FeedbackBtn2);//FeedbackBtn2
FeedbackBtn2.setOnClickListener(new View.OnClickListener()
{
public void onClick(View arg0) {
Uri uri = Uri.parse(Constants.URL_XMPP);
Intent feedback2 = new Intent(Intent.ACTION_VIEW, Uri.parse(String.valueOf(uri)));
startActivity(feedback2);
}
});
FeedbackBtn2.setOnClickListener( arg0 -> {
Uri uri = Uri.parse(Constants.URL_XMPP);
Intent feedback2 = new Intent(Intent.ACTION_VIEW, Uri.parse(String.valueOf(uri)));
startActivity(feedback2);
} );
break;
case 2:
rootView = inflater.inflate(R.layout.fragment_about_about, container, false);
final ImageButton fDroidBtn = rootView.findViewById(R.id.fDroidBtn);//fDroidBtn
fDroidBtn.setOnClickListener(new View.OnClickListener()
{
public void onClick(View arg0) {
Uri uri = Uri.parse(Constants.URL_FDROID);
Intent fDroid = new Intent(Intent.ACTION_VIEW, Uri.parse(String.valueOf(uri)));
startActivity(fDroid);
}
});
fDroidBtn.setOnClickListener( arg0 -> {
Uri uri = Uri.parse(Constants.URL_FDROID);
Intent fDroid = new Intent(Intent.ACTION_VIEW, Uri.parse(String.valueOf(uri)));
startActivity(fDroid);
} );
final ImageButton homeBtn;//DisrootBtn
homeBtn = rootView.findViewById(R.id.homeBtn);
homeBtn.setOnClickListener(new View.OnClickListener()
{
public void onClick(View arg0) {
Uri uri = Uri.parse(Constants.URL_DISROOT);
Intent home = new Intent(Intent.ACTION_VIEW, Uri.parse(String.valueOf(uri)));
startActivity(home);
}
});
homeBtn.setOnClickListener( arg0 -> {
Uri uri = Uri.parse(Constants.URL_DISROOT);
Intent home = new Intent(Intent.ACTION_VIEW, Uri.parse(String.valueOf(uri)));
startActivity(home);
} );
final TextView PackageName= rootView.findViewById(R.id.PackageName);
PackageName.setText(getString( R.string.id ) + " "+ APPLICATION_ID);
@ -229,13 +203,13 @@ public class AboutActivity extends AppCompatActivity {
rootView = inflater.inflate(R.layout.fragment_about_license, container, false);
//Contributors
//Admins
final TextView contr_text;
contr_text = rootView.findViewById(R.id.admins_text);
contr_text.setMovementMethod( LinkMovementMethod.getInstance());
final TextView contributors_text;
contributors_text = rootView.findViewById(R.id.admins_text);
contributors_text.setMovementMethod( LinkMovementMethod.getInstance());
String admins="";
for(String admin: Contributors.admins) {
admins+="&bull; "+admin+"</a><br>";
contr_text.setText( Html.fromHtml(admins));
contributors_text.setText( Html.fromHtml(admins));
}
//devs
final TextView devs_text;
@ -268,34 +242,25 @@ public class AboutActivity extends AppCompatActivity {
//Buttons
final Button licenseBtn;//LicenseBtn
licenseBtn = rootView.findViewById(R.id.license_button);
licenseBtn.setOnClickListener(new View.OnClickListener()
{
public void onClick(View arg0) {
Uri uri = Uri.parse(Constants.URL_LICENSE);
Intent license = new Intent(Intent.ACTION_VIEW, Uri.parse(String.valueOf(uri)));
startActivity(license);
}
});
licenseBtn.setOnClickListener( arg0 -> {
Uri uri = Uri.parse(Constants.URL_LICENSE);
Intent license = new Intent(Intent.ACTION_VIEW, Uri.parse(String.valueOf(uri)));
startActivity(license);
} );
final TextView disrootBtn;//DisrootBtn
disrootBtn = rootView.findViewById(R.id.disrootUrl);
disrootBtn.setOnClickListener(new View.OnClickListener()
{
public void onClick(View arg0) {
Uri uri = Uri.parse(Constants.URL_DISROOT);
Intent disroot = new Intent(Intent.ACTION_VIEW, Uri.parse(String.valueOf(uri)));
startActivity(disroot);
}
});
final TextView dioBtn;//DiotBtn
disrootBtn.setOnClickListener( arg0 -> {
Uri uri = Uri.parse(Constants.URL_DISROOT);
Intent disroot = new Intent(Intent.ACTION_VIEW, Uri.parse(String.valueOf(uri)));
startActivity(disroot);
} );
final TextView dioBtn;//DioBtn
dioBtn = rootView.findViewById(R.id.dioBtn);
dioBtn.setOnClickListener(new View.OnClickListener()
{
public void onClick(View arg0) {
Uri uri = Uri.parse(Constants.URL_DIO);
Intent dio = new Intent(Intent.ACTION_VIEW, Uri.parse(String.valueOf(uri)));
startActivity(dio);
}
});
dioBtn.setOnClickListener( arg0 -> {
Uri uri = Uri.parse(Constants.URL_DIO);
Intent dio = new Intent(Intent.ACTION_VIEW, Uri.parse(String.valueOf(uri)));
startActivity(dio);
} );
final TextView htmlToTextView = rootView.findViewById(R.id.ThirdParty);// textview links clickable
htmlToTextView.setMovementMethod( LinkMovementMethod.getInstance());// textview links clickable
break;
@ -308,7 +273,7 @@ public class AboutActivity extends AppCompatActivity {
* A {@link FragmentPagerAdapter} that returns a fragment corresponding to
* one of the sections/tabs/pages.
*/
public class SectionsPagerAdapter extends FragmentPagerAdapter {
public static class SectionsPagerAdapter extends FragmentPagerAdapter {
final FragmentManager fm;

View File

@ -92,8 +92,8 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
WebChromeClient.FileChooserParams chooserParams;
ValueCallback<Uri[]> chooserPathUri;
Button button;
private Button MailBtn,CloudBtn,ForumBtn,ChatBtn,PadBtn,CalcBtn,BinBtn,UploadBtn,SearxBtn,PollsBtn,BoardBtn,CallsBtn,NotesBtn,GitBtn,UserBtn,StateBtn,HowToBtn,AboutBtn;//all buttons
private String email,cloud,forum,etherpad,ethercalc,bin,upload,searx,polls,taiga,user,xmpp,notes,git,cryptpad;
private Button MailBtn,CloudBtn,ChatBtn,PadBtn, CryptpadBtn,BinBtn,UploadBtn,SearxBtn,CallsBtn,NotesBtn,GitBtn,UserBtn,StateBtn,HowToBtn,AboutBtn;//all buttons
private String email,cloud,etherpad,bin,upload,searx,jitsi,user,xmpp,notes,git,cryptpad;
private CookieManager cookieManager;
private WebView webView;
private DisWebChromeClient disWebChromeClient;
@ -145,7 +145,7 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
}
} );
componentList = new ArrayList<>();
new GetList().execute();
//new GetList().execute();
setupWebView(savedInstanceState, frameLayoutContainer);
//settings
@ -154,14 +154,12 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
//buttons visiblility preference
BtnPreference = getSharedPreferences( "MailBtn", Context.MODE_PRIVATE );//mail
BtnPreference = getSharedPreferences( "CloudBtn", Context.MODE_PRIVATE );//cloud
BtnPreference = getSharedPreferences( "ForumBtn", Context.MODE_PRIVATE );//forum
BtnPreference = getSharedPreferences( "ChatBtn", Context.MODE_PRIVATE );//chat
BtnPreference = getSharedPreferences( "PadBtn", Context.MODE_PRIVATE );//pad
BtnPreference = getSharedPreferences( "CalcBtn", Context.MODE_PRIVATE );//calc
BtnPreference = getSharedPreferences( "CryptpadBtn", Context.MODE_PRIVATE );//cryptpad
BtnPreference = getSharedPreferences( "BinBtn", Context.MODE_PRIVATE );//bin
BtnPreference = getSharedPreferences( "UploadBtn", Context.MODE_PRIVATE );//upload
BtnPreference = getSharedPreferences( "SearxBtn", Context.MODE_PRIVATE );//search
BtnPreference = getSharedPreferences( "PollsBtn", Context.MODE_PRIVATE );//polls
BtnPreference = getSharedPreferences( "BoardBtn", Context.MODE_PRIVATE );//board
BtnPreference = getSharedPreferences( "CallsBtn", Context.MODE_PRIVATE );//calls
BtnPreference = getSharedPreferences( "NotesBtn", Context.MODE_PRIVATE );//notes
@ -169,9 +167,9 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
BtnPreference = getSharedPreferences( "UserBtn", Context.MODE_PRIVATE );//user
BtnPreference = getSharedPreferences( "HowToBtn", Context.MODE_PRIVATE );//howTo
BtnPreference = getSharedPreferences( "AboutBtn", Context.MODE_PRIVATE );//about
//Status service
Intent intent = new Intent( MainActivity.this, StatusService.class);
startService(intent);
// status service disabled
//Intent intent = new Intent( MainActivity.this, StatusService.class);
//startService(intent);
//progressbarLoading
progressBar = findViewById(R.id.progressbarLoading);
@ -199,6 +197,7 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
//ckCangelog library
ChangeLog cl = new ChangeLog(this);
//Battery optimization
if (cl.isFirstRun()) {
cl.getLogDialog().show();
}
@ -235,16 +234,12 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
// Link the button in activity_main.xml
MailBtn = findViewById( R.id.MailBtn );
CloudBtn = findViewById( R.id.CloudBtn );
//DiasporaBtn = findViewById( R.id.DiasporaBtn );//end of Disroot's Dandelion
ForumBtn = findViewById( R.id.ForumBtn );
ChatBtn = findViewById( R.id.ChatBtn );
PadBtn = findViewById( R.id.PadBtn );
CalcBtn = findViewById( R.id.CalcBtn );
CryptpadBtn = findViewById( R.id.CryptpadBtn );
BinBtn = findViewById( R.id.BinBtn );
UploadBtn = findViewById( R.id.UploadBtn );
SearxBtn = findViewById( R.id.SearxBtn );
PollsBtn = findViewById( R.id.PollsBtn );
BoardBtn = findViewById( R.id.BoardBtn );
CallsBtn = findViewById( R.id.CallsBtn );
NotesBtn = findViewById( R.id.NotesBtn );
GitBtn = findViewById( R.id.GitBtn );
@ -274,16 +269,12 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
//Set longclick buttons
MailBtn.setOnLongClickListener( this );
CloudBtn.setOnLongClickListener( this );
//DiasporaBtn.setOnLongClickListener( this );//end of Disroot's Dandelion
ForumBtn.setOnLongClickListener( this );
ChatBtn.setOnLongClickListener( this );
PadBtn.setOnLongClickListener( this );
CalcBtn.setOnLongClickListener( this );
CryptpadBtn.setOnLongClickListener( this );
BinBtn.setOnLongClickListener( this );
UploadBtn.setOnLongClickListener( this );
SearxBtn.setOnLongClickListener( this );
PollsBtn.setOnLongClickListener( this );
BoardBtn.setOnLongClickListener( this );
CallsBtn.setOnLongClickListener( this );
NotesBtn.setOnLongClickListener( this );
GitBtn.setOnLongClickListener( this );
@ -295,16 +286,12 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
//set clickbuttons
MailBtn.setOnClickListener( this );
CloudBtn.setOnClickListener( this );
//DiasporaBtn.setOnClickListener( this );//end of Disroot's Dandelion
ForumBtn.setOnClickListener( this );
ChatBtn.setOnClickListener( this );
PadBtn.setOnClickListener( this );
CalcBtn.setOnClickListener( this );
CryptpadBtn.setOnClickListener( this );
BinBtn.setOnClickListener( this );
UploadBtn.setOnClickListener( this );
SearxBtn.setOnClickListener( this );
PollsBtn.setOnClickListener( this );
BoardBtn.setOnClickListener( this );
CallsBtn.setOnClickListener( this );
NotesBtn.setOnClickListener( this );
GitBtn.setOnClickListener( this );
@ -347,18 +334,6 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
}
else startActivity(cloud);
break;
/*case R.id.DiasporaBtn: //end ofDisroot's Dandelion
Intent pod = getPackageManager().getLaunchIntentForPackage(Diaspora);
if(getPackageManager().getLaunchIntentForPackage(Diaspora) == null) {
showDiaDialog();
break;
}
else startActivity(pod);
break;*/
case R.id.ForumBtn:
webView.loadUrl(Constants.URL_DisApp_FORUM);
hideDashboard();
break;
case R.id.ChatBtn:
Intent xmpp1 = getPackageManager().getLaunchIntentForPackage(Constants.Conversations);
@ -395,8 +370,8 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
}
else startActivity(pad);
break;
case R.id.CalcBtn:
webView.loadUrl(Constants.URL_DisApp_CALC);
case R.id.CryptpadBtn:
webView.loadUrl(Constants.URL_DisApp_CRYPTPAD );
hideDashboard();
break;
case R.id.BinBtn:
@ -411,18 +386,10 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
webView.loadUrl(Constants.URL_DisApp_SEARX);
hideDashboard();
break;
case R.id.PollsBtn:
webView.loadUrl(Constants.URL_DisApp_POLL);
hideDashboard();
break;
case R.id.BoardBtn:
webView.loadUrl(Constants.URL_DisApp_BOARD);
hideDashboard();
break;
case R.id.CallsBtn:
Intent board = getPackageManager().getLaunchIntentForPackage(Constants.CallsApp);
if(board == null) {
showBoardDialog();
showCallsDialog();
break;
}
else startActivity(board);
@ -447,9 +414,15 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
webView.loadUrl(Constants.URL_DisApp_USER);
hideDashboard();
break;
// status service disabled
/*
case R.id.StateBtn:
Intent goState = new Intent(MainActivity.this, StateActivity.class);
MainActivity.this.startActivity(goState);
break;*/
case R.id.StateBtn:
webView.loadUrl(Constants.URL_DisApp_STATE);
hideDashboard();
break;
case R.id.HowToBtn:
webView.loadUrl(Constants.URL_DisApp_HOWTO);
@ -474,20 +447,14 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
case R.id.CloudBtn:
showCloudInfo();
break;
/*case R.id.DiasporaBtn://end of Disroot's Dandelion
showDiaInfo();
break;*/
case R.id.ForumBtn:
showForumInfo();
break;
case R.id.ChatBtn:
showChatInfo();
break;
case R.id.PadBtn:
showPadInfo();
break;
case R.id.CalcBtn:
showCalcInfo();
case R.id.CryptpadBtn:
showCryptpadInfo();
break;
case R.id.BinBtn:
showBinInfo();
@ -498,12 +465,6 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
case R.id.SearxBtn:
showSearxInfo();
break;
case R.id.PollsBtn:
showPollsInfo();
break;
case R.id.BoardBtn:
showBoardInfo();
break;
case R.id.CallsBtn:
showCallsInfo();
break;
@ -590,12 +551,14 @@ 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, new DialogInterface.OnClickListener() {
builder.setPositiveButton(R.string.global_ok,null);
// status service disabled
/*builder.setPositiveButton(R.string.global_ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
showOptimzation();
}
});
});*/
builder.show();
}
@ -712,66 +675,6 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
builder.show();
}
/*End of Disroot's Dandelion*
//Diaspora info
private void showDiaInfo() {
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setCancelable(false);
builder.setTitle(R.string.DiasporaTitle);
builder.setMessage(getString(R.string.DiasporaInfo));
builder.setPositiveButton(R.string.global_ok, null);
builder.setNegativeButton(R.string.tell_more, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
webView.loadUrl(Constants.URL_DisApp_DIAHELP);
hideDashboard();
}
});
builder.show();
}
private void showDiaDialog(){
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setCancelable(false);
builder.setTitle(R.string.DiaInstallTitle);
builder.setMessage(getString(R.string.DiasporaDialog));
builder.setPositiveButton(R.string.global_install, new DialogInterface.OnClickListener() {
Intent pod = getPackageManager().getLaunchIntentForPackage(Diaspora);
@Override
public void onClick(DialogInterface dialog, int which) {
pod = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + Diaspora));
startActivity(pod);
}
});
builder.setNegativeButton(R.string.global_cancel , null);
builder.show();
}*/
private void showForumInfo() {
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setCancelable(false);
builder.setTitle(R.string.ForumTitle);
builder.setMessage(forum + "\n\n"+ getString(R.string.ForumInfo));
builder.setPositiveButton(R.string.global_ok, null);
builder.setNegativeButton(R.string.more_help, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
webView.loadUrl(Constants.URL_DisApp_FORUMHELP);
hideDashboard();
}
});
builder.setNeutralButton( R.string.hide, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
ViewGroup viewGroup =((ViewGroup)findViewById( R.id.StateBtn ).getParent());
if (findViewById( R.id.ForumBtn).getParent()!=null){
viewGroup.removeView(ForumBtn);
BtnPreference.edit().putBoolean( "ForumBtn", false ).apply();
return;}
}
});
builder.show();
}
private void showForget() {
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setCancelable(false);
@ -888,16 +791,16 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
builder.show();
}
private void showCalcInfo() {
private void showCryptpadInfo() {
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setCancelable(false);
builder.setTitle(R.string.CalcTitle);
builder.setMessage(ethercalc +"\n\n"+ getString(R.string.CalcInfo));
builder.setTitle(R.string.CryptpadTitle );
builder.setMessage(cryptpad +"\n\n"+ getString(R.string.CryptpadInfo ));
builder.setPositiveButton(R.string.global_ok, null);
builder.setNegativeButton(R.string.more_help, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
webView.loadUrl(Constants.URL_DisApp_CALCHELP);
webView.loadUrl(Constants.URL_DisApp_CRYPTPADHELP );
hideDashboard();
}
});
@ -905,9 +808,9 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
@Override
public void onClick(DialogInterface dialog, int which) {
ViewGroup viewGroup =((ViewGroup)findViewById( R.id.StateBtn ).getParent());
if (findViewById( R.id.CalcBtn).getParent()!=null){
viewGroup.removeView(CalcBtn);
BtnPreference.edit().putBoolean( "CalcBtn", false ).apply();
if (findViewById( R.id.CryptpadBtn ).getParent()!=null){
viewGroup.removeView( CryptpadBtn );
BtnPreference.edit().putBoolean( "CryptpadBtn", false ).apply();
return;}
}
});
@ -993,58 +896,6 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
builder.show();
}
private void showPollsInfo() {
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setCancelable(false);
builder.setTitle(R.string.PollsTitle);
builder.setMessage(polls +"\n\n"+ getString(R.string.PollsInfo));
builder.setPositiveButton(R.string.global_ok, null);
builder.setNegativeButton(R.string.more_help, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
webView.loadUrl(Constants.URL_DisApp_POLLHELP);
hideDashboard();
}
});
builder.setNeutralButton( R.string.hide, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
ViewGroup viewGroup =((ViewGroup)findViewById( R.id.StateBtn ).getParent());
if (findViewById( R.id.PollsBtn).getParent()!=null){
viewGroup.removeView(PollsBtn);
BtnPreference.edit().putBoolean( "PollsBtn", false ).apply();
return;}
}
});
builder.show();
}
private void showBoardInfo() {
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setCancelable(false);
builder.setTitle(R.string.BoardTitle);
builder.setMessage(taiga +"\n\n"+ getString(R.string.BoardInfo));
builder.setPositiveButton(R.string.global_ok, null);
builder.setNegativeButton(R.string.more_help, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
webView.loadUrl(Constants.URL_DisApp_BOARDHELP);
hideDashboard();
}
});
builder.setNeutralButton( R.string.hide, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
ViewGroup viewGroup =((ViewGroup)findViewById( R.id.StateBtn ).getParent());
if (findViewById( R.id.BoardBtn).getParent()!=null){
viewGroup.removeView(BoardBtn);
BtnPreference.edit().putBoolean( "BoardBtn", false ).apply();
return;}
}
});
builder.show();
}
private void showCallsInfo() {
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setCancelable(false);
@ -1070,11 +921,11 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
});
builder.show();
}
private void showBoardDialog(){
private void showCallsDialog(){
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setCancelable(false);
builder.setTitle(R.string.DiaInstallTitle);
builder.setMessage(taiga +"\n\n"+ getString(R.string.CallsDialog));
builder.setMessage( jitsi +"\n\n"+ getString(R.string.CallsDialog));
builder.setPositiveButton(R.string.global_install, new DialogInterface.OnClickListener() {
Intent calls = getPackageManager().getLaunchIntentForPackage(Constants.CallsApp);
@Override
@ -1094,7 +945,7 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
builder.setTitle(R.string.NotesTitle);
builder.setMessage(notes +"\n\n"+ getString(R.string.NotesInfo));
builder.setPositiveButton(R.string.global_ok, null);
builder.setNegativeButton(R.string.tell_more, new DialogInterface.OnClickListener() {
builder.setNegativeButton(R.string.more_help, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
webView.loadUrl(Constants.URL_DisApp_NOTESHELP);
@ -1403,9 +1254,13 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
if (keyCode == KeyEvent.KEYCODE_BACK) {
if (disWebChromeClient.hideCustomView()) {
return true;
} else if (!disWebChromeClient.hideCustomView() && webView.canGoBack()) {
} if (!disWebChromeClient.hideCustomView() && webView.canGoBack()&&webView.copyBackForwardList().getCurrentIndex()>1){
Log.e(TAG, "CanGoBack" );
webView.goBack();
return true;
} else
{
webView.goBack();
}
}
return super.onKeyDown(keyCode, event);
@ -1484,9 +1339,11 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
webView.loadUrl(url);
return true;
}
case R.id.action_optimization:
//Status service disabled
/*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);
@ -1519,7 +1376,7 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
webView = findViewById(R.id.webView_content);
webView.setWebChromeClient(disWebChromeClient);
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setDomStorageEnabled(true);//solves taiga board \o<