-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into feature/notifications
- Loading branch information
Showing
312 changed files
with
6,249 additions
and
4,276 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
liberapay: TeamNewPipe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ | |
/app/app.iml | ||
/.idea | ||
/*.iml | ||
gradle.properties | ||
*~ | ||
.weblate | ||
*.class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
app/src/androidTest/java/org/schabi/newpipe/report/ErrorInfoTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
116 changes: 0 additions & 116 deletions
116
app/src/main/java/android/support/design/widget/FlingBehavior.java
This file was deleted.
Oops, something went wrong.
82 changes: 82 additions & 0 deletions
82
app/src/main/java/com/google/android/material/appbar/FlingBehavior.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
package com.google.android.material.appbar; | ||
|
||
import android.content.Context; | ||
import android.util.AttributeSet; | ||
import android.view.MotionEvent; | ||
import android.widget.OverScroller; | ||
|
||
import androidx.annotation.Nullable; | ||
import androidx.coordinatorlayout.widget.CoordinatorLayout; | ||
|
||
import java.lang.reflect.Field; | ||
|
||
// check this https://stackoverflow.com/questions/56849221/recyclerview-fling-causes-laggy-while-appbarlayout-is-scrolling/57997489#57997489 | ||
public final class FlingBehavior extends AppBarLayout.Behavior { | ||
|
||
public FlingBehavior(Context context, AttributeSet attrs) { | ||
super(context, attrs); | ||
} | ||
|
||
@Override | ||
public boolean onInterceptTouchEvent(CoordinatorLayout parent, AppBarLayout child, MotionEvent ev) { | ||
switch (ev.getActionMasked()) { | ||
case MotionEvent.ACTION_DOWN: | ||
// remove reference to old nested scrolling child | ||
resetNestedScrollingChild(); | ||
// Stop fling when your finger touches the screen | ||
stopAppBarLayoutFling(); | ||
break; | ||
default: | ||
break; | ||
} | ||
return super.onInterceptTouchEvent(parent, child, ev); | ||
} | ||
|
||
@Nullable | ||
private OverScroller getScrollerField() { | ||
try { | ||
Class<?> headerBehaviorType = this.getClass().getSuperclass().getSuperclass().getSuperclass(); | ||
if (headerBehaviorType != null) { | ||
Field field = headerBehaviorType.getDeclaredField("scroller"); | ||
field.setAccessible(true); | ||
return ((OverScroller) field.get(this)); | ||
} | ||
} catch (NoSuchFieldException | IllegalAccessException e) { | ||
// ? | ||
} | ||
return null; | ||
} | ||
|
||
@Nullable | ||
private Field getLastNestedScrollingChildRefField() { | ||
try { | ||
Class<?> headerBehaviorType = this.getClass().getSuperclass().getSuperclass(); | ||
if (headerBehaviorType != null) { | ||
Field field = headerBehaviorType.getDeclaredField("lastNestedScrollingChildRef"); | ||
field.setAccessible(true); | ||
return field; | ||
} | ||
} catch (NoSuchFieldException e) { | ||
// ? | ||
} | ||
return null; | ||
} | ||
|
||
private void resetNestedScrollingChild(){ | ||
Field field = getLastNestedScrollingChildRefField(); | ||
if(field != null){ | ||
try { | ||
Object value = field.get(this); | ||
if(value != null) field.set(this, null); | ||
} catch (IllegalAccessException e) { | ||
// ? | ||
} | ||
} | ||
} | ||
|
||
private void stopAppBarLayoutFling() { | ||
OverScroller scroller = getScrollerField(); | ||
if (scroller != null) scroller.forceFinished(true); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.