Fix crashes
This commit is contained in:
parent
dc11f3cdf1
commit
9b2f50d726
|
@ -10,7 +10,7 @@ android {
|
|||
applicationId "org.joinmastodon.android"
|
||||
minSdk 23
|
||||
targetSdk 31
|
||||
versionCode 22
|
||||
versionCode 23
|
||||
versionName "0.1"
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ import java.lang.reflect.InvocationTargetException;
|
|||
|
||||
import me.grishka.appkit.imageloader.ImageCache;
|
||||
import me.grishka.appkit.utils.NetworkUtils;
|
||||
import me.grishka.appkit.utils.V;
|
||||
|
||||
public class MastodonApp extends Application{
|
||||
|
||||
|
@ -19,12 +20,13 @@ public class MastodonApp extends Application{
|
|||
@Override
|
||||
public void onCreate(){
|
||||
super.onCreate();
|
||||
context=getApplicationContext();
|
||||
V.setApplicationContext(context);
|
||||
ImageCache.Parameters params=new ImageCache.Parameters();
|
||||
params.diskCacheSize=100*1024*1024;
|
||||
params.maxMemoryCacheSize=Integer.MAX_VALUE;
|
||||
ImageCache.setParams(params);
|
||||
NetworkUtils.setUserAgent("MastodonAndroid/"+BuildConfig.VERSION_NAME);
|
||||
context=getApplicationContext();
|
||||
|
||||
PushSubscriptionManager.tryRegisterFCM();
|
||||
GlobalUserPreferences.load();
|
||||
|
|
|
@ -109,7 +109,7 @@ public class ComposeFragment extends ToolbarFragment implements OnBackPressedLis
|
|||
private static final Pattern MENTION_PATTERN=Pattern.compile("(^|[^\\/\\w])@(([a-z0-9_]+)@[a-z0-9\\.\\-]+[a-z0-9]+)", Pattern.CASE_INSENSITIVE);
|
||||
|
||||
// from https://github.com/mastodon/mastodon-ios/blob/main/Mastodon/Helper/MastodonRegex.swift
|
||||
private static final Pattern AUTO_COMPLETE_PATTERN=Pattern.compile("(?<!\\w)(?:@([a-zA-Z0-9_]+)(@[a-zA-Z0-9_.-]+)?|#([^\\s.]+))|(^\\B:|\\s:)([a-zA-Z0-9_]+)");
|
||||
private static final Pattern AUTO_COMPLETE_PATTERN=Pattern.compile("(?<!\\w)(?:@([a-zA-Z0-9_]+)(@[a-zA-Z0-9_.-]+)?|#([^\\s.]+)|:([a-zA-Z0-9_]+))");
|
||||
private static final Pattern HIGHLIGHT_PATTERN=Pattern.compile("(?<!\\w)(?:@([a-zA-Z0-9_]+)(@[a-zA-Z0-9_.-]+)?|#([^\\s.]+))");
|
||||
|
||||
private static final String VALID_URL_PATTERN_STRING =
|
||||
|
|
|
@ -375,6 +375,8 @@ public class ComposeAutocompleteViewController{
|
|||
|
||||
@Override
|
||||
public ImageLoaderRequest getImageRequest(int position, int image){
|
||||
if(position>=emojis.size())
|
||||
return null;
|
||||
return emojis.get(position).request;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue