Crash fixes
This commit is contained in:
parent
1ac6a04a46
commit
159d91f390
|
@ -12,6 +12,7 @@ import android.media.ExifInterface;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.provider.OpenableColumns;
|
import android.provider.OpenableColumns;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import org.joinmastodon.android.MastodonApp;
|
import org.joinmastodon.android.MastodonApp;
|
||||||
import org.joinmastodon.android.ui.utils.UiUtils;
|
import org.joinmastodon.android.ui.utils.UiUtils;
|
||||||
|
@ -48,6 +49,8 @@ public class ResizedImageRequestBody extends CountingRequestBody{
|
||||||
}
|
}
|
||||||
contentType=MastodonApp.context.getContentResolver().getType(uri);
|
contentType=MastodonApp.context.getContentResolver().getType(uri);
|
||||||
}
|
}
|
||||||
|
if(TextUtils.isEmpty(contentType))
|
||||||
|
contentType="image/jpeg";
|
||||||
if(needResize(opts.outWidth, opts.outHeight) || needCrop(opts.outWidth, opts.outHeight)){
|
if(needResize(opts.outWidth, opts.outHeight) || needCrop(opts.outWidth, opts.outHeight)){
|
||||||
Bitmap bitmap;
|
Bitmap bitmap;
|
||||||
if(Build.VERSION.SDK_INT>=28){
|
if(Build.VERSION.SDK_INT>=28){
|
||||||
|
|
|
@ -91,6 +91,8 @@ public class SearchFragment extends BaseStatusListFragment<SearchResult>{
|
||||||
@Override
|
@Override
|
||||||
public void onItemClick(String id){
|
public void onItemClick(String id){
|
||||||
SearchResult res=getResultByID(id);
|
SearchResult res=getResultByID(id);
|
||||||
|
if(res==null)
|
||||||
|
return;
|
||||||
switch(res.type){
|
switch(res.type){
|
||||||
case ACCOUNT -> {
|
case ACCOUNT -> {
|
||||||
Bundle args=new Bundle();
|
Bundle args=new Bundle();
|
||||||
|
|
|
@ -200,7 +200,6 @@ public class SignupFragment extends AppKitFragment{
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Token result){
|
public void onSuccess(Token result){
|
||||||
progressDialog.dismiss();
|
progressDialog.dismiss();
|
||||||
progressDialog=null;
|
|
||||||
Account fakeAccount=new Account();
|
Account fakeAccount=new Account();
|
||||||
fakeAccount.acct=fakeAccount.username=username;
|
fakeAccount.acct=fakeAccount.username=username;
|
||||||
fakeAccount.id="tmp"+System.currentTimeMillis();
|
fakeAccount.id="tmp"+System.currentTimeMillis();
|
||||||
|
@ -238,7 +237,6 @@ public class SignupFragment extends AppKitFragment{
|
||||||
error.showToast(getActivity());
|
error.showToast(getActivity());
|
||||||
}
|
}
|
||||||
progressDialog.dismiss();
|
progressDialog.dismiss();
|
||||||
progressDialog=null;
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.exec(instance.uri, apiToken);
|
.exec(instance.uri, apiToken);
|
||||||
|
@ -255,9 +253,11 @@ public class SignupFragment extends AppKitFragment{
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showProgressDialog(){
|
private void showProgressDialog(){
|
||||||
progressDialog=new ProgressDialog(getActivity());
|
if(progressDialog==null){
|
||||||
progressDialog.setMessage(getString(R.string.loading));
|
progressDialog=new ProgressDialog(getActivity());
|
||||||
progressDialog.setCancelable(false);
|
progressDialog.setMessage(getString(R.string.loading));
|
||||||
|
progressDialog.setCancelable(false);
|
||||||
|
}
|
||||||
progressDialog.show();
|
progressDialog.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -280,7 +280,6 @@ public class SignupFragment extends AppKitFragment{
|
||||||
if(submitAfterGettingToken){
|
if(submitAfterGettingToken){
|
||||||
submitAfterGettingToken=false;
|
submitAfterGettingToken=false;
|
||||||
progressDialog.dismiss();
|
progressDialog.dismiss();
|
||||||
progressDialog=null;
|
|
||||||
error.showToast(getActivity());
|
error.showToast(getActivity());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -307,7 +306,6 @@ public class SignupFragment extends AppKitFragment{
|
||||||
if(submitAfterGettingToken){
|
if(submitAfterGettingToken){
|
||||||
submitAfterGettingToken=false;
|
submitAfterGettingToken=false;
|
||||||
progressDialog.dismiss();
|
progressDialog.dismiss();
|
||||||
progressDialog=null;
|
|
||||||
error.showToast(getActivity());
|
error.showToast(getActivity());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue