diff options
5 files changed, 10 insertions, 30 deletions
diff --git a/app/build.gradle b/app/build.gradle index cc6943f20..5fdaccb9c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -87,11 +87,6 @@ dependencies { // Image compression implementation 'id.zelory:compressor:3.0.1' - implementation "org.jetbrains.kotlin:kotlin-stdlib:1.5.10" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0-native-mt" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0-native-mt" - implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' - implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1' // Markdown implementation 'com.github.stefan-niedermann:nextcloud-notes:3.4.3' diff --git a/cross-tab-drag-and-drop/build.gradle b/cross-tab-drag-and-drop/build.gradle index 4e8be54c5..e06d0993e 100644 --- a/cross-tab-drag-and-drop/build.gradle +++ b/cross-tab-drag-and-drop/build.gradle @@ -4,13 +4,9 @@ android { compileSdkVersion 30 buildToolsVersion "30.0.3" defaultConfig { - minSdkVersion 19 + minSdkVersion 21 targetSdkVersion 30 } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } } dependencies { diff --git a/cross-tab-drag-and-drop/src/main/java/it/niedermann/android/crosstabdnd/ScrollHelper.java b/cross-tab-drag-and-drop/src/main/java/it/niedermann/android/crosstabdnd/ScrollHelper.java index 47b1d9b17..29ce3c35a 100644 --- a/cross-tab-drag-and-drop/src/main/java/it/niedermann/android/crosstabdnd/ScrollHelper.java +++ b/cross-tab-drag-and-drop/src/main/java/it/niedermann/android/crosstabdnd/ScrollHelper.java @@ -7,7 +7,7 @@ import androidx.recyclerview.widget.RecyclerView; @SuppressWarnings("WeakerAccess") public class ScrollHelper implements Runnable { - private static final int SROLL_SPEED = 200; + private static final int SCROLL_SPEED = 200; public enum ScrollDirection { UP, @@ -17,7 +17,7 @@ public class ScrollHelper implements Runnable { private boolean shouldScroll = false; private ScrollDirection scrollDirection; private RecyclerView currentRecyclerView; - private Handler handler = new Handler(); + private final Handler handler = new Handler(); public void startScroll(RecyclerView recyclerView, ScrollDirection scrollDirection) { this.scrollDirection = scrollDirection; @@ -35,9 +35,9 @@ public class ScrollHelper implements Runnable { @Override public void run() { if (scrollDirection == ScrollDirection.UP) { - currentRecyclerView.smoothScrollBy(0, SROLL_SPEED * -1); + currentRecyclerView.smoothScrollBy(0, SCROLL_SPEED * -1); } else { - currentRecyclerView.smoothScrollBy(0, SROLL_SPEED); + currentRecyclerView.smoothScrollBy(0, SCROLL_SPEED); } if (shouldScroll) { handler.postDelayed(this, 100); diff --git a/tab-layout-helper/build.gradle b/tab-layout-helper/build.gradle index 4e8be54c5..e06d0993e 100644 --- a/tab-layout-helper/build.gradle +++ b/tab-layout-helper/build.gradle @@ -4,13 +4,9 @@ android { compileSdkVersion 30 buildToolsVersion "30.0.3" defaultConfig { - minSdkVersion 19 + minSdkVersion 21 targetSdkVersion 30 } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } } dependencies { diff --git a/tab-layout-helper/src/main/java/it/niedermann/android/tablayouthelper/TabLayoutHelper.java b/tab-layout-helper/src/main/java/it/niedermann/android/tablayouthelper/TabLayoutHelper.java index 449e9db8c..21f9f8092 100644 --- a/tab-layout-helper/src/main/java/it/niedermann/android/tablayouthelper/TabLayoutHelper.java +++ b/tab-layout-helper/src/main/java/it/niedermann/android/tablayouthelper/TabLayoutHelper.java @@ -16,8 +16,6 @@ package it.niedermann.android.tablayouthelper; -import android.os.Build.VERSION; -import android.os.Build.VERSION_CODES; import android.view.Gravity; import android.view.View; import android.widget.LinearLayout; @@ -56,7 +54,7 @@ public class TabLayoutHelper { * @param tabTitleGenerator TabTitleGenerator instance */ public TabLayoutHelper(@NonNull TabLayout tabLayout, @NonNull ViewPager2 viewPager, @NonNull TabTitleGenerator tabTitleGenerator) { - RecyclerView.Adapter adapter = viewPager.getAdapter(); + RecyclerView.Adapter<?> adapter = viewPager.getAdapter(); if (adapter == null) { throw new IllegalArgumentException("ViewPager does not have a PagerAdapter set"); @@ -242,7 +240,7 @@ public class TabLayoutHelper { } private void setupWithViewPager(@NonNull TabLayout tabLayout, @NonNull ViewPager2 viewPager) { - final RecyclerView.Adapter adapter = viewPager.getAdapter(); + final RecyclerView.Adapter<?> adapter = viewPager.getAdapter(); if (adapter == null) { throw new IllegalArgumentException("ViewPager does not have a PagerAdapter set"); } @@ -253,7 +251,7 @@ public class TabLayoutHelper { tabLayout.addOnTabSelectedListener(mInternalOnTabSelectedListener); } - private void setTabsFromPagerAdapter(@NonNull TabLayout tabLayout, @Nullable RecyclerView.Adapter adapter, final int currentItem) { + private void setTabsFromPagerAdapter(@NonNull TabLayout tabLayout, @Nullable RecyclerView.Adapter<?> adapter, final int currentItem) { try { mDuringSetTabsFromPagerAdapter = true; @@ -306,12 +304,7 @@ public class TabLayoutHelper { // NOTE: slidingTabStrip.getMeasuredWidth() method does not return correct width! // Need to measure each tabs and calculate the sum of them. - final int tabLayoutWidth; - if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN_MR1) { - tabLayoutWidth = tabLayout.getMeasuredWidth() - tabLayout.getPaddingStart() - tabLayout.getPaddingEnd(); - } else { - tabLayoutWidth = tabLayout.getMeasuredWidth() - tabLayout.getPaddingLeft() - tabLayout.getPaddingRight(); - } + final int tabLayoutWidth = tabLayout.getMeasuredWidth() - tabLayout.getPaddingStart() - tabLayout.getPaddingEnd(); final int tabLayoutHeight = tabLayout.getMeasuredHeight() - tabLayout.getPaddingTop() - tabLayout.getPaddingBottom(); if (childCount == 0) { |