forked from PojavLauncherTeam/PojavLauncher
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
haven't done this in a while, technically upgrades SCL to foxglove since I don't think I did that yet
- Loading branch information
Showing
169 changed files
with
5,034 additions
and
2,792 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 |
---|---|---|
@@ -1,2 +1 @@ | ||
open_collective: pojavlauncher | ||
patreon: pojavlauncher |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
1. This app (while idle) does NOT collect any sensitive information, and does NOT use network (exception is the "News" page, it uses network to load the launcher news) | ||
1. This app (while idle) does NOT collect any sensitive information, and uses network for downloading Minecraft resources. | ||
2. While running Minecraft, app also does NOT collect any sensitive information about your device. Snooper by Mojang does. | ||
3. Some sensitive data is stored in crash reports after the game crashes, but it's not being shared to anyone except the current user. |
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
Binary file modified
BIN
+544 KB
(120%)
app_pojavlauncher/src/main/assets/components/lwjgl3/lwjgl-glfw-classes.jar
Binary file not shown.
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 |
---|---|---|
@@ -1 +1 @@ | ||
1731000005291 | ||
1732218529630 |
164 changes: 164 additions & 0 deletions
164
app_pojavlauncher/src/main/java/com/kdt/CustomSeekbar.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,164 @@ | ||
package com.kdt; | ||
|
||
import android.annotation.SuppressLint; | ||
import android.content.Context; | ||
import android.content.res.TypedArray; | ||
import android.os.Build; | ||
import android.util.AttributeSet; | ||
import android.widget.SeekBar; | ||
|
||
import androidx.annotation.Nullable; | ||
|
||
import net.kdt.pojavlaunch.R; | ||
|
||
/** | ||
* Seekbar with ability to handle ranges and increments | ||
*/ | ||
@SuppressLint("AppCompatCustomView") | ||
public class CustomSeekbar extends SeekBar { | ||
private int mMin = 0; | ||
private int mIncrement = 1; | ||
private SeekBar.OnSeekBarChangeListener mListener; | ||
|
||
private final OnSeekBarChangeListener mInternalListener = new OnSeekBarChangeListener() { | ||
/** When using increments, this flag is used to prevent double calls to the listener */ | ||
private boolean internalChanges = false; | ||
/** Store the previous progress to prevent double calls with increments */ | ||
private int previousProgress = 0; | ||
@Override | ||
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { | ||
if (internalChanges) return; | ||
internalChanges = true; | ||
|
||
progress += mMin; | ||
progress = applyIncrement(progress); | ||
|
||
if (progress != previousProgress) { | ||
if (mListener != null) { | ||
previousProgress = progress; | ||
mListener.onProgressChanged(seekBar, progress, fromUser); | ||
} | ||
} | ||
|
||
// Forces the thumb to snap to the increment | ||
setProgress(progress); | ||
internalChanges = false; | ||
} | ||
|
||
@Override | ||
public void onStartTrackingTouch(SeekBar seekBar) { | ||
if (internalChanges) return; | ||
|
||
if (mListener != null) { | ||
mListener.onStartTrackingTouch(seekBar); | ||
} | ||
} | ||
|
||
@Override | ||
public void onStopTrackingTouch(SeekBar seekBar) { | ||
if (internalChanges) return; | ||
internalChanges = true; | ||
|
||
setProgress(seekBar.getProgress()); | ||
|
||
if (mListener != null) { | ||
mListener.onStopTrackingTouch(seekBar); | ||
} | ||
internalChanges = false; | ||
} | ||
}; | ||
|
||
public CustomSeekbar(Context context) { | ||
super(context); | ||
setup(null); | ||
} | ||
|
||
public CustomSeekbar(Context context, AttributeSet attrs) { | ||
super(context, attrs); | ||
setup(attrs); | ||
} | ||
|
||
public CustomSeekbar(Context context, AttributeSet attrs, int defStyleAttr) { | ||
super(context, attrs, defStyleAttr); | ||
setup(attrs); | ||
} | ||
|
||
public void setIncrement(int increment) { | ||
mIncrement = increment; | ||
} | ||
|
||
public void setRange(int min, int max) { | ||
mMin = min; | ||
setMax(max - min); | ||
} | ||
|
||
@Override | ||
public synchronized void setProgress(int progress) { | ||
super.setProgress(applyIncrement(progress - mMin)); | ||
} | ||
|
||
@Override | ||
public void setProgress(int progress, boolean animate) { | ||
super.setProgress(applyIncrement(progress - mMin), animate); | ||
} | ||
|
||
@Override | ||
public synchronized int getProgress() { | ||
return applyIncrement(super.getProgress() + mMin); | ||
} | ||
|
||
@Override | ||
public synchronized void setMin(int min) { | ||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { | ||
super.setMin(0); | ||
} | ||
mMin = min; | ||
//todo perform something to update the progress ? | ||
} | ||
|
||
|
||
|
||
/** | ||
* Wrapper to allow for a listener to be set around the internal listener | ||
*/ | ||
@Override | ||
public void setOnSeekBarChangeListener(OnSeekBarChangeListener l) { | ||
mListener = l; | ||
} | ||
|
||
public void setup(@Nullable AttributeSet attrs) { | ||
try (TypedArray attributes = getContext().obtainStyledAttributes(attrs, R.styleable.CustomSeekbar)) { | ||
setIncrement(attributes.getInt(R.styleable.CustomSeekbar_seekBarIncrement, 1)); | ||
int min = attributes.getInt(R.styleable.CustomSeekbar_android_min, 0); | ||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { | ||
super.setMin(0); | ||
} | ||
setRange(min, super.getMax()); | ||
} | ||
|
||
// Due to issues with negative progress when setting up the seekbar | ||
// We need to set a random progress to force the refresh of the thumb | ||
if(super.getProgress() == 0) { | ||
super.setProgress(super.getProgress() + 1); | ||
post(() -> { | ||
super.setProgress(super.getProgress() - 1); | ||
post(() -> super.setOnSeekBarChangeListener(mInternalListener)); | ||
}); | ||
} else { | ||
super.setOnSeekBarChangeListener(mInternalListener); | ||
} | ||
} | ||
|
||
/** | ||
* Apply increment to the progress | ||
* @param progress Progress to apply increment to | ||
* @return Progress with increment applied | ||
*/ | ||
private int applyIncrement(int progress) { | ||
if (mIncrement < 1) return progress; | ||
|
||
progress = progress / mIncrement; | ||
progress = progress * mIncrement; | ||
return progress; | ||
} | ||
} |
Oops, something went wrong.