Search in sources :

Example 1 with CustomWebView

use of org.odk.collect.android.views.CustomWebView in project collect by opendatakit.

the class SelectImageMapWidget method createLayout.

private void createLayout() {
    readItems();
    webView = new CustomWebView(getContext());
    selectedAreasLabel = getAnswerTextView();
    answerLayout.addView(webView);
    answerLayout.addView(selectedAreasLabel);
    // add a space to facilitate scrolling
    int width = Math.round(getResources().getDisplayMetrics().widthPixels / getResources().getDisplayMetrics().density);
    // 5% of the screen
    int paddingInDp = width / 20;
    final float scale = getResources().getDisplayMetrics().density;
    int paddingInPx = (int) (paddingInDp * scale + 0.5f);
    answerLayout.setPadding(0, 0, paddingInPx, 0);
    addAnswerView(answerLayout);
    setUpWebView();
}
Also used : CustomWebView(org.odk.collect.android.views.CustomWebView) SuppressLint(android.annotation.SuppressLint)

Aggregations

SuppressLint (android.annotation.SuppressLint)1 CustomWebView (org.odk.collect.android.views.CustomWebView)1