app/src/main/java/fr/neamar/kiss/forwarder/Widgets.java
/**
     * Adds widget to Activity and persists it in prefs to be able to restore it
     *
     * @param data Intent holding widget id to add
     */
Adds widget to Activity and persists it in prefs to be able to restore it
@param data Intent holding widget id to add
Adds widget to Activity and persists it in prefs to be able to restore it @param data Intent holding widget id to add
private void addAppWidget(Intent data) {
        int appWidgetId = data.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, -1);
        AppWidgetProviderInfo appWidgetInfo = mAppWidgetManager.getAppWidgetInfo(appWidgetId);
        float minWidgetHeight = appWidgetInfo.minHeight;
        float lineHeight = getLineHeight();
        int lineSize = (int) Math.ceil(minWidgetHeight / lineHeight);
        AppWidgetHostView widget = getWidget(appWidgetId, lineSize);
        if (widget != null) {
            widgetArea.addView(widget, LinearLayout.LayoutParams.MATCH_PARENT, widget.getLayoutParams().height);
        }
        serializeState();
    }
private void addAppWidget ( Intent data ) { int appWidgetId = data . getIntExtra ( AppWidgetManager . EXTRA_APPWIDGET_ID , - 1 ) ; AppWidgetProviderInfo appWidgetInfo = mAppWidgetManager . getAppWidgetInfo ( appWidgetId ) ; float minWidgetHeight = appWidgetInfo . minHeight ; float lineHeight = getLineHeight ( ) ; int lineSize = ( int ) Math . ceil ( minWidgetHeight / lineHeight ) ; AppWidgetHostView widget = getWidget ( appWidgetId , lineSize ) ; if ( widget != null ) { widgetArea . addView ( widget , LinearLayout . LayoutParams . MATCH_PARENT , widget . getLayoutParams ( ) . height ) ; } serializeState ( ) ; }
Adds widget to Activity and persists it in prefs to be able to restore it
 @param data Intent holding widget id to add
Adds widget to Activity and persists it in prefs to be able to restore it @param data Intent holding widget id to add