Skip to content

Commit

Permalink
Merge branch 'updatestuff' of https://github.com/fat-tire/haven into …
Browse files Browse the repository at this point in the history
…fat-tire-updatestuff
  • Loading branch information
n8fr8 committed Feb 5, 2019
2 parents d571e1d + df38846 commit 8147d78
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 47 deletions.
2 changes: 1 addition & 1 deletion _layouts/default.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="{{ site.lang | default: "en-US" }}">
<html lang="{{ site.lang | default: 'en-US' }}">
<head>
<meta charset="UTF-8">

Expand Down
12 changes: 6 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
classpath 'com.android.tools.build:gradle:3.5.0-alpha01'
}

}
Expand Down Expand Up @@ -110,14 +110,14 @@ android {
}

dependencies {
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.preference:preference:1.0.0'
implementation 'androidx.multidex:multidex:2.0.0'
implementation 'androidx.annotation:annotation:1.0.0'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.annotation:annotation:1.0.1'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.wdullaer:materialdatetimepicker:3.6.4'
implementation 'com.wdullaer:materialdatetimepicker:4.1.1'
implementation 'com.github.guardianproject:signal-cli-android:v0.6.0-android-beta-1'
implementation 'com.github.satyan:sugar:1.5'
implementation 'net.the4thdimension:audio-wife:1.0.3'
Expand All @@ -131,7 +131,7 @@ dependencies {
implementation 'com.github.derlio:audio-waveform:v1.0.1'
implementation 'org.firezenk:audiowaves:1.1@aar'
implementation 'com.maxproj.simplewaveform:app:1.0.0'
implementation 'com.googlecode.libphonenumber:libphonenumber:8.9.14'
implementation 'com.googlecode.libphonenumber:libphonenumber:8.10.3'
implementation('com.mikepenz:aboutlibraries:6.1.1@aar') {
transitive = true
}
Expand Down
5 changes: 2 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
android.enableR8=true

zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
10 changes: 5 additions & 5 deletions src/main/java/org/havenapp/main/MonitorActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
import android.widget.Button;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;

import com.wdullaer.materialdatetimepicker.time.TimePickerDialog;

import org.havenapp.main.service.MonitorService;
Expand All @@ -43,10 +47,6 @@
import java.io.FileOutputStream;
import java.io.IOException;

import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;

import static org.havenapp.main.Utils.getTimerText;

public class MonitorActivity extends AppCompatActivity implements TimePickerDialog.OnTimeSetListener {
Expand Down Expand Up @@ -351,7 +351,7 @@ private void showTimeDelayDialog() {

TimePickerDialog mTimePickerDialog = TimePickerDialog.newInstance(this, hours, minutes, seconds, true);
mTimePickerDialog.enableSeconds(true);
mTimePickerDialog.show(getFragmentManager(), "TimePickerDialog");
mTimePickerDialog.show(getSupportFragmentManager(), "TimePickerDialog");
}

@Override
Expand Down
44 changes: 22 additions & 22 deletions src/main/java/org/havenapp/main/SettingsFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@
import android.widget.Switch;
import android.widget.Toast;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import androidx.preference.EditTextPreference;
import androidx.preference.ListPreference;
import androidx.preference.Preference;
import androidx.preference.PreferenceFragmentCompat;
import androidx.preference.SwitchPreference;

import com.google.i18n.phonenumbers.PhoneNumberUtil;
import com.wdullaer.materialdatetimepicker.time.TimePickerDialog;

Expand All @@ -34,16 +44,6 @@
import java.io.File;
import java.util.Locale;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import androidx.preference.EditTextPreference;
import androidx.preference.ListPreference;
import androidx.preference.Preference;
import androidx.preference.PreferenceFragmentCompat;
import androidx.preference.SwitchPreference;
import androidx.preference.SwitchPreferenceCompat;
import info.guardianproject.netcipher.proxy.OrbotHelper;


Expand Down Expand Up @@ -86,7 +86,7 @@ public void onCreatePreferences(Bundle bundle, String s) {
}

if (preferences.getSmsActivation()) {
((SwitchPreferenceCompat) findPreference(PreferenceManager.SMS_ACTIVE)).setChecked(true);
((SwitchPreference) findPreference(PreferenceManager.SMS_ACTIVE)).setChecked(true);
}

findPreference(PreferenceManager.SMS_NUMBER).setOnPreferenceClickListener(preference -> {
Expand All @@ -110,7 +110,7 @@ public void onCreatePreferences(Bundle bundle, String s) {
}

if (preferences.getRemoteAccessActive()) {
((SwitchPreferenceCompat) findPreference(PreferenceManager.REMOTE_ACCESS_ACTIVE)).setChecked(true);
((SwitchPreference) findPreference(PreferenceManager.REMOTE_ACCESS_ACTIVE)).setChecked(true);
}

if (checkValidString(preferences.getRemoteAccessOnion())) {
Expand Down Expand Up @@ -141,7 +141,7 @@ public void onCreatePreferences(Bundle bundle, String s) {

if (preferences.getHeartbeatActive())
{
((SwitchPreferenceCompat) findPreference(PreferenceManager.HEARTBEAT_MONITOR_ACTIVE)).setChecked(true);
((SwitchPreference) findPreference(PreferenceManager.HEARTBEAT_MONITOR_ACTIVE)).setChecked(true);
if (preferences.getHeartbeatActive()) {
findPreference(PreferenceManager.HEARTBEAT_MONITOR_DELAY).setSummary(preferences.getHeartbeatNotificationTimeMs() / 60000 + " " + getString(R.string.minutes));
}
Expand Down Expand Up @@ -224,7 +224,7 @@ protected void save() {

preferences.setSignalUsername(((EditTextPreference) findPreference(PreferenceManager.REGISTER_SIGNAL)).getText());

boolean remoteAccessActive = ((SwitchPreferenceCompat) findPreference(PreferenceManager.REMOTE_ACCESS_ACTIVE)).isChecked();
boolean remoteAccessActive = ((SwitchPreference) findPreference(PreferenceManager.REMOTE_ACCESS_ACTIVE)).isChecked();

preferences.activateRemoteAccess(remoteAccessActive);
String password = ((EditTextPreference) findPreference(PreferenceManager.REMOTE_ACCESS_CRED)).getText();
Expand All @@ -237,7 +237,7 @@ protected void save() {

preferences.setVoiceVerification(false);

boolean heartbeatMonitorActive = ((SwitchPreferenceCompat) findPreference(PreferenceManager.HEARTBEAT_MONITOR_ACTIVE)).isChecked();
boolean heartbeatMonitorActive = ((SwitchPreference) findPreference(PreferenceManager.HEARTBEAT_MONITOR_ACTIVE)).isChecked();

preferences.activateHeartbeat(heartbeatMonitorActive);

Expand Down Expand Up @@ -319,7 +319,7 @@ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, Strin
setPhoneNumber();
break;
case PreferenceManager.REMOTE_ACCESS_ACTIVE:
boolean remoteAccessActive = ((SwitchPreferenceCompat) findPreference(PreferenceManager.REMOTE_ACCESS_ACTIVE)).isChecked();
boolean remoteAccessActive = ((SwitchPreference) findPreference(PreferenceManager.REMOTE_ACCESS_ACTIVE)).isChecked();
if (remoteAccessActive) {
checkRemoteAccessOnion();
app.startServer();
Expand Down Expand Up @@ -349,7 +349,7 @@ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, Strin
break;
}
case PreferenceManager.SMS_NUMBER:
boolean smsActive = ((SwitchPreferenceCompat) findPreference(PreferenceManager.SMS_ACTIVE)).isChecked();
boolean smsActive = ((SwitchPreference) findPreference(PreferenceManager.SMS_ACTIVE)).isChecked();
if (smsActive && TextUtils.isEmpty(preferences.getSignalUsername())) {
askForPermission(Manifest.permission.SEND_SMS, 6);
askForPermission(Manifest.permission.READ_PHONE_STATE, 6);
Expand Down Expand Up @@ -395,7 +395,7 @@ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, Strin
}
case PreferenceManager.HEARTBEAT_MONITOR_ACTIVE: {
boolean isMonitoring = preferences.getHeartbeatActive();
boolean hbSwitchOn = ((SwitchPreferenceCompat) findPreference(PreferenceManager.HEARTBEAT_MONITOR_ACTIVE)).isChecked();
boolean hbSwitchOn = ((SwitchPreference) findPreference(PreferenceManager.HEARTBEAT_MONITOR_ACTIVE)).isChecked();
if (!isMonitoring && hbSwitchOn) {
preferences.activateHeartbeat(true);
findPreference(PreferenceManager.HEARTBEAT_MONITOR_DELAY).setSummary(preferences.getHeartbeatNotificationTimeMs() / 60000 + " " + getString(R.string.minutes));
Expand Down Expand Up @@ -423,7 +423,7 @@ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, Strin
preferences.setHeartbeatMonitorNotifications(notificationTimeMs);
findPreference(PreferenceManager.HEARTBEAT_MONITOR_DELAY).setSummary(preferences.getHeartbeatNotificationTimeMs() / 60000 + " " + getString(R.string.minutes));

boolean heartbeatActive = ((SwitchPreferenceCompat) findPreference(PreferenceManager.HEARTBEAT_MONITOR_ACTIVE)).isChecked();
boolean heartbeatActive = ((SwitchPreference) findPreference(PreferenceManager.HEARTBEAT_MONITOR_ACTIVE)).isChecked();
if (heartbeatActive && preferences.getMonitorServiceActive()) {
SignalSender sender = SignalSender.getInstance(getActivity(), preferences.getSignalUsername());
sender.stopHeartbeatTimer();
Expand Down Expand Up @@ -452,7 +452,7 @@ private void setDefaultStoragePath () {
}

private void setPhoneNumber() {
boolean smsActive = ((SwitchPreferenceCompat) findPreference(PreferenceManager.SMS_ACTIVE)).isChecked();
boolean smsActive = ((SwitchPreference) findPreference(PreferenceManager.SMS_ACTIVE)).isChecked();
String phoneNumber = ((EditTextPreference) findPreference(PreferenceManager.SMS_NUMBER)).getText();
if (smsActive && checkValidString(phoneNumber)) {
preferences.activateSms(true);
Expand Down Expand Up @@ -484,9 +484,9 @@ private void showTimeDelayDialog(String configVideoLength) {
TimePickerDialog mTimePickerDialog = TimePickerDialog.newInstance(this, hours, minutes, seconds, true);
mTimePickerDialog.enableSeconds(true);
if (configVideoLength.equalsIgnoreCase(PreferenceManager.CONFIG_TIME_DELAY)) {
mTimePickerDialog.show(mActivity.getFragmentManager(), "TimeDelayPickerDialog");
mTimePickerDialog.show(getFragmentManager(), "TimeDelayPickerDialog");
} else {
mTimePickerDialog.show(mActivity.getFragmentManager(), "VideoLengthPickerDialog");
mTimePickerDialog.show(getFragmentManager(), "VideoLengthPickerDialog");
}
}

Expand Down
7 changes: 3 additions & 4 deletions src/main/java/org/havenapp/main/service/MonitorService.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import android.telephony.SmsManager;
import android.text.TextUtils;

import androidx.core.app.NotificationCompat;

import org.havenapp.main.HavenApp;
import org.havenapp.main.MonitorActivity;
import org.havenapp.main.PreferenceManager;
Expand All @@ -42,8 +44,6 @@
import java.util.Date;
import java.util.StringTokenizer;

import androidx.core.app.NotificationCompat;

@SuppressLint("HandlerLeak")
public class MonitorService extends Service {

Expand Down Expand Up @@ -181,8 +181,7 @@ public IBinder onBind(Intent intent) {
/**
* Show a notification while this service is running.
*/
@SuppressWarnings("deprecation")
private void showNotification() {
private void showNotification() {

Intent toLaunch = new Intent(getApplicationContext(),
MonitorActivity.class);
Expand Down
2 changes: 1 addition & 1 deletion src/main/res/layout/activity_event.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:listitem="@layout/item_event"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"/>

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab"
Expand Down
4 changes: 2 additions & 2 deletions src/main/res/layout/activity_list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"
tools:listitem="@layout/item_event" />

<ImageView
android:id="@+id/empty_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/empty_prompt"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"/>

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab"
Expand Down
6 changes: 3 additions & 3 deletions src/main/res/xml/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
</PreferenceCategory>
<PreferenceCategory android:title="@string/label_notifications">

<SwitchPreferenceCompat
<SwitchPreference
android:defaultValue="true"
android:key="sms_active"
android:title="@string/sms_label" />
Expand Down Expand Up @@ -101,7 +101,7 @@
</PreferenceCategory>
<PreferenceCategory android:title="@string/hearbeat_monitor">

<SwitchPreferenceCompat
<SwitchPreference
android:defaultValue="false"
android:key="heartbeat_monitor_active"
android:title="@string/hearbeat_monitor_enable" />
Expand All @@ -118,7 +118,7 @@
</PreferenceCategory>
<PreferenceCategory android:title="@string/remote_access">

<SwitchPreferenceCompat
<SwitchPreference
android:defaultValue="false"
android:key="remote_access_active"
android:summary="@string/remote_access_label"
Expand Down

0 comments on commit 8147d78

Please sign in to comment.