From 12f2756504ab2ce16c691f98e32f480cc258163c Mon Sep 17 00:00:00 2001 From: y20k Date: Mon, 16 Oct 2017 16:55:26 +0200 Subject: [PATCH] clean up & removed er-rUS translation (-> duplicate ressource) --- app/build.gradle | 2 +- .../org/y20k/transistor/MainActivity.java | 2 +- .../org/y20k/transistor/PlayerFragment.java | 11 +- .../org/y20k/transistor/PlayerService.java | 21 ++- .../transistor/adapter/CollectionAdapter.java | 8 - .../org/y20k/transistor/core/Station.java | 1 - app/src/main/res/values-en-rUS/strings.xml | 168 ------------------ app/src/main/res/values/strings.xml | 12 +- 8 files changed, 28 insertions(+), 197 deletions(-) delete mode 100644 app/src/main/res/values-en-rUS/strings.xml diff --git a/app/build.gradle b/app/build.gradle index 284fc5c8..ca5f4812 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -13,7 +13,7 @@ android { vectorDrawables.useSupportLibrary = true - resConfigs "en", "ca", "de", "en-rUS", "el", "es", "eu", "fr", "ja", "nb-rNO", "pl", "ru", "sl", "sr", "tr", "uk", "v21", "v24", "w820dp", "zh-rCN" + resConfigs "en", "ca", "de", "el", "es", "eu", "fr", "ja", "nb-rNO", "pl", "ru", "sl", "sr", "tr", "uk", "v21", "v24", "w820dp", "zh-rCN" } buildTypes { diff --git a/app/src/main/java/org/y20k/transistor/MainActivity.java b/app/src/main/java/org/y20k/transistor/MainActivity.java index b0af45ed..e4ce8201 100644 --- a/app/src/main/java/org/y20k/transistor/MainActivity.java +++ b/app/src/main/java/org/y20k/transistor/MainActivity.java @@ -280,7 +280,7 @@ public int handleStationRename(Station station, String newStationName) { // initialize StorageHelper StorageHelper storageHelper = new StorageHelper(this); - // create copys of station and main list of stations + // create copies of station and main list of stations ArrayList newStationList = StationListHelper.copyStationList(mStationList); Station newStation = new Station(station); diff --git a/app/src/main/java/org/y20k/transistor/PlayerFragment.java b/app/src/main/java/org/y20k/transistor/PlayerFragment.java index 3befa7c2..5de3ae33 100644 --- a/app/src/main/java/org/y20k/transistor/PlayerFragment.java +++ b/app/src/main/java/org/y20k/transistor/PlayerFragment.java @@ -472,7 +472,7 @@ private void copyToClipboard(int contentType) { switch (contentType) { case COPY_STATION_ALL: // set clip text - if ( mThisStation.getMetadata() != null) { + if (mThisStation.getMetadata() != null) { clipboardText = mThisStation.getStationName() + " - " + mThisStation.getMetadata() + " (" + mThisStation.getStreamUri().toString() + ")"; } else { clipboardText = mThisStation.getStationName() + " (" + mThisStation.getStreamUri().toString() + ")"; @@ -483,13 +483,17 @@ private void copyToClipboard(int contentType) { case COPY_STATION_METADATA: // set clip text and notify user - clipboardText = mThisStation.getMetadata(); + if (mThisStation.getMetadata() != null) { + clipboardText = mThisStation.getMetadata(); + } Toast.makeText(mActivity, mActivity.getString(R.string.toastmessage_copied_to_clipboard_metadata), Toast.LENGTH_SHORT).show(); break; case COPY_STREAM_URL: // set clip text and notify user - clipboardText = mThisStation.getStreamUri().toString(); + if (mThisStation.getStreamUri() != null) { + clipboardText = mThisStation.getStreamUri().toString(); + } Toast.makeText(mActivity, mActivity.getString(R.string.toastmessage_copied_to_clipboard_url), Toast.LENGTH_SHORT).show(); break; @@ -756,7 +760,6 @@ else if (!(newMetaData.equals(oldMetaData))) { updateStationMetadataView(newStation); } // CASE: PLAYBACK STATE -// if (mThisStation.getStreamUri().equals(newStation.getStreamUri()) && mPlaybackState != newStation.getPlaybackState()) { // todo remove if (mPlaybackState != newStation.getPlaybackState()) { mPlaybackState = newStation.getPlaybackState(); changeVisualState(newStation); diff --git a/app/src/main/java/org/y20k/transistor/PlayerService.java b/app/src/main/java/org/y20k/transistor/PlayerService.java index 29f42f27..92eeca6a 100644 --- a/app/src/main/java/org/y20k/transistor/PlayerService.java +++ b/app/src/main/java/org/y20k/transistor/PlayerService.java @@ -846,7 +846,6 @@ private void saveAppState() { * Inner class: Handles callback from active media session *** */ private final class MediaSessionCallback extends MediaSessionCompat.Callback { - // note: this can be replaced by MediaSessionConnector.PlaybackController (ExoPlayer) @Override public void onPlay() { // start playback @@ -855,7 +854,6 @@ public void onPlay() { } } - @Override public void onPlayFromMediaId(String mediaId, Bundle extras) { super.onPlayFromMediaId(mediaId, extras); @@ -866,7 +864,6 @@ public void onPlayFromMediaId(String mediaId, Bundle extras) { startPlayback(); } - @Override public void onPause() { // stop playback @@ -879,6 +876,24 @@ public void onStop() { stopPlayback(true); } + @Override + public void onPlayFromSearch(String query, Bundle extras) { + super.onPlayFromSearch(query, extras); + // handle requests to begin playback from a search query (eg. Assistant, Android Auto, etc.) + } + + @Override + public void onSkipToNext() { + super.onSkipToNext(); + // handle requests to skip to the next media item + } + + @Override + public void onSkipToPrevious() { + super.onSkipToPrevious(); + // handle requests to skip to the previous media item + } + } /** * End of inner class diff --git a/app/src/main/java/org/y20k/transistor/adapter/CollectionAdapter.java b/app/src/main/java/org/y20k/transistor/adapter/CollectionAdapter.java index bdcdc061..2262c2db 100644 --- a/app/src/main/java/org/y20k/transistor/adapter/CollectionAdapter.java +++ b/app/src/main/java/org/y20k/transistor/adapter/CollectionAdapter.java @@ -466,14 +466,6 @@ private void handlePlaybackStateChange(Intent intent) { private void handlePlaybackStateError(Intent intent) { LogHelper.e(LOG_TAG, "Forcing a reload of station list. Did Transistor crash?"); - // todo remove -// // check if a station has been transmitted -// if (intent != null && intent.hasExtra(EXTRA_STATION) && intent.getParcelableExtra(EXTRA_STATION) != null) { -// Station newStation = intent.getParcelableExtra(EXTRA_STATION); -// newStation.setPlaybackState(PLAYBACK_STATE_STOPPED); -// mCollectionViewModel.getPlayerServiceStation().setValue(newStation); -// } - mCollectionViewModel.getStationList().setValue(StationListHelper.loadStationListFromStorage(mActivity)); } diff --git a/app/src/main/java/org/y20k/transistor/core/Station.java b/app/src/main/java/org/y20k/transistor/core/Station.java index 86b90d0c..a5de269a 100644 --- a/app/src/main/java/org/y20k/transistor/core/Station.java +++ b/app/src/main/java/org/y20k/transistor/core/Station.java @@ -228,7 +228,6 @@ public Station(File folder, Uri fileLocation) { /* Constructor when given MediaMetadata (e.g. from Android Auto) */ public Station (MediaMetadataCompat stationMediaMetadata) { - // todo implement mStationImageFile = new File(stationMediaMetadata.getString(METADATA_CUSTOM_KEY_IMAGE_FILE)); mStationImageSize = mStationImageFile.length(); mStationName = stationMediaMetadata.getString(METADATA_KEY_TITLE); diff --git a/app/src/main/res/values-en-rUS/strings.xml b/app/src/main/res/values-en-rUS/strings.xml deleted file mode 100644 index 3cc23a70..00000000 --- a/app/src/main/res/values-en-rUS/strings.xml +++ /dev/null @@ -1,168 +0,0 @@ - - - - Transistor - Now Playing - Info Sheet - - - Last station - Play last station - Shortcut for playback of last station disabled. - - - About - How to use - Refresh list - Sleep timer - Change icon - Add - Delete - Rename - Place on Home screen - - - About - How to use - - - Arrow pointing towards the add station symbol - Display options for radio station - Icon of radio station - Name of radio station - Metadata (Artist / Title) of currently playing radio station - Example FM - Artist - Title - Loading stream … - Big playback button - Indicator for running playback - Indicator for running playback - Indicator for running sleep timer - Information Icon - Content copy icon - Name of selected radio station - Metadata from selected radio station - Streaming link of selected radio station - - - Station - Currently Playing - Streaming link - no metadata available - MIME type - Channel count - Sample rate - Bitrate - - - Okay - Cancel - Add - Paste streaming link - Add new station - You can add raw audio streams encoded in MP3, AAC and Ogg/Opus as well as streams encapsulated in PLS or M3U files. Alternatively you can add new stations by tapping on streaming links (.pls or .m3u) in your web browser. - Delete station - Delete - Enter a new name - Rename station - Rename - - - Error - An error occurred - Show details - No details available - This station is probably a duplicate or else you might want to check your external storage. - Download Issue - Read Issue - Write Issue - External storage: - Hint: Transistor can only process MP3, AAC and Ogg/Opus encoded streams or links ending in .m3u or .pls. - MIME type of file: - MIME type of stream: - Content of file: - Transistor tried hard but could not make sense of the link. - Streaming link of station: - Transistor tried hard but could not make sense of the file. - Location of file: - Transistor tried hard but could not save the station. - - - Add a new station - Download started. - Opening file. - Playback stopped (long press detected) - Playback started (long press detected) - Shortcut created. - Shortcut not created. This device does not allow the creation of shortcuts. - Reloading list of stations. - Streaming link copied to clipboard. - Metadata copied to clipboard. - Station copied to clipboard. - Unsupported audio format detected. Playback of stream may not work properly. - Sleep timer activated. - Sleep timer cancelled. - Duration increased. - Please start playback first. - Unable to connect. Device does not have an internet connection or stream may be outdated. - Unable to rename station. Please choose a different name. - The station was removed. - Unable to access external storage. - Headphones unplugged. Playback stopped. - Permission denied: - Unable to find station. - Transistor does not recognize this station. Please delete and add it again to the Home screen. - Transistor needs to be granted read permissions to be able access data from external storage. - Sleep timer set to - - - Play - Stop - Swipe to stop - Playing - Playback Controls - Playback controls, station logo and now playing info. - - - About Transistor - Radio app for Android - Version 2.3 (Kooks) - Transistor is a bare bones app for listening to radio programs over the internet. The app stores stations as files on your device\'s external storage. Look for .m3u files in /Android/data/org.y20k.transistor/files/Collection. It currently understands streams encoded in MP3, AAC and Ogg/Opus. - Important note: This is an app of type BYOS ("bring your own station"). It does not feature any kind of built-in search option. You will have to manually add radio stations. - Transistor is free software. It is published under the MIT open source license. You can find the code on GitHub. GitHub is also a good place to file bugs or even to contribute, if you are interested. - https://github.com/y20k/transistor - https://opensource.org/licenses/MIT - Which Permissions does Transistor need? - INSTALL_SHORTCUT and UNINSTALL_SHORTCUT - These are needed for radio station shortcuts to be installed on and uninstalled from the Android Home screen. - INTERNET - Transistor streams radio stations over the internet. - READ_EXTERNAL_STORAGE - Transistor needs access to images, photos and documents to be able to customize radio station icons and to able to open locally saved playlist files. - VIBRATE - Tapping and holding a radio station will trigger a tiny vibration. - WAKE_LOCK - During playback Transistor acquires a so called partial wake lock, preventing the Android system from stopping playback to save power. - - - How to use Transistor - How to add a new radio station? - The easiest way to add a new station is to search the web for streaming links and then choose Transistor as a your default handler for those file types. You can also tap the (+) symbol in the top bar and paste in streaming links directly. Please note: Transistor does not feature any kind of built-in search option. - How to playback a radio station? - Tap the big Play button ;). - How to stop playback? - Tap the big Stop button or unplug your headphones or swipe off the notification from the lock screen. - How to start the sleep timer? - Tapping the Clock symbol starts a 15 minute countdown after which Transistor stops playback. An additional tap adds 15 minutes to the clock. Playback must be running to be able to activate the sleep timer. - How to place a station shortcut on the Home screen? - The option to place a shortcut for a station on the Home screen can be accessed from the station\'s three dots menu. A tap on a shortcut will open Transistor - playback will start immediately. - How to rename or delete a station? - The rename and delete options can be accessed both from the station\'s context menu. Just tap on the three dots symbol. You can manage the list of stations also from a file browser (see next question). - Where does Transistor store its stations? - Transistor does not save its list of stations in a database. Instead it stores stations as .m3u files on your device\'s external storage. Feel free to tinker with those files using the text editor of your choice. The files are stored in /Android/data/org.y20k.transistor/files/Collection. - How do I backup and transfer my radio stations? - Transistor has support for the Auto Backup feature in Android 6. Radio stations are always backed up to your Google account and will be restored upon reinstalling. On devices running older versions of Android, you must manually save and restore the Collection folder. - Why are there no settings in Transistor? - There is nothing to set ;). Transistor is a very simple app. Depending on your point of view "simple" is either great or lame. - - diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f24a43d4..3cc23a70 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -161,18 +161,8 @@ Where does Transistor store its stations? Transistor does not save its list of stations in a database. Instead it stores stations as .m3u files on your device\'s external storage. Feel free to tinker with those files using the text editor of your choice. The files are stored in /Android/data/org.y20k.transistor/files/Collection. How do I backup and transfer my radio stations? - Transistor has support for the Auto Backup feature in Android 6. Radio stations are always backed up to your Google account and will be restored upon reinstalling. On devices running older versions of Android, you must manually save and restore the "Collection" folder. + Transistor has support for the Auto Backup feature in Android 6. Radio stations are always backed up to your Google account and will be restored upon reinstalling. On devices running older versions of Android, you must manually save and restore the Collection folder. Why are there no settings in Transistor? There is nothing to set ;). Transistor is a very simple app. Depending on your point of view "simple" is either great or lame. - -