1
0
mirror of https://github.com/tateisu/SubwayTooter synced 2025-01-11 00:44:03 +01:00

refactor and add workaround for crash report

This commit is contained in:
tateisu 2020-07-23 03:25:12 +09:00
parent 90f08df268
commit 54f851cca1
2 changed files with 10 additions and 6 deletions

View File

@ -533,7 +533,7 @@ class ActPost : AsyncActivity(),
}
} else {
when(requestCode) {
REQUEST_CODE_CUSTOM_THUMBNAIL -> checkCustomThumbnail(
REQUEST_CODE_CUSTOM_THUMBNAIL -> uploadCustomThumbnail(
data?.handleGetContentResult(
contentResolver
)
@ -1770,7 +1770,7 @@ class ActPost : AsyncActivity(),
private var lastPostAttachment : PostAttachment? = null
private fun checkCustomThumbnail(srcList : ArrayList<GetContentResultEntry>?) {
private fun uploadCustomThumbnail(srcList : ArrayList<GetContentResultEntry>?) {
val src = srcList?.elementAtOrNull(0) ?: return
val account = this@ActPost.account

View File

@ -343,10 +343,14 @@ public class ColorPickerDialog extends DialogFragment implements OnTouchListener
@Override public void afterTextChanged(Editable s) {
if (hexEditText.isFocused()) {
int color = parseColorString(s.toString());
if (color != colorPicker.getColor()) {
fromEditText = true;
colorPicker.setColor(color, true);
try{
int color = parseColorString( s.toString() );
if (color != colorPicker.getColor()) {
fromEditText = true;
colorPicker.setColor(color, true);
}
}catch( NumberFormatException ex ){
// nothing to do
}
}
}