Start adding a new custom setting to the original pojav launcher settings

This commit is contained in:
downthecrop 2023-10-16 22:46:21 -07:00
parent 496f3ea33a
commit 1196fc8d86
3 changed files with 18 additions and 1 deletions

View file

@ -57,13 +57,15 @@ public class AWTCanvasView extends TextureView implements TextureView.SurfaceTex
Surface surface = new Surface(getSurfaceTexture());
Bitmap rgbArrayBitmap = Bitmap.createBitmap(AWT_CANVAS_WIDTH, AWT_CANVAS_HEIGHT, Bitmap.Config.ARGB_8888);
Paint paint = new Paint();
paint.setAntiAlias(false);
paint.setDither(false);
paint.setFilterBitmap(false);
long frameEndNanos;
long frameStartNanos;
long sleepTime;
long sleepMillis;
int sleepNanos;
int[] rgbArray;
// define the frame rate limit
final long frameTimeNanos = (long)(NANOS / 60); // Targeting 60 FPS
long frameDuration;
@ -107,6 +109,9 @@ public class AWTCanvasView extends TextureView implements TextureView.SurfaceTex
private void refreshSize(){
ViewGroup.LayoutParams layoutParams = getLayoutParams();
/** Note: In the future this is a good way to stretch the aspect ratio too. Like for
* 16:9 widescreen in SD mode like mudkip osrs videos */
if(getHeight() < getWidth()){
layoutParams.width = AWT_CANVAS_WIDTH * getHeight() / AWT_CANVAS_HEIGHT;
}else{

View file

@ -89,6 +89,7 @@ public class CustomSeekBarPreference extends SeekBarPreference {
setValue(progress + mMin);
updateTextViewWithSuffix();
System.out.println("Hello from CustomSeekBar: "+progress);
}
});

View file

@ -38,6 +38,17 @@
app2:seekBarIncrement="10"
android:icon="@drawable/ic_setting_gesture_time"
/>
<net.kdt.pojavlaunch.prefs.CustomSeekBarPreference
android:id="@+id/customSeekBarPreference"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:icon="@drawable/ic_setting_gesture_time"
android:key="timeLongPressTrigger"
android:summary="&quot;Hello&quot;"
android:title="&quot;Example&quot;"
app2:seekBarIncrement="10"
app2:selectable="false"
app2:showSeekBarValue="true" />
</PreferenceCategory>