Skip to content

Commit 05beb28

Browse files
committed
galaxy 9 support - rounded corners
1 parent 2176509 commit 05beb28

6 files changed

Lines changed: 17 additions & 1 deletion

File tree

android/res/layout/option_value.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
android:layout_centerVertical="true"
3939
/>
4040
<ImageView android:id="@+id/btn_option_add_info"
41+
android:layout_width="wrap_content"
42+
android:layout_height="wrap_content"
4143
android:layout_marginRight="2dip"
4244
android:layout_marginLeft="2dip"
4345
android:layout_gravity="center_vertical|right"

android/res/values-ru/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
<string name="options_page_margin_right">Правый отступ</string>
9393
<string name="options_page_margin_top">Верхний отступ</string>
9494
<string name="options_page_margin_bottom">Нижний отступ</string>
95+
<string name="options_rounded_corners_margin">Отступы в заголовке (для скругленных краев)</string>
9596
<string name="options_view_mode">Режим просмотра</string>
9697
<string name="options_view_mode_pages">Страницы</string>
9798
<string name="options_view_mode_scroll">Свиток</string>

android/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
<string name="options_page_margin_right">Right margin</string>
9898
<string name="options_page_margin_top">Top margin</string>
9999
<string name="options_page_margin_bottom">Bottom margin</string>
100+
<string name="options_rounded_corners_margin">Header margins (for rounded corners)</string>
100101
<string name="options_view_mode">View mode</string>
101102
<string name="options_view_mode_pages">Pages</string>
102103
<string name="options_view_mode_scroll">Scroll</string>

android/src/org/coolreader/crengine/BaseActivity.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1956,6 +1956,8 @@ public Properties loadSettings(BaseActivity activity, File file) {
19561956
props.applyDefault(ReaderView.PROP_PAGE_MARGIN_RIGHT, hmargin);
19571957
props.applyDefault(ReaderView.PROP_PAGE_MARGIN_TOP, vmargin);
19581958
props.applyDefault(ReaderView.PROP_PAGE_MARGIN_BOTTOM, vmargin);
1959+
1960+
props.applyDefault(ReaderView.PROP_ROUNDED_CORNERS_MARGIN, "0");
19591961

19601962
props.applyDefault(ReaderView.PROP_APP_SCREEN_UPDATE_MODE, "0");
19611963
props.applyDefault(ReaderView.PROP_APP_SCREEN_UPDATE_INTERVAL, "10");

android/src/org/coolreader/crengine/OptionsDialog.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@ public static int findBacklightSettingIndex( int value ) {
139139
int[] mMargins = new int[] {
140140
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 15, 20, 25, 30, 40, 50, 60, 80, 100, 130, 150, 200, 300
141141
};
142+
int[] mRoundedCornersMargins = new int[] {
143+
0, 5, 10, 15, 20, 30, 40, 50, 60, 70,80, 90, 100, 120, 140, 160
144+
};
142145
double[] mGammas = new double[] {
143146
0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.5, 1.9
144147
};
@@ -3184,7 +3187,12 @@ private void setupReaderOptions()
31843187
mOptionsPage.add(new ListOption(this, getString(R.string.options_page_margin_right), PROP_PAGE_MARGIN_RIGHT, getString(R.string.option_add_info_empty_text)).add(mMargins).setDefaultValue("5").setIconIdByAttr(R.attr.cr3_option_text_margin_right_drawable, R.drawable.cr3_option_text_margin_right));
31853188
mOptionsPage.add(new ListOption(this, getString(R.string.options_page_margin_top), PROP_PAGE_MARGIN_TOP, getString(R.string.option_add_info_empty_text)).add(mMargins).setDefaultValue("5").setIconIdByAttr(R.attr.cr3_option_text_margin_top_drawable, R.drawable.cr3_option_text_margin_top));
31863189
mOptionsPage.add(new ListOption(this, getString(R.string.options_page_margin_bottom), PROP_PAGE_MARGIN_BOTTOM, getString(R.string.option_add_info_empty_text)).add(mMargins).setDefaultValue("5").setIconIdByAttr(R.attr.cr3_option_text_margin_bottom_drawable, R.drawable.cr3_option_text_margin_bottom));
3187-
3190+
mOptionsPage.add(new ListOption(this, getString(R.string.options_rounded_corners_margin), PROP_ROUNDED_CORNERS_MARGIN,
3191+
getString(R.string.option_add_info_empty_text)).add(mRoundedCornersMargins).setDefaultValue("0"))
3192+
//.
3193+
//setIconIdByAttr(R.attr.cr3_option_text_margin_right_drawable, R.drawable.cr3_option_text_margin_right))
3194+
;
3195+
31883196
mOptionsControls = new OptionsListView(getContext());
31893197
mOptionsControls.add(new KeyMapOption(this, getString(R.string.options_app_key_actions), getString(R.string.option_add_info_empty_text)).setIconIdByAttr(R.attr.cr3_option_controls_keys_drawable, R.drawable.cr3_option_controls_keys));
31903198
mOptionsControls.add(new TapZoneOption(this, getString(R.string.options_app_tapzones_normal), PROP_APP_TAP_ZONE_ACTIONS_TAP, getString(R.string.option_add_info_empty_text)).setIconIdByAttr(R.attr.cr3_option_controls_tapzones_drawable, R.drawable.cr3_option_controls_tapzones));

android/src/org/coolreader/crengine/Settings.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ public interface Settings {
4141
public static final String PROP_PAGE_MARGIN_BOTTOM ="crengine.page.margin.bottom";
4242
public static final String PROP_PAGE_MARGIN_LEFT ="crengine.page.margin.left";
4343
public static final String PROP_PAGE_MARGIN_RIGHT ="crengine.page.margin.right";
44+
public static final String PROP_ROUNDED_CORNERS_MARGIN = "crengine.rounded.corners.margin";
45+
4446
public static final String PROP_PAGE_VIEW_MODE ="crengine.page.view.mode"; // pages/scroll
4547
public static final String PROP_PAGE_ANIMATION ="crengine.page.animation";
4648
public static final String PROP_INTERLINE_SPACE ="crengine.interline.space";

0 commit comments

Comments
 (0)