From 27fbe690333f460f44841559c5b2d8926085ca50 Mon Sep 17 00:00:00 2001 From: BO41 Date: Tue, 28 Aug 2018 19:17:14 +0200 Subject: [PATCH 01/13] code cleanup mainly removes throw statements automated using Android Studio, staged by hand BUILD SUCCESSFUL in 52s 39 actionable tasks: 37 executed, 2 up-to-date --- app/src/main/java/org/schabi/newpipe/App.java | 2 +- .../newpipe/local/dialog/PlaylistDialog.java | 2 +- .../subscription/SubscriptionService.java | 2 +- .../mediasession/PlayQueueNavigator.java | 2 +- .../player/playback/CustomTrackSelector.java | 2 +- .../playqueue/AbstractInfoPlayQueue.java | 2 +- .../newpipe/report/AcraReportSender.java | 2 +- .../settings/SelectChannelFragment.java | 2 +- .../newpipe/settings/SelectKioskFragment.java | 2 +- .../schabi/newpipe/util/ExtractorHelper.java | 2 +- .../services/ImportExportJsonHelperTest.java | 2 +- .../newpipe/report/ErrorActivityTest.java | 2 +- .../schabi/newpipe/util/ListHelperTest.java | 20 +++++++++---------- .../util/QuadraticSliderStrategyTest.java | 18 ++++++++--------- .../giga/get/DownloadManagerImplTest.java | 12 +++++------ 15 files changed, 37 insertions(+), 37 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/App.java b/app/src/main/java/org/schabi/newpipe/App.java index f436a26b8..dfce8f100 100644 --- a/app/src/main/java/org/schabi/newpipe/App.java +++ b/app/src/main/java/org/schabi/newpipe/App.java @@ -106,7 +106,7 @@ public class App extends Application { // https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling RxJavaPlugins.setErrorHandler(new Consumer() { @Override - public void accept(@NonNull Throwable throwable) throws Exception { + public void accept(@NonNull Throwable throwable) { Log.e(TAG, "RxJavaPlugins.ErrorHandler called with -> : " + "throwable = [" + throwable.getClass().getName() + "]"); diff --git a/app/src/main/java/org/schabi/newpipe/local/dialog/PlaylistDialog.java b/app/src/main/java/org/schabi/newpipe/local/dialog/PlaylistDialog.java index 4b8e391c7..96d628683 100644 --- a/app/src/main/java/org/schabi/newpipe/local/dialog/PlaylistDialog.java +++ b/app/src/main/java/org/schabi/newpipe/local/dialog/PlaylistDialog.java @@ -58,7 +58,7 @@ public abstract class PlaylistDialog extends DialogFragment implements StateSave @Override @SuppressWarnings("unchecked") - public void readFrom(@NonNull Queue savedObjects) throws Exception { + public void readFrom(@NonNull Queue savedObjects) { streamEntities = (List) savedObjects.poll(); } diff --git a/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionService.java b/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionService.java index fc4230711..b4545a2dd 100644 --- a/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionService.java +++ b/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionService.java @@ -116,7 +116,7 @@ public class SubscriptionService { public Completable updateChannelInfo(final ChannelInfo info) { final Function, CompletableSource> update = new Function, CompletableSource>() { @Override - public CompletableSource apply(@NonNull List subscriptionEntities) throws Exception { + public CompletableSource apply(@NonNull List subscriptionEntities) { if (DEBUG) Log.d(TAG, "updateChannelInfo() called with: subscriptionEntities = [" + subscriptionEntities + "]"); if (subscriptionEntities.size() == 1) { SubscriptionEntity subscription = subscriptionEntities.get(0); diff --git a/app/src/main/java/org/schabi/newpipe/player/mediasession/PlayQueueNavigator.java b/app/src/main/java/org/schabi/newpipe/player/mediasession/PlayQueueNavigator.java index 429c26fd9..3d1fd171f 100644 --- a/app/src/main/java/org/schabi/newpipe/player/mediasession/PlayQueueNavigator.java +++ b/app/src/main/java/org/schabi/newpipe/player/mediasession/PlayQueueNavigator.java @@ -79,7 +79,7 @@ public class PlayQueueNavigator implements MediaSessionConnector.QueueNavigator private void publishFloatingQueueWindow() { if (callback.getQueueSize() == 0) { - mediaSession.setQueue(Collections.emptyList()); + mediaSession.setQueue(Collections.emptyList()); activeQueueItemId = MediaSessionCompat.QueueItem.UNKNOWN_ID; return; } diff --git a/app/src/main/java/org/schabi/newpipe/player/playback/CustomTrackSelector.java b/app/src/main/java/org/schabi/newpipe/player/playback/CustomTrackSelector.java index d80ea5bae..45cf545ce 100644 --- a/app/src/main/java/org/schabi/newpipe/player/playback/CustomTrackSelector.java +++ b/app/src/main/java/org/schabi/newpipe/player/playback/CustomTrackSelector.java @@ -55,7 +55,7 @@ public class CustomTrackSelector extends DefaultTrackSelector { /** @see DefaultTrackSelector#selectTextTrack(TrackGroupArray, int[][], Parameters) */ @Override protected TrackSelection selectTextTrack(TrackGroupArray groups, int[][] formatSupport, - Parameters params) throws ExoPlaybackException { + Parameters params) { TrackGroup selectedGroup = null; int selectedTrackIndex = 0; int selectedTrackScore = 0; diff --git a/app/src/main/java/org/schabi/newpipe/player/playqueue/AbstractInfoPlayQueue.java b/app/src/main/java/org/schabi/newpipe/player/playqueue/AbstractInfoPlayQueue.java index 2c08f4f92..5ff766313 100644 --- a/app/src/main/java/org/schabi/newpipe/player/playqueue/AbstractInfoPlayQueue.java +++ b/app/src/main/java/org/schabi/newpipe/player/playqueue/AbstractInfoPlayQueue.java @@ -26,7 +26,7 @@ abstract class AbstractInfoPlayQueue ext transient Disposable fetchReactor; AbstractInfoPlayQueue(final U item) { - this(item.getServiceId(), item.getUrl(), null, Collections.emptyList(), 0); + this(item.getServiceId(), item.getUrl(), null, Collections.emptyList(), 0); } AbstractInfoPlayQueue(final int serviceId, diff --git a/app/src/main/java/org/schabi/newpipe/report/AcraReportSender.java b/app/src/main/java/org/schabi/newpipe/report/AcraReportSender.java index 2d3226ab6..4ef075353 100644 --- a/app/src/main/java/org/schabi/newpipe/report/AcraReportSender.java +++ b/app/src/main/java/org/schabi/newpipe/report/AcraReportSender.java @@ -31,7 +31,7 @@ import org.schabi.newpipe.R; public class AcraReportSender implements ReportSender { @Override - public void send(@NonNull Context context, @NonNull CrashReportData report) throws ReportSenderException { + public void send(@NonNull Context context, @NonNull CrashReportData report) { ErrorActivity.reportError(context, report, ErrorActivity.ErrorInfo.make(UserAction.UI_ERROR,"none", "App crash, UI failure", R.string.app_ui_crash)); diff --git a/app/src/main/java/org/schabi/newpipe/settings/SelectChannelFragment.java b/app/src/main/java/org/schabi/newpipe/settings/SelectChannelFragment.java index 0ebdbefe0..6d85d5967 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/SelectChannelFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/SelectChannelFragment.java @@ -89,7 +89,7 @@ public class SelectChannelFragment extends DialogFragment { @Override public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.select_channel_fragment, container, false); - recyclerView = (RecyclerView) v.findViewById(R.id.items_list); + recyclerView = v.findViewById(R.id.items_list); recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); channelAdapter = new SelectChannelAdapter(); recyclerView.setAdapter(channelAdapter); diff --git a/app/src/main/java/org/schabi/newpipe/settings/SelectKioskFragment.java b/app/src/main/java/org/schabi/newpipe/settings/SelectKioskFragment.java index 44cb16682..16ba6fec6 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/SelectKioskFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/SelectKioskFragment.java @@ -75,7 +75,7 @@ public class SelectKioskFragment extends DialogFragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.select_kiosk_fragment, container, false); - recyclerView = (RecyclerView) v.findViewById(R.id.items_list); + recyclerView = v.findViewById(R.id.items_list); recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); try { selectKioskAdapter = new SelectKioskAdapter(); diff --git a/app/src/main/java/org/schabi/newpipe/util/ExtractorHelper.java b/app/src/main/java/org/schabi/newpipe/util/ExtractorHelper.java index e445233c3..fb9579802 100644 --- a/app/src/main/java/org/schabi/newpipe/util/ExtractorHelper.java +++ b/app/src/main/java/org/schabi/newpipe/util/ExtractorHelper.java @@ -183,7 +183,7 @@ public final class ExtractorHelper { cache.removeInfo(serviceId, url); load = loadFromNetwork; } else { - load = Maybe.concat(ExtractorHelper.loadFromCache(serviceId, url), + load = Maybe.concat(ExtractorHelper.loadFromCache(serviceId, url), loadFromNetwork.toMaybe()) .firstElement() //Take the first valid .toSingle(); diff --git a/app/src/test/java/org/schabi/newpipe/local/subscription/services/ImportExportJsonHelperTest.java b/app/src/test/java/org/schabi/newpipe/local/subscription/services/ImportExportJsonHelperTest.java index 4a8b3d8c8..7f5f818be 100644 --- a/app/src/test/java/org/schabi/newpipe/local/subscription/services/ImportExportJsonHelperTest.java +++ b/app/src/test/java/org/schabi/newpipe/local/subscription/services/ImportExportJsonHelperTest.java @@ -27,7 +27,7 @@ public class ImportExportJsonHelperTest { } @Test - public void testInvalidSource() throws Exception { + public void testInvalidSource() { List invalidList = Arrays.asList( "{}", "", diff --git a/app/src/test/java/org/schabi/newpipe/report/ErrorActivityTest.java b/app/src/test/java/org/schabi/newpipe/report/ErrorActivityTest.java index 44a2f7cd0..ca6c76ff3 100644 --- a/app/src/test/java/org/schabi/newpipe/report/ErrorActivityTest.java +++ b/app/src/test/java/org/schabi/newpipe/report/ErrorActivityTest.java @@ -15,7 +15,7 @@ import static org.junit.Assert.assertNull; */ public class ErrorActivityTest { @Test - public void getReturnActivity() throws Exception { + public void getReturnActivity() { Class returnActivity; returnActivity = ErrorActivity.getReturnActivity(MainActivity.class); assertEquals(MainActivity.class, returnActivity); diff --git a/app/src/test/java/org/schabi/newpipe/util/ListHelperTest.java b/app/src/test/java/org/schabi/newpipe/util/ListHelperTest.java index 278ea81e1..abc09dc98 100644 --- a/app/src/test/java/org/schabi/newpipe/util/ListHelperTest.java +++ b/app/src/test/java/org/schabi/newpipe/util/ListHelperTest.java @@ -45,7 +45,7 @@ public class ListHelperTest { new VideoStream("", MediaFormat.MPEG_4, /**/ "1080p60", true)); @Test - public void getSortedStreamVideosListTest() throws Exception { + public void getSortedStreamVideosListTest() { List result = ListHelper.getSortedStreamVideosList(MediaFormat.MPEG_4, true, videoStreamsTestList, videoOnlyStreamsTestList, true); List expected = Arrays.asList("144p", "240p", "360p", "480p", "720p", "720p60", "1080p", "1080p60", "1440p60", "2160p", "2160p60"); @@ -67,7 +67,7 @@ public class ListHelperTest { } @Test - public void getSortedStreamVideosExceptHighResolutionsTest() throws Exception { + public void getSortedStreamVideosExceptHighResolutionsTest() { //////////////////////////////////// // Don't show Higher resolutions // ////////////////////////////////// @@ -79,7 +79,7 @@ public class ListHelperTest { } @Test - public void getDefaultResolutionTest() throws Exception { + public void getDefaultResolutionTest() { List testList = Arrays.asList( new VideoStream("", MediaFormat.MPEG_4, /**/ "720p"), new VideoStream("", MediaFormat.v3GPP, /**/ "240p"), @@ -130,7 +130,7 @@ public class ListHelperTest { } @Test - public void getHighestQualityAudioFormatTest() throws Exception { + public void getHighestQualityAudioFormatTest() { AudioStream stream = audioStreamsTestList.get(ListHelper.getHighestQualityAudioIndex(MediaFormat.M4A, audioStreamsTestList)); assertEquals(320, stream.average_bitrate); assertEquals(MediaFormat.M4A, stream.getFormat()); @@ -145,7 +145,7 @@ public class ListHelperTest { } @Test - public void getHighestQualityAudioFormatPreferredAbsent() throws Exception { + public void getHighestQualityAudioFormatPreferredAbsent() { ////////////////////////////////////////// // Doesn't contain the preferred format // @@ -186,13 +186,13 @@ public class ListHelperTest { } @Test - public void getHighestQualityAudioNull() throws Exception { + public void getHighestQualityAudioNull() { assertEquals(-1, ListHelper.getHighestQualityAudioIndex(null, null)); assertEquals(-1, ListHelper.getHighestQualityAudioIndex(null, new ArrayList())); } @Test - public void getLowestQualityAudioFormatTest() throws Exception { + public void getLowestQualityAudioFormatTest() { AudioStream stream = audioStreamsTestList.get(ListHelper.getMostCompactAudioIndex(MediaFormat.M4A, audioStreamsTestList)); assertEquals(128, stream.average_bitrate); assertEquals(MediaFormat.M4A, stream.getFormat()); @@ -207,7 +207,7 @@ public class ListHelperTest { } @Test - public void getLowestQualityAudioFormatPreferredAbsent() throws Exception { + public void getLowestQualityAudioFormatPreferredAbsent() { ////////////////////////////////////////// // Doesn't contain the preferred format // @@ -250,13 +250,13 @@ public class ListHelperTest { } @Test - public void getLowestQualityAudioNull() throws Exception { + public void getLowestQualityAudioNull() { assertEquals(-1, ListHelper.getMostCompactAudioIndex(null, null)); assertEquals(-1, ListHelper.getMostCompactAudioIndex(null, new ArrayList())); } @Test - public void getVideoDefaultStreamIndexCombinations() throws Exception { + public void getVideoDefaultStreamIndexCombinations() { List testList = Arrays.asList( new VideoStream("", MediaFormat.MPEG_4, /**/ "1080p"), new VideoStream("", MediaFormat.MPEG_4, /**/ "720p60"), diff --git a/app/src/test/java/org/schabi/newpipe/util/QuadraticSliderStrategyTest.java b/app/src/test/java/org/schabi/newpipe/util/QuadraticSliderStrategyTest.java index 8c8d52043..c652472d1 100644 --- a/app/src/test/java/org/schabi/newpipe/util/QuadraticSliderStrategyTest.java +++ b/app/src/test/java/org/schabi/newpipe/util/QuadraticSliderStrategyTest.java @@ -11,25 +11,25 @@ public class QuadraticSliderStrategyTest { private final SliderStrategy.Quadratic standard = new SliderStrategy.Quadratic(0f, 100f, 50f, STEP); @Test - public void testLeftBound() throws Exception { + public void testLeftBound() { assertEquals(standard.progressOf(0), 0); assertEquals(standard.valueOf(0), 0f, DELTA); } @Test - public void testCenter() throws Exception { + public void testCenter() { assertEquals(standard.progressOf(50), 50); assertEquals(standard.valueOf(50), 50f, DELTA); } @Test - public void testRightBound() throws Exception { + public void testRightBound() { assertEquals(standard.progressOf(100), 100); assertEquals(standard.valueOf(100), 100f, DELTA); } @Test - public void testLeftRegion() throws Exception { + public void testLeftRegion() { final int leftProgress = standard.progressOf(25); final double leftValue = standard.valueOf(25); assertTrue(leftProgress > 0 && leftProgress < 50); @@ -37,7 +37,7 @@ public class QuadraticSliderStrategyTest { } @Test - public void testRightRegion() throws Exception { + public void testRightRegion() { final int leftProgress = standard.progressOf(75); final double leftValue = standard.valueOf(75); assertTrue(leftProgress > 50 && leftProgress < 100); @@ -45,7 +45,7 @@ public class QuadraticSliderStrategyTest { } @Test - public void testConversion() throws Exception { + public void testConversion() { assertEquals(standard.progressOf(standard.valueOf(0)), 0); assertEquals(standard.progressOf(standard.valueOf(25)), 25); assertEquals(standard.progressOf(standard.valueOf(50)), 50); @@ -54,7 +54,7 @@ public class QuadraticSliderStrategyTest { } @Test - public void testReverseConversion() throws Exception { + public void testReverseConversion() { // Need a larger delta since step size / granularity is too small and causes // floating point round-off errors during conversion final float largeDelta = 1f; @@ -67,7 +67,7 @@ public class QuadraticSliderStrategyTest { } @Test - public void testQuadraticPropertyLeftRegion() throws Exception { + public void testQuadraticPropertyLeftRegion() { final double differenceCloserToCenter = Math.abs(standard.valueOf(40) - standard.valueOf(45)); final double differenceFurtherFromCenter = @@ -76,7 +76,7 @@ public class QuadraticSliderStrategyTest { } @Test - public void testQuadraticPropertyRightRegion() throws Exception { + public void testQuadraticPropertyRightRegion() { final double differenceCloserToCenter = Math.abs(standard.valueOf(75) - standard.valueOf(70)); final double differenceFurtherFromCenter = diff --git a/app/src/test/java/us/shandian/giga/get/DownloadManagerImplTest.java b/app/src/test/java/us/shandian/giga/get/DownloadManagerImplTest.java index 6ff702273..49bfd4840 100644 --- a/app/src/test/java/us/shandian/giga/get/DownloadManagerImplTest.java +++ b/app/src/test/java/us/shandian/giga/get/DownloadManagerImplTest.java @@ -110,7 +110,7 @@ public class DownloadManagerImplTest { } @Test - public void resumeMission() throws Exception { + public void resumeMission() { DownloadMission mission = missions.get(0); mission.running = true; verify(mission, never()).start(); @@ -122,7 +122,7 @@ public class DownloadManagerImplTest { } @Test - public void pauseMission() throws Exception { + public void pauseMission() { DownloadMission mission = missions.get(0); mission.running = false; downloadManager.pauseMission(0); @@ -133,7 +133,7 @@ public class DownloadManagerImplTest { } @Test - public void deleteMission() throws Exception { + public void deleteMission() { DownloadMission mission = missions.get(0); assertEquals(mission, downloadManager.getMission(0)); downloadManager.deleteMission(0); @@ -143,18 +143,18 @@ public class DownloadManagerImplTest { } @Test(expected = RuntimeException.class) - public void getMissionWithNegativeIndex() throws Exception { + public void getMissionWithNegativeIndex() { downloadManager.getMission(-1); } @Test - public void getMission() throws Exception { + public void getMission() { assertSame(missions.get(0), downloadManager.getMission(0)); assertSame(missions.get(1), downloadManager.getMission(1)); } @Test - public void sortByTimestamp() throws Exception { + public void sortByTimestamp() { ArrayList downloadMissions = new ArrayList<>(); DownloadMission mission = new DownloadMission(); mission.timestamp = 0; From 5660b5ddc6d90299710896a796570d58c563517a Mon Sep 17 00:00:00 2001 From: BO41 Date: Tue, 28 Aug 2018 19:25:56 +0200 Subject: [PATCH 02/13] accessibility image without contentDescription Keyboard inaccessible widget BUILD SUCCESSFUL in 6s 39 actionable tasks: 4 executed, 35 up-to-date --- app/src/main/res/layout-v21/drawer_header.xml | 9 ++++++--- app/src/main/res/layout/drawer_header.xml | 9 ++++++--- app/src/main/res/layout/fragment_about.xml | 3 ++- app/src/main/res/layout/item_search_history.xml | 3 ++- app/src/main/res/layout/item_software_component.xml | 3 ++- app/src/main/res/layout/mission_item.xml | 6 ++++-- app/src/main/res/layout/mission_item_linear.xml | 6 ++++-- app/src/main/res/layout/select_channel_item.xml | 3 ++- app/src/main/res/layout/select_kiosk_item.xml | 6 ++++-- 9 files changed, 32 insertions(+), 16 deletions(-) diff --git a/app/src/main/res/layout-v21/drawer_header.xml b/app/src/main/res/layout-v21/drawer_header.xml index 4cdc2b30e..9336c8d9c 100644 --- a/app/src/main/res/layout-v21/drawer_header.xml +++ b/app/src/main/res/layout-v21/drawer_header.xml @@ -16,7 +16,8 @@ android:layout_height="match_parent" android:background="?attr/colorPrimary" android:scaleType="centerCrop" - android:src="@drawable/background_header" /> + android:src="@drawable/background_header" + android:contentDescription="TODO" /> + android:src="@drawable/np_logo_nude_shadow" + android:contentDescription="TODO" /> + android:src="@drawable/ic_arrow_down_white" + android:contentDescription="TODO" /> \ No newline at end of file diff --git a/app/src/main/res/layout/drawer_header.xml b/app/src/main/res/layout/drawer_header.xml index c119c302a..833abe1c6 100644 --- a/app/src/main/res/layout/drawer_header.xml +++ b/app/src/main/res/layout/drawer_header.xml @@ -16,7 +16,8 @@ android:focusable="true"> android:layout_height="match_parent" android:background="?attr/colorPrimary" android:src="@drawable/background_header" - android:scaleType="centerCrop"/> + android:scaleType="centerCrop" + android:contentDescription="TODO" /> android:layout_width="70dp" android:layout_height="70dp" - android:src="@drawable/np_logo_nude_shadow"/> + android:src="@drawable/np_logo_nude_shadow" + android:contentDescription="TODO" /> android:paddingBottom="20dp" android:paddingRight="20dp" android:src="@drawable/ic_arrow_down_white" - android:paddingEnd="20dp" /> + android:paddingEnd="20dp" + android:contentDescription="TODO" /> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_about.xml b/app/src/main/res/layout/fragment_about.xml index 320f72ab9..e8537cad3 100644 --- a/app/src/main/res/layout/fragment_about.xml +++ b/app/src/main/res/layout/fragment_about.xml @@ -21,7 +21,8 @@ android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:layout_marginBottom="8dp" - app:srcCompat="@mipmap/ic_launcher" /> + app:srcCompat="@mipmap/ic_launcher" + android:contentDescription="TODO" /> + android:paddingTop="8dp" + android:focusable="true"> + android:clickable="true" + android:focusable="true"> + android:scaleType="centerInside" + android:contentDescription="TODO" /> @@ -50,7 +51,8 @@ android:layout_centerHorizontal="true" android:scaleType="fitXY" android:gravity="center" - android:padding="10dp"/> + android:padding="10dp" + android:contentDescription="TODO" /> + android:padding="15dp" + android:contentDescription="TODO" /> + android:scaleType="centerInside" + android:contentDescription="TODO" /> diff --git a/app/src/main/res/layout/select_channel_item.xml b/app/src/main/res/layout/select_channel_item.xml index 09602a371..5d00c1b01 100644 --- a/app/src/main/res/layout/select_channel_item.xml +++ b/app/src/main/res/layout/select_channel_item.xml @@ -6,7 +6,8 @@ android:layout_height="wrap_content" android:background="?attr/selectableItemBackground" android:clickable="true" - android:padding="5dp"> + android:padding="5dp" + android:focusable="true"> + android:padding="5dp" + android:focusable="true"> + tools:ignore="RtlHardcoded" + android:contentDescription="TODO" /> Date: Tue, 28 Aug 2018 19:30:44 +0200 Subject: [PATCH 03/13] correctness use apply() on SharedPreferences use dp instead of sp for text sizes BUILD SUCCESSFUL in 22s 39 actionable tasks: 10 executed, 29 up-to-date --- .../org/schabi/newpipe/settings/ContentSettingsFragment.java | 2 +- app/src/main/res/layout-v21/drawer_header.xml | 4 ++-- app/src/main/res/layout/drawer_header.xml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java b/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java index 0ca78b34a..ca48ed8b5 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java @@ -264,7 +264,7 @@ public class ContentSettingsFragment extends BasePreferenceFragment { else if (v instanceof String) prefEdit.putString(key, ((String) v)); } - prefEdit.commit(); + prefEdit.apply(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { diff --git a/app/src/main/res/layout-v21/drawer_header.xml b/app/src/main/res/layout-v21/drawer_header.xml index 9336c8d9c..4474ee4ed 100644 --- a/app/src/main/res/layout-v21/drawer_header.xml +++ b/app/src/main/res/layout-v21/drawer_header.xml @@ -40,7 +40,7 @@ android:layout_toRightOf="@id/drawer_header_np_nude_view" android:gravity="center" android:text="@string/app_name" - android:textSize="30dp" + android:textSize="30sp" android:textColor="@color/drawer_header_font_color" android:textStyle="bold|italic" /> @@ -52,7 +52,7 @@ android:layout_alignStart="@id/drawer_header_np_text_view" android:layout_below="@id/drawer_header_np_text_view" android:text="YouTube" - android:textSize="18dp" + android:textSize="18sp" android:textColor="@color/drawer_header_font_color" android:textStyle="italic" /> diff --git a/app/src/main/res/layout/drawer_header.xml b/app/src/main/res/layout/drawer_header.xml index 833abe1c6..0458773d7 100644 --- a/app/src/main/res/layout/drawer_header.xml +++ b/app/src/main/res/layout/drawer_header.xml @@ -40,7 +40,7 @@ android:focusable="true"> android:layout_alignTop="@id/drawer_header_np_nude_view" android:layout_alignBottom="@id/drawer_header_np_nude_view" android:gravity="center" - android:textSize="30dp" + android:textSize="30sp" android:textColor="@color/drawer_header_font_color" android:textStyle="bold|italic"/> @@ -52,7 +52,7 @@ android:focusable="true"> android:layout_below="@id/drawer_header_np_text_view" android:layout_alignLeft="@id/drawer_header_np_text_view" android:layout_alignStart="@id/drawer_header_np_text_view" - android:textSize="18dp" + android:textSize="18sp" android:textColor="@color/drawer_header_font_color" android:textStyle="italic"/> From 5db0cc524174dfda56d19cc7e1bd61d91fa8ec06 Mon Sep 17 00:00:00 2001 From: BO41 Date: Tue, 28 Aug 2018 19:40:05 +0200 Subject: [PATCH 04/13] performance + usability obsolete layout params Ellipsis string can be replaced with ellipsis character Missing inputType Usage of showAsAction=always BUILD SUCCESSFUL in 5s 39 actionable tasks: 4 executed, 35 up-to-date --- app/src/main/res/layout/activity_error.xml | 3 ++- app/src/main/res/layout/mission_item_linear.xml | 3 +-- app/src/main/res/menu/menu_videooptions.xml | 6 +++--- app/src/main/res/values-hu/strings.xml | 2 +- app/src/main/res/values-ko/strings.xml | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/src/main/res/layout/activity_error.xml b/app/src/main/res/layout/activity_error.xml index 7752dc7cb..c47077c73 100644 --- a/app/src/main/res/layout/activity_error.xml +++ b/app/src/main/res/layout/activity_error.xml @@ -114,7 +114,8 @@ + android:layout_height="wrap_content" + android:inputType="" />