Skip to content

Commit

Permalink
Add a place to facilitate scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
grzesiek2010 committed Jan 26, 2018
1 parent 75b06d6 commit 06097d4
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,15 @@ private void setUpLayout() {
selectedAreasLabel = getAnswerTextView();
answerLayout.addView(webView);
answerLayout.addView(selectedAreasLabel);
addAnswerView(answerLayout);

// add a place to facilitate scrolling
int width = Math.round(getResources().getDisplayMetrics().widthPixels / getResources().getDisplayMetrics().density);
int paddingInDp = width / 20; // 5% of the screen
final float scale = getResources().getDisplayMetrics().density;
int paddingInPx = (int) (paddingInDp * scale + 0.5f);
answerLayout.setPadding(0, 0, paddingInPx, 0);

addAnswerView(answerLayout);
setUpWebView();
}

Expand Down

0 comments on commit 06097d4

Please sign in to comment.