Some code quality improvements

This commit is contained in:
Christian Basler 2016-12-06 06:40:58 +01:00
parent 0a8459750a
commit 6f26e84f71
2 changed files with 10 additions and 8 deletions

View File

@ -240,6 +240,7 @@ public class ComposeMessageFragment extends Fragment {
subjectInput.getText().toString(), subjectInput.getText().toString(),
bodyInput.getText().toString() bodyInput.getText().toString()
); );
break;
} }
bmc.send(builder.build()); bmc.send(builder.build());
getActivity().finish(); getActivity().finish();

View File

@ -16,9 +16,7 @@
package ch.dissem.apps.abit.dialog; package ch.dissem.apps.abit.dialog;
import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatDialogFragment; import android.support.v7.app.AppCompatDialogFragment;
@ -26,14 +24,12 @@ import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.RadioGroup; import android.widget.RadioGroup;
import android.widget.Toast;
import ch.dissem.apps.abit.ImportIdentityActivity; import org.slf4j.Logger;
import ch.dissem.apps.abit.MainActivity; import org.slf4j.LoggerFactory;
import ch.dissem.apps.abit.R; import ch.dissem.apps.abit.R;
import ch.dissem.bitmessage.entity.BitmessageAddress;
import ch.dissem.bitmessage.entity.Plaintext; import ch.dissem.bitmessage.entity.Plaintext;
import ch.dissem.bitmessage.entity.payload.Pubkey;
import static android.app.Activity.RESULT_OK; import static android.app.Activity.RESULT_OK;
import static ch.dissem.apps.abit.ComposeMessageActivity.EXTRA_ENCODING; import static ch.dissem.apps.abit.ComposeMessageActivity.EXTRA_ENCODING;
@ -45,6 +41,7 @@ import static ch.dissem.bitmessage.entity.Plaintext.Encoding.SIMPLE;
*/ */
public class SelectEncodingDialogFragment extends AppCompatDialogFragment { public class SelectEncodingDialogFragment extends AppCompatDialogFragment {
private static final Logger LOG = LoggerFactory.getLogger(SelectEncodingDialogFragment.class);
private Plaintext.Encoding encoding; private Plaintext.Encoding encoding;
@Nullable @Nullable
@ -67,6 +64,9 @@ public class SelectEncodingDialogFragment extends AppCompatDialogFragment {
case EXTENDED: case EXTENDED:
radioGroup.check(R.id.extended); radioGroup.check(R.id.extended);
break; break;
default:
LOG.warn("Unexpected encoding: " + encoding);
break;
} }
view.findViewById(R.id.ok).setOnClickListener(new View.OnClickListener() { view.findViewById(R.id.ok).setOnClickListener(new View.OnClickListener() {
@Override @Override
@ -76,9 +76,10 @@ public class SelectEncodingDialogFragment extends AppCompatDialogFragment {
encoding = EXTENDED; encoding = EXTENDED;
break; break;
case R.id.simple: case R.id.simple:
encoding = SIMPLE;
break; break;
default: default:
encoding = SIMPLE; dismiss();
return; return;
} }
Intent result = new Intent(); Intent result = new Intent();