Skip to content

Commit 7ae630a

Browse files
committed
Version 1.6.6: improvements to text drawing for icons and exports
Also added link to browser-based app preview
1 parent 5a7f07d commit 7ae630a

File tree

10 files changed

+36
-34
lines changed

10 files changed

+36
-34
lines changed

MediaPhone/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ android {
1010

1111
targetSdkVersion 29
1212
minSdkVersion 14
13-
versionCode 47
14-
versionName '1.6.5'
13+
versionCode 48
14+
versionName '1.6.6'
1515
// versionNameSuffix = '-beta-1'
1616
resConfigs 'en', 'es', 'fr', 'nl', 'pt', 'pl', 'ru'
1717
}
@@ -48,7 +48,7 @@ android {
4848
dependencies {
4949
implementation project(':MediaUtilities')
5050

51-
implementation 'com.google.android.material:material:1.2.1' // for overall UI appearance
51+
implementation 'com.google.android.material:material:1.3.0' // for overall UI appearance
5252
implementation 'androidx.exifinterface:exifinterface:1.3.2' // for auto-selection of export resolution
5353
implementation 'androidx.core:core:1.3.2' // for FileProvider
5454
implementation 'androidx.documentfile:documentfile:1.0.1' // for Storage Access Framework

MediaPhone/src/main/java/ac/robinson/mediaphone/MediaPhoneActivity.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,8 @@ protected void prepareMediaMenuNavigationButtons(Menu menu, String mediaId) {
492492
menu.findItem(R.id.menu_copy_media).setVisible(true);
493493
menu.findItem(R.id.menu_paste_media).setVisible(false);
494494
} else {
495-
SharedPreferences copyFrameSettings = getSharedPreferences(MediaPhone.APPLICATION_NAME, Context.MODE_PRIVATE);
495+
SharedPreferences copyFrameSettings = getSharedPreferences(MediaPhone.APPLICATION_NAME,
496+
Context.MODE_PRIVATE);
496497
String copiedFrameId = copyFrameSettings.getString(getString(R.string.key_copied_frame), null);
497498
menu.findItem(R.id.menu_copy_media).setVisible(false);
498499
menu.findItem(R.id.menu_paste_media).setVisible(!TextUtils.isEmpty(copiedFrameId));
@@ -1880,22 +1881,21 @@ public void onClick(DialogInterface dialog, int item) {
18801881
final Map<Integer, Object> settings = new Hashtable<>();
18811882
settings.put(MediaUtilities.KEY_AUDIO_RESOURCE_ID, R.raw.ic_audio_playback);
18821883

1883-
// some output settings (TODO: make sure HTML version respects these)
1884+
// configure output settings (TODO: make sure HTML version respects all of these)
18841885
settings.put(MediaUtilities.KEY_BACKGROUND_COLOUR, res.getColor(R.color.export_background));
18851886
settings.put(MediaUtilities.KEY_TEXT_COLOUR_NO_IMAGE, res.getColor(R.color.export_text_no_image));
18861887
settings.put(MediaUtilities.KEY_TEXT_COLOUR_WITH_IMAGE, res.getColor(R.color.export_text_with_image));
18871888
settings.put(MediaUtilities.KEY_TEXT_BACKGROUND_COLOUR, res.getColor(R.color.export_text_background));
1889+
18881890
// TODO: do we want to do getDimensionPixelSize for export?
1889-
settings.put(MediaUtilities.KEY_TEXT_SPACING, res.getDimensionPixelSize(R.dimen.export_icon_text_padding));
1890-
settings.put(MediaUtilities.KEY_TEXT_CORNER_RADIUS,
1891-
res.getDimensionPixelSize(R.dimen.export_icon_text_corner_radius));
18921891
settings.put(MediaUtilities.KEY_TEXT_BACKGROUND_SPAN_WIDTH,
18931892
Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB);
18941893
settings.put(MediaUtilities.KEY_MAX_TEXT_FONT_SIZE, res.getDimensionPixelSize(R.dimen.export_maximum_text_size));
1895-
settings.put(MediaUtilities.KEY_MAX_TEXT_CHARACTERS_PER_LINE,
1896-
res.getInteger(R.integer.export_maximum_text_characters_per_line));
1897-
settings.put(MediaUtilities.KEY_MAX_TEXT_HEIGHT_WITH_IMAGE,
1898-
res.getDimensionPixelSize(R.dimen.export_maximum_text_height_with_image));
1894+
settings.put(MediaUtilities.KEY_MAX_TEXT_PERCENTAGE_HEIGHT_WITH_IMAGE,
1895+
res.getInteger(R.integer.export_maximum_text_percentage_height_with_image));
1896+
settings.put(MediaUtilities.KEY_TEXT_SPACING, res.getDimensionPixelSize(R.dimen.export_icon_text_padding));
1897+
settings.put(MediaUtilities.KEY_TEXT_CORNER_RADIUS,
1898+
res.getDimensionPixelSize(R.dimen.export_icon_text_corner_radius));
18991899

19001900
if (contentList != null && contentList.size() > 0) {
19011901
switch (item) {
@@ -2955,7 +2955,7 @@ public void run() {
29552955
IOUtilities.getFileExtension(mediaFile.getName()));
29562956
IOUtilities.copyFile(mediaFile, outputFile);
29572957
MediaScannerConnection.scanFile(MediaPhoneActivity.this,
2958-
new String[]{ outputFile.getAbsolutePath() },
2958+
new String[]{ outputFile.getAbsolutePath() },
29592959
null, new MediaScannerConnection.OnScanCompletedListener() {
29602960
@Override
29612961
public void onScanCompleted(String path, Uri uri) {

MediaPhone/src/main/java/ac/robinson/mediaphone/provider/FrameItem.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,13 +291,12 @@ public Bitmap loadIcon(Resources res, ContentResolver contentResolver, BitmapUti
291291
int textBackgroundColour = imageLoaded ? res.getColor(R.color.frame_icon_text_background) : 0;
292292
float leftOffset = isFirstFrame ? indicatorWidth : 0;
293293
int maxTextHeight = (imageLoaded ?
294-
res.getDimensionPixelSize(R.dimen.frame_icon_maximum_text_height_with_image) - textPadding :
295-
bitmapHeight - textPadding);
294+
(bitmapHeight * res.getInteger(R.integer.frame_icon_maximum_text_percentage_height_with_image) / 100) :
295+
bitmapHeight);
296296
BitmapUtilities.drawScaledText(textString, frameBitmapCanvas, frameBitmapPaint, textColour, textBackgroundColour,
297297
textPadding, textCornerRadius, imageLoaded, leftOffset,
298298
Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB, maxTextHeight,
299-
res.getDimensionPixelSize(R.dimen.frame_icon_maximum_text_size),
300-
res.getInteger(R.integer.frame_icon_maximum_text_characters_per_line));
299+
res.getDimensionPixelSize(R.dimen.frame_icon_maximum_text_size));
301300

302301
// add border if there's no image (looks much tidier)
303302
if (!imageLoaded) {

MediaPhone/src/main/java/ac/robinson/mediaphone/provider/UpgradeManager.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,14 @@ public static void installHelperNarrative(Context context) {
236236
final int narrativeSequenceIdIncrement = res.getInteger(R.integer.frame_narrative_sequence_increment);
237237

238238
// add a narrative that gives a few tips on first use
239+
// note: \u00A0 (non-breaking space) is used to force spacing in the frame icon after improvements to text drawing which
240+
// mean the text maximum size/height is now properly used (rather than being overridden by the old maximum line width
241+
// parameter, which it turns out we unintentionally relied upon for the helper narrative's initial appearance)
239242
String[] mediaStrings = {
240-
context.getString(R.string.helper_narrative_frame_1, context.getString(R.string.app_name)),
243+
"\u00A0\n" + context.getString(R.string.helper_narrative_frame_1, context.getString(R.string.app_name)) +
244+
"\n\u00A0",
241245
context.getString(R.string.helper_narrative_frame_2),
242-
context.getString(R.string.helper_narrative_frame_3),
246+
"\u00A0\n" + context.getString(R.string.helper_narrative_frame_3),
243247
context.getString(R.string.helper_narrative_frame_4, context.getString(R.string.preferences_contact_us_title),
244248
context.getString(R.string.title_preferences))
245249
};
@@ -301,16 +305,18 @@ public static void installTimingEditorNarrative(Context context) {
301305
final String narrativeId = NarrativeItem.TIMING_EDITOR_NARRATIVE_ID;
302306
final int narrativeSequenceIdIncrement = res.getInteger(R.integer.frame_narrative_sequence_increment);
303307

304-
// add a narrative that gives instructions for using the timing editor
308+
// add a narrative that gives instructions for using the timing editor (\u00A0 used as above)
305309
String[] mediaStrings = {
306310
context.getString(R.string.timing_editor_narrative_frame_1),
307311
context.getString(R.string.timing_editor_narrative_frame_2, context.getString(R.string.timing_editor_ffwd_icon)),
308312
context.getString(R.string.timing_editor_narrative_frame_3, context.getString(R.string.timing_editor_rew_icon),
309313
context.getString(R.string.menu_edit_timing), context.getString(R.string.timing_editor_menu_icon),
310314
context.getString(R.string.timing_editor_record_icon_alternative)),
311315
context.getString(R.string.timing_editor_narrative_frame_4),
312-
context.getString(R.string.timing_editor_narrative_frame_5,
313-
context.getString(R.string.preferences_contact_us_title), context.getString(R.string.title_preferences)),
316+
"\u00A0\n" + context.getString(R.string.timing_editor_narrative_frame_5,
317+
context.getString(R.string.preferences_contact_us_title),
318+
context.getString(R.string.title_preferences)) +
319+
"\n\u00A0",
314320
};
315321

316322
for (int i = 0, n = mediaStrings.length; i < n; i++) {

MediaPhone/src/main/res/values/attrs.xml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,14 @@
2626
<dimen name="frame_icon_width">162dp</dimen>
2727
<dimen name="frame_icon_height">@dimen/frame_icon_width</dimen>
2828
<dimen name="frame_icon_progress_size">40dp</dimen>
29-
<dimen name="frame_icon_maximum_text_size">30sp</dimen>
30-
<dimen name="frame_icon_maximum_text_height_with_image">60dp</dimen>
29+
<dimen name="frame_icon_maximum_text_size">30sp</dimen><!-- note that this is converted to a pixel size before drawing -->
30+
<integer name="frame_icon_maximum_text_percentage_height_with_image">37</integer><!-- percentage of icon height -->
3131
<dimen name="frame_icon_indicator_maximum_text_size">30dp</dimen>
3232
<dimen name="frame_icon_border_width">2dp</dimen>
3333
<dimen name="frame_icon_selector_corner_radius">0dp</dimen>
3434
<dimen name="frame_icon_text_padding">6dp</dimen>
3535
<dimen name="frame_icon_text_corner_radius">0dp</dimen>
3636

37-
<integer name="frame_icon_maximum_text_characters_per_line">26</integer>
38-
3937
<item name="frame_icon_scale_factor" format="float" type="dimen">0.9</item>
4038
<item name="frame_icon_overlay_scale_factor" format="float" type="dimen">0.22</item>
4139
<item name="frame_icon_overlay_spacing_factor" format="float" type="dimen">0.02</item>
@@ -225,12 +223,10 @@
225223
<integer name="export_smil_player_bar_adjustment">16</integer>
226224
<integer name="export_html_width">@integer/export_smil_width</integer>
227225
<integer name="export_html_height">@integer/export_smil_height</integer>
228-
<integer name="export_maximum_text_characters_per_line">@integer/frame_icon_maximum_text_characters_per_line
229-
</integer>
230226

227+
<!-- TODO: make text size a configurable setting? Same for percentage of output height? -->
231228
<dimen name="export_maximum_text_size">@dimen/frame_icon_maximum_text_size</dimen>
232-
<!-- TODO: export_maximum_text_height_with_image doesn't currently work (not actually passed to video creators) -->
233-
<dimen name="export_maximum_text_height_with_image">@dimen/frame_icon_maximum_text_height_with_image</dimen>
229+
<integer name="export_maximum_text_percentage_height_with_image">24</integer><!-- percentage of output height -->
234230
<dimen name="export_icon_text_padding">@dimen/frame_icon_text_padding</dimen>
235231
<dimen name="export_icon_text_corner_radius">@dimen/frame_icon_text_corner_radius</dimen>
236232

MediaPhone/src/main/res/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@
203203
<string name="timing_editor_ffwd_icon" translatable="false">&#x25b8;&#x25b8;</string>
204204
<string name="timing_editor_menu_icon" translatable="false">&#x22ee;</string>
205205
<string name="timing_editor_record_icon_alternative" translatable="false">&#x1f534;</string>
206-
<string name="timing_editor_narrative_frame_1">Getting started:\ntiming editor tips\n\nLong press here to watch an introduction, then edit its timing to practice</string>
206+
<string name="timing_editor_narrative_frame_1">Getting started: timing editor\ntips\n\nLong press here to watch an introduction, then edit its timing to practice</string>
207207
<string name="timing_editor_narrative_frame_2">When editing, you record each frame\'s duration in live time\n\nAudio will play as normal, but images and text will be extended until you press %1$s to change frames</string>
208208
<string name="timing_editor_narrative_frame_3">If you make a mistake, press %1$s to go back. You can reset timings or cancel your changes anytime\n\nTry it now – select \"%2$s\" from the %3$s menu, then press %4$s to start</string>
209209
<string name="timing_editor_narrative_frame_4">Why not use the timing editor to set your own durations for photo captions?\n\nOr, use it with spanning media to match subtitles with background music</string>

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MediaPhone
22
==========
3-
MediaPhone is an Android storytelling and multimedia narrative application. You can find it on Google Play as [Com-Phone Story Maker](https://play.google.com/store/apps/details?id=ac.robinson.mediaphone). It is also available on [F-Droid](https://f-droid.org/packages/ac.robinson.mediaphone/), [Amazon](https://www.amazon.co.uk/dp/B00C2RMU0M/) and [App Bazaar](appbazaar://details?id=ac.robinson.mediaphone).
3+
MediaPhone is an Android storytelling and multimedia narrative application. You can find it on Google Play as [Com-Phone Story Maker](https://play.google.com/store/apps/details?id=ac.robinson.mediaphone). It is also available on [F-Droid](https://f-droid.org/packages/ac.robinson.mediaphone/), [Amazon](https://www.amazon.co.uk/dp/B00C2RMU0M/) and [App Bazaar](appbazaar://details?id=ac.robinson.mediaphone), or you can try a [preview in your browser](https://appetize.io/app/ytq8mk02pp86770jzdzzx7d1jw).
44

55
What does it do?
66
----------------

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
dependencies {
88
// distributionSha256Sum in gradle-wrapper.properties is also required for F-Droid (see distributionUrl version number)
99
// see: https://gradle.org/release-checksums/
10-
classpath 'com.android.tools.build:gradle:4.1.2'
10+
classpath 'com.android.tools.build:gradle:4.1.3'
1111
}
1212
}
1313

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Improved text appearance for frame icons and exported media

0 commit comments

Comments
 (0)