|
|
@ -33,6 +33,7 @@ import android.net.ConnectivityManager;
|
|
|
|
import android.net.Network;
|
|
|
|
import android.net.Network;
|
|
|
|
import android.net.NetworkCapabilities;
|
|
|
|
import android.net.NetworkCapabilities;
|
|
|
|
import android.net.NetworkRequest;
|
|
|
|
import android.net.NetworkRequest;
|
|
|
|
|
|
|
|
import android.net.Uri;
|
|
|
|
import android.os.Bundle;
|
|
|
|
import android.os.Bundle;
|
|
|
|
import android.os.Handler;
|
|
|
|
import android.os.Handler;
|
|
|
|
import android.os.Parcel;
|
|
|
|
import android.os.Parcel;
|
|
|
@ -53,6 +54,7 @@ import android.view.ViewGroup;
|
|
|
|
import android.view.animation.Animation;
|
|
|
|
import android.view.animation.Animation;
|
|
|
|
import android.view.animation.AnimationUtils;
|
|
|
|
import android.view.animation.AnimationUtils;
|
|
|
|
import android.widget.ArrayAdapter;
|
|
|
|
import android.widget.ArrayAdapter;
|
|
|
|
|
|
|
|
import android.widget.Button;
|
|
|
|
import android.widget.CheckBox;
|
|
|
|
import android.widget.CheckBox;
|
|
|
|
import android.widget.ImageButton;
|
|
|
|
import android.widget.ImageButton;
|
|
|
|
import android.widget.SeekBar;
|
|
|
|
import android.widget.SeekBar;
|
|
|
@ -83,6 +85,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
|
|
|
import androidx.recyclerview.widget.RecyclerView;
|
|
|
|
import androidx.recyclerview.widget.RecyclerView;
|
|
|
|
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
|
|
|
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.bugsnag.android.Bugsnag;
|
|
|
|
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
|
|
|
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
|
|
|
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
|
|
|
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
|
|
|
import com.google.android.material.snackbar.Snackbar;
|
|
|
|
import com.google.android.material.snackbar.Snackbar;
|
|
|
@ -1966,6 +1969,8 @@ public class FragmentMessages extends FragmentBase {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
checkReporting();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
@ -2029,6 +2034,67 @@ public class FragmentMessages extends FragmentBase {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void checkReporting() {
|
|
|
|
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
|
|
|
|
|
|
|
if (prefs.getBoolean("crash_reports", false) ||
|
|
|
|
|
|
|
|
prefs.getBoolean("crash_reports_asked", false))
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final Snackbar snackbar = Snackbar.make(view, R.string.title_ask_help, Snackbar.LENGTH_INDEFINITE);
|
|
|
|
|
|
|
|
snackbar.setAction(R.string.title_info, new View.OnClickListener() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
|
|
|
|
snackbar.dismiss();
|
|
|
|
|
|
|
|
askReporting();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
snackbar.show();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void askReporting() {
|
|
|
|
|
|
|
|
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final View dview = LayoutInflater.from(getContext()).inflate(R.layout.dialog_error_reporting, null);
|
|
|
|
|
|
|
|
final Button btnInfo = dview.findViewById(R.id.btnInfo);
|
|
|
|
|
|
|
|
final CheckBox cbNotAgain = dview.findViewById(R.id.cbNotAgain);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final Intent info = new Intent(Intent.ACTION_VIEW);
|
|
|
|
|
|
|
|
info.setData(Uri.parse(Helper.FAQ_URI + "#user-content-faq104"));
|
|
|
|
|
|
|
|
info.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
btnInfo.setVisibility(
|
|
|
|
|
|
|
|
info.resolveActivity(getContext().getPackageManager()) == null ? View.GONE : View.VISIBLE);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
btnInfo.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
|
|
|
|
startActivity(info);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
new DialogBuilderLifecycle(getContext(), getViewLifecycleOwner())
|
|
|
|
|
|
|
|
.setView(dview)
|
|
|
|
|
|
|
|
.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
|
|
|
|
|
prefs.edit().putBoolean("crash_reports", true).apply();
|
|
|
|
|
|
|
|
if (cbNotAgain.isChecked())
|
|
|
|
|
|
|
|
prefs.edit().putBoolean("crash_reports_asked", true).apply();
|
|
|
|
|
|
|
|
Bugsnag.startSession();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.setNegativeButton(android.R.string.no, new DialogInterface.OnClickListener() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
|
|
|
|
|
if (cbNotAgain.isChecked())
|
|
|
|
|
|
|
|
prefs.edit().putBoolean("crash_reports_asked", true).apply();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.show();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
|
|
|
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
|
|
|
inflater.inflate(R.menu.menu_messages, menu);
|
|
|
|
inflater.inflate(R.menu.menu_messages, menu);
|
|
|
|