src/main/java/de/blau/android/propertyeditor/AlternativePresetItemsFragment.java
/**
     * Actually create the view
     * 
     * @param inflater layout inflater
     * @param savedInstanceState saved state or null
     * @return the View
     */
Actually create the view

@param inflater layout inflater
@param savedInstanceState saved state or null
@return the View
Actually create the view @param inflater layout inflater @param savedInstanceState saved state or null @return the View
@Nullable
    private LinearLayout createView(@NonNull LayoutInflater inflater, @Nullable Bundle savedInstanceState) {
        LinearLayout presetsLayout = (LinearLayout) inflater.inflate(R.layout.recentpresets_view, null);
        PresetElementPath presetElementPath = null;
        if (savedInstanceState != null) {
            presetElementPath = (PresetElementPath) savedInstanceState.getSerializable(ITEM_PATH_KEY);
        } else {
            presetElementPath = (PresetElementPath) getArguments().getSerializable(ITEM_PATH_KEY);
        }
        PresetElement presetItem = Preset.getElementByPath(App.getCurrentRootPreset(getContext()).getRootGroup(), presetElementPath,
                propertyEditorListener.getCountryIsoCode(), false);
        if (!(presetItem instanceof PresetItem)) {
            Log.e(DEBUG_TAG, "no PresetItem found for " + presetElementPath);
            return null;
        }
        View v = getAlternativesView(presetsLayout, (PresetItem) presetItem);
        presetsLayout.addView(v);
        presetsLayout.setVisibility(View.VISIBLE);
        return presetsLayout;
    }
@ Nullable private LinearLayout createView ( @ NonNull LayoutInflater inflater , @ Nullable Bundle savedInstanceState ) { LinearLayout presetsLayout = ( LinearLayout ) inflater . inflate ( R . layout . recentpresets_view , null ) ; PresetElementPath presetElementPath = null ; if ( savedInstanceState != null ) { presetElementPath = ( PresetElementPath ) savedInstanceState . getSerializable ( ITEM_PATH_KEY ) ; } else { presetElementPath = ( PresetElementPath ) getArguments ( ) . getSerializable ( ITEM_PATH_KEY ) ; } PresetElement presetItem = Preset . getElementByPath ( App . getCurrentRootPreset ( getContext ( ) ) . getRootGroup ( ) , presetElementPath , propertyEditorListener . getCountryIsoCode ( ) , false ) ; if ( ! ( presetItem instanceof PresetItem ) ) { Log . e ( DEBUG_TAG , "no PresetItem found for " + presetElementPath ) ; return null ; } View v = getAlternativesView ( presetsLayout , ( PresetItem ) presetItem ) ; presetsLayout . addView ( v ) ; presetsLayout . setVisibility ( View . VISIBLE ) ; return presetsLayout ; }
Actually create the view
Actually create the view