-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
The Judge
committed
Oct 21, 2024
1 parent
8f42cbc
commit 553ea62
Showing
32 changed files
with
509 additions
and
617 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
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
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,5 +1,22 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="pojlib.android"> | ||
package="pojlib.android" > | ||
|
||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | ||
<application android:allowNativeHeapPointerTagging="false"/> | ||
|
||
<application | ||
android:allowNativeHeapPointerTagging="false" | ||
android:extractNativeLibs="true" > | ||
<activity | ||
android:name="pojlib.MainActivity" | ||
android:exported="true" | ||
android:theme="@style/Theme.Pojlib" > | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
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 @@ | ||
1728465869857 | ||
1729463321072 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package pojlib; | ||
|
||
import android.os.Bundle; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.fragment.app.Fragment; | ||
import androidx.navigation.fragment.NavHostFragment; | ||
|
||
import java.util.ArrayList; | ||
|
||
import pojlib.android.R; | ||
import pojlib.android.databinding.FragmentFirstBinding; | ||
import pojlib.util.JREUtils; | ||
import pojlib.util.json.MinecraftInstances; | ||
|
||
public class FirstFragment extends Fragment { | ||
|
||
private FragmentFirstBinding binding; | ||
|
||
@Override | ||
public View onCreateView( | ||
@NonNull LayoutInflater inflater, ViewGroup container, | ||
Bundle savedInstanceState | ||
) { | ||
|
||
binding = FragmentFirstBinding.inflate(inflater, container, false); | ||
return binding.getRoot(); | ||
|
||
} | ||
|
||
public void onViewCreated(@NonNull View view, Bundle savedInstanceState) { | ||
super.onViewCreated(view, savedInstanceState); | ||
|
||
binding.buttonFirst.setOnClickListener(v -> { | ||
NavHostFragment.findNavController(FirstFragment.this) | ||
.navigate(R.id.action_FirstFragment_to_SecondFragment); | ||
|
||
MinecraftInstances.Instance instance = new MinecraftInstances.Instance(); | ||
instance.gameDir = this.getActivity().getFilesDir().getAbsolutePath(); | ||
try { | ||
JREUtils.launchJavaVM(this.getActivity(), new ArrayList<>(), instance); | ||
} catch (Throwable e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
); | ||
} | ||
|
||
@Override | ||
public void onDestroyView() { | ||
super.onDestroyView(); | ||
binding = null; | ||
} | ||
|
||
} |
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 |
---|---|---|
@@ -0,0 +1,81 @@ | ||
package pojlib; | ||
|
||
import android.content.ClipboardManager; | ||
import android.os.Bundle; | ||
|
||
import com.google.android.material.snackbar.Snackbar; | ||
|
||
import androidx.appcompat.app.AppCompatActivity; | ||
|
||
import android.view.View; | ||
|
||
import androidx.navigation.NavController; | ||
import androidx.navigation.Navigation; | ||
import androidx.navigation.ui.AppBarConfiguration; | ||
import androidx.navigation.ui.NavigationUI; | ||
|
||
import org.lwjgl.glfw.CallbackBridge; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import fr.spse.gamepad_remapper.RemapperManager; | ||
import fr.spse.gamepad_remapper.RemapperView; | ||
import pojlib.android.databinding.ActivityMain2Binding; | ||
|
||
import pojlib.android.R; | ||
import pojlib.input.gamepad.Gamepad; | ||
import pojlib.util.JREUtils; | ||
import pojlib.util.json.MinecraftInstances; | ||
|
||
public class MainActivity extends AppCompatActivity { | ||
public static volatile ClipboardManager GLOBAL_CLIPBOARD; | ||
private Gamepad mGamepad = null; | ||
|
||
private RemapperManager mInputManager; | ||
private AppBarConfiguration appBarConfiguration; | ||
private ActivityMain2Binding binding; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
|
||
binding = ActivityMain2Binding.inflate(getLayoutInflater()); | ||
setContentView(binding.getRoot()); | ||
|
||
setSupportActionBar(binding.toolbar); | ||
|
||
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_content_main2); | ||
appBarConfiguration = new AppBarConfiguration.Builder(navController.getGraph()).build(); | ||
NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration); | ||
|
||
GLOBAL_CLIPBOARD = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); | ||
|
||
/* | ||
mInputManager = new RemapperManager(this, new RemapperView.Builder(null) | ||
.remapA(true) | ||
.remapB(true) | ||
.remapX(true) | ||
.remapY(true) | ||
.remapLeftJoystick(true) | ||
.remapRightJoystick(true) | ||
.remapStart(true) | ||
.remapSelect(true) | ||
.remapLeftShoulder(true) | ||
.remapRightShoulder(true) | ||
.remapLeftTrigger(true) | ||
.remapRightTrigger(true) | ||
.remapDpad(true)); | ||
CallbackBridge.nativeSetUseInputStackQueue(true); | ||
*/ | ||
} | ||
|
||
@Override | ||
public boolean onSupportNavigateUp() { | ||
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_content_main2); | ||
return NavigationUI.navigateUp(navController, appBarConfiguration) | ||
|| super.onSupportNavigateUp(); | ||
} | ||
} |
Oops, something went wrong.