mirror of
https://github.com/revanced/revanced-integrations.git
synced 2025-05-06 17:34:30 +02:00
refactor: use existing method ReVancedUtils.getIdentifier
(#271)
This commit is contained in:
parent
25604cec0a
commit
0fc94e2305
@ -1,6 +1,5 @@
|
|||||||
package app.revanced.integrations.videoplayer;
|
package app.revanced.integrations.videoplayer;
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.support.constraint.ConstraintLayout;
|
import android.support.constraint.ConstraintLayout;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.animation.Animation;
|
import android.view.animation.Animation;
|
||||||
@ -27,7 +26,7 @@ public abstract class BottomControlButton {
|
|||||||
constraintLayout = (ConstraintLayout) obj;
|
constraintLayout = (ConstraintLayout) obj;
|
||||||
isButtonEnabled = isEnabled;
|
isButtonEnabled = isEnabled;
|
||||||
|
|
||||||
ImageView imageView = constraintLayout.findViewById(getIdentifier(viewId, "id"));
|
ImageView imageView = constraintLayout.findViewById(ReVancedUtils.getIdentifier(viewId, "id"));
|
||||||
if (imageView == null) {
|
if (imageView == null) {
|
||||||
LogHelper.printDebug(() -> "Couldn't find ImageView with id: " + viewId);
|
LogHelper.printDebug(() -> "Couldn't find ImageView with id: " + viewId);
|
||||||
return;
|
return;
|
||||||
@ -70,17 +69,11 @@ public abstract class BottomControlButton {
|
|||||||
imageView.setVisibility(View.GONE);
|
imageView.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int getIdentifier(String str, String str2) {
|
|
||||||
Context appContext = ReVancedUtils.getContext();
|
|
||||||
return appContext.getResources().getIdentifier(str, str2, appContext.getPackageName());
|
|
||||||
}
|
|
||||||
|
|
||||||
private static int getInteger(String str) {
|
private static int getInteger(String str) {
|
||||||
return ReVancedUtils.getContext().getResources().getInteger(getIdentifier(str, "integer"));
|
return ReVancedUtils.getContext().getResources().getInteger(ReVancedUtils.getIdentifier(str, "integer"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Animation getAnimation(String str) {
|
private static Animation getAnimation(String str) {
|
||||||
return AnimationUtils.loadAnimation(ReVancedUtils.getContext(), getIdentifier(str, "anim"));
|
return AnimationUtils.loadAnimation(ReVancedUtils.getContext(), ReVancedUtils.getIdentifier(str, "anim"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user