Fix issue #429
This commit is contained in:
parent
da5ff2320d
commit
95f0db6413
|
@ -40,6 +40,7 @@ import android.text.style.QuoteSpan;
|
|||
import android.text.style.URLSpan;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.webkit.URLUtil;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
@ -446,7 +447,7 @@ public class SpannableHelper {
|
|||
|
||||
for (Map.Entry<String, String> entry : urlDetails.entrySet()) {
|
||||
String value = entry.getValue();
|
||||
if (value.startsWith("@") || value.startsWith("#")) {
|
||||
if (value.startsWith("@") || value.startsWith("#") || !URLUtil.isValidUrl(value)) {
|
||||
continue;
|
||||
}
|
||||
SpannableString contentUrl;
|
||||
|
|
|
@ -19,8 +19,6 @@ import android.content.Context;
|
|||
import android.content.SharedPreferences;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.service.notification.StatusBarNotification;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
|
@ -44,11 +42,8 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||
|
||||
import app.fedilab.android.BaseMainActivity;
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.activities.MainActivity;
|
||||
import app.fedilab.android.client.entities.app.StatusCache;
|
||||
import app.fedilab.android.databinding.FragmentNotificationContainerBinding;
|
||||
import app.fedilab.android.databinding.PopupNotificationSettingsBinding;
|
||||
import app.fedilab.android.exception.DBException;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.helper.ThemeHelper;
|
||||
import app.fedilab.android.ui.pageadapter.FedilabNotificationPageAdapter;
|
||||
|
@ -98,18 +93,6 @@ public class FragmentNotificationContainer extends Fragment {
|
|||
|
||||
DrawableCompat.setTintList(DrawableCompat.wrap(dialogView.displayAllCategories.getThumbDrawable()), ThemeHelper.getSwitchCompatThumbDrawable(requireActivity()));
|
||||
DrawableCompat.setTintList(DrawableCompat.wrap(dialogView.displayAllCategories.getTrackDrawable()), ThemeHelper.getSwitchCompatTrackDrawable(requireActivity()));
|
||||
//Clear notifications from cache
|
||||
dialogView.clearNotificationCache.setOnClickListener(v2 -> new Thread(() -> {
|
||||
try {
|
||||
new StatusCache(requireActivity()).deleteNotifications(MainActivity.currentUserID, MainActivity.currentInstance);
|
||||
Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||
changes.set(true);
|
||||
Runnable myRunnable = () -> Toasty.info(requireActivity(), getString(R.string.notification_remove_from_cache), Toasty.LENGTH_SHORT).show();
|
||||
mainHandler.post(myRunnable);
|
||||
} catch (DBException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}).start());
|
||||
dialogView.clearAllNotif.setOnClickListener(v1 -> {
|
||||
AlertDialog.Builder db = new AlertDialog.Builder(requireActivity(), Helper.dialogStyle());
|
||||
db.setTitle(R.string.delete_notification_ask_all);
|
||||
|
|
|
@ -105,21 +105,6 @@
|
|||
</com.google.android.material.button.MaterialButtonToggleGroup>
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/clear_notification_cache"
|
||||
style="@style/MyOutlinedButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:paddingTop="3dp"
|
||||
android:paddingBottom="3dp"
|
||||
android:text="@string/clear_cache"
|
||||
android:textAlignment="textStart"
|
||||
app:icon="@drawable/ic_baseline_cached_24"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/more"
|
||||
|
|
Loading…
Reference in New Issue