src/main/java/de/blau/android/propertyeditor/tagform/TagFormFragment.java
/**
     * Focus on the value field of a tag with key "key"
     * 
     * @param key the key value we want to focus on
     * @return true if the key was found
     */
Focus on the value field of a tag with key "key"

@param key the key value we want to focus on
@return true if the key was found
Focus on the value field of a tag with key " key " @param key the key value we want to focus on @return true if the key was found
public boolean focusOnTag(String key) {
        boolean found = false;
        View sv = getView();
        LinearLayout ll = (LinearLayout) sv.findViewById(R.id.form_container_layout);
        if (ll != null) {
            int pos = 0;
            while (ll.getChildAt(pos) instanceof EditableLayout && pos < ll.getChildCount() && !found) {
                EditableLayout ll2 = (EditableLayout) ll.getChildAt(pos);
                Log.d(DEBUG_TAG, "focusOnTag key " + key);
                for (int i = ll2.getChildCount() - 1; i >= 0; --i) {
                    View v = ll2.getChildAt(i);
                    if (v instanceof TextRow && ((TextRow) v).getKey().equals(key)) {
                        Util.scrollToRow(sv, v, true, true);
                        ((TextRow) v).getValueView().requestFocus();
                        found = true;
                        break;
                    } else if (v instanceof DialogRow && ((DialogRow) v).getKey().equals(key)) {
                        Util.scrollToRow(sv, v, true, true);
                        ((DialogRow) v).click();
                        found = true;
                        break;
                    }
                }
                pos++;
            }
        } else {
            Log.d(DEBUG_TAG, "focusOnTag container layout null");
            return false;
        }
        return found;
    }
public boolean focusOnTag ( String key ) { boolean found = false ; View sv = getView ( ) ; LinearLayout ll = ( LinearLayout ) sv . findViewById ( R . id . form_container_layout ) ; if ( ll != null ) { int pos = 0 ; while ( ll . getChildAt ( pos ) instanceof EditableLayout && pos < ll . getChildCount ( ) && ! found ) { EditableLayout ll2 = ( EditableLayout ) ll . getChildAt ( pos ) ; Log . d ( DEBUG_TAG , "focusOnTag key " + key ) ; for ( int i = ll2 . getChildCount ( ) - 1 ; i >= 0 ; -- i ) { View v = ll2 . getChildAt ( i ) ; if ( v instanceof TextRow && ( ( TextRow ) v ) . getKey ( ) . equals ( key ) ) { Util . scrollToRow ( sv , v , true , true ) ; ( ( TextRow ) v ) . getValueView ( ) . requestFocus ( ) ; found = true ; break ; } else if ( v instanceof DialogRow && ( ( DialogRow ) v ) . getKey ( ) . equals ( key ) ) { Util . scrollToRow ( sv , v , true , true ) ; ( ( DialogRow ) v ) . click ( ) ; found = true ; break ; } } pos ++ ; } } else { Log . d ( DEBUG_TAG , "focusOnTag container layout null" ) ; return false ; } return found ; }
Focus on the value field of a tag with key "key"
Focus on the value field of a tag with key " key "