File tree Expand file tree Collapse file tree
source-code/app/src/main/java/org/buildmlearn/toolkit Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3737import org .buildmlearn .toolkit .model .TemplateInterface ;
3838import org .buildmlearn .toolkit .simulator .Simulator ;
3939import org .buildmlearn .toolkit .utilities .FileUtils ;
40+ import org .buildmlearn .toolkit .utilities .KeyboardHelper ;
4041import org .buildmlearn .toolkit .utilities .SignerThread ;
4142import org .w3c .dom .Attr ;
4243import org .w3c .dom .Document ;
@@ -84,6 +85,9 @@ protected void onCreate(Bundle savedInstanceState) {
8485 super .onCreate (savedInstanceState );
8586 oldFileName = null ;
8687 setContentView (R .layout .activity_template_editor );
88+ KeyboardHelper .hideKeyboard (this , findViewById (R .id .toolbar ));
89+ KeyboardHelper .hideKeyboard (this ,findViewById (R .id .template_editor_listview ));
90+ KeyboardHelper .hideKeyboard (this ,findViewById (R .id .empty ));
8791 setSupportActionBar ((Toolbar ) findViewById (R .id .toolbar ));
8892 toolkit = (ToolkitApplication ) getApplicationContext ();
8993 templateId = getIntent ().getIntExtra (Constants .TEMPLATE_ID , -1 );
Original file line number Diff line number Diff line change 1+ package org .buildmlearn .toolkit .utilities ;
2+
3+ import android .app .Activity ;
4+ import android .view .MotionEvent ;
5+ import android .view .View ;
6+ import android .view .inputmethod .InputMethodManager ;
7+
8+ /**
9+ * User : opticod(Anupam Das)
10+ * Date : 24/2/16.
11+ */
12+ public class KeyboardHelper {
13+ public static void hideKeyboard (final Activity activity , View view ) {
14+ view .setOnTouchListener (new View .OnTouchListener () {
15+ @ Override
16+ public boolean onTouch (View v , MotionEvent event ) {
17+ View view = activity .getCurrentFocus ();
18+ if (view != null ) {
19+ InputMethodManager inputMethodManager = (InputMethodManager ) activity .getSystemService (Activity .INPUT_METHOD_SERVICE );
20+ inputMethodManager .hideSoftInputFromWindow (view .getWindowToken (), 0 );
21+ }
22+ return false ;
23+ }
24+ });
25+ }
26+ }
27+
You can’t perform that action at this time.
0 commit comments