blob: 8b8261e3516e8dab5da9dadd8f47ce695a5aa4a7 [file] [log] [blame]
Luke Songedc6b522017-06-12 16:08:33 -07001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include "vr_ui.h"
18
19#include <minui/minui.h>
20
Luke Songc3928882017-06-23 14:33:46 -070021VrRecoveryUI::VrRecoveryUI() : kStereoOffset(RECOVERY_UI_VR_STEREO_OFFSET) {}
Luke Songedc6b522017-06-12 16:08:33 -070022
23bool VrRecoveryUI::InitTextParams() {
Luke Songc3928882017-06-23 14:33:46 -070024 if (!ScreenRecoveryUI::InitTextParams()) return false;
Luke Songedc6b522017-06-12 16:08:33 -070025 int mid_divide = gr_fb_width() / 2;
Luke Songc3928882017-06-23 14:33:46 -070026 text_cols_ = (mid_divide - kMarginWidth - kStereoOffset) / char_width_;
Luke Songedc6b522017-06-12 16:08:33 -070027 return true;
28}
29
Luke Songedc6b522017-06-12 16:08:33 -070030void VrRecoveryUI::DrawTextLine(int x, int* y, const char* line, bool bold) const {
31 int mid_divide = gr_fb_width() / 2;
Luke Songc3928882017-06-23 14:33:46 -070032 gr_text(gr_sys_font(), x + kStereoOffset, *y, line, bold);
33 gr_text(gr_sys_font(), x - kStereoOffset + mid_divide, *y, line, bold);
Luke Songedc6b522017-06-12 16:08:33 -070034 *y += char_height_ + 4;
35}