Skip to content

Commit 4bf2db0

Browse files
committed
Hide soft keyboard when switching to preview tab
1 parent efeac65 commit 4bf2db0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

app/src/main/java/com/github/mobile/ui/comment/RenderedCommentFragment.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@
2525
import android.widget.ProgressBar;
2626
import android.widget.TextView;
2727

28-
import com.github.kevinsawicki.wishlist.ViewFinder;
28+
import com.github.kevinsawicki.wishlist.Keyboard;
2929
import com.github.kevinsawicki.wishlist.ViewUtils;
3030
import com.github.mobile.R.id;
3131
import com.github.mobile.R.layout;
3232
import com.github.mobile.R.string;
33+
import com.github.mobile.ui.DialogFragment;
3334
import com.github.mobile.ui.MarkdownLoader;
3435
import com.github.mobile.util.HttpImageGetter;
3536
import com.github.mobile.util.ToastUtils;
36-
import com.github.rtyley.android.sherlock.roboguice.fragment.RoboSherlockFragment;
3737

3838
import java.io.Serializable;
3939

@@ -42,7 +42,7 @@
4242
/**
4343
* Fragment to display rendered comment fragment
4444
*/
45-
public class RenderedCommentFragment extends RoboSherlockFragment implements
45+
public class RenderedCommentFragment extends DialogFragment implements
4646
LoaderCallbacks<CharSequence> {
4747

4848
private static final String ARG_TEXT = "text";
@@ -61,10 +61,10 @@ public void onActivityCreated(Bundle savedInstanceState) {
6161
imageGetter = new HttpImageGetter(getActivity());
6262
}
6363

64+
@Override
6465
public void onViewCreated(View view, Bundle savedInstanceState) {
6566
super.onViewCreated(view, savedInstanceState);
6667

67-
ViewFinder finder = new ViewFinder(view);
6868
progress = finder.find(id.pb_loading);
6969
bodyText = finder.find(id.tv_comment_body);
7070
}
@@ -81,6 +81,7 @@ public void setText(final String raw, final IRepositoryIdProvider repo) {
8181
if (repo instanceof Serializable)
8282
args.putSerializable(ARG_REPO, (Serializable) repo);
8383
getLoaderManager().restartLoader(0, args, this);
84+
Keyboard.hideSoftInput(bodyText);
8485
showLoading(true);
8586
}
8687

0 commit comments

Comments
 (0)