mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2025-12-10 10:20:32 -07:00
Merge branch 'v3_openjdk' of https://github.com/khanhduytran0/PojavLauncher.git into v3_openjdk
This commit is contained in:
commit
d8832d76cc
152 changed files with 4783 additions and 2813 deletions
|
|
@ -1,9 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: __local_aars__:C.\Users\Admin\AndroidStudioProjects\PojavLauncherSource\app\libs\PointerCapture26Wrapper.jar:unspecified@jar">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/app/libs/PointerCapture26Wrapper.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: __local_aars__:C.\Users\Admin\AndroidStudioProjects\PojavLauncherSource\app\libs\asm-tree-5.0.3.jar:unspecified@jar">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/app/libs/asm-tree-5.0.3.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: __local_aars__:C.\Users\Admin\AndroidStudioProjects\PojavLauncherSource\app\libs\boardwalk_asm.jar:unspecified@jar">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/app/libs/boardwalk_asm.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: __local_aars__:C.\Users\Admin\AndroidStudioProjects\PojavLauncherSource\app\libs\boardwalk_jinput.jar:unspecified@jar">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/app/libs/boardwalk_jinput.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: __local_aars__:C.\Users\Admin\AndroidStudioProjects\PojavLauncherSource\app\libs\boardwalk_lwjgl.jar:unspecified@jar">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/app/libs/boardwalk_lwjgl.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: __local_aars__:C.\Users\Admin\AndroidStudioProjects\PojavLauncherSource\app\libs\boardwalk_lzma.jar:unspecified@jar">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/app/libs/boardwalk_lzma.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: __local_aars__:C.\Users\Admin\AndroidStudioProjects\PojavLauncherSource\app\libs\gson-2.8.6.jar:unspecified@jar">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/app/libs/gson-2.8.6.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: __local_aars__:C.\Users\Admin\AndroidStudioProjects\PojavLauncherSource\app\libs\jopt-simple-5.0.4.jar:unspecified@jar">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/app/libs/jopt-simple-5.0.4.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: android.arch.core:common:1.1.1@jar">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/android.arch.core/common/1.1.1/e55b70d1f5620db124b3e85a7f4bdc7bd48d9f95/common-1.1.1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/android.arch.core/common/1.1.1/ae9b923fc99c1fc5a7a9b6cedc6df8b2b8529c54/common-1.1.1-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: android.arch.core:runtime:1.1.1@aar">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/32c3c3c1ff1572cd4fbf4adc8b2e281b/runtime-1.1.1/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/32c3c3c1ff1572cd4fbf4adc8b2e281b/runtime-1.1.1/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/android.arch.core/runtime/1.1.1/25df553df10af32bede9dd768a2d15299543d84/runtime-1.1.1-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: android.arch.lifecycle:common:1.1.1@jar">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/android.arch.lifecycle/common/1.1.1/207a6efae6a3555e326de41f76bdadd9a239cbce/common-1.1.1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/android.arch.lifecycle/common/1.1.1/bcdaa509a856d1430e736b102f899aa9870a8f83/common-1.1.1-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: android.arch.lifecycle:livedata:1.1.1@aar">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/855199d21a2457dffd94f776f414402b/livedata-1.1.1/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/855199d21a2457dffd94f776f414402b/livedata-1.1.1/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/android.arch.lifecycle/livedata/1.1.1/bf27acaa4953c98cd519756ed7b7caacf94407d4/livedata-1.1.1-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: android.arch.lifecycle:livedata-core:1.1.1@aar">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/0c580ad6917269345b415f2689381fa7/livedata-core-1.1.1/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/0c580ad6917269345b415f2689381fa7/livedata-core-1.1.1/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/android.arch.lifecycle/livedata-core/1.1.1/c38818e006ea7a408c05e3090364332d46494ef/livedata-core-1.1.1-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: android.arch.lifecycle:runtime:1.1.1@aar">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/912d14cf8b7da59afd70a06b1ab8df17/runtime-1.1.1/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/912d14cf8b7da59afd70a06b1ab8df17/runtime-1.1.1/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/android.arch.lifecycle/runtime/1.1.1/8e4214221b3797b863dc9998d16abb4af043e784/runtime-1.1.1-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: android.arch.lifecycle:viewmodel:1.1.1@aar">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/e30d9e6f3403e84c4cae532d406e4009/viewmodel-1.1.1/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/e30d9e6f3403e84c4cae532d406e4009/viewmodel-1.1.1/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/android.arch.lifecycle/viewmodel/1.1.1/d1cc8e805317f171be63c68341f499acda7e42d6/viewmodel-1.1.1-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:animated-vector-drawable:24.0.0@aar">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/75877556ef6481fccd342946f0c48eda/animated-vector-drawable-24.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/75877556ef6481fccd342946f0c48eda/animated-vector-drawable-24.0.0/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.android.support/animated-vector-drawable/24.0.0/7cdb85f9bda31e9a1a885a9d35bded49d7bfda79/animated-vector-drawable-24.0.0-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.android.support/animated-vector-drawable/24.0.0/1a9454b9d6a39997960dc49990e46d70398ce220/animated-vector-drawable-24.0.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:animated-vector-drawable:28.0.0@aar">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/c82b71cc23f1f749201c229f1e0919f8/animated-vector-drawable-28.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/c82b71cc23f1f749201c229f1e0919f8/animated-vector-drawable-28.0.0/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:appcompat-v7:24.0.0@aar">
|
||||
<ANNOTATIONS>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/944544cad7c677d407c6328370bb2d6b/appcompat-v7-24.0.0/annotations.zip!/" />
|
||||
</ANNOTATIONS>
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/944544cad7c677d407c6328370bb2d6b/appcompat-v7-24.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/944544cad7c677d407c6328370bb2d6b/appcompat-v7-24.0.0/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.android.support/appcompat-v7/24.0.0/1dee1f847e0681d78ab66161730cb2de984d3a9d/appcompat-v7-24.0.0-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.android.support/appcompat-v7/24.0.0/62f5a92844ab233aca69beadc350d772b8b44b85/appcompat-v7-24.0.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:appcompat-v7:28.0.0@aar">
|
||||
<ANNOTATIONS>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/7f5f0b3369d8fa8a72a20e2278ec0acc/appcompat-v7-28.0.0/annotations.zip!/" />
|
||||
</ANNOTATIONS>
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/7f5f0b3369d8fa8a72a20e2278ec0acc/appcompat-v7-28.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/7f5f0b3369d8fa8a72a20e2278ec0acc/appcompat-v7-28.0.0/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:asynclayoutinflater:28.0.0@aar">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/e2a5a2145c109898fc28f4778cc59fa2/asynclayoutinflater-28.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/e2a5a2145c109898fc28f4778cc59fa2/asynclayoutinflater-28.0.0/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:cardview-v7:28.0.0@aar">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/45af0f91ec351e1a1c603d501e9b45b7/cardview-v7-28.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/45af0f91ec351e1a1c603d501e9b45b7/cardview-v7-28.0.0/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:collections:28.0.0@jar">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.android.support/collections/28.0.0/c1bcdade4d3cc2836130424a3f3e4182c666a745/collections-28.0.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:coordinatorlayout:28.0.0@aar">
|
||||
<ANNOTATIONS>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/2f9ffac3f9aa7c3da9b2ea0a60bff798/coordinatorlayout-28.0.0/annotations.zip!/" />
|
||||
</ANNOTATIONS>
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/2f9ffac3f9aa7c3da9b2ea0a60bff798/coordinatorlayout-28.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/2f9ffac3f9aa7c3da9b2ea0a60bff798/coordinatorlayout-28.0.0/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:cursoradapter:28.0.0@aar">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/f89186d3faa35207960141dbf97e7823/cursoradapter-28.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/f89186d3faa35207960141dbf97e7823/cursoradapter-28.0.0/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:customview:28.0.0@aar">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/b82955ed32a4ee277723d8123c155ac3/customview-28.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/b82955ed32a4ee277723d8123c155ac3/customview-28.0.0/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:design:24.0.0@aar">
|
||||
<ANNOTATIONS>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/1c7406d0210466456f7f2a18769322be/design-24.0.0/annotations.zip!/" />
|
||||
</ANNOTATIONS>
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/1c7406d0210466456f7f2a18769322be/design-24.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/1c7406d0210466456f7f2a18769322be/design-24.0.0/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.android.support/design/24.0.0/4e7a74da078c5b1e11fd4485cefba1390a88c290/design-24.0.0-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.android.support/design/24.0.0/eafe125bfb8f8971b1e717c04a01446b944c238e/design-24.0.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:design:28.0.0@aar">
|
||||
<ANNOTATIONS>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/9d7250a774d78c6da773e4ce19c93e82/design-28.0.0/annotations.zip!/" />
|
||||
</ANNOTATIONS>
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/9d7250a774d78c6da773e4ce19c93e82/design-28.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/9d7250a774d78c6da773e4ce19c93e82/design-28.0.0/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:documentfile:28.0.0@aar">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/6382b0a1555e0e71f2a2930dfe6b1d66/documentfile-28.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/6382b0a1555e0e71f2a2930dfe6b1d66/documentfile-28.0.0/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:drawerlayout:28.0.0@aar">
|
||||
<ANNOTATIONS>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/e393f8741de26a3dcc6eeb170bd18679/drawerlayout-28.0.0/annotations.zip!/" />
|
||||
</ANNOTATIONS>
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/e393f8741de26a3dcc6eeb170bd18679/drawerlayout-28.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/e393f8741de26a3dcc6eeb170bd18679/drawerlayout-28.0.0/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:interpolator:28.0.0@aar">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/9f66af0770fd83464340388aae824c93/interpolator-28.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/9f66af0770fd83464340388aae824c93/interpolator-28.0.0/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:loader:28.0.0@aar">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/776dfa9be835a7a130740bd6b0619584/loader-28.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/776dfa9be835a7a130740bd6b0619584/loader-28.0.0/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:localbroadcastmanager:28.0.0@aar">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/ab60f6dd6ef13cb57d98ea7973f298c0/localbroadcastmanager-28.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/ab60f6dd6ef13cb57d98ea7973f298c0/localbroadcastmanager-28.0.0/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:print:28.0.0@aar">
|
||||
<ANNOTATIONS>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/441dd746fc5507909e127eaa50801847/print-28.0.0/annotations.zip!/" />
|
||||
</ANNOTATIONS>
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/441dd746fc5507909e127eaa50801847/print-28.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/441dd746fc5507909e127eaa50801847/print-28.0.0/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:recyclerview-v7:24.0.0@aar">
|
||||
<ANNOTATIONS>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/5e9dfaae4dbe56458c785c60383ff02f/recyclerview-v7-24.0.0/annotations.zip!/" />
|
||||
</ANNOTATIONS>
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/5e9dfaae4dbe56458c785c60383ff02f/recyclerview-v7-24.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/5e9dfaae4dbe56458c785c60383ff02f/recyclerview-v7-24.0.0/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.android.support/recyclerview-v7/24.0.0/1a7422282d41a7cc03967d984f98c3cc2403b366/recyclerview-v7-24.0.0-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.android.support/recyclerview-v7/24.0.0/7d5bcb1d9d740c56fa29a830e5430bae461c4c5b/recyclerview-v7-24.0.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:recyclerview-v7:28.0.0@aar">
|
||||
<ANNOTATIONS>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/711cd693cb47fa08b9b342d9a2815457/recyclerview-v7-28.0.0/annotations.zip!/" />
|
||||
</ANNOTATIONS>
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/711cd693cb47fa08b9b342d9a2815457/recyclerview-v7-28.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/711cd693cb47fa08b9b342d9a2815457/recyclerview-v7-28.0.0/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:slidingpanelayout:28.0.0@aar">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/c98a9bc0a455ab0200cce6feac99fa67/slidingpanelayout-28.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/c98a9bc0a455ab0200cce6feac99fa67/slidingpanelayout-28.0.0/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:support-annotations:24.0.0@jar">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.android.support/support-annotations/24.0.0/2943c74db6d4346ab8c6531adac91fa05c137c40/support-annotations-24.0.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.android.support/support-annotations/24.0.0/1860f9b872b4c4a2940e44aff2a923e2c6a6125d/support-annotations-24.0.0-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.android.support/support-annotations/24.0.0/95108bd6693b3b1a192e750e29d5b57bf36a651b/support-annotations-24.0.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:support-annotations:28.0.0@jar">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.android.support/support-annotations/28.0.0/ed73f5337a002d1fd24339d5fb08c2c9d9ca60d8/support-annotations-28.0.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:support-compat:28.0.0@aar">
|
||||
<ANNOTATIONS>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/b73d0db3c489aeab8b531c92b0313ef9/support-compat-28.0.0/annotations.zip!/" />
|
||||
</ANNOTATIONS>
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/b73d0db3c489aeab8b531c92b0313ef9/support-compat-28.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/b73d0db3c489aeab8b531c92b0313ef9/support-compat-28.0.0/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:support-core-ui:28.0.0@aar">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/240ad4e7c0a4c0f0ac07ba22afac43c2/support-core-ui-28.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/240ad4e7c0a4c0f0ac07ba22afac43c2/support-core-ui-28.0.0/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:support-core-utils:28.0.0@aar">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/13f115cc5d5138e9ed6d7046dab5d030/support-core-utils-28.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/13f115cc5d5138e9ed6d7046dab5d030/support-core-utils-28.0.0/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:support-fragment:28.0.0@aar">
|
||||
<ANNOTATIONS>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/bc3876738bdb5d8e498d8c27630d1092/support-fragment-28.0.0/annotations.zip!/" />
|
||||
</ANNOTATIONS>
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/bc3876738bdb5d8e498d8c27630d1092/support-fragment-28.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/bc3876738bdb5d8e498d8c27630d1092/support-fragment-28.0.0/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:support-media-compat:28.0.0@aar">
|
||||
<ANNOTATIONS>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/7ba19d4c13a915d31338854ea04490b4/support-media-compat-28.0.0/annotations.zip!/" />
|
||||
</ANNOTATIONS>
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/7ba19d4c13a915d31338854ea04490b4/support-media-compat-28.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/7ba19d4c13a915d31338854ea04490b4/support-media-compat-28.0.0/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:support-v4:24.0.0@aar">
|
||||
<ANNOTATIONS>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/be53f99ed6133cd79ec12244f8e69ea0/support-v4-24.0.0/annotations.zip!/" />
|
||||
</ANNOTATIONS>
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/be53f99ed6133cd79ec12244f8e69ea0/support-v4-24.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/be53f99ed6133cd79ec12244f8e69ea0/support-v4-24.0.0/res" />
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/be53f99ed6133cd79ec12244f8e69ea0/support-v4-24.0.0/jars/libs/internal_impl-24.0.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.android.support/support-v4/24.0.0/6de54e5f4f33e1b3f15fe239f0fedce9867bfdb3/support-v4-24.0.0-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.android.support/support-v4/24.0.0/16200284c24098f46a52d93f8f608486423369de/support-v4-24.0.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:support-v4:28.0.0@aar">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/5e6c966e41283eb28599ac75ae8916f4/support-v4-28.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/5e6c966e41283eb28599ac75ae8916f4/support-v4-28.0.0/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:support-vector-drawable:24.0.0@aar">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/9a930d2ee4ded0c4ef412c68b5a80450/support-vector-drawable-24.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/9a930d2ee4ded0c4ef412c68b5a80450/support-vector-drawable-24.0.0/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.android.support/support-vector-drawable/24.0.0/6de54e5f4f33e1b3f15fe239f0fedce9867bfdb3/support-vector-drawable-24.0.0-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.android.support/support-vector-drawable/24.0.0/200498b6cb999f720daae0e89725984b46192534/support-vector-drawable-24.0.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:support-vector-drawable:28.0.0@aar">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/6c361ce609604c8b37cbff4112761818/support-vector-drawable-28.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/6c361ce609604c8b37cbff4112761818/support-vector-drawable-28.0.0/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:swiperefreshlayout:28.0.0@aar">
|
||||
<ANNOTATIONS>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/8756cea37b098f254fcf1c05271849e1/swiperefreshlayout-28.0.0/annotations.zip!/" />
|
||||
</ANNOTATIONS>
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/8756cea37b098f254fcf1c05271849e1/swiperefreshlayout-28.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/8756cea37b098f254fcf1c05271849e1/swiperefreshlayout-28.0.0/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:transition:28.0.0@aar">
|
||||
<ANNOTATIONS>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/a191153422ddfd26478c8b99811273f5/transition-28.0.0/annotations.zip!/" />
|
||||
</ANNOTATIONS>
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/a191153422ddfd26478c8b99811273f5/transition-28.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/a191153422ddfd26478c8b99811273f5/transition-28.0.0/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:versionedparcelable:28.0.0@aar">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/b93ddaf99704c9896c23344bb8a6cc5b/versionedparcelable-28.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/b93ddaf99704c9896c23344bb8a6cc5b/versionedparcelable-28.0.0/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: com.android.support:viewpager:28.0.0@aar">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/4660acd0807cc71ba66bee2bd6cbbbe5/viewpager-28.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/4660acd0807cc71ba66bee2bd6cbbbe5/viewpager-28.0.0/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Gradle: commons-codec:commons-codec:20041127.091804@jar">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/commons-codec/commons-codec/20041127.091804/17b1ff59f0916ac7bcff704e712415a0d49d468d/commons-codec-20041127.091804.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
33
README.md
33
README.md
|
|
@ -1,19 +1,13 @@
|
|||
[](https://github.com/PojavLauncherTeam/PojavLauncher/actions)
|
||||
[](https://crowdin.com/project/pojavlauncher)
|
||||
[**Discord server**](https://discord.gg/6RpEJda)
|
||||
# PojavLauncher
|
||||
A Minecraft: Java Edition launcher for Android based from Boardwalk. This branch is intended to support 1.13+
|
||||
|
||||
## This branch?
|
||||
- Attempt to run Minecraft in OpenJDK, similar way with Boardwalk 2.
|
||||
|
||||
## About OpenJDK 9 Java Runtime Mobile
|
||||
Build script: [PojavLauncherTeam/android-openjdk-build-multiarch](https://github.com/PojavLauncherTeam/android-openjdk-build-multiarch)<br>
|
||||
Source code: http://hg.openjdk.java.net/mobile/jdk9 <br>
|
||||
Architectures:
|
||||
- For ARMv7 (aarch32): **working**.
|
||||
- For ARM64 (aarch64): **working**.
|
||||
- For x86 (i\*86): **working**.
|
||||
- For x86_64 (amd64): **working**.
|
||||
## Mainly features on v3
|
||||
- Launch Minecraft 1.6 to latest 1.17 snapshot.
|
||||
- Launch Forge up to 1.13.2. To install Forge 1.12.2 and below, simply put to mod install launcher. For Forge 1.13.2, use custom arguments.
|
||||
- Launch Fabric any versions. [How to install Fabric](https://github.com/PojavLauncherTeam/PojavLauncher/wiki/Install-Fabric).
|
||||
|
||||
## Building
|
||||
- Because languages are auto added by Crowdin, so need to run language list generator before build. In this directory, run:
|
||||
|
|
@ -28,14 +22,12 @@ scripts\languagelist_updater.bat
|
|||
- Then, build use Android Studio.
|
||||
|
||||
## Current status
|
||||
- [x] **Removed** ~~BinaryExecutor: execute `java` binary, no `JNIInvocation`.~~
|
||||
- [x] **Temporary removed** ~~JVDroid OpenJDK 11 (32 and 64-bit ARM and x86). Partial, no error `can't lock mutex`, but now exit with none output.~~
|
||||
- [x] OpenJDK 9 Mobile port: ARM32, ARM64, x86, x86_64.
|
||||
- [x] OpenJDK 8 Mobile port: ARM64, x86, x86_64
|
||||
- [x] Mod installer headless
|
||||
- [ ] Mod installer with GUI. Will try own graphics environment~~use `Caciocavallo` project~~.
|
||||
- [ ] Mod installer with GUI. Little run on `Caciocavallo` project.
|
||||
- [x] OpenGL in OpenJDK environment
|
||||
- [x] OpenAL (work on most devices)
|
||||
- [x] Input keyboard and mouse events from ART to OpenJDK environment
|
||||
- [x] Support Minecraft 1.12.2 and below. Used [lwjglx](https://github.com/PojavLauncherTeam/lwjglx), a LWJGL2 compatibility layer for LWJGL3.
|
||||
- [x] Support Minecraft 1.13 and above. Used [GLFW stub](https://github.com/PojavLauncherTeam/lwjgl3-glfw-java).
|
||||
- [ ] Game surface zooming.
|
||||
|
|
@ -43,4 +35,13 @@ scripts\languagelist_updater.bat
|
|||
- [ ] More...
|
||||
|
||||
## License
|
||||
- PojavLauncher is licensed under GPLv3.
|
||||
- PojavLauncher is licensed under [GNU GPLv3](https://github.com/khanhduytran0/PojavLauncher/blob/master/LICENSE).
|
||||
|
||||
## Third party components and it's licenses
|
||||
- [Boardwalk](https://github.com/zhuowei/Boardwalk) (JVM Launcher): Unknown License/[Apache License 2.0](https://github.com/zhuowei/Boardwalk/blob/master/LICENSE) or GNU GPLv2.
|
||||
- Android Support Libraries: [Apache License 2.0](https://android.googlesource.com/platform/prebuilts/maven_repo/android/+/master/NOTICE.txt).
|
||||
- [GL4ES](https://github.com/ptitSeb/gl4es): [MIT License](https://github.com/ptitSeb/gl4es/blob/master/LICENSE).<br>
|
||||
- [OpenJDK](https://github.com/PojavLauncherTeam/openjdk-multiarch-jdk8u): [GNU GPLv2 License](https://openjdk.java.net/legal/gplv2+ce.html).<br>
|
||||
- [LWJGL3](https://github.com/PojavLauncherTeam/lwjgl3): [BSD-3 License](https://github.com/LWJGL/lwjgl3/blob/master/LICENSE.md).
|
||||
- [LWJGLX](https://github.com/PojavLauncherTeam/lwjglx) (LWJGL2 API compatibility layer for LWJGL3): unknown license.<br>
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ android {
|
|||
minSdkVersion 21
|
||||
targetSdkVersion 26
|
||||
versionCode 156236
|
||||
versionName "3.3.0b_6408b_20201119"
|
||||
versionName "3.3.0b_6408b_20201127"
|
||||
multiDexEnabled true //important
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -63,13 +63,6 @@
|
|||
android:name=".MainActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|keyboard|navigation"/>
|
||||
|
||||
<activity
|
||||
android:launchMode="standard"
|
||||
android:multiprocess="true"
|
||||
android:screenOrientation="sensorLandscape"
|
||||
android:name=".CustomCtrlMainActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|keyboard|navigation"/>
|
||||
|
||||
<activity
|
||||
android:screenOrientation="sensorLandscape"
|
||||
android:name=".prefs.LauncherPreferenceActivity"
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -13,14 +13,14 @@
|
|||
* Third party licenses:<br>
|
||||
• Apache Commons Compress (unknown or Apache License 2.0).<br>
|
||||
• exp4j: <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License 2.0</a>.<br>
|
||||
• gl4es: <a href="https://github.com/ptitSeb/gl4es/blob/master/LICENSE">MIT License</a>.<br>
|
||||
• GL4ES: <a href="https://github.com/ptitSeb/gl4es/blob/master/LICENSE">MIT License</a>.<br>
|
||||
• LegacyLauncher: (unknown license).<br>
|
||||
• OpenJDK: <a href="https://openjdk.java.net/legal/gplv2+ce.html">GNU GPLv2 License</a>.<br>
|
||||
• LWJGL: <a href="http://legacy.lwjgl.org/license.php.html">LWJGL 2's License</a>.<br><br>
|
||||
|
||||
* Notes:<br>
|
||||
- This app is under development and will not be stable.<br>
|
||||
- This app is not affiliated with Minecraft, Mojang or Microsoft.
|
||||
- This app is not affiliated with Minecraft, Mojang or Microsoft.<br><br>
|
||||
|
||||
%s
|
||||
* Translators can be found at https://crowdin.com/project/pojavlauncher
|
||||
|
||||
|
|
|
|||
1
app/src/main/assets/components/jre/version
Normal file
1
app/src/main/assets/components/jre/version
Normal file
|
|
@ -0,0 +1 @@
|
|||
20201127
|
||||
BIN
app/src/main/assets/components/lwjgl3/jsr305.jar
Normal file
BIN
app/src/main/assets/components/lwjgl3/jsr305.jar
Normal file
Binary file not shown.
BIN
app/src/main/assets/components/lwjgl3/lwjgl-glfw-classes.jar
Normal file
BIN
app/src/main/assets/components/lwjgl3/lwjgl-glfw-classes.jar
Normal file
Binary file not shown.
BIN
app/src/main/assets/components/lwjgl3/lwjgl-jemalloc.jar
Normal file
BIN
app/src/main/assets/components/lwjgl3/lwjgl-jemalloc.jar
Normal file
Binary file not shown.
BIN
app/src/main/assets/components/lwjgl3/lwjgl-openal.jar
Normal file
BIN
app/src/main/assets/components/lwjgl3/lwjgl-openal.jar
Normal file
Binary file not shown.
BIN
app/src/main/assets/components/lwjgl3/lwjgl-opengl.jar
Normal file
BIN
app/src/main/assets/components/lwjgl3/lwjgl-opengl.jar
Normal file
Binary file not shown.
BIN
app/src/main/assets/components/lwjgl3/lwjgl-stb.jar
Normal file
BIN
app/src/main/assets/components/lwjgl3/lwjgl-stb.jar
Normal file
Binary file not shown.
BIN
app/src/main/assets/components/lwjgl3/lwjgl-tinyfd.jar
Normal file
BIN
app/src/main/assets/components/lwjgl3/lwjgl-tinyfd.jar
Normal file
Binary file not shown.
BIN
app/src/main/assets/components/lwjgl3/lwjgl.jar
Normal file
BIN
app/src/main/assets/components/lwjgl3/lwjgl.jar
Normal file
Binary file not shown.
1
app/src/main/assets/components/lwjgl3/version
Normal file
1
app/src/main/assets/components/lwjgl3/version
Normal file
|
|
@ -0,0 +1 @@
|
|||
20201121:1
|
||||
|
|
@ -103,7 +103,7 @@ public class ActionPopupWindow extends PinnedPopupWindow implements OnClickListe
|
|||
String[] oldSpecialArr = ControlData.buildSpecialButtonArray();
|
||||
final String[] specialArr = new String[oldSpecialArr.length];
|
||||
for (int i = 0; i < specialArr.length; i++) {
|
||||
specialArr[i] = "SPECIAL_" + oldSpecialArr[i];
|
||||
specialArr[i] = "SPECIAL_" + oldSpecialArr[specialArr.length - i - 1];
|
||||
}
|
||||
|
||||
adapter.addAll(specialArr);
|
||||
|
|
@ -118,11 +118,20 @@ public class ActionPopupWindow extends PinnedPopupWindow implements OnClickListe
|
|||
|
||||
final CheckBox checkHidden = dialog.findViewById(R.id.controlsetting_checkbox_hidden);
|
||||
checkHidden.setChecked(properties.hidden);
|
||||
|
||||
final CheckBox checkDynamicPos = dialog.findViewById(R.id.controlsetting_checkbox_dynamicpos);
|
||||
checkDynamicPos.setChecked(properties.isDynamicBtn);
|
||||
|
||||
final CheckBox checkToggle = dialog.findViewById(R.id.controlsetting_checkbox_toggle);
|
||||
checkToggle.setChecked(properties.isToggle);
|
||||
|
||||
final LinearLayout layoutDynamicBtn = dialog.findViewById(R.id.controlsetting_dynamicbtnlayout);
|
||||
final CheckBox checkDynamicPos = dialog.findViewById(R.id.controlsetting_checkbox_dynamicpos);
|
||||
checkDynamicPos.setOnCheckedChangeListener(new CheckBox.OnCheckedChangeListener(){
|
||||
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton btn, boolean checked) {
|
||||
layoutDynamicBtn.setVisibility(checked ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
});
|
||||
checkDynamicPos.setChecked(properties.isDynamicBtn);
|
||||
|
||||
final EditText editDynamicX = dialog.findViewById(R.id.controlsetting_edit_dynamicpos_x);
|
||||
final EditText editDynamicY = dialog.findViewById(R.id.controlsetting_edit_dynamicpos_y);
|
||||
|
|
@ -133,14 +142,6 @@ public class ActionPopupWindow extends PinnedPopupWindow implements OnClickListe
|
|||
editDynamicY.setHint(Float.toString(properties.y));
|
||||
editDynamicY.setText(properties.dynamicY);
|
||||
|
||||
checkDynamicPos.setOnCheckedChangeListener(new CheckBox.OnCheckedChangeListener(){
|
||||
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton btn, boolean checked) {
|
||||
layoutDynamicBtn.setVisibility(checked ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
});
|
||||
|
||||
final CheckBox checkHoldAlt = dialog.findViewById(R.id.controlsetting_checkbox_keycombine_alt);
|
||||
checkHoldAlt.setChecked(properties.holdAlt);
|
||||
|
||||
|
|
@ -174,16 +175,18 @@ public class ActionPopupWindow extends PinnedPopupWindow implements OnClickListe
|
|||
errorAt = null;
|
||||
*/
|
||||
|
||||
int errorAt = 0;
|
||||
try {
|
||||
properties.insertDynamicPos(editDynamicX.getText().toString());
|
||||
errorAt = 1;
|
||||
properties.insertDynamicPos(editDynamicY.getText().toString());
|
||||
} catch (Throwable th) {
|
||||
(errorAt == 0 ? editDynamicX : editDynamicY)
|
||||
.setError(th.getMessage());
|
||||
|
||||
return;
|
||||
if (properties.isDynamicBtn) {
|
||||
int errorAt = 0;
|
||||
try {
|
||||
properties.insertDynamicPos(editDynamicX.getText().toString());
|
||||
errorAt = 1;
|
||||
properties.insertDynamicPos(editDynamicY.getText().toString());
|
||||
} catch (Throwable th) {
|
||||
(errorAt == 0 ? editDynamicX : editDynamicY)
|
||||
.setError(th.getMessage());
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (spinnerKeycode.getSelectedItemPosition() < specialArr.length) {
|
||||
|
|
@ -194,6 +197,7 @@ public class ActionPopupWindow extends PinnedPopupWindow implements OnClickListe
|
|||
properties.name = editName.getText().toString();
|
||||
properties.hidden = checkHidden.isChecked();
|
||||
properties.isDynamicBtn = checkDynamicPos.isChecked();
|
||||
properties.isToggle = checkToggle.isChecked();
|
||||
properties.dynamicX = editDynamicX.getText().toString();
|
||||
properties.dynamicY = editDynamicY.getText().toString();
|
||||
|
||||
|
|
|
|||
|
|
@ -32,40 +32,40 @@ import net.kdt.pojavlaunch.customcontrols.*;
|
|||
|
||||
public abstract class HandleView extends View implements ViewPositionListener, View.OnLongClickListener
|
||||
{
|
||||
protected Drawable mDrawable;
|
||||
protected Drawable mDrawableLtr;
|
||||
protected Drawable mDrawableRtl;
|
||||
private final PopupWindow mContainer;
|
||||
// Position with respect to the parent TextView
|
||||
private int mPositionX, mPositionY;
|
||||
private boolean mIsDragging;
|
||||
// Offset from touch position to mPosition
|
||||
private float mTouchToWindowOffsetX, mTouchToWindowOffsetY;
|
||||
protected int mHotspotX;
|
||||
protected int mHorizontalGravity;
|
||||
// Offsets the hotspot point up, so that cursor is not hidden by the finger when moving up
|
||||
private float mTouchOffsetY;
|
||||
// Where the touch position should be on the handle to ensure a maximum cursor visibility
|
||||
private float mIdealVerticalOffset;
|
||||
// Parent's (TextView) previous position in window
|
||||
private int mLastParentX, mLastParentY;
|
||||
// Transient action popup window for Paste and Replace actions
|
||||
protected ActionPopupWindow mActionPopupWindow;
|
||||
// Previous text character offset
|
||||
private int mPreviousOffset = -1;
|
||||
// Previous text character offset
|
||||
private boolean mPositionHasChanged = true;
|
||||
// Used to delay the appearance of the action popup window
|
||||
private Runnable mActionPopupShower;
|
||||
// Minimum touch target size for handles
|
||||
private int mMinSize;
|
||||
protected ControlButton mView;
|
||||
|
||||
// MOD: Addition. Save old size of parent
|
||||
private int mDownWidth, mDownHeight;
|
||||
// int mWindowPosX, mWindowPosY;
|
||||
protected Drawable mDrawable;
|
||||
protected Drawable mDrawableLtr;
|
||||
protected Drawable mDrawableRtl;
|
||||
private final PopupWindow mContainer;
|
||||
// Position with respect to the parent TextView
|
||||
private int mPositionX, mPositionY;
|
||||
private boolean mIsDragging;
|
||||
// Offset from touch position to mPosition
|
||||
private float mTouchToWindowOffsetX, mTouchToWindowOffsetY;
|
||||
protected int mHotspotX;
|
||||
protected int mHorizontalGravity;
|
||||
// Offsets the hotspot point up, so that cursor is not hidden by the finger when moving up
|
||||
private float mTouchOffsetY;
|
||||
// Where the touch position should be on the handle to ensure a maximum cursor visibility
|
||||
private float mIdealVerticalOffset;
|
||||
// Parent's (TextView) previous position in window
|
||||
private int mLastParentX, mLastParentY;
|
||||
// Transient action popup window for Paste and Replace actions
|
||||
protected ActionPopupWindow mActionPopupWindow;
|
||||
// Previous text character offset
|
||||
private int mPreviousOffset = -1;
|
||||
// Previous text character offset
|
||||
private boolean mPositionHasChanged = true;
|
||||
// Used to delay the appearance of the action popup window
|
||||
private Runnable mActionPopupShower;
|
||||
// Minimum touch target size for handles
|
||||
private int mMinSize;
|
||||
protected ControlButton mView;
|
||||
|
||||
// MOD: Addition. Save old size of parent
|
||||
private int mDownWidth, mDownHeight;
|
||||
// int mWindowPosX, mWindowPosY;
|
||||
|
||||
private PositionListener mPositionListener;
|
||||
private PositionListener mPositionListener;
|
||||
public PositionListener getPositionListener() {
|
||||
if (mPositionListener == null) {
|
||||
mPositionListener = new PositionListener(mView);
|
||||
|
|
@ -73,279 +73,279 @@ public abstract class HandleView extends View implements ViewPositionListener, V
|
|||
return mPositionListener;
|
||||
}
|
||||
|
||||
public HandleView(ControlButton view) {
|
||||
super(view.getContext());
|
||||
|
||||
mView = view;
|
||||
|
||||
mDownWidth = view.getLayoutParams().width;
|
||||
mDownHeight = view.getLayoutParams().height;
|
||||
|
||||
mContainer = new PopupWindow(view.getContext(), null, android.R.attr.textSelectHandleWindowStyle);
|
||||
mContainer.setSplitTouchEnabled(true);
|
||||
mContainer.setClippingEnabled(false);
|
||||
mContainer.setWindowLayoutType(WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL);
|
||||
mContainer.setContentView(this);
|
||||
public HandleView(ControlButton view) {
|
||||
super(view.getContext());
|
||||
|
||||
mView = view;
|
||||
|
||||
mDownWidth = view.getLayoutParams().width;
|
||||
mDownHeight = view.getLayoutParams().height;
|
||||
|
||||
mContainer = new PopupWindow(view.getContext(), null, android.R.attr.textSelectHandleWindowStyle);
|
||||
mContainer.setSplitTouchEnabled(true);
|
||||
mContainer.setClippingEnabled(false);
|
||||
mContainer.setWindowLayoutType(WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL);
|
||||
mContainer.setContentView(this);
|
||||
|
||||
mDrawableLtr = view.getContext().getDrawable(R.drawable.text_select_handle_left_material);
|
||||
mDrawableRtl = view.getContext().getDrawable(R.drawable.text_select_handle_right_material);
|
||||
mMinSize = view.getContext().getResources().getDimensionPixelSize(R.dimen.text_handle_min_size);
|
||||
mDrawableLtr = view.getContext().getDrawable(R.drawable.text_select_handle_left_material);
|
||||
mDrawableRtl = view.getContext().getDrawable(R.drawable.text_select_handle_right_material);
|
||||
mMinSize = view.getContext().getResources().getDimensionPixelSize(R.dimen.text_handle_min_size);
|
||||
|
||||
setOnLongClickListener(this);
|
||||
|
||||
updateDrawable();
|
||||
setOnLongClickListener(this);
|
||||
|
||||
updateDrawable();
|
||||
|
||||
final int handleHeight = getPreferredHeight();
|
||||
mTouchOffsetY = -0.3f * handleHeight;
|
||||
mIdealVerticalOffset = 0.7f * handleHeight;
|
||||
}
|
||||
final int handleHeight = getPreferredHeight();
|
||||
mTouchOffsetY = -0.3f * handleHeight;
|
||||
mIdealVerticalOffset = 0.7f * handleHeight;
|
||||
}
|
||||
|
||||
protected void updateDrawable() {
|
||||
// final int offset = getCurrentCursorOffset();
|
||||
final boolean isRtlCharAtOffset = true; // mView.getLayout().isRtlCharAt(offset);
|
||||
mDrawable = isRtlCharAtOffset ? mDrawableRtl : mDrawableLtr;
|
||||
mHotspotX = getHotspotX(mDrawable, isRtlCharAtOffset);
|
||||
mHorizontalGravity = getHorizontalGravity(isRtlCharAtOffset);
|
||||
}
|
||||
protected void updateDrawable() {
|
||||
// final int offset = getCurrentCursorOffset();
|
||||
final boolean isRtlCharAtOffset = true; // mView.getLayout().isRtlCharAt(offset);
|
||||
mDrawable = isRtlCharAtOffset ? mDrawableRtl : mDrawableLtr;
|
||||
mHotspotX = getHotspotX(mDrawable, isRtlCharAtOffset);
|
||||
mHorizontalGravity = getHorizontalGravity(isRtlCharAtOffset);
|
||||
}
|
||||
|
||||
protected abstract int getHotspotX(Drawable drawable, boolean isRtlRun);
|
||||
protected abstract int getHorizontalGravity(boolean isRtlRun);
|
||||
protected abstract int getHotspotX(Drawable drawable, boolean isRtlRun);
|
||||
protected abstract int getHorizontalGravity(boolean isRtlRun);
|
||||
|
||||
// Touch-up filter: number of previous positions remembered
|
||||
private static final int HISTORY_SIZE = 5;
|
||||
private static final int TOUCH_UP_FILTER_DELAY_AFTER = 150;
|
||||
private static final int TOUCH_UP_FILTER_DELAY_BEFORE = 350;
|
||||
private final long[] mPreviousOffsetsTimes = new long[HISTORY_SIZE];
|
||||
private final int[] mPreviousOffsets = new int[HISTORY_SIZE];
|
||||
private int mPreviousOffsetIndex = 0;
|
||||
private int mNumberPreviousOffsets = 0;
|
||||
// Touch-up filter: number of previous positions remembered
|
||||
private static final int HISTORY_SIZE = 5;
|
||||
private static final int TOUCH_UP_FILTER_DELAY_AFTER = 150;
|
||||
private static final int TOUCH_UP_FILTER_DELAY_BEFORE = 350;
|
||||
private final long[] mPreviousOffsetsTimes = new long[HISTORY_SIZE];
|
||||
private final int[] mPreviousOffsets = new int[HISTORY_SIZE];
|
||||
private int mPreviousOffsetIndex = 0;
|
||||
private int mNumberPreviousOffsets = 0;
|
||||
|
||||
private void startTouchUpFilter(int offset) {
|
||||
mNumberPreviousOffsets = 0;
|
||||
addPositionToTouchUpFilter(offset);
|
||||
}
|
||||
private void startTouchUpFilter(int offset) {
|
||||
mNumberPreviousOffsets = 0;
|
||||
addPositionToTouchUpFilter(offset);
|
||||
}
|
||||
|
||||
private void addPositionToTouchUpFilter(int offset) {
|
||||
mPreviousOffsetIndex = (mPreviousOffsetIndex + 1) % HISTORY_SIZE;
|
||||
mPreviousOffsets[mPreviousOffsetIndex] = offset;
|
||||
mPreviousOffsetsTimes[mPreviousOffsetIndex] = SystemClock.uptimeMillis();
|
||||
mNumberPreviousOffsets++;
|
||||
}
|
||||
private void addPositionToTouchUpFilter(int offset) {
|
||||
mPreviousOffsetIndex = (mPreviousOffsetIndex + 1) % HISTORY_SIZE;
|
||||
mPreviousOffsets[mPreviousOffsetIndex] = offset;
|
||||
mPreviousOffsetsTimes[mPreviousOffsetIndex] = SystemClock.uptimeMillis();
|
||||
mNumberPreviousOffsets++;
|
||||
}
|
||||
|
||||
private void filterOnTouchUp() {
|
||||
final long now = SystemClock.uptimeMillis();
|
||||
int i = 0;
|
||||
int index = mPreviousOffsetIndex;
|
||||
final int iMax = Math.min(mNumberPreviousOffsets, HISTORY_SIZE);
|
||||
while (i < iMax && (now - mPreviousOffsetsTimes[index]) < TOUCH_UP_FILTER_DELAY_AFTER) {
|
||||
i++;
|
||||
index = (mPreviousOffsetIndex - i + HISTORY_SIZE) % HISTORY_SIZE;
|
||||
}
|
||||
private void filterOnTouchUp() {
|
||||
final long now = SystemClock.uptimeMillis();
|
||||
int i = 0;
|
||||
int index = mPreviousOffsetIndex;
|
||||
final int iMax = Math.min(mNumberPreviousOffsets, HISTORY_SIZE);
|
||||
while (i < iMax && (now - mPreviousOffsetsTimes[index]) < TOUCH_UP_FILTER_DELAY_AFTER) {
|
||||
i++;
|
||||
index = (mPreviousOffsetIndex - i + HISTORY_SIZE) % HISTORY_SIZE;
|
||||
}
|
||||
|
||||
if (i > 0 && i < iMax &&
|
||||
(now - mPreviousOffsetsTimes[index]) > TOUCH_UP_FILTER_DELAY_BEFORE) {
|
||||
positionAtCursorOffset(mPreviousOffsets[index], false);
|
||||
}
|
||||
}
|
||||
if (i > 0 && i < iMax &&
|
||||
(now - mPreviousOffsetsTimes[index]) > TOUCH_UP_FILTER_DELAY_BEFORE) {
|
||||
positionAtCursorOffset(mPreviousOffsets[index], false);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean offsetHasBeenChanged() {
|
||||
return mNumberPreviousOffsets > 1;
|
||||
}
|
||||
public boolean offsetHasBeenChanged() {
|
||||
return mNumberPreviousOffsets > 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
setMeasuredDimension(getPreferredWidth(), getPreferredHeight());
|
||||
}
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
setMeasuredDimension(getPreferredWidth(), getPreferredHeight());
|
||||
}
|
||||
|
||||
private int getPreferredWidth() {
|
||||
return Math.max(mDrawable.getIntrinsicWidth(), mMinSize);
|
||||
}
|
||||
private int getPreferredWidth() {
|
||||
return Math.max(mDrawable.getIntrinsicWidth(), mMinSize);
|
||||
}
|
||||
|
||||
private int getPreferredHeight() {
|
||||
return Math.max(mDrawable.getIntrinsicHeight(), mMinSize);
|
||||
}
|
||||
private int getPreferredHeight() {
|
||||
return Math.max(mDrawable.getIntrinsicHeight(), mMinSize);
|
||||
}
|
||||
|
||||
public void show() {
|
||||
if (isShowing()) return;
|
||||
public void show() {
|
||||
if (isShowing()) return;
|
||||
|
||||
getPositionListener().addSubscriber(this, true /* local position may change */);
|
||||
getPositionListener().addSubscriber(this, true /* local position may change */);
|
||||
|
||||
// Make sure the offset is always considered new, even when focusing at same position
|
||||
mPreviousOffset = -1;
|
||||
positionAtCursorOffset(getCurrentCursorOffset(), false);
|
||||
// Make sure the offset is always considered new, even when focusing at same position
|
||||
mPreviousOffset = -1;
|
||||
positionAtCursorOffset(getCurrentCursorOffset(), false);
|
||||
|
||||
hideActionPopupWindow();
|
||||
}
|
||||
hideActionPopupWindow();
|
||||
}
|
||||
|
||||
protected void dismiss() {
|
||||
mIsDragging = false;
|
||||
mContainer.dismiss();
|
||||
onDetached();
|
||||
}
|
||||
protected void dismiss() {
|
||||
mIsDragging = false;
|
||||
mContainer.dismiss();
|
||||
onDetached();
|
||||
}
|
||||
|
||||
public void hide() {
|
||||
dismiss();
|
||||
public void hide() {
|
||||
dismiss();
|
||||
|
||||
getPositionListener().removeSubscriber(this);
|
||||
}
|
||||
getPositionListener().removeSubscriber(this);
|
||||
}
|
||||
|
||||
void showActionPopupWindow(int delay) {
|
||||
if (mActionPopupWindow == null) {
|
||||
mActionPopupWindow = new ActionPopupWindow(this);
|
||||
}
|
||||
if (mActionPopupShower == null) {
|
||||
mActionPopupShower = new Runnable() {
|
||||
public void run() {
|
||||
mActionPopupWindow.show();
|
||||
}
|
||||
};
|
||||
} else {
|
||||
mView.removeCallbacks(mActionPopupShower);
|
||||
}
|
||||
mView.postDelayed(mActionPopupShower, delay);
|
||||
}
|
||||
void showActionPopupWindow(int delay) {
|
||||
if (mActionPopupWindow == null) {
|
||||
mActionPopupWindow = new ActionPopupWindow(this);
|
||||
}
|
||||
if (mActionPopupShower == null) {
|
||||
mActionPopupShower = new Runnable() {
|
||||
public void run() {
|
||||
mActionPopupWindow.show();
|
||||
}
|
||||
};
|
||||
} else {
|
||||
mView.removeCallbacks(mActionPopupShower);
|
||||
}
|
||||
mView.postDelayed(mActionPopupShower, delay);
|
||||
}
|
||||
|
||||
protected void hideActionPopupWindow() {
|
||||
if (mActionPopupShower != null) {
|
||||
mView.removeCallbacks(mActionPopupShower);
|
||||
}
|
||||
if (mActionPopupWindow != null) {
|
||||
mActionPopupWindow.hide();
|
||||
}
|
||||
}
|
||||
protected void hideActionPopupWindow() {
|
||||
if (mActionPopupShower != null) {
|
||||
mView.removeCallbacks(mActionPopupShower);
|
||||
}
|
||||
if (mActionPopupWindow != null) {
|
||||
mActionPopupWindow.hide();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isShowing() {
|
||||
return mContainer.isShowing();
|
||||
}
|
||||
public boolean isShowing() {
|
||||
return mContainer.isShowing();
|
||||
}
|
||||
|
||||
private boolean isVisible() {
|
||||
// Always show a dragging handle.
|
||||
if (mIsDragging) {
|
||||
return true;
|
||||
}
|
||||
private boolean isVisible() {
|
||||
// Always show a dragging handle.
|
||||
if (mIsDragging) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return mView.getVisibility() == View.VISIBLE;
|
||||
}
|
||||
return mView.getVisibility() == View.VISIBLE;
|
||||
}
|
||||
|
||||
public abstract int getCurrentCursorOffset();
|
||||
public abstract int getCurrentCursorOffset();
|
||||
|
||||
protected abstract void updateSelection(int offset);
|
||||
protected abstract void updateSelection(int offset);
|
||||
|
||||
public abstract void updatePosition(float x, float y);
|
||||
public abstract void updatePosition(float x, float y);
|
||||
|
||||
protected void positionAtCursorOffset(int offset, boolean parentScrolled) {
|
||||
mPositionX = (int) (mView.getWidth() / 1.1);
|
||||
mPositionY = mView.getHeight();
|
||||
|
||||
mPositionHasChanged = true;
|
||||
}
|
||||
protected void positionAtCursorOffset(int offset, boolean parentScrolled) {
|
||||
mPositionX = (int) (mView.getWidth() / 1.1);
|
||||
mPositionY = mView.getHeight();
|
||||
|
||||
mPositionHasChanged = true;
|
||||
}
|
||||
|
||||
public void updatePosition(int parentPositionX, int parentPositionY,
|
||||
boolean parentPositionChanged, boolean parentScrolled) {
|
||||
positionAtCursorOffset(getCurrentCursorOffset(), parentScrolled);
|
||||
if (parentPositionChanged || mPositionHasChanged) {
|
||||
if (mIsDragging) {
|
||||
// Update touchToWindow offset in case of parent scrolling while dragging
|
||||
if (parentPositionX != mLastParentX || parentPositionY != mLastParentY) {
|
||||
mTouchToWindowOffsetX += parentPositionX - mLastParentX;
|
||||
mTouchToWindowOffsetY += parentPositionY - mLastParentY;
|
||||
mLastParentX = parentPositionX;
|
||||
mLastParentY = parentPositionY;
|
||||
}
|
||||
public void updatePosition(int parentPositionX, int parentPositionY,
|
||||
boolean parentPositionChanged, boolean parentScrolled) {
|
||||
positionAtCursorOffset(getCurrentCursorOffset(), parentScrolled);
|
||||
if (parentPositionChanged || mPositionHasChanged) {
|
||||
if (mIsDragging) {
|
||||
// Update touchToWindow offset in case of parent scrolling while dragging
|
||||
if (parentPositionX != mLastParentX || parentPositionY != mLastParentY) {
|
||||
mTouchToWindowOffsetX += parentPositionX - mLastParentX;
|
||||
mTouchToWindowOffsetY += parentPositionY - mLastParentY;
|
||||
mLastParentX = parentPositionX;
|
||||
mLastParentY = parentPositionY;
|
||||
}
|
||||
|
||||
onHandleMoved();
|
||||
}
|
||||
onHandleMoved();
|
||||
}
|
||||
|
||||
if (isVisible()) {
|
||||
final int positionX = parentPositionX + mPositionX;
|
||||
final int positionY = parentPositionY + mPositionY;
|
||||
/*
|
||||
mWindowPosX = positionX;
|
||||
mWindowPosY = positionY;
|
||||
*/
|
||||
if (isShowing()) {
|
||||
mContainer.update(positionX, positionY, -1, -1);
|
||||
} else {
|
||||
mContainer.showAtLocation(mView, Gravity.NO_GRAVITY,
|
||||
positionX, positionY);
|
||||
}
|
||||
} else {
|
||||
if (isShowing()) {
|
||||
dismiss();
|
||||
}
|
||||
}
|
||||
if (isVisible()) {
|
||||
final int positionX = parentPositionX + mPositionX;
|
||||
final int positionY = parentPositionY + mPositionY;
|
||||
/*
|
||||
mWindowPosX = positionX;
|
||||
mWindowPosY = positionY;
|
||||
*/
|
||||
if (isShowing()) {
|
||||
mContainer.update(positionX, positionY, -1, -1);
|
||||
} else {
|
||||
mContainer.showAtLocation(mView, Gravity.NO_GRAVITY,
|
||||
positionX, positionY);
|
||||
}
|
||||
} else {
|
||||
if (isShowing()) {
|
||||
dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
mPositionHasChanged = false;
|
||||
}
|
||||
}
|
||||
mPositionHasChanged = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDraw(Canvas c) {
|
||||
final int drawWidth = mDrawable.getIntrinsicWidth();
|
||||
final int left = getHorizontalOffset();
|
||||
@Override
|
||||
protected void onDraw(Canvas c) {
|
||||
final int drawWidth = mDrawable.getIntrinsicWidth();
|
||||
final int left = getHorizontalOffset();
|
||||
|
||||
mDrawable.setBounds(left, 0, left + drawWidth, mDrawable.getIntrinsicHeight());
|
||||
mDrawable.draw(c);
|
||||
}
|
||||
mDrawable.setBounds(left, 0, left + drawWidth, mDrawable.getIntrinsicHeight());
|
||||
mDrawable.draw(c);
|
||||
}
|
||||
|
||||
private int getHorizontalOffset() {
|
||||
final int width = getPreferredWidth();
|
||||
final int drawWidth = mDrawable.getIntrinsicWidth();
|
||||
final int left;
|
||||
switch (mHorizontalGravity) {
|
||||
case Gravity.LEFT:
|
||||
left = 0;
|
||||
break;
|
||||
default:
|
||||
case Gravity.CENTER:
|
||||
left = (width - drawWidth) / 2;
|
||||
break;
|
||||
case Gravity.RIGHT:
|
||||
left = width - drawWidth;
|
||||
break;
|
||||
}
|
||||
return left;
|
||||
}
|
||||
private int getHorizontalOffset() {
|
||||
final int width = getPreferredWidth();
|
||||
final int drawWidth = mDrawable.getIntrinsicWidth();
|
||||
final int left;
|
||||
switch (mHorizontalGravity) {
|
||||
case Gravity.LEFT:
|
||||
left = 0;
|
||||
break;
|
||||
default:
|
||||
case Gravity.CENTER:
|
||||
left = (width - drawWidth) / 2;
|
||||
break;
|
||||
case Gravity.RIGHT:
|
||||
left = width - drawWidth;
|
||||
break;
|
||||
}
|
||||
return left;
|
||||
}
|
||||
|
||||
protected int getCursorOffset() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Addition
|
||||
@Override
|
||||
public boolean onLongClick(View view) {
|
||||
showActionPopupWindow(0);
|
||||
return true;
|
||||
}
|
||||
protected int getCursorOffset() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Addition
|
||||
@Override
|
||||
public boolean onLongClick(View view) {
|
||||
showActionPopupWindow(0);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Addition
|
||||
private float mDownX, mDownY;
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent ev) {
|
||||
ViewGroup.LayoutParams params = mView.getLayoutParams();
|
||||
|
||||
switch (ev.getActionMasked()) {
|
||||
case MotionEvent.ACTION_DOWN: {
|
||||
// Addition
|
||||
private float mDownX, mDownY;
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent ev) {
|
||||
ViewGroup.LayoutParams params = mView.getLayoutParams();
|
||||
|
||||
switch (ev.getActionMasked()) {
|
||||
case MotionEvent.ACTION_DOWN: {
|
||||
startTouchUpFilter(getCurrentCursorOffset());
|
||||
mTouchToWindowOffsetX = ev.getRawX() - mPositionX;
|
||||
mTouchToWindowOffsetY = ev.getRawY() - mPositionY;
|
||||
|
||||
|
||||
final PositionListener positionListener = getPositionListener();
|
||||
mLastParentX = positionListener.getPositionX();
|
||||
mLastParentY = positionListener.getPositionY();
|
||||
mIsDragging = true;
|
||||
|
||||
// MOD: Addition
|
||||
mDownX = ev.getRawX();
|
||||
mDownY = ev.getRawY();
|
||||
mDownWidth = params.width;
|
||||
mDownHeight = params.height;
|
||||
|
||||
|
||||
// MOD: Addition
|
||||
mDownX = ev.getRawX();
|
||||
mDownY = ev.getRawY();
|
||||
mDownWidth = params.width;
|
||||
mDownHeight = params.height;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case MotionEvent.ACTION_MOVE: {
|
||||
case MotionEvent.ACTION_MOVE: {
|
||||
final float rawX = ev.getRawX();
|
||||
final float rawY = ev.getRawY();
|
||||
|
||||
|
|
@ -365,41 +365,41 @@ public abstract class HandleView extends View implements ViewPositionListener, V
|
|||
final float newPosX = rawX - mTouchToWindowOffsetX + mHotspotX;
|
||||
final float newPosY = rawY - mTouchToWindowOffsetY + mTouchOffsetY;
|
||||
|
||||
int newWidth = (int) (mDownWidth + (rawX - mDownX));
|
||||
int newHeight = (int) (mDownHeight + (rawY - mDownY));
|
||||
|
||||
if (newWidth > 49) params.width = newWidth;
|
||||
if (newHeight > 49) params.height = newHeight;
|
||||
|
||||
mView.setLayoutParams(params);
|
||||
|
||||
int newWidth = (int) (mDownWidth + (rawX - mDownX));
|
||||
int newHeight = (int) (mDownHeight + (rawY - mDownY));
|
||||
|
||||
params.width = Math.max(50, newWidth);
|
||||
params.height = Math.max(50, newHeight);
|
||||
|
||||
mView.setLayoutParams(params);
|
||||
|
||||
updatePosition(newPosX, newPosY);
|
||||
// break;
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
case MotionEvent.ACTION_UP:
|
||||
filterOnTouchUp();
|
||||
mIsDragging = false;
|
||||
break;
|
||||
case MotionEvent.ACTION_UP:
|
||||
filterOnTouchUp();
|
||||
mIsDragging = false;
|
||||
break;
|
||||
|
||||
case MotionEvent.ACTION_CANCEL:
|
||||
mIsDragging = false;
|
||||
break;
|
||||
}
|
||||
return false; // super.onTouchEvent(ev);
|
||||
}
|
||||
case MotionEvent.ACTION_CANCEL:
|
||||
mIsDragging = false;
|
||||
break;
|
||||
}
|
||||
return false; // super.onTouchEvent(ev);
|
||||
}
|
||||
|
||||
public boolean isDragging() {
|
||||
return mIsDragging;
|
||||
}
|
||||
public boolean isDragging() {
|
||||
return mIsDragging;
|
||||
}
|
||||
|
||||
void onHandleMoved() {
|
||||
hideActionPopupWindow();
|
||||
}
|
||||
void onHandleMoved() {
|
||||
hideActionPopupWindow();
|
||||
}
|
||||
|
||||
public void onDetached() {
|
||||
hideActionPopupWindow();
|
||||
}
|
||||
public void onDetached() {
|
||||
hideActionPopupWindow();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,51 +27,51 @@ import net.kdt.pojavlaunch.customcontrols.*;
|
|||
|
||||
public class SelectionEndHandleView extends HandleView
|
||||
{
|
||||
public SelectionEndHandleView(ControlButton view) {
|
||||
super(view);
|
||||
}
|
||||
public SelectionEndHandleView(ControlButton view) {
|
||||
super(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getHotspotX(Drawable drawable, boolean isRtlRun) {
|
||||
if (isRtlRun) {
|
||||
return (drawable.getIntrinsicWidth() * 3) / 4;
|
||||
} else {
|
||||
return drawable.getIntrinsicWidth() / 4;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected int getHotspotX(Drawable drawable, boolean isRtlRun) {
|
||||
if (isRtlRun) {
|
||||
return (drawable.getIntrinsicWidth() * 3) / 4;
|
||||
} else {
|
||||
return drawable.getIntrinsicWidth() / 4;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getHorizontalGravity(boolean isRtlRun) {
|
||||
return isRtlRun ? Gravity.LEFT : Gravity.RIGHT;
|
||||
}
|
||||
@Override
|
||||
protected int getHorizontalGravity(boolean isRtlRun) {
|
||||
return isRtlRun ? Gravity.LEFT : Gravity.RIGHT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCurrentCursorOffset() {
|
||||
return 0; // mView.getSelectionEnd();
|
||||
}
|
||||
@Override
|
||||
public int getCurrentCursorOffset() {
|
||||
return 0; // mView.getSelectionEnd();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void show() {
|
||||
super.show();
|
||||
|
||||
showActionPopupWindow(0);
|
||||
}
|
||||
@Override
|
||||
public void show() {
|
||||
super.show();
|
||||
|
||||
@Override
|
||||
public void updateSelection(int offset) {
|
||||
// Selection.setSelection((Spannable) mView.getText(), mView.getSelectionStart(), offset);
|
||||
updateDrawable();
|
||||
}
|
||||
showActionPopupWindow(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePosition(float x, float y) {
|
||||
// updatePosition((int) x, (int) y, false, false);
|
||||
positionAtCursorOffset(0, false);
|
||||
}
|
||||
/*
|
||||
public void setActionPopupWindow(ActionPopupWindow actionPopupWindow) {
|
||||
mActionPopupWindow = actionPopupWindow;
|
||||
}
|
||||
*/
|
||||
@Override
|
||||
public void updateSelection(int offset) {
|
||||
// Selection.setSelection((Spannable) mView.getText(), mView.getSelectionStart(), offset);
|
||||
updateDrawable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePosition(float x, float y) {
|
||||
// updatePosition((int) x, (int) y, false, false);
|
||||
positionAtCursorOffset(0, false);
|
||||
}
|
||||
/*
|
||||
public void setActionPopupWindow(ActionPopupWindow actionPopupWindow) {
|
||||
mActionPopupWindow = actionPopupWindow;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ public class AWTCanvasView extends TextureView implements TextureView.SurfaceTex
|
|||
canvas.drawRGB(0, 0, 0);
|
||||
|
||||
if (!attached) {
|
||||
attached = CallbackBridge.nativeAttachThreadToOther(true, false, BaseMainActivity.isInputStackCall);
|
||||
attached = CallbackBridge.nativeAttachThreadToOther(true, BaseMainActivity.isInputStackCall);
|
||||
} else {
|
||||
int[] rgbArray = JREUtils.renderAWTScreenFrame(/* canvas, mWidth, mHeight */);
|
||||
mDrawing = rgbArray != null;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import org.lwjgl.glfw.*;
|
|||
|
||||
public class AndroidLWJGLKeycode {
|
||||
// Fix double letters on MC 1.9 and above
|
||||
public static boolean isBackspaceAfterChar;
|
||||
public static boolean isBackspaceAfterChar = true;
|
||||
private static final ArrayMap<Integer, Integer> androidToLwjglMap;
|
||||
private static String[] androidKeyNameArray;
|
||||
static {
|
||||
|
|
@ -168,14 +168,14 @@ public class AndroidLWJGLKeycode {
|
|||
return androidKeyNameArray;
|
||||
}
|
||||
|
||||
public static void execKey(BaseMainActivity mainActivity, KeyEvent keyEvent, int i, boolean isDown) {
|
||||
public static void execKey(KeyEvent keyEvent, int i, boolean isDown) {
|
||||
for (Map.Entry<Integer, Integer> perKey : androidToLwjglMap.entrySet()) {
|
||||
if (i == 1 && (keyEvent.getSource() == InputDevice.SOURCE_MOUSE)) {
|
||||
// Right mouse detection
|
||||
mainActivity.sendMouseButton(LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_RIGHT, true);
|
||||
mainActivity.sendMouseButton(LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_RIGHT, false);
|
||||
BaseMainActivity.sendMouseButton(LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_RIGHT, isDown);
|
||||
// BaseMainActivity.sendMouseButton(LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_RIGHT, false);
|
||||
} else if (perKey.getKey() == i) {
|
||||
mainActivity.sendKeyPress(perKey.getValue(), keyEvent.getModifiers(), isDown);
|
||||
BaseMainActivity.sendKeyPress(perKey.getValue(), keyEvent.getModifiers(), isDown);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -195,15 +195,19 @@ public class AndroidLWJGLKeycode {
|
|||
}
|
||||
|
||||
try {
|
||||
if ((int) keyEvent.getDisplayLabel() != KeyEvent.KEYCODE_UNKNOWN && !CallbackBridge.isGrabbing()) {
|
||||
mainActivity.sendKeyPress(androidToLwjglMap.get(keyEvent.getKeyCode()), (char) keyEvent.getUnicodeChar(), mods, isDown);
|
||||
if (!CallbackBridge.isGrabbing()) {
|
||||
if ((int) keyEvent.getUnicodeChar() != KeyEvent.KEYCODE_UNKNOWN) {
|
||||
BaseMainActivity.sendKeyPress(androidToLwjglMap.get(keyEvent.getKeyCode()), (char) keyEvent.getUnicodeChar(), keyEvent.getScanCode(), mods, isDown);
|
||||
} else if ((int) keyEvent.getDisplayLabel() != KeyEvent.KEYCODE_UNKNOWN) {
|
||||
BaseMainActivity.sendKeyPress(androidToLwjglMap.get(keyEvent.getKeyCode()), (char) keyEvent.getDisplayLabel(), keyEvent.getScanCode(), mods, isDown);
|
||||
}
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
th.printStackTrace();
|
||||
}
|
||||
|
||||
if (isBackspaceAfterChar && (int) keyEvent.getDisplayLabel() != KeyEvent.KEYCODE_UNKNOWN && !CallbackBridge.isGrabbing() && i != KeyEvent.KEYCODE_DEL) {
|
||||
mainActivity.sendKeyPress(LWJGLGLFWKeycode.GLFW_KEY_BACKSPACE, 0, isDown);
|
||||
BaseMainActivity.sendKeyPress(LWJGLGLFWKeycode.GLFW_KEY_BACKSPACE, 0, isDown);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,19 +1,19 @@
|
|||
package net.kdt.pojavlaunch;
|
||||
|
||||
import android.app.*;
|
||||
import android.content.*;
|
||||
import android.support.v4.app.*;
|
||||
import android.support.v7.app.*;
|
||||
import android.text.*;
|
||||
import android.view.*;
|
||||
import android.widget.*;
|
||||
import com.kdt.filerapi.*;
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
import net.kdt.pojavlaunch.*;
|
||||
import net.kdt.pojavlaunch.fragments.*;
|
||||
import net.kdt.pojavlaunch.prefs.*;
|
||||
import net.kdt.pojavlaunch.tasks.*;
|
||||
|
||||
import android.support.v7.app.AlertDialog;
|
||||
|
||||
public abstract class BaseLauncherActivity extends BaseActivity {
|
||||
public Button mPlayButton;
|
||||
public ConsoleFragment mConsoleView;
|
||||
|
|
@ -28,11 +28,34 @@ public abstract class BaseLauncherActivity extends BaseActivity {
|
|||
public String[] mAvailableVersions;
|
||||
|
||||
public boolean mIsAssetsProcessing = false;
|
||||
protected boolean canBack = false;
|
||||
|
||||
public abstract void statusIsLaunching(boolean isLaunching);
|
||||
|
||||
public void launcherMenu(View view)
|
||||
{
|
||||
public void mcaccSwitchUser(View view) {
|
||||
showProfileInfo();
|
||||
}
|
||||
|
||||
public void mcaccLogout(View view) {
|
||||
//PojavProfile.reset();
|
||||
finish();
|
||||
}
|
||||
|
||||
private void showProfileInfo() {
|
||||
/*
|
||||
new AlertDialog.Builder(this)
|
||||
.setTitle("Info player")
|
||||
.setMessage(
|
||||
"AccessToken=" + profile.getAccessToken() + "\n" +
|
||||
"ClientID=" + profile.getClientID() + "\n" +
|
||||
"ProfileID=" + profile.getProfileID() + "\n" +
|
||||
"Username=" + profile.getUsername() + "\n" +
|
||||
"Version=" + profile.getVersion()
|
||||
).show();
|
||||
*/
|
||||
}
|
||||
|
||||
public void launcherMenu(View view) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle(R.string.mcl_options);
|
||||
builder.setItems(R.array.mcl_options, new DialogInterface.OnClickListener(){
|
||||
|
|
@ -48,9 +71,7 @@ public abstract class BaseLauncherActivity extends BaseActivity {
|
|||
installMod(true);
|
||||
break;
|
||||
case 2: // Custom controls
|
||||
if (Tools.enableDevFeatures) {
|
||||
startActivity(new Intent(BaseLauncherActivity.this, CustomControlsActivity.class));
|
||||
}
|
||||
startActivity(new Intent(BaseLauncherActivity.this, CustomControlsActivity.class));
|
||||
break;
|
||||
case 3: // Settings
|
||||
startActivity(new Intent(BaseLauncherActivity.this, LauncherPreferenceActivity.class));
|
||||
|
|
@ -63,7 +84,7 @@ public abstract class BaseLauncherActivity extends BaseActivity {
|
|||
aboutB.setMessage(Html.fromHtml(String.format(Tools.read(getAssets().open("about_en.txt")),
|
||||
Tools.APP_NAME,
|
||||
Tools.usingVerName,
|
||||
"3.2.3", getString(R.string.mcl_about_translated_by))
|
||||
"3.2.3")
|
||||
));
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
|
|
@ -91,6 +112,7 @@ public abstract class BaseLauncherActivity extends BaseActivity {
|
|||
@Override
|
||||
public void onClick(DialogInterface di, int i) {
|
||||
Intent intent = new Intent(BaseLauncherActivity.this, JavaGUILauncherActivity.class);
|
||||
intent.putExtra("skipDetectMod", true);
|
||||
intent.putExtra("javaArgs", edit.getText().toString());
|
||||
startActivity(intent);
|
||||
}
|
||||
|
|
@ -115,4 +137,101 @@ public abstract class BaseLauncherActivity extends BaseActivity {
|
|||
}
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
public void launchGame(View v) {
|
||||
if (!canBack && mIsAssetsProcessing) {
|
||||
mIsAssetsProcessing = false;
|
||||
statusIsLaunching(false);
|
||||
} else if (canBack) {
|
||||
v.setEnabled(false);
|
||||
mTask = new MinecraftDownloaderTask(this);
|
||||
mTask.execute(mProfile.getVersion());
|
||||
mCrashView.resetCrashLog = true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
if (canBack) {
|
||||
super.onBackPressed();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostResume() {
|
||||
super.onPostResume();
|
||||
Tools.updateWindowSize(this);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume(){
|
||||
super.onResume();
|
||||
final int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
|
||||
final View decorView = getWindow().getDecorView();
|
||||
decorView.setSystemUiVisibility(uiOptions);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResumeFragments() {
|
||||
super.onResumeFragments();
|
||||
new RefreshVersionListTask(this).execute();
|
||||
|
||||
try{
|
||||
final ProgressDialog barrier = new ProgressDialog(this);
|
||||
barrier.setMessage("Waiting");
|
||||
barrier.setProgressStyle(barrier.STYLE_SPINNER);
|
||||
barrier.setCancelable(false);
|
||||
barrier.show();
|
||||
|
||||
new Thread(new Runnable(){
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
while (mConsoleView == null) {
|
||||
try {
|
||||
Thread.sleep(20);
|
||||
} catch (Throwable th) {}
|
||||
}
|
||||
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
} catch (Throwable th) {}
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
try {
|
||||
mConsoleView.putLog("");
|
||||
barrier.dismiss();
|
||||
} catch (Throwable th) {
|
||||
startActivity(getIntent());
|
||||
finish();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}).start();
|
||||
|
||||
File lastCrashFile = Tools.lastFileModified(Tools.crashPath);
|
||||
if(CrashFragment.isNewCrash(lastCrashFile) || !mCrashView.getLastCrash().isEmpty()){
|
||||
mCrashView.resetCrashLog = false;
|
||||
selectTabPage(2);
|
||||
} else throw new Exception();
|
||||
} catch(Throwable e) {
|
||||
e.printStackTrace();
|
||||
// selectTabPage(tabLayout.getSelectedTabPosition());
|
||||
}
|
||||
}
|
||||
|
||||
// Catching touch exception
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
return super.onTouchEvent(event);
|
||||
}
|
||||
|
||||
protected abstract void selectTabPage(int pageIndex);
|
||||
protected abstract float updateWidthHeight();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,6 +73,8 @@ public class BaseMainActivity extends LoggableActivity {
|
|||
|
||||
private DrawerLayout drawerLayout;
|
||||
private NavigationView navDrawer;
|
||||
|
||||
// protected CapturedEditText mKeyHandlerView;
|
||||
|
||||
private LinearLayout contentLog;
|
||||
private TextView textLog;
|
||||
|
|
@ -124,8 +126,6 @@ public class BaseMainActivity extends LoggableActivity {
|
|||
|
||||
mProfile = PojavProfile.getCurrentProfileContent(this);
|
||||
mVersionInfo = Tools.getVersionInfo(mProfile.getVersion());
|
||||
// Minecraft 1.12.x special case: use indirect char pipe
|
||||
CallbackBridge.isMinecraft1p12 = mVersionInfo.assets.startsWith("1.12");
|
||||
|
||||
setTitle("Minecraft " + mProfile.getVersion());
|
||||
|
||||
|
|
@ -197,9 +197,13 @@ public class BaseMainActivity extends LoggableActivity {
|
|||
|
||||
// toggleGui(null);
|
||||
this.drawerLayout.closeDrawers();
|
||||
|
||||
AndroidLWJGLKeycode.isBackspaceAfterChar = mVersionInfo.minimumLauncherVersion >= 18;
|
||||
|
||||
/*
|
||||
mKeyHandlerView = findViewById(R.id.main_key_handler);
|
||||
mKeyHandlerView.setSingleLine(false);
|
||||
mKeyHandlerView.clearFocus();
|
||||
|
||||
AndroidLWJGLKeycode.isBackspaceAfterChar = true; // mVersionInfo.minimumLauncherVersion >= 18;
|
||||
*/
|
||||
placeMouseAt(CallbackBridge.windowWidth / 2, CallbackBridge.windowHeight / 2);
|
||||
new Thread(new Runnable(){
|
||||
|
||||
|
|
@ -714,50 +718,18 @@ public class BaseMainActivity extends LoggableActivity {
|
|||
e.printStackTrace();
|
||||
Tools.showError(this, e, true);
|
||||
}
|
||||
|
||||
// Mirror video of OpenGL view.
|
||||
/*
|
||||
new Thread(new Runnable(){
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
try {
|
||||
while (true) {
|
||||
if (bit == null) continue;
|
||||
runOnUiThread(new Runnable(){
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
fillCanvasGL();
|
||||
mirrorView.setImageBitmap(bit);
|
||||
}
|
||||
});
|
||||
|
||||
// ~33fps render
|
||||
Thread.sleep(30);
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
th.printStackTrace();
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
*/
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyUp(int keyCode, KeyEvent event)
|
||||
{
|
||||
AndroidLWJGLKeycode.execKey(this, event, keyCode, false);
|
||||
return super.onKeyUp(keyCode, event);
|
||||
}
|
||||
@Override
|
||||
public boolean onKeyUp(int keyCode, KeyEvent event) {
|
||||
AndroidLWJGLKeycode.execKey(event, keyCode, false);
|
||||
return super.onKeyUp(keyCode, event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event)
|
||||
{
|
||||
AndroidLWJGLKeycode.execKey(this, event, keyCode, true);
|
||||
return super.onKeyDown(keyCode, event);
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
AndroidLWJGLKeycode.execKey(event, keyCode, true);
|
||||
return super.onKeyDown(keyCode, event);
|
||||
}
|
||||
|
||||
//private Dialog menuDial;
|
||||
|
|
@ -1044,8 +1016,10 @@ public class BaseMainActivity extends LoggableActivity {
|
|||
public void onBackPressed() {
|
||||
// Prevent back
|
||||
// Catch back as Esc keycode at another place
|
||||
}
|
||||
|
||||
// sendKeyPress(LWJGLGLFWKeycode.GLFW_KEY_ESCAPE);
|
||||
}
|
||||
|
||||
public void hideKeyboard() {
|
||||
try {
|
||||
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
|
||||
|
|
@ -1067,16 +1041,20 @@ public class BaseMainActivity extends LoggableActivity {
|
|||
}
|
||||
|
||||
public static void sendKeyPress(int keyCode, int modifiers, boolean status) {
|
||||
sendKeyPress(keyCode, '\u0000', modifiers, status);
|
||||
sendKeyPress(keyCode, 0, modifiers, status);
|
||||
}
|
||||
|
||||
public static void sendKeyPress(int keyCode, int scancode, int modifiers, boolean status) {
|
||||
sendKeyPress(keyCode, '\u0000', scancode, modifiers, status);
|
||||
}
|
||||
|
||||
public static void sendKeyPress(int keyCode, char keyChar, int modifiers, boolean status) {
|
||||
CallbackBridge.sendKeycode(keyCode, keyChar, modifiers, status);
|
||||
public static void sendKeyPress(int keyCode, char keyChar, int scancode, int modifiers, boolean status) {
|
||||
CallbackBridge.sendKeycode(keyCode, keyChar, scancode, modifiers, status);
|
||||
}
|
||||
|
||||
public void sendKeyPress(char keyChar) {
|
||||
sendKeyPress(0, keyChar, 0, true);
|
||||
sendKeyPress(0, keyChar, 0, false);
|
||||
sendKeyPress(0, keyChar, 0, 0, true);
|
||||
sendKeyPress(0, keyChar, 0, 0, false);
|
||||
}
|
||||
|
||||
public void sendKeyPress(int keyCode) {
|
||||
|
|
@ -1084,8 +1062,8 @@ public class BaseMainActivity extends LoggableActivity {
|
|||
sendKeyPress(keyCode, 0, false);
|
||||
}
|
||||
|
||||
private boolean isLeftMouseDown, isRightMouseDown;
|
||||
public void sendMouseButton(int button, boolean status) {
|
||||
private static boolean isLeftMouseDown, isRightMouseDown;
|
||||
public static void sendMouseButton(int button, boolean status) {
|
||||
// TODO implement this method!!!
|
||||
// CallbackBridge.setMouseButtonInGrabMode((byte) button, status ? (byte) 1 : (byte) 0);
|
||||
// or
|
||||
|
|
|
|||
|
|
@ -20,12 +20,10 @@ public class CustomControlsActivity extends BaseActivity
|
|||
private DrawerLayout drawerLayout;
|
||||
private NavigationView navDrawer;
|
||||
private ControlLayout ctrlLayout;
|
||||
private CustomControls mCtrl;
|
||||
|
||||
|
||||
private SharedPreferences mPref;
|
||||
|
||||
public boolean isModified = false;
|
||||
|
||||
private String selectedName = "new_control";
|
||||
|
||||
@Override
|
||||
|
|
@ -66,14 +64,10 @@ public class CustomControlsActivity extends BaseActivity
|
|||
}
|
||||
});
|
||||
|
||||
mCtrl = new CustomControls();
|
||||
|
||||
ctrlLayout.setActivity(this);
|
||||
ctrlLayout.setModifiable(true);
|
||||
|
||||
loadControl(LauncherPreferences.PREF_DEFAULTCTRL_PATH);
|
||||
|
||||
ctrlLayout.loadLayout(mCtrl);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -96,7 +90,7 @@ public class CustomControlsActivity extends BaseActivity
|
|||
Tools.showError(this, th);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void dialogSelectDefaultCtrl() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle(R.string.customctrl_selectdefault);
|
||||
|
|
@ -203,8 +197,7 @@ public class CustomControlsActivity extends BaseActivity
|
|||
|
||||
private void loadControl(String path) {
|
||||
try {
|
||||
mCtrl = Tools.GLOBAL_GSON.fromJson(Tools.read(path), CustomControls.class);
|
||||
ctrlLayout.loadLayout(mCtrl);
|
||||
ctrlLayout.loadLayout(path);
|
||||
|
||||
selectedName = new File(path).getName();
|
||||
// Remove `.json`
|
||||
|
|
|
|||
|
|
@ -1,113 +0,0 @@
|
|||
package net.kdt.pojavlaunch;
|
||||
|
||||
import android.os.*;
|
||||
import android.view.*;
|
||||
import android.view.View.*;
|
||||
import android.widget.*;
|
||||
import net.kdt.pojavlaunch.customcontrols.*;
|
||||
import net.kdt.pojavlaunch.prefs.*;
|
||||
import org.lwjgl.glfw.*;
|
||||
|
||||
public class CustomCtrlMainActivity extends BaseMainActivity implements OnClickListener, OnTouchListener {
|
||||
private CustomControls mControl;
|
||||
private ControlLayout mControlLayout;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
initLayout(R.layout.main_with_customctrl);
|
||||
|
||||
ControlData[] specialButtons = ControlData.getSpecialButtons();
|
||||
specialButtons[0].specialButtonListener
|
||||
= specialButtons[1].specialButtonListener
|
||||
= specialButtons[4].specialButtonListener
|
||||
= ((View.OnClickListener) this);
|
||||
|
||||
specialButtons[2].specialButtonListener
|
||||
= specialButtons[3].specialButtonListener
|
||||
= specialButtons[5].specialButtonListener
|
||||
= ((View.OnTouchListener) this);
|
||||
|
||||
mControlLayout = findViewById(R.id.main_control_layout);
|
||||
mControl = new CustomControls();
|
||||
mControlLayout.setModifiable(false);
|
||||
loadControl(LauncherPreferences.PREF_DEFAULTCTRL_PATH);
|
||||
mControlLayout.loadLayout(mControl);
|
||||
|
||||
// toggleGui(null);
|
||||
mControlLayout.toggleControlVisible();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (view instanceof ControlButton) {
|
||||
ControlButton button = (ControlButton) view;
|
||||
switch (button.getProperties().keycode) {
|
||||
case ControlData.SPECIALBTN_KEYBOARD:
|
||||
showKeyboard();
|
||||
break;
|
||||
|
||||
case ControlData.SPECIALBTN_TOGGLECTRL:
|
||||
mControlLayout.toggleControlVisible();
|
||||
break;
|
||||
|
||||
case ControlData.SPECIALBTN_VIRTUALMOUSE:
|
||||
toggleMouse(button);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTouch(View view, MotionEvent e) {
|
||||
boolean isDown;
|
||||
switch (e.getActionMasked()) {
|
||||
case MotionEvent.ACTION_DOWN: // 0
|
||||
case MotionEvent.ACTION_POINTER_DOWN: // 5
|
||||
isDown = true;
|
||||
break;
|
||||
case MotionEvent.ACTION_UP: // 1
|
||||
case MotionEvent.ACTION_CANCEL: // 3
|
||||
case MotionEvent.ACTION_POINTER_UP: // 6
|
||||
isDown = false;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (view instanceof ControlButton) {
|
||||
ControlButton button = (ControlButton) view;
|
||||
appendToLog("Debug: touch special btn " + button.getProperties().keycode);
|
||||
switch (button.getProperties().keycode) {
|
||||
case ControlData.SPECIALBTN_MOUSEPRI:
|
||||
sendMouseButton(LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_LEFT, isDown);
|
||||
break;
|
||||
|
||||
case ControlData.SPECIALBTN_MOUSEMID:
|
||||
sendMouseButton(LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_MIDDLE, isDown);
|
||||
break;
|
||||
|
||||
case ControlData.SPECIALBTN_MOUSESEC:
|
||||
if (CallbackBridge.isGrabbing()) {
|
||||
sendMouseButton(LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_RIGHT, isDown);
|
||||
} else {
|
||||
CallbackBridge.putMouseEventWithCoords(LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_RIGHT, isDown ? 1 : 0, CallbackBridge.mouseX, CallbackBridge.mouseY);
|
||||
|
||||
setRightOverride(isDown);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void loadControl(String path) {
|
||||
try {
|
||||
mControl = Tools.GLOBAL_GSON.fromJson(Tools.read(path), CustomControls.class);
|
||||
mControlLayout.loadLayout(mControl);
|
||||
} catch (Exception e) {
|
||||
Tools.showError(this, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -5,6 +5,19 @@ public class DisplayableLocale {
|
|||
public final Locale mLocale;
|
||||
public final CharSequence mName;
|
||||
|
||||
private static Locale processStringLocale(String locale) {
|
||||
if (locale.contains("-")) {
|
||||
String[] split = locale.split("-");
|
||||
return new Locale(split[0], split[1]);
|
||||
} else {
|
||||
return new Locale(locale);
|
||||
}
|
||||
}
|
||||
|
||||
public DisplayableLocale(String locale) {
|
||||
this(processStringLocale(locale));
|
||||
}
|
||||
|
||||
public DisplayableLocale(Locale locale) {
|
||||
this(locale, locale.getDisplayName(locale));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,16 +2,18 @@ package net.kdt.pojavlaunch;
|
|||
|
||||
import android.graphics.*;
|
||||
import android.os.*;
|
||||
import android.support.v7.app.*;
|
||||
import android.util.*;
|
||||
import android.view.*;
|
||||
import android.widget.*;
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
import net.kdt.pojavlaunch.installers.*;
|
||||
import net.kdt.pojavlaunch.utils.*;
|
||||
import org.lwjgl.glfw.*;
|
||||
import android.content.*;
|
||||
|
||||
public class JavaGUILauncherActivity extends LoggableActivity {
|
||||
public static volatile boolean IS_JRE_RUNNING;
|
||||
|
||||
private AWTCanvasView mTextureView;
|
||||
private LinearLayout contentLog;
|
||||
private TextView textLog;
|
||||
|
|
@ -20,8 +22,10 @@ public class JavaGUILauncherActivity extends LoggableActivity {
|
|||
|
||||
private File logFile;
|
||||
private PrintStream logStream;
|
||||
|
||||
private final Object mDialogLock = new Object();
|
||||
|
||||
private boolean isLogAllow;
|
||||
private boolean isLogAllow, mSkipDetectMod;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
|
@ -48,24 +52,87 @@ public class JavaGUILauncherActivity extends LoggableActivity {
|
|||
appendToLog("");
|
||||
}
|
||||
});
|
||||
JREUtils.redirectAndPrintJRELog(this, null);
|
||||
|
||||
|
||||
final File modFile = (File) getIntent().getExtras().getSerializable("modFile");
|
||||
final String javaArgs = getIntent().getExtras().getString("javaArgs");
|
||||
|
||||
mTextureView = findViewById(R.id.installmod_surfaceview);
|
||||
|
||||
mSkipDetectMod = getIntent().getExtras().getBoolean("skipDetectMod", false);
|
||||
if (mSkipDetectMod) {
|
||||
new Thread(new Runnable(){
|
||||
@Override
|
||||
public void run() {
|
||||
launchJavaRuntime(modFile, javaArgs);
|
||||
}
|
||||
}, "JREMainThread").start();
|
||||
} else {
|
||||
openLogOutput(null);
|
||||
new Thread(new Runnable(){
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
doCustomInstall(modFile, javaArgs);
|
||||
appendlnToLog(getString(R.string.toast_optifine_success));
|
||||
runOnUiThread(new Runnable(){
|
||||
|
||||
new Thread(new Runnable(){
|
||||
@Override
|
||||
public void run() {
|
||||
launchJavaRuntime(modFile, javaArgs);
|
||||
IS_JRE_RUNNING = false;
|
||||
}
|
||||
}, "JREMainThread").start();
|
||||
@Override
|
||||
public void run() {
|
||||
Toast.makeText(JavaGUILauncherActivity.this, R.string.toast_optifine_success, Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}
|
||||
});
|
||||
} catch (Throwable e) {
|
||||
appendlnToLog("Install failed:");
|
||||
appendlnToLog(Log.getStackTraceString(e));
|
||||
Tools.showError(JavaGUILauncherActivity.this, e);
|
||||
}
|
||||
}
|
||||
}, "Installer").start();
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
Tools.showError(this, th, true);
|
||||
}
|
||||
}
|
||||
|
||||
public String dialogInput(final String title, final int message) {
|
||||
final StringBuilder str = new StringBuilder();
|
||||
|
||||
runOnUiThread(new Runnable(){
|
||||
@Override
|
||||
public void run() {
|
||||
final EditText editText = new EditText(JavaGUILauncherActivity.this);
|
||||
editText.setHint(message);
|
||||
editText.setSingleLine();
|
||||
|
||||
AlertDialog.Builder d = new AlertDialog.Builder(JavaGUILauncherActivity.this);
|
||||
d.setCancelable(false);
|
||||
d.setTitle(title);
|
||||
d.setView(editText);
|
||||
d.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener(){
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface i, int id) {
|
||||
str.append(editText.getText().toString());
|
||||
synchronized (mDialogLock) {
|
||||
mDialogLock.notifyAll();
|
||||
}
|
||||
}
|
||||
});
|
||||
d.show();
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
synchronized (mDialogLock) {
|
||||
mDialogLock.wait();
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return str.toString();
|
||||
}
|
||||
|
||||
public void forceClose(View v) {
|
||||
BaseMainActivity.dialogForceClose(this);
|
||||
|
|
@ -76,11 +143,39 @@ public class JavaGUILauncherActivity extends LoggableActivity {
|
|||
}
|
||||
|
||||
public void closeLogOutput(View view) {
|
||||
contentLog.setVisibility(View.GONE);
|
||||
// mIsResuming = true;
|
||||
if (mSkipDetectMod) {
|
||||
contentLog.setVisibility(View.GONE);
|
||||
} else {
|
||||
forceClose(null);
|
||||
}
|
||||
}
|
||||
|
||||
private void doCustomInstall(File modFile, String javaArgs) throws IOException {
|
||||
isLogAllow = true;
|
||||
|
||||
// Attempt to detects some mod installers
|
||||
BaseInstaller installer = new BaseInstaller();
|
||||
installer.setInput(modFile);
|
||||
|
||||
if (InstallerDetector.isForgeLegacy(installer)) {
|
||||
appendlnToLog("Detected Forge Installer 1.12.1 or below!");
|
||||
new LegacyForgeInstaller(installer).install(this);
|
||||
} else if (InstallerDetector.isForgeNew(installer)) {
|
||||
appendlnToLog("Detected Forge Installer 1.12.2 or above!");
|
||||
new NewForgeInstaller(installer).install(this);
|
||||
} else if (InstallerDetector.isFabric(installer)) {
|
||||
appendlnToLog("Detected Fabric Installer!");
|
||||
new FabricInstaller(installer).install(this);
|
||||
} else {
|
||||
appendlnToLog("No mod detected. Starting JVM");
|
||||
isLogAllow = false;
|
||||
mSkipDetectMod = true;
|
||||
launchJavaRuntime(modFile, javaArgs);
|
||||
}
|
||||
}
|
||||
|
||||
private void launchJavaRuntime(File modFile, String javaArgs) {
|
||||
public void launchJavaRuntime(File modFile, String javaArgs) {
|
||||
JREUtils.redirectAndPrintJRELog(this, null);
|
||||
try {
|
||||
List<String> javaArgList = new ArrayList<String>();
|
||||
|
||||
|
|
@ -111,6 +206,8 @@ public class JavaGUILauncherActivity extends LoggableActivity {
|
|||
|
||||
// System.out.println(Arrays.toString(javaArgList.toArray(new String[0])));
|
||||
|
||||
appendlnToLog("Info: Java arguments: " + Arrays.toString(javaArgList.toArray(new String[0])));
|
||||
|
||||
Tools.launchJavaVM(this, javaArgList);
|
||||
} catch (Throwable th) {
|
||||
Tools.showError(this, th, true);
|
||||
|
|
|
|||
|
|
@ -38,295 +38,148 @@ import android.support.design.widget.VerticalTabLayout.*;
|
|||
|
||||
public class MCLauncherActivity extends BaseLauncherActivity
|
||||
{
|
||||
//private FragmentTabHost mTabHost;
|
||||
private LinearLayout fullTab;
|
||||
//private FragmentTabHost mTabHost;
|
||||
private LinearLayout fullTab;
|
||||
/*
|
||||
private PojavLauncherViewPager viewPager;
|
||||
private VerticalTabLayout tabLayout;
|
||||
*/
|
||||
|
||||
private PojavLauncherViewPager viewPager;
|
||||
private VerticalTabLayout tabLayout;
|
||||
*/
|
||||
|
||||
private ViewPager viewPager;
|
||||
private TabLayout tabLayout;
|
||||
private TabLayout tabLayout;
|
||||
|
||||
private TextView tvUsernameView;
|
||||
private String profilePath = null;
|
||||
private ViewPagerAdapter viewPageAdapter;
|
||||
private TextView tvUsernameView;
|
||||
private String profilePath = null;
|
||||
private ViewPagerAdapter viewPageAdapter;
|
||||
|
||||
private Button switchUsrBtn, logoutBtn; // MineButtons
|
||||
private ViewGroup leftView, rightView;
|
||||
private Button switchUsrBtn, logoutBtn; // MineButtons
|
||||
private ViewGroup leftView, rightView;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
if (BuildConfig.DEBUG) {
|
||||
Toast.makeText(this, "Launcher process id: " + android.os.Process.myPid(), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
setContentView(R.layout.launcher_main);
|
||||
|
||||
fullTab = findViewById(R.id.launchermainFragmentTabView);
|
||||
tabLayout = findViewById(R.id.launchermainTabLayout);
|
||||
viewPager = findViewById(R.id.launchermainTabPager);
|
||||
|
||||
mConsoleView = new ConsoleFragment();
|
||||
mCrashView = new CrashFragment();
|
||||
|
||||
viewPageAdapter = new ViewPagerAdapter(getSupportFragmentManager());
|
||||
|
||||
viewPageAdapter.addFragment(new LauncherFragment(), 0, getStr(R.string.mcl_tab_news));
|
||||
viewPageAdapter.addFragment(mConsoleView, 0, getStr(R.string.mcl_tab_console));
|
||||
viewPageAdapter.addFragment(mCrashView, 0, getStr(R.string.mcl_tab_crash));
|
||||
|
||||
viewPager.setAdapter(viewPageAdapter);
|
||||
tabLayout.setupWithViewPager(viewPager);
|
||||
|
||||
tvUsernameView = (TextView) findViewById(R.id.launcherMainUsernameView);
|
||||
mTextVersion = (TextView) findViewById(R.id.launcherMainVersionView);
|
||||
|
||||
try {
|
||||
profilePath = PojavProfile.getCurrentProfilePath(this);
|
||||
mProfile = PojavProfile.getCurrentProfileContent(this);
|
||||
|
||||
tvUsernameView.setText(mProfile.getUsername());
|
||||
} catch(Exception e) {
|
||||
//Tools.throwError(this, e);
|
||||
e.printStackTrace();
|
||||
Toast.makeText(this, getStr(R.string.toast_login_error, e.getMessage()), Toast.LENGTH_LONG).show();
|
||||
finish();
|
||||
}
|
||||
|
||||
viewInit();
|
||||
//showProfileInfo();
|
||||
|
||||
if (BuildConfig.DEBUG) {
|
||||
Toast.makeText(this, "Launcher process id: " + android.os.Process.myPid(), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
// DEBUG
|
||||
//new android.support.design.widget.NavigationView(this);
|
||||
List<String> versions = new ArrayList<String>();
|
||||
final File fVers = new File(Tools.versnDir);
|
||||
|
||||
private String getStr(int id, Object... val) {
|
||||
if (val != null && val.length > 0) {
|
||||
return getResources().getString(id, val);
|
||||
} else {
|
||||
return getResources().getString(id);
|
||||
}
|
||||
}
|
||||
|
||||
private void viewInit() {
|
||||
// setContentView(R.layout.launcher_main_v3);
|
||||
setContentView(R.layout.launcher_main);
|
||||
|
||||
fullTab = findViewById(R.id.launchermainFragmentTabView);
|
||||
tabLayout = findViewById(R.id.launchermainTabLayout);
|
||||
viewPager = findViewById(R.id.launchermainTabPager);
|
||||
|
||||
mConsoleView = new ConsoleFragment();
|
||||
mCrashView = new CrashFragment();
|
||||
|
||||
viewPageAdapter = new ViewPagerAdapter(getSupportFragmentManager());
|
||||
|
||||
viewPageAdapter.addFragment(new LauncherFragment(), 0, getStr(R.string.mcl_tab_news));
|
||||
viewPageAdapter.addFragment(mConsoleView, 0, getStr(R.string.mcl_tab_console));
|
||||
viewPageAdapter.addFragment(mCrashView, 0, getStr(R.string.mcl_tab_crash));
|
||||
|
||||
viewPager.setAdapter(viewPageAdapter);
|
||||
tabLayout.setupWithViewPager(viewPager);
|
||||
|
||||
tvUsernameView = (TextView) findViewById(R.id.launcherMainUsernameView);
|
||||
mTextVersion = (TextView) findViewById(R.id.launcherMainVersionView);
|
||||
|
||||
try {
|
||||
profilePath = PojavProfile.getCurrentProfilePath(this);
|
||||
mProfile = PojavProfile.getCurrentProfileContent(this);
|
||||
|
||||
tvUsernameView.setText(mProfile.getUsername());
|
||||
} catch(Exception e) {
|
||||
//Tools.throwError(this, e);
|
||||
e.printStackTrace();
|
||||
Toast.makeText(this, getStr(R.string.toast_login_error, e.getMessage()), Toast.LENGTH_LONG).show();
|
||||
finish();
|
||||
}
|
||||
/*
|
||||
File logFile = new File(Tools.MAIN_PATH, "latestlog.txt");
|
||||
if (logFile.exists() && logFile.length() < 20480) {
|
||||
String errMsg = "Error occurred during initialization of ";
|
||||
try {
|
||||
String logContent = Tools.read(logFile.getAbsolutePath());
|
||||
if (logContent.contains(errMsg + "VM") &&
|
||||
logContent.contains("Could not reserve enough space for")) {
|
||||
OutOfMemoryError ex = new OutOfMemoryError("Java error: " + logContent);
|
||||
ex.setStackTrace(null);
|
||||
Tools.showError(MCLauncherActivity.this, ex);
|
||||
|
||||
// Do it so dialog will not shown for second time
|
||||
Tools.write(logFile.getAbsolutePath(), logContent.replace(errMsg + "VM", errMsg + "JVM"));
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
System.err.println("Could not detect java crash");
|
||||
th.printStackTrace();
|
||||
try {
|
||||
if (fVers.listFiles().length < 1) {
|
||||
throw new Exception(getStr(R.string.error_no_version));
|
||||
}
|
||||
}
|
||||
*/
|
||||
//showProfileInfo();
|
||||
|
||||
List<String> versions = new ArrayList<String>();
|
||||
final File fVers = new File(Tools.versnDir);
|
||||
|
||||
try {
|
||||
if (fVers.listFiles().length < 1) {
|
||||
throw new Exception(getStr(R.string.error_no_version));
|
||||
}
|
||||
|
||||
for (File fVer : fVers.listFiles()) {
|
||||
for (File fVer : fVers.listFiles()) {
|
||||
if (fVer.isDirectory())
|
||||
versions.add(fVer.getName());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
versions.add(getStr(R.string.global_error) + ":");
|
||||
versions.add(e.getMessage());
|
||||
versions.add(fVer.getName());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
versions.add(getStr(R.string.global_error) + ":");
|
||||
versions.add(e.getMessage());
|
||||
|
||||
} finally {
|
||||
mAvailableVersions = versions.toArray(new String[0]);
|
||||
}
|
||||
} finally {
|
||||
mAvailableVersions = versions.toArray(new String[0]);
|
||||
}
|
||||
|
||||
//availableVersions;
|
||||
//availableVersions;
|
||||
|
||||
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, mAvailableVersions);
|
||||
adapter.setDropDownViewResource(android.R.layout.simple_list_item_single_choice);
|
||||
mVersionSelector = (Spinner) findViewById(R.id.launcherMainSelectVersion);
|
||||
mVersionSelector.setAdapter(adapter);
|
||||
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, mAvailableVersions);
|
||||
adapter.setDropDownViewResource(android.R.layout.simple_list_item_single_choice);
|
||||
mVersionSelector = (Spinner) findViewById(R.id.launcherMainSelectVersion);
|
||||
mVersionSelector.setAdapter(adapter);
|
||||
|
||||
mLaunchProgress = (ProgressBar) findViewById(R.id.progressDownloadBar);
|
||||
mLaunchTextStatus = (TextView) findViewById(R.id.progressDownloadText);
|
||||
LinearLayout exitLayout = (LinearLayout) findViewById(R.id.launcherMainExitbtns);
|
||||
switchUsrBtn = (Button) exitLayout.getChildAt(0);
|
||||
logoutBtn = (Button) exitLayout.getChildAt(1);
|
||||
mLaunchProgress = (ProgressBar) findViewById(R.id.progressDownloadBar);
|
||||
mLaunchTextStatus = (TextView) findViewById(R.id.progressDownloadText);
|
||||
LinearLayout exitLayout = (LinearLayout) findViewById(R.id.launcherMainExitbtns);
|
||||
switchUsrBtn = (Button) exitLayout.getChildAt(0);
|
||||
logoutBtn = (Button) exitLayout.getChildAt(1);
|
||||
|
||||
leftView = (LinearLayout) findViewById(R.id.launcherMainLeftLayout);
|
||||
mPlayButton = (Button) findViewById(R.id.launcherMainPlayButton);
|
||||
rightView = (ViewGroup) findViewById(R.id.launcherMainRightLayout);
|
||||
leftView = (LinearLayout) findViewById(R.id.launcherMainLeftLayout);
|
||||
mPlayButton = (Button) findViewById(R.id.launcherMainPlayButton);
|
||||
rightView = (ViewGroup) findViewById(R.id.launcherMainRightLayout);
|
||||
|
||||
statusIsLaunching(false);
|
||||
}
|
||||
statusIsLaunching(false);
|
||||
}
|
||||
// DEBUG
|
||||
//new android.support.design.widget.NavigationView(this);
|
||||
|
||||
@Override
|
||||
protected void onPostResume() {
|
||||
super.onPostResume();
|
||||
Tools.updateWindowSize(this);
|
||||
}
|
||||
private String getStr(int id, Object... val) {
|
||||
if (val != null && val.length > 0) {
|
||||
return getResources().getString(id, val);
|
||||
} else {
|
||||
return getResources().getString(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float updateWidthHeight() {
|
||||
float leftRightWidth = (float) CallbackBridge.windowWidth / 100f * 32f;
|
||||
float mPlayButtonWidth = CallbackBridge.windowWidth - leftRightWidth * 2f;
|
||||
LinearLayout.LayoutParams leftRightParams = new LinearLayout.LayoutParams((int) leftRightWidth, (int) Tools.dpToPx(CallbackBridge.windowHeight / 9));
|
||||
LinearLayout.LayoutParams mPlayButtonParams = new LinearLayout.LayoutParams((int) mPlayButtonWidth, (int) Tools.dpToPx(CallbackBridge.windowHeight / 9));
|
||||
leftView.setLayoutParams(leftRightParams);
|
||||
rightView.setLayoutParams(leftRightParams);
|
||||
mPlayButton.setLayoutParams(mPlayButtonParams);
|
||||
|
||||
private float updateWidthHeight() {
|
||||
float leftRightWidth = (float) CallbackBridge.windowWidth / 100f * 32f;
|
||||
float mPlayButtonWidth = CallbackBridge.windowWidth - leftRightWidth * 2f;
|
||||
LinearLayout.LayoutParams leftRightParams = new LinearLayout.LayoutParams((int) leftRightWidth, (int) Tools.dpToPx(this, CallbackBridge.windowHeight / 9));
|
||||
LinearLayout.LayoutParams mPlayButtonParams = new LinearLayout.LayoutParams((int) mPlayButtonWidth, (int) Tools.dpToPx(this, CallbackBridge.windowHeight / 9));
|
||||
leftView.setLayoutParams(leftRightParams);
|
||||
rightView.setLayoutParams(leftRightParams);
|
||||
mPlayButton.setLayoutParams(mPlayButtonParams);
|
||||
return leftRightWidth;
|
||||
}
|
||||
|
||||
return leftRightWidth;
|
||||
}
|
||||
@Override
|
||||
protected void selectTabPage(int pageIndex) {
|
||||
if (tabLayout.getSelectedTabPosition() != pageIndex) {
|
||||
tabLayout.setScrollPosition(pageIndex,0f,true);
|
||||
viewPager.setCurrentItem(pageIndex);
|
||||
}
|
||||
}
|
||||
|
||||
public void mcaccSwitchUser(View view)
|
||||
{
|
||||
showProfileInfo();
|
||||
}
|
||||
public void statusIsLaunching(boolean isLaunching) {
|
||||
LinearLayout.LayoutParams reparam = new LinearLayout.LayoutParams((int) updateWidthHeight(), LinearLayout.LayoutParams.WRAP_CONTENT);
|
||||
ViewGroup.MarginLayoutParams lmainTabParam = (ViewGroup.MarginLayoutParams) fullTab.getLayoutParams();
|
||||
int launchVisibility = isLaunching ? View.VISIBLE : View.GONE;
|
||||
mLaunchProgress.setVisibility(launchVisibility);
|
||||
mLaunchTextStatus.setVisibility(launchVisibility);
|
||||
lmainTabParam.bottomMargin = reparam.height;
|
||||
leftView.setLayoutParams(reparam);
|
||||
|
||||
public void mcaccLogout(View view)
|
||||
{
|
||||
//PojavProfile.reset();
|
||||
finish();
|
||||
}
|
||||
|
||||
private void showProfileInfo()
|
||||
{
|
||||
/*
|
||||
new AlertDialog.Builder(this)
|
||||
.setTitle("Info player")
|
||||
.setMessage(
|
||||
"AccessToken=" + profile.getAccessToken() + "\n" +
|
||||
"ClientID=" + profile.getClientID() + "\n" +
|
||||
"ProfileID=" + profile.getProfileID() + "\n" +
|
||||
"Username=" + profile.getUsername() + "\n" +
|
||||
"Version=" + profile.getVersion()
|
||||
).show();
|
||||
*/
|
||||
}
|
||||
|
||||
private void selectTabPage(int pageIndex){
|
||||
if (tabLayout.getSelectedTabPosition() != pageIndex) {
|
||||
tabLayout.setScrollPosition(pageIndex,0f,true);
|
||||
viewPager.setCurrentItem(pageIndex);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResumeFragments()
|
||||
{
|
||||
super.onResumeFragments();
|
||||
new RefreshVersionListTask(this).execute();
|
||||
|
||||
try{
|
||||
final ProgressDialog barrier = new ProgressDialog(this);
|
||||
barrier.setMessage("Waiting");
|
||||
barrier.setProgressStyle(barrier.STYLE_SPINNER);
|
||||
barrier.setCancelable(false);
|
||||
barrier.show();
|
||||
|
||||
new Thread(new Runnable(){
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
while (mConsoleView == null) {
|
||||
try {
|
||||
Thread.sleep(20);
|
||||
} catch (Throwable th) {}
|
||||
}
|
||||
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
} catch (Throwable th) {}
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
try {
|
||||
mConsoleView.putLog("");
|
||||
barrier.dismiss();
|
||||
} catch (Throwable th) {
|
||||
startActivity(getIntent());
|
||||
finish();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}).start();
|
||||
|
||||
File lastCrashFile = Tools.lastFileModified(Tools.crashPath);
|
||||
if(CrashFragment.isNewCrash(lastCrashFile) || !mCrashView.getLastCrash().isEmpty()){
|
||||
mCrashView.resetCrashLog = false;
|
||||
selectTabPage(2);
|
||||
} else throw new Exception();
|
||||
} catch(Throwable e){
|
||||
selectTabPage(tabLayout.getSelectedTabPosition());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume(){
|
||||
super.onResume();
|
||||
final int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
|
||||
final View decorView = getWindow().getDecorView();
|
||||
decorView.setSystemUiVisibility(uiOptions);
|
||||
}
|
||||
|
||||
private boolean canBack = false;
|
||||
public void statusIsLaunching(boolean isLaunching)
|
||||
{
|
||||
LinearLayout.LayoutParams reparam = new LinearLayout.LayoutParams((int) updateWidthHeight(), LinearLayout.LayoutParams.WRAP_CONTENT);
|
||||
ViewGroup.MarginLayoutParams lmainTabParam = (ViewGroup.MarginLayoutParams) fullTab.getLayoutParams();
|
||||
int launchVisibility = isLaunching ? View.VISIBLE : View.GONE;
|
||||
mLaunchProgress.setVisibility(launchVisibility);
|
||||
mLaunchTextStatus.setVisibility(launchVisibility);
|
||||
lmainTabParam.bottomMargin = reparam.height;
|
||||
leftView.setLayoutParams(reparam);
|
||||
|
||||
switchUsrBtn.setEnabled(!isLaunching);
|
||||
logoutBtn.setEnabled(!isLaunching);
|
||||
mVersionSelector.setEnabled(!isLaunching);
|
||||
canBack = !isLaunching;
|
||||
}
|
||||
@Override
|
||||
public void onBackPressed()
|
||||
{
|
||||
if (canBack) {
|
||||
super.onBackPressed();
|
||||
}
|
||||
}
|
||||
|
||||
// Catching touch exception
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
return super.onTouchEvent(event);
|
||||
}
|
||||
|
||||
public void launchGame(View v)
|
||||
{
|
||||
if (!canBack && mIsAssetsProcessing) {
|
||||
mIsAssetsProcessing = false;
|
||||
statusIsLaunching(false);
|
||||
} else if (canBack) {
|
||||
v.setEnabled(false);
|
||||
mTask = new MinecraftDownloaderTask(this);
|
||||
mTask.execute(mProfile.getVersion());
|
||||
mCrashView.resetCrashLog = true;
|
||||
}
|
||||
}
|
||||
switchUsrBtn.setEnabled(!isLaunching);
|
||||
logoutBtn.setEnabled(!isLaunching);
|
||||
mVersionSelector.setEnabled(!isLaunching);
|
||||
canBack = !isLaunching;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,133 +7,107 @@ import android.widget.*;
|
|||
import net.kdt.pojavlaunch.customcontrols.*;
|
||||
import net.kdt.pojavlaunch.prefs.*;
|
||||
import org.lwjgl.glfw.*;
|
||||
import java.io.*;
|
||||
import com.google.gson.*;
|
||||
|
||||
public class MainActivity extends BaseMainActivity implements OnClickListener, OnTouchListener {
|
||||
private Button upButton,
|
||||
downButton, leftButton,
|
||||
rightButton, jumpButton,
|
||||
primaryButton, secondaryButton,
|
||||
debugButton, shiftButton,
|
||||
keyboardButton, inventoryButton,
|
||||
talkButton, thirdPersonButton,
|
||||
zoomButton, listPlayersButton,
|
||||
toggleControlButton;
|
||||
|
||||
private Button[] controlButtons;
|
||||
|
||||
public class MainActivity extends BaseMainActivity {
|
||||
private ControlLayout mControlLayout;
|
||||
|
||||
private View.OnClickListener mClickListener;
|
||||
private View.OnTouchListener mTouchListener;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
initLayout(R.layout.main);
|
||||
|
||||
this.upButton = findButton(R.id.control_up);
|
||||
this.downButton = findButton(R.id.control_down);
|
||||
this.leftButton = findButton(R.id.control_left);
|
||||
this.rightButton = findButton(R.id.control_right);
|
||||
this.jumpButton = findButton(R.id.control_jump);
|
||||
this.primaryButton = findButton(R.id.control_primary);
|
||||
this.secondaryButton = findButton(R.id.control_secondary);
|
||||
this.debugButton = findButton(R.id.control_debug);
|
||||
this.shiftButton = findButton(R.id.control_shift);
|
||||
this.keyboardButton = findButton(R.id.control_keyboard);
|
||||
this.inventoryButton = findButton(R.id.control_inventory);
|
||||
this.talkButton = findButton(R.id.control_talk);
|
||||
this.thirdPersonButton = findButton(R.id.control_thirdperson);
|
||||
this.zoomButton = findButton(R.id.control_zoom);
|
||||
this.listPlayersButton = findButton(R.id.control_listplayers);
|
||||
this.toggleControlButton = findButton(R.id.control_togglecontrol);
|
||||
this.controlButtons = new Button[]{
|
||||
upButton, downButton, leftButton, rightButton,
|
||||
jumpButton, primaryButton, secondaryButton,
|
||||
debugButton, shiftButton, keyboardButton,
|
||||
inventoryButton, talkButton, thirdPersonButton,
|
||||
listPlayersButton
|
||||
initLayout(R.layout.main_with_customctrl);
|
||||
|
||||
mClickListener = new View.OnClickListener(){
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (view instanceof ControlButton) {
|
||||
ControlButton button = (ControlButton) view;
|
||||
switch (button.getProperties().keycode) {
|
||||
case ControlData.SPECIALBTN_KEYBOARD:
|
||||
showKeyboard();
|
||||
break;
|
||||
|
||||
case ControlData.SPECIALBTN_TOGGLECTRL:
|
||||
mControlLayout.toggleControlVisible();
|
||||
break;
|
||||
|
||||
case ControlData.SPECIALBTN_VIRTUALMOUSE:
|
||||
toggleMouse(button);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
this.toggleControlButton.setOnClickListener(this);
|
||||
this.zoomButton.setVisibility(mVersionInfo.optifineLib == null ? View.GONE : View.VISIBLE);
|
||||
|
||||
mTouchListener = new View.OnTouchListener(){
|
||||
@Override
|
||||
public boolean onTouch(View view, MotionEvent e) {
|
||||
boolean isDown;
|
||||
switch (e.getActionMasked()) {
|
||||
case MotionEvent.ACTION_DOWN: // 0
|
||||
case MotionEvent.ACTION_POINTER_DOWN: // 5
|
||||
isDown = true;
|
||||
break;
|
||||
case MotionEvent.ACTION_UP: // 1
|
||||
case MotionEvent.ACTION_CANCEL: // 3
|
||||
case MotionEvent.ACTION_POINTER_UP: // 6
|
||||
isDown = false;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (view instanceof ControlButton) {
|
||||
ControlButton button = (ControlButton) view;
|
||||
switch (button.getProperties().keycode) {
|
||||
case ControlData.SPECIALBTN_MOUSEPRI:
|
||||
sendMouseButton(LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_LEFT, isDown);
|
||||
break;
|
||||
|
||||
case ControlData.SPECIALBTN_MOUSEMID:
|
||||
sendMouseButton(LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_MIDDLE, isDown);
|
||||
break;
|
||||
|
||||
case ControlData.SPECIALBTN_MOUSESEC:
|
||||
if (CallbackBridge.isGrabbing()) {
|
||||
sendMouseButton(LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_RIGHT, isDown);
|
||||
} else {
|
||||
CallbackBridge.putMouseEventWithCoords(LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_RIGHT, isDown ? 1 : 0, CallbackBridge.mouseX, CallbackBridge.mouseY);
|
||||
|
||||
setRightOverride(isDown);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
ControlData[] specialButtons = ControlData.getSpecialButtons();
|
||||
specialButtons[0].specialButtonListener
|
||||
= specialButtons[1].specialButtonListener
|
||||
= specialButtons[4].specialButtonListener
|
||||
= mClickListener;
|
||||
|
||||
specialButtons[2].specialButtonListener
|
||||
= specialButtons[3].specialButtonListener
|
||||
= specialButtons[5].specialButtonListener
|
||||
= mTouchListener;
|
||||
|
||||
mControlLayout = findViewById(R.id.main_control_layout);
|
||||
mControlLayout.setModifiable(false);
|
||||
try {
|
||||
mControlLayout.loadLayout(LauncherPreferences.PREF_DEFAULTCTRL_PATH);
|
||||
} catch (Throwable th) {
|
||||
Tools.showError(this, th);
|
||||
}
|
||||
|
||||
// toggleGui(null);
|
||||
onClick(toggleControlButton);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
switch (view.getId()) {
|
||||
case R.id.control_togglecontrol: {
|
||||
/*
|
||||
switch(overlayView.getVisibility()){
|
||||
case View.VISIBLE: overlayView.setVisibility(View.GONE);
|
||||
break;
|
||||
case View.GONE: overlayView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
*/
|
||||
|
||||
for (Button button : controlButtons) {
|
||||
button.setVisibility(button.getVisibility() == View.GONE ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
zoomButton.setVisibility((zoomButton.getVisibility() == View.GONE && mVersionInfo.optifineLib != null) ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean onTouch(View v, MotionEvent e) {
|
||||
boolean isDown;
|
||||
switch (e.getActionMasked()) {
|
||||
case MotionEvent.ACTION_DOWN: // 0
|
||||
case MotionEvent.ACTION_POINTER_DOWN: // 5
|
||||
isDown = true;
|
||||
break;
|
||||
case MotionEvent.ACTION_UP: // 1
|
||||
case MotionEvent.ACTION_CANCEL: // 3
|
||||
case MotionEvent.ACTION_POINTER_UP: // 6
|
||||
isDown = false;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (v.getId()) {
|
||||
case R.id.control_up: sendKeyPress(LWJGLGLFWKeycode.GLFW_KEY_W, 0, isDown); break;
|
||||
case R.id.control_left: sendKeyPress(LWJGLGLFWKeycode.GLFW_KEY_A, 0, isDown); break;
|
||||
case R.id.control_down: sendKeyPress(LWJGLGLFWKeycode.GLFW_KEY_S, 0, isDown); break;
|
||||
case R.id.control_right: sendKeyPress(LWJGLGLFWKeycode.GLFW_KEY_D, 0, isDown); break;
|
||||
case R.id.control_jump: sendKeyPress(LWJGLGLFWKeycode.GLFW_KEY_SPACE, 0, isDown); break;
|
||||
case R.id.control_primary: sendMouseButton(LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_LEFT, isDown); break;
|
||||
case R.id.control_secondary:
|
||||
if (CallbackBridge.isGrabbing()) {
|
||||
sendMouseButton(LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_RIGHT, isDown);
|
||||
} else {
|
||||
/*
|
||||
if (!isDown) {
|
||||
CallbackBridge.putMouseEventWithCoords(LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_RIGHT, CallbackBridge.mouseX, CallbackBridge.mouseY);
|
||||
}
|
||||
*/
|
||||
|
||||
CallbackBridge.putMouseEventWithCoords(LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_RIGHT, isDown ? 1 : 0, CallbackBridge.mouseX, CallbackBridge.mouseY);
|
||||
|
||||
setRightOverride(isDown);
|
||||
} break;
|
||||
case R.id.control_debug: sendKeyPress(LWJGLGLFWKeycode.GLFW_KEY_F3, 0, isDown); break;
|
||||
case R.id.control_shift: sendKeyPress(LWJGLGLFWKeycode.GLFW_KEY_LEFT_SHIFT, 0, isDown); break;
|
||||
case R.id.control_inventory: sendKeyPress(LWJGLGLFWKeycode.GLFW_KEY_E, 0, isDown); break;
|
||||
case R.id.control_talk: sendKeyPress(LWJGLGLFWKeycode.GLFW_KEY_T, 0, isDown); break;
|
||||
case R.id.control_keyboard: showKeyboard(); break;
|
||||
case R.id.control_thirdperson: sendKeyPress(LWJGLGLFWKeycode.GLFW_KEY_F5, 0, isDown); break;
|
||||
case R.id.control_zoom: sendKeyPress(LWJGLGLFWKeycode.GLFW_KEY_C, 0, isDown); break;
|
||||
case R.id.control_listplayers: sendKeyPress(LWJGLGLFWKeycode.GLFW_KEY_TAB, 0, isDown); break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private Button findButton(int id) {
|
||||
Button button = (Button) findViewById(id);
|
||||
button.setWidth((int) (button.getWidth() * Tools.currentDisplayMetrics.scaledDensity));
|
||||
button.setHeight((int) (button.getHeight() * LauncherPreferences.PREF_BUTTONSIZE));
|
||||
button.setOnTouchListener(this);
|
||||
button.setFocusable(false);
|
||||
button.setFocusableInTouchMode(false);
|
||||
return button;
|
||||
mControlLayout.toggleControlVisible();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,16 +55,10 @@ public class PojavLauncherActivity extends BaseLauncherActivity
|
|||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
viewInit();
|
||||
|
||||
if (BuildConfig.DEBUG) {
|
||||
Toast.makeText(this, "Launcher process id: " + android.os.Process.myPid(), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
// DEBUG
|
||||
//new android.support.design.widget.NavigationView(this);
|
||||
|
||||
private void viewInit() {
|
||||
|
||||
setContentView(R.layout.launcher_main_v3);
|
||||
// setContentView(R.layout.launcher_main);
|
||||
|
||||
|
|
@ -188,16 +182,11 @@ public class PojavLauncherActivity extends BaseLauncherActivity
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void onPostResume() {
|
||||
super.onPostResume();
|
||||
Tools.updateWindowSize(this);
|
||||
}
|
||||
|
||||
private float updateWidthHeight() {
|
||||
protected float updateWidthHeight() {
|
||||
float leftRightWidth = (float) CallbackBridge.windowWidth / 100f * 32f;
|
||||
float mPlayButtonWidth = CallbackBridge.windowWidth - leftRightWidth * 2f;
|
||||
LinearLayout.LayoutParams leftRightParams = new LinearLayout.LayoutParams((int) leftRightWidth, (int) Tools.dpToPx(this, CallbackBridge.windowHeight / 9));
|
||||
LinearLayout.LayoutParams mPlayButtonParams = new LinearLayout.LayoutParams((int) mPlayButtonWidth, (int) Tools.dpToPx(this, CallbackBridge.windowHeight / 9));
|
||||
LinearLayout.LayoutParams leftRightParams = new LinearLayout.LayoutParams((int) leftRightWidth, (int) Tools.dpToPx(CallbackBridge.windowHeight / 9));
|
||||
LinearLayout.LayoutParams mPlayButtonParams = new LinearLayout.LayoutParams((int) mPlayButtonWidth, (int) Tools.dpToPx(CallbackBridge.windowHeight / 9));
|
||||
leftView.setLayoutParams(leftRightParams);
|
||||
rightView.setLayoutParams(leftRightParams);
|
||||
mPlayButton.setLayoutParams(mPlayButtonParams);
|
||||
|
|
@ -205,102 +194,14 @@ public class PojavLauncherActivity extends BaseLauncherActivity
|
|||
return leftRightWidth;
|
||||
}
|
||||
|
||||
public void mcaccSwitchUser(View view)
|
||||
{
|
||||
showProfileInfo();
|
||||
}
|
||||
|
||||
public void mcaccLogout(View view)
|
||||
{
|
||||
//PojavProfile.reset();
|
||||
finish();
|
||||
}
|
||||
|
||||
private void showProfileInfo()
|
||||
{
|
||||
/*
|
||||
new AlertDialog.Builder(this)
|
||||
.setTitle("Info player")
|
||||
.setMessage(
|
||||
"AccessToken=" + profile.getAccessToken() + "\n" +
|
||||
"ClientID=" + profile.getClientID() + "\n" +
|
||||
"ProfileID=" + profile.getProfileID() + "\n" +
|
||||
"Username=" + profile.getUsername() + "\n" +
|
||||
"Version=" + profile.getVersion()
|
||||
).show();
|
||||
*/
|
||||
}
|
||||
|
||||
private void selectTabPage(int pageIndex){
|
||||
@Override
|
||||
protected void selectTabPage(int pageIndex){
|
||||
if (tabLayout.getSelectedTabPosition() != pageIndex) {
|
||||
tabLayout.setScrollPosition(pageIndex,0f,true);
|
||||
viewPager.setCurrentItem(pageIndex);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResumeFragments()
|
||||
{
|
||||
super.onResumeFragments();
|
||||
new RefreshVersionListTask(this).execute();
|
||||
|
||||
try{
|
||||
final ProgressDialog barrier = new ProgressDialog(this);
|
||||
barrier.setMessage("Waiting");
|
||||
barrier.setProgressStyle(barrier.STYLE_SPINNER);
|
||||
barrier.setCancelable(false);
|
||||
barrier.show();
|
||||
|
||||
new Thread(new Runnable(){
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
while (mConsoleView == null) {
|
||||
try {
|
||||
Thread.sleep(20);
|
||||
} catch (Throwable th) {}
|
||||
}
|
||||
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
} catch (Throwable th) {}
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
try {
|
||||
mConsoleView.putLog("");
|
||||
barrier.dismiss();
|
||||
} catch (Throwable th) {
|
||||
startActivity(getIntent());
|
||||
finish();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}).start();
|
||||
|
||||
File lastCrashFile = Tools.lastFileModified(Tools.crashPath);
|
||||
if(CrashFragment.isNewCrash(lastCrashFile) || !mCrashView.getLastCrash().isEmpty()){
|
||||
mCrashView.resetCrashLog = false;
|
||||
selectTabPage(2);
|
||||
} else throw new Exception();
|
||||
} catch(Throwable e){
|
||||
selectTabPage(tabLayout.getSelectedTabPosition());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume(){
|
||||
super.onResume();
|
||||
final int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
|
||||
final View decorView = getWindow().getDecorView();
|
||||
decorView.setSystemUiVisibility(uiOptions);
|
||||
}
|
||||
|
||||
private boolean canBack = false;
|
||||
public void statusIsLaunching(boolean isLaunching) {
|
||||
// As preference fragment put to tab, changes without notice, so need re-load pref
|
||||
if (isLaunching) LauncherPreferences.loadPreferences();
|
||||
|
|
@ -318,35 +219,5 @@ public class PojavLauncherActivity extends BaseLauncherActivity
|
|||
mVersionSelector.setEnabled(!isLaunching);
|
||||
canBack = !isLaunching;
|
||||
}
|
||||
@Override
|
||||
public void onBackPressed()
|
||||
{
|
||||
if (canBack) {
|
||||
super.onBackPressed();
|
||||
}
|
||||
}
|
||||
|
||||
// Catching touch exception
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
try {
|
||||
return super.onTouchEvent(event);
|
||||
} catch (Throwable th) {
|
||||
Tools.showError(this, th);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void launchGame(View v)
|
||||
{
|
||||
if (!canBack && mIsAssetsProcessing) {
|
||||
mIsAssetsProcessing = false;
|
||||
statusIsLaunching(false);
|
||||
} else if (canBack) {
|
||||
v.setEnabled(false);
|
||||
mTask = new MinecraftDownloaderTask(this);
|
||||
mTask.execute(mProfile.getVersion());
|
||||
mCrashView.resetCrashLog = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import android.support.v7.app.*;
|
|||
import android.system.*;
|
||||
import android.text.*;
|
||||
import android.text.style.*;
|
||||
import android.util.Log;
|
||||
import android.view.*;
|
||||
import android.widget.*;
|
||||
import android.widget.CompoundButton.*;
|
||||
|
|
@ -45,7 +46,7 @@ public class PojavLoginActivity extends BaseActivity
|
|||
|
||||
private SharedPreferences firstLaunchPrefs;
|
||||
|
||||
private boolean isSkipInit = false;
|
||||
private static boolean isSkipInit = false;
|
||||
|
||||
// private final String PREF_IS_DONOTSHOWAGAIN_WARN = "isWarnDoNotShowAgain";
|
||||
public static final String PREF_IS_INSTALLED_JAVARUNTIME = "isJavaRuntimeInstalled";
|
||||
|
|
@ -56,10 +57,10 @@ public class PojavLoginActivity extends BaseActivity
|
|||
|
||||
Tools.updateWindowSize(this);
|
||||
|
||||
ControlData.pixelOf2dp = (int) Tools.dpToPx(this, 2);
|
||||
ControlData.pixelOf30dp = (int) Tools.dpToPx(this, 30);
|
||||
ControlData.pixelOf50dp = (int) Tools.dpToPx(this, 50);
|
||||
ControlData.pixelOf80dp = (int) Tools.dpToPx(this, 80);
|
||||
ControlData.pixelOf2dp = (int) Tools.dpToPx(2);
|
||||
ControlData.pixelOf30dp = (int) Tools.dpToPx(30);
|
||||
ControlData.pixelOf50dp = (int) Tools.dpToPx(50);
|
||||
ControlData.pixelOf80dp = (int) Tools.dpToPx(80);
|
||||
ControlData[] specialButtons = ControlData.getSpecialButtons();
|
||||
specialButtons[0].name = getString(R.string.control_keyboard);
|
||||
specialButtons[1].name = getString(R.string.control_toggle);
|
||||
|
|
@ -69,8 +70,6 @@ public class PojavLoginActivity extends BaseActivity
|
|||
|
||||
firstLaunchPrefs = getSharedPreferences("pojav_extract", MODE_PRIVATE);
|
||||
new InitTask().execute(isSkipInit);
|
||||
|
||||
isSkipInit = true;
|
||||
}
|
||||
|
||||
private class InitTask extends AsyncTask<Boolean, String, Integer>{
|
||||
|
|
@ -217,8 +216,7 @@ public class PojavLoginActivity extends BaseActivity
|
|||
System.out.println(currFile.getAbsolutePath());
|
||||
if (currFile.getAbsolutePath().contains("/values-") || currFile.getName().startsWith("values-")) {
|
||||
// TODO use regex(?)
|
||||
Locale thisLocale = new Locale(currFile.getName().replace("values-", "").replace("-r", "-"));
|
||||
langAdapter.add(new DisplayableLocale(thisLocale));
|
||||
langAdapter.add(new DisplayableLocale(currFile.getName().replace("values-", "").replace("-r", "-")));
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
|
|
@ -248,7 +246,7 @@ public class PojavLoginActivity extends BaseActivity
|
|||
|
||||
Locale locale;
|
||||
if (position == 0) {
|
||||
locale = Locale.getDefault();
|
||||
locale = LocaleUtils.DEFAULT_LOCALE;
|
||||
} else if (position == 1) {
|
||||
locale = Locale.ENGLISH;
|
||||
} else {
|
||||
|
|
@ -281,6 +279,8 @@ public class PojavLoginActivity extends BaseActivity
|
|||
edit3.setEnabled(!p2);
|
||||
}
|
||||
});
|
||||
|
||||
isSkipInit = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -323,6 +323,7 @@ public class PojavLoginActivity extends BaseActivity
|
|||
mkdirs(Tools.CTRLMAP_PATH);
|
||||
|
||||
try {
|
||||
AssetManager am = this.getAssets();
|
||||
new CustomControls(this).save(Tools.CTRLDEF_FILE);
|
||||
|
||||
Tools.copyAssetFile(this, "options.txt", Tools.MAIN_PATH, false);
|
||||
|
|
@ -330,16 +331,54 @@ public class PojavLoginActivity extends BaseActivity
|
|||
// Extract launcher_profiles.json
|
||||
// TODO: Remove after implement.
|
||||
Tools.copyAssetFile(this, "launcher_profiles.json", Tools.MAIN_PATH, false);
|
||||
|
||||
Tools.copyAssetFile(this, "ClassWrapper.jar", Tools.MAIN_PATH + "/lwjgl3", false);
|
||||
|
||||
// Yep, the codebase from v1.0.3:
|
||||
//FileAccess.copyAssetToFolderIfNonExist(this, "1.0.jar", Tools.versnDir + "/1.0");
|
||||
//FileAccess.copyAssetToFolderIfNonExist(this, "1.7.3.jar", Tools.versnDir + "/1.7.3");
|
||||
//FileAccess.copyAssetToFolderIfNonExist(this, "1.7.10.jar", Tools.versnDir + "/1.7.10");
|
||||
|
||||
// UpdateDataChanger.changeDataAuto("2.4", "2.4.2");
|
||||
|
||||
|
||||
InputStream is = am.open("components/lwjgl3/version");
|
||||
if(!new File(Tools.MAIN_PATH + "/lwjgl3/version").exists()) {
|
||||
Log.i("LWJGL3Prep","Pack was installed manually, or does not exist, unpacking new...");
|
||||
String[] lwjglFileList = am.list("components/lwjgl3");
|
||||
FileOutputStream fos;
|
||||
InputStream iis;
|
||||
for(String s : lwjglFileList) {
|
||||
iis = am.open("components/lwjgl3/"+s);
|
||||
fos = new FileOutputStream(new File(Tools.MAIN_PATH+"/lwjgl3/"+s));
|
||||
/*
|
||||
int i; byte[] buf = new byte[1024];
|
||||
while((i = iis.read(buf)) != -1) {
|
||||
fos.write(buf,0,i);
|
||||
}
|
||||
*/
|
||||
IOUtils.copy(iis,fos);
|
||||
fos.close();
|
||||
iis.close();
|
||||
}
|
||||
}else {
|
||||
FileInputStream fis = new FileInputStream(new File(Tools.MAIN_PATH + "/lwjgl3/version"));
|
||||
byte[] release1 = new byte[is.available()];
|
||||
byte[] release2 = new byte[fis.available()];
|
||||
is.read(release1);
|
||||
fis.read(release2);
|
||||
if(!Arrays.equals(release1,release2)) {
|
||||
String[] lwjglFileList = am.list("components/lwjgl3");
|
||||
FileOutputStream fos;
|
||||
InputStream iis;
|
||||
for(String s : lwjglFileList) {
|
||||
iis = am.open("components/lwjgl3/"+s);
|
||||
fos = new FileOutputStream(new File(Tools.MAIN_PATH+"/lwjgl3/"+s));
|
||||
/*
|
||||
int i; byte[] buf = new byte[1024];
|
||||
while((i = iis.read(buf)) != -1) {
|
||||
fos.write(buf,0,i);
|
||||
}
|
||||
*/
|
||||
IOUtils.copy(iis,fos);
|
||||
|
||||
fos.close();
|
||||
iis.close();
|
||||
}
|
||||
}else{
|
||||
Log.i("LWJGL3Prep","Pack is up-to-date with the launcher, continuing...");
|
||||
}
|
||||
}
|
||||
if (!isJavaRuntimeInstalled()) {
|
||||
File jreTarFile = selectJreTarFile();
|
||||
uncompressTarXZ(jreTarFile, new File(Tools.homeJreDir));
|
||||
|
|
@ -357,7 +396,7 @@ public class PojavLoginActivity extends BaseActivity
|
|||
|
||||
// Refresh libraries
|
||||
copyDummyNativeLib("libawt_xawt.so");
|
||||
copyDummyNativeLib("libfontconfig.so");
|
||||
// copyDummyNativeLib("libfontconfig.so");
|
||||
}
|
||||
catch(Throwable e){
|
||||
Tools.showError(this, e);
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ public final class Tools
|
|||
|
||||
public static void launchJavaVM(final LoggableActivity ctx, final List<String> args) throws Throwable {
|
||||
JREUtils.relocateLibPath(ctx);
|
||||
ctx.appendlnToLog("LD_LIBRARY_PATH = " + JREUtils.LD_LIBRARY_PATH);
|
||||
// ctx.appendlnToLog("LD_LIBRARY_PATH = " + JREUtils.LD_LIBRARY_PATH);
|
||||
|
||||
List<String> javaArgList = new ArrayList<String>();
|
||||
javaArgList.add(Tools.homeJreDir + "/bin/java");
|
||||
|
|
@ -159,10 +159,11 @@ public final class Tools
|
|||
|
||||
public static String[] getMinecraftArgs(MCProfile.Builder profile, JMinecraftVersionList.Version versionInfo) {
|
||||
String username = profile.getUsername();
|
||||
String versionName = profile.getVersion();
|
||||
String versionName = versionInfo.id;
|
||||
if (versionInfo.inheritsFrom != null) {
|
||||
versionName = versionInfo.inheritsFrom;
|
||||
}
|
||||
|
||||
String userType = "mojang";
|
||||
|
||||
File gameDir = new File(Tools.MAIN_PATH);
|
||||
|
|
@ -341,15 +342,11 @@ public final class Tools
|
|||
CallbackBridge.windowHeight = currentDisplayMetrics.heightPixels;
|
||||
}
|
||||
|
||||
public static float pxToDp(Context ctx, float px) {
|
||||
return (px / ctx.getResources().getDisplayMetrics().density);
|
||||
}
|
||||
|
||||
public static float dpToPx(Context ctx, float dp) {
|
||||
public static float dpToPx(float dp) {
|
||||
// 921600 = 1280 * 720, default scale
|
||||
// TODO better way to scaling
|
||||
// float scaledDp = dp / 921600 * CallbackBridge.windowWidth * CallbackBridge.windowHeight;
|
||||
return (dp /* scaledDp */ * ctx.getResources().getDisplayMetrics().density);
|
||||
float scaledDp = dp; // / DisplayMetrics.DENSITY_XHIGH * currentDisplayMetrics.densityDpi;
|
||||
return (scaledDp * currentDisplayMetrics.density);
|
||||
}
|
||||
|
||||
public static void copyAssetFile(Context ctx, String fileName, String output, boolean overwrite) throws Exception
|
||||
|
|
@ -361,7 +358,9 @@ public final class Tools
|
|||
{
|
||||
try {
|
||||
File file = new File(output);
|
||||
if(!file.exists()) file.mkdirs();
|
||||
if(!file.exists()) {
|
||||
file.mkdirs();
|
||||
}
|
||||
File file2 = new File(output, outputName);
|
||||
if(!file2.exists() || overwrite){
|
||||
write(file2.getAbsolutePath(), loadFromAssetToByte(ctx, fileName));
|
||||
|
|
@ -532,18 +531,13 @@ public final class Tools
|
|||
for (DependentLibrary lib : customVer.libraries) {
|
||||
if (lib.name.startsWith(optifineLib)) {
|
||||
customVer.optifineLib = lib;
|
||||
} else if (lib.name.startsWith("net.minecraft:launchwrapper")) {
|
||||
int versionIndex = lib.name.lastIndexOf(":");
|
||||
if (lib.name.substring(versionIndex + 1).startsWith("1.")) {
|
||||
lib.name = lib.name.substring(0, versionIndex + 1) + "2.0";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (customVer.inheritsFrom == null || customVer.inheritsFrom.isEmpty()) {
|
||||
if (customVer.inheritsFrom == null || customVer.inheritsFrom.equals(customVer.id)) {
|
||||
return customVer;
|
||||
} else {
|
||||
JMinecraftVersionList.Version inheritsVer = Tools.GLOBAL_GSON.fromJson(read(versnDir + "/" + customVer.inheritsFrom + "/" + customVer.inheritsFrom + ".json"), JMinecraftVersionList.Version.class);
|
||||
inheritsVer.inheritsFrom = "";
|
||||
inheritsVer.inheritsFrom = inheritsVer.id;
|
||||
|
||||
insertSafety(inheritsVer, customVer,
|
||||
"assetIndex", "assets", "id",
|
||||
|
|
@ -620,9 +614,12 @@ public final class Tools
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static String convertStream(InputStream inputStream) throws IOException {
|
||||
return convertStream(inputStream, Charset.forName("UTF-8"));
|
||||
}
|
||||
|
||||
public static String convertStream(InputStream inputStream, Charset charset) throws IOException {
|
||||
|
||||
String out = "";
|
||||
int len;
|
||||
byte[] buf = new byte[512];
|
||||
|
|
@ -666,7 +663,7 @@ public final class Tools
|
|||
}
|
||||
|
||||
|
||||
public static String read(InputStream is) throws Exception {
|
||||
public static String read(InputStream is) throws IOException {
|
||||
String out = "";
|
||||
int len;
|
||||
byte[] buf = new byte[512];
|
||||
|
|
@ -676,11 +673,11 @@ public final class Tools
|
|||
return out;
|
||||
}
|
||||
|
||||
public static String read(String path) throws Exception {
|
||||
public static String read(String path) throws IOException {
|
||||
return read(new FileInputStream(path));
|
||||
}
|
||||
|
||||
public static void write(String path, byte[] content) throws Exception
|
||||
public static void write(String path, byte[] content) throws IOException
|
||||
{
|
||||
File outPath = new File(path);
|
||||
outPath.getParentFile().mkdirs();
|
||||
|
|
@ -691,8 +688,7 @@ public final class Tools
|
|||
fos.close();
|
||||
}
|
||||
|
||||
public static void write(String path, String content) throws Exception
|
||||
{
|
||||
public static void write(String path, String content) throws IOException {
|
||||
write(path, content.getBytes());
|
||||
}
|
||||
|
||||
|
|
@ -713,7 +709,7 @@ public final class Tools
|
|||
return buffer;
|
||||
}
|
||||
|
||||
public static void downloadFile(String urlInput, String nameOutput) throws Throwable {
|
||||
public static void downloadFile(String urlInput, String nameOutput) throws IOException {
|
||||
File file = new File(nameOutput);
|
||||
DownloadUtils.downloadFile(urlInput, file);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,37 +1,53 @@
|
|||
package net.kdt.pojavlaunch.customcontrols;
|
||||
|
||||
import android.content.*;
|
||||
import android.graphics.*;
|
||||
import android.util.*;
|
||||
import android.view.*;
|
||||
import android.view.View.*;
|
||||
import android.widget.*;
|
||||
import net.kdt.pojavlaunch.*;
|
||||
import com.kdt.handleview.*;
|
||||
import android.view.ViewGroup.*;
|
||||
import net.kdt.pojavlaunch.*;
|
||||
import org.lwjgl.glfw.*;
|
||||
|
||||
public class ControlButton extends Button implements OnLongClickListener, OnTouchListener
|
||||
{
|
||||
private Paint mRectPaint;
|
||||
|
||||
private GestureDetector mGestureDetector;
|
||||
private ControlData mProperties;
|
||||
private SelectionEndHandleView mHandleView;
|
||||
|
||||
private boolean mCanModify = false;
|
||||
private boolean mModifiable = false;
|
||||
private boolean mCanTriggerLongClick = true;
|
||||
|
||||
private boolean mChecked = false;
|
||||
|
||||
private float mScaleAt;
|
||||
private int mMods;
|
||||
|
||||
public ControlButton(Context ctx, ControlData properties) {
|
||||
super(ctx);
|
||||
public ControlButton(ControlLayout layout, ControlData properties) {
|
||||
super(layout.getContext());
|
||||
setWillNotDraw(false);
|
||||
|
||||
mGestureDetector = new GestureDetector(ctx, new SingleTapConfirm());
|
||||
mScaleAt = layout.mLayout.scaledAt;
|
||||
|
||||
mGestureDetector = new GestureDetector(getContext(), new SingleTapConfirm());
|
||||
|
||||
setBackgroundResource(R.drawable.control_button);
|
||||
|
||||
setOnLongClickListener(this);
|
||||
setOnTouchListener(this);
|
||||
|
||||
setProperties(properties);
|
||||
setModified(false);
|
||||
|
||||
mHandleView = new SelectionEndHandleView(this);
|
||||
|
||||
final TypedValue value = new TypedValue();
|
||||
getContext().getTheme().resolveAttribute(R.attr.colorAccent, value, true);
|
||||
|
||||
mRectPaint = new Paint();
|
||||
mRectPaint.setColor(value.data);
|
||||
}
|
||||
|
||||
public HandleView getHandleView() {
|
||||
|
|
@ -70,115 +86,152 @@ public class ControlButton extends Button implements OnLongClickListener, OnTouc
|
|||
// A non-special button or inside custom controls screen so skip listener
|
||||
} else if (properties.specialButtonListener instanceof View.OnClickListener) {
|
||||
setOnClickListener((View.OnClickListener) properties.specialButtonListener);
|
||||
// setOnLongClickListener(null);
|
||||
// setOnTouchListener(null);
|
||||
} else if (properties.specialButtonListener instanceof View.OnTouchListener) {
|
||||
// setOnLongClickListener(null);
|
||||
setOnTouchListener((View.OnTouchListener) properties.specialButtonListener);
|
||||
} else {
|
||||
throw new IllegalArgumentException("Field " + ControlData.class.getName() + ".specialButtonListener must be View.OnClickListener or View.OnTouchListener, but is " + properties.specialButtonListener.getClass().getName());
|
||||
}
|
||||
|
||||
setLayoutParams(new FrameLayout.LayoutParams(properties.width, properties.height));
|
||||
setLayoutParams(new FrameLayout.LayoutParams((int) properties.width, (int) properties.height));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLayoutParams(ViewGroup.LayoutParams params)
|
||||
{
|
||||
public void setLayoutParams(ViewGroup.LayoutParams params) {
|
||||
super.setLayoutParams(params);
|
||||
|
||||
mProperties.width = params.width;
|
||||
mProperties.height = params.height;
|
||||
|
||||
// Re-calculate position
|
||||
mProperties.update();
|
||||
setTranslationX(mProperties.x);
|
||||
setTranslationY(mProperties.y);
|
||||
|
||||
setModified(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTranslationX(float x) {
|
||||
super.setTranslationX(x);
|
||||
mProperties.x = x;
|
||||
|
||||
if (!mProperties.isDynamicBtn) {
|
||||
mProperties.x = x;
|
||||
mProperties.dynamicX = Float.toString(x / CallbackBridge.windowWidth) + " * ${screen_width}";
|
||||
setModified(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTranslationY(float y) {
|
||||
super.setTranslationY(y);
|
||||
mProperties.y = y;
|
||||
}
|
||||
|
||||
if (!mProperties.isDynamicBtn) {
|
||||
mProperties.y = y;
|
||||
mProperties.dynamicY = Float.toString(y / CallbackBridge.windowHeight) + " * ${screen_height}";
|
||||
setModified(true);
|
||||
}
|
||||
}
|
||||
|
||||
public void updateProperties() {
|
||||
setProperties(mProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onLongClick(View p1) {
|
||||
if (!mCanTriggerLongClick) return false;
|
||||
|
||||
if (mHandleView.isShowing()) {
|
||||
mHandleView.hide();
|
||||
} else {
|
||||
if (getParent() != null) {
|
||||
((ControlLayout) getParent()).hideAllHandleViews();
|
||||
}
|
||||
mHandleView.show();
|
||||
protected void onDraw(Canvas canvas) {
|
||||
super.onDraw(canvas);
|
||||
if (mChecked) {
|
||||
canvas.drawRect(0, getHeight() - 10 * mScaleAt, getWidth(), getHeight(), mRectPaint);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onLongClick(View p1) {
|
||||
if (mCanTriggerLongClick && mModifiable) {
|
||||
if (mHandleView.isShowing()) {
|
||||
mHandleView.hide();
|
||||
} else {
|
||||
if (getParent() != null) {
|
||||
((ControlLayout) getParent()).hideAllHandleViews();
|
||||
}
|
||||
mHandleView.show();
|
||||
}
|
||||
}
|
||||
|
||||
return mCanTriggerLongClick;
|
||||
}
|
||||
|
||||
private float moveX, moveY;
|
||||
private float downX, downY;
|
||||
@Override
|
||||
public boolean onTouch(View view, MotionEvent event) {
|
||||
if (!mCanModify) {
|
||||
if (!mModifiable) {
|
||||
mCanTriggerLongClick = false;
|
||||
|
||||
if (mProperties.keycode >= 0) {
|
||||
boolean isDown;
|
||||
switch (event.getActionMasked()) {
|
||||
case MotionEvent.ACTION_DOWN: // 0
|
||||
case MotionEvent.ACTION_POINTER_DOWN: // 5
|
||||
isDown = true;
|
||||
break;
|
||||
case MotionEvent.ACTION_UP: // 1
|
||||
case MotionEvent.ACTION_CANCEL: // 3
|
||||
case MotionEvent.ACTION_POINTER_UP: // 6
|
||||
isDown = false;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
// if (!mProperties.isToggle) {
|
||||
if (mProperties.keycode >= 0) {
|
||||
boolean isDown;
|
||||
switch (event.getActionMasked()) {
|
||||
case MotionEvent.ACTION_DOWN: // 0
|
||||
case MotionEvent.ACTION_POINTER_DOWN: // 5
|
||||
isDown = true;
|
||||
break;
|
||||
case MotionEvent.ACTION_UP: // 1
|
||||
case MotionEvent.ACTION_CANCEL: // 3
|
||||
case MotionEvent.ACTION_POINTER_UP: // 6
|
||||
isDown = false;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
MainActivity.sendKeyPress(mProperties.keycode, mMods, isDown);
|
||||
return true;
|
||||
}
|
||||
MainActivity.sendKeyPress(mProperties.keycode, mMods, isDown);
|
||||
/* } else if (mGestureDetector.onTouchEvent(event)) {
|
||||
mChecked = !mChecked;
|
||||
MainActivity.sendKeyPress(mProperties.keycode, mMods, mChecked);
|
||||
} */
|
||||
|
||||
return true;
|
||||
} else {
|
||||
if (mGestureDetector.onTouchEvent(event)) {
|
||||
mCanTriggerLongClick = true;
|
||||
onLongClick(this);
|
||||
}
|
||||
|
||||
return false;
|
||||
switch (event.getActionMasked()) {
|
||||
case MotionEvent.ACTION_UP:
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
mCanTriggerLongClick = true;
|
||||
downX = event.getX();
|
||||
downY = event.getY();
|
||||
break;
|
||||
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
mCanTriggerLongClick = false;
|
||||
moveX += event.getX() - downX;
|
||||
moveY += event.getY() - downY;
|
||||
|
||||
if (!mProperties.isDynamicBtn) {
|
||||
setTranslationX(moveX);
|
||||
setTranslationY(moveY);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (mGestureDetector.onTouchEvent(event)) {
|
||||
mCanTriggerLongClick = true;
|
||||
onLongClick(this);
|
||||
}
|
||||
|
||||
switch (event.getActionMasked()) {
|
||||
case MotionEvent.ACTION_UP:
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
mCanTriggerLongClick = true;
|
||||
downX = event.getX();
|
||||
downY = event.getY();
|
||||
break;
|
||||
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
mCanTriggerLongClick = false;
|
||||
moveX += event.getX() - downX;
|
||||
moveY += event.getY() - downY;
|
||||
|
||||
if (!mProperties.isDynamicBtn) {
|
||||
setTranslationX(moveX);
|
||||
setTranslationY(moveY);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setModifiable(boolean z) {
|
||||
mCanModify = z;
|
||||
mModifiable = z;
|
||||
}
|
||||
|
||||
private void setModified(boolean modified) {
|
||||
if (getParent() != null) {
|
||||
((ControlLayout) getParent()).setModified(modified);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ public class ControlData implements Cloneable
|
|||
* bigger device or vice versa.
|
||||
*/
|
||||
public String dynamicX, dynamicY;
|
||||
public boolean isDynamicBtn;
|
||||
public boolean isDynamicBtn, isToggle;
|
||||
|
||||
public static ControlData[] getSpecialButtons(){
|
||||
if (SPECIAL_BUTTONS == null) {
|
||||
|
|
@ -69,8 +69,8 @@ public class ControlData implements Cloneable
|
|||
public String name;
|
||||
public float x;
|
||||
public float y;
|
||||
public int width = pixelOf50dp;
|
||||
public int height = pixelOf50dp;
|
||||
public float width = pixelOf50dp;
|
||||
public float height = pixelOf50dp;
|
||||
public int keycode;
|
||||
public boolean hidden;
|
||||
public boolean holdCtrl;
|
||||
|
|
@ -99,18 +99,13 @@ public class ControlData implements Cloneable
|
|||
this(name, keycode, x, y, isSquare ? pixelOf50dp : pixelOf80dp, isSquare ? pixelOf50dp : pixelOf30dp);
|
||||
}
|
||||
|
||||
public ControlData(String name, int keycode, float x, float y, int width, int height) {
|
||||
this.name = name;
|
||||
this.keycode = keycode;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
public ControlData(String name, int keycode, float x, float y, float width, float height) {
|
||||
this(name, keycode, Float.toString(x), Float.toString(y), width, height, false);
|
||||
this.isDynamicBtn = false;
|
||||
}
|
||||
|
||||
public ControlData(String name, int keycode, String dynamicX, String dynamicY) {
|
||||
this(name, keycode, dynamicX, dynamicY, pixelOf50dp, pixelOf50dp);
|
||||
this(name, keycode, dynamicX, dynamicY, pixelOf50dp, pixelOf50dp, false);
|
||||
}
|
||||
|
||||
public ControlData(android.content.Context ctx, int resId, int keycode, String dynamicX, String dynamicY, boolean isSquare) {
|
||||
|
|
@ -118,14 +113,18 @@ public class ControlData implements Cloneable
|
|||
}
|
||||
|
||||
public ControlData(String name, int keycode, String dynamicX, String dynamicY, boolean isSquare) {
|
||||
this(name, keycode, dynamicX, dynamicY, isSquare ? pixelOf50dp : pixelOf80dp, isSquare ? pixelOf50dp : pixelOf30dp);
|
||||
this(name, keycode, dynamicX, dynamicY, isSquare ? pixelOf50dp : pixelOf80dp, isSquare ? pixelOf50dp : pixelOf30dp, false);
|
||||
}
|
||||
|
||||
public ControlData(String name, int keycode, String dynamicX, String dynamicY, int width, int height) {
|
||||
this(name, keycode, 0, 0, width, height);
|
||||
public ControlData(String name, int keycode, String dynamicX, String dynamicY, float width, float height, boolean isToggle) {
|
||||
this.name = name;
|
||||
this.keycode = keycode;
|
||||
this.dynamicX = dynamicX;
|
||||
this.dynamicY = dynamicY;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
this.isDynamicBtn = true;
|
||||
this.isToggle = isToggle;
|
||||
update();
|
||||
}
|
||||
|
||||
|
|
@ -135,7 +134,7 @@ public class ControlData implements Cloneable
|
|||
|
||||
public ControlData clone() {
|
||||
if (this instanceof ControlData) {
|
||||
return new ControlData(name, keycode, ((ControlData) this).dynamicX, ((ControlData) this).dynamicY, width, height);
|
||||
return new ControlData(name, keycode, ((ControlData) this).dynamicX, ((ControlData) this).dynamicY, width, height, isToggle);
|
||||
} else {
|
||||
return new ControlData(name, keycode, x, y, width, height);
|
||||
}
|
||||
|
|
@ -146,10 +145,10 @@ public class ControlData implements Cloneable
|
|||
Map<String, String> keyValueMap = new ArrayMap<>();
|
||||
keyValueMap.put("top", "0");
|
||||
keyValueMap.put("left", "0");
|
||||
keyValueMap.put("right", Integer.toString(CallbackBridge.windowWidth - width));
|
||||
keyValueMap.put("bottom", Integer.toString(CallbackBridge.windowHeight - height));
|
||||
keyValueMap.put("width", Integer.toString(width));
|
||||
keyValueMap.put("height", Integer.toString(height));
|
||||
keyValueMap.put("right", Float.toString(CallbackBridge.windowWidth - width));
|
||||
keyValueMap.put("bottom", Float.toString(CallbackBridge.windowHeight - height));
|
||||
keyValueMap.put("width", Float.toString(width));
|
||||
keyValueMap.put("height", Float.toString(height));
|
||||
keyValueMap.put("screen_width", Integer.toString(CallbackBridge.windowWidth));
|
||||
keyValueMap.put("screen_height", Integer.toString(CallbackBridge.windowHeight));
|
||||
keyValueMap.put("margin", Integer.toString(pixelOf2dp));
|
||||
|
|
@ -168,8 +167,10 @@ public class ControlData implements Cloneable
|
|||
specialButtonListener = data.specialButtonListener;
|
||||
}
|
||||
}
|
||||
} if (!isDynamicBtn) {
|
||||
return;
|
||||
} if (dynamicX == null) {
|
||||
dynamicX = Float.toString(x);
|
||||
} if (dynamicY == null) {
|
||||
dynamicY = Float.toString(y);
|
||||
}
|
||||
|
||||
x = insertDynamicPos(dynamicX);
|
||||
|
|
|
|||
|
|
@ -1,17 +1,18 @@
|
|||
package net.kdt.pojavlaunch.customcontrols;
|
||||
import android.widget.*;
|
||||
import android.content.*;
|
||||
import android.util.*;
|
||||
import android.view.*;
|
||||
import android.widget.*;
|
||||
import com.google.gson.*;
|
||||
import java.io.*;
|
||||
import net.kdt.pojavlaunch.*;
|
||||
import android.support.v7.app.*;
|
||||
import java.util.*;
|
||||
import net.kdt.pojavlaunch.prefs.*;
|
||||
import org.lwjgl.glfw.*;
|
||||
|
||||
public class ControlLayout extends FrameLayout
|
||||
{
|
||||
private boolean mCanModify;
|
||||
private CustomControls mLayout;
|
||||
protected CustomControls mLayout;
|
||||
private boolean mModifiable;
|
||||
private CustomControlsActivity mActivity;
|
||||
private boolean mControlVisible = false;
|
||||
|
||||
|
|
@ -32,21 +33,29 @@ public class ControlLayout extends FrameLayout
|
|||
}
|
||||
}
|
||||
|
||||
public void loadLayout(String jsonPath) {
|
||||
try {
|
||||
loadLayout(Tools.GLOBAL_GSON.fromJson(Tools.read(jsonPath), CustomControls.class));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
public void loadLayout(String jsonPath) throws IOException, JsonSyntaxException {
|
||||
loadLayout(Tools.GLOBAL_GSON.fromJson(Tools.read(jsonPath), CustomControls.class));
|
||||
}
|
||||
|
||||
public void loadLayout(CustomControls controlLayout) {
|
||||
if (mModifiable) {
|
||||
removeAllViews();
|
||||
}
|
||||
|
||||
mLayout = controlLayout;
|
||||
removeAllViews();
|
||||
|
||||
for (ControlData button : controlLayout.mControlDataList) {
|
||||
button.isHideable = button.keycode != ControlData.SPECIALBTN_TOGGLECTRL && button.keycode != ControlData.SPECIALBTN_VIRTUALMOUSE;
|
||||
button.width = button.width / controlLayout.scaledAt * LauncherPreferences.PREF_BUTTONSIZE;
|
||||
button.height = button.height / controlLayout.scaledAt * LauncherPreferences.PREF_BUTTONSIZE;
|
||||
if (!button.isDynamicBtn) {
|
||||
button.dynamicX = Float.toString(button.x / CallbackBridge.windowWidth) + " * ${screen_width}";
|
||||
button.dynamicY = Float.toString(button.y / CallbackBridge.windowHeight) + " * ${screen_height}";
|
||||
}
|
||||
button.update();
|
||||
addControlView(button);
|
||||
}
|
||||
mLayout.scaledAt = LauncherPreferences.PREF_BUTTONSIZE;
|
||||
|
||||
setModified(false);
|
||||
}
|
||||
|
|
@ -57,8 +66,8 @@ public class ControlLayout extends FrameLayout
|
|||
}
|
||||
|
||||
private void addControlView(ControlData controlButton) {
|
||||
final ControlButton view = new ControlButton(getContext(), controlButton);
|
||||
view.setModifiable(mCanModify);
|
||||
final ControlButton view = new ControlButton(this, controlButton);
|
||||
view.setModifiable(mModifiable);
|
||||
addView(view);
|
||||
|
||||
setModified(true);
|
||||
|
|
@ -82,19 +91,19 @@ public class ControlLayout extends FrameLayout
|
|||
}
|
||||
|
||||
public void toggleControlVisible() {
|
||||
if (mCanModify) return; // Not using on custom controls activity
|
||||
if (mModifiable) return; // Not using on custom controls activity
|
||||
|
||||
mControlVisible = !mControlVisible;
|
||||
for (int i = 0; i < getChildCount(); i++) {
|
||||
View view = getChildAt(i);
|
||||
if (view instanceof ControlButton && ((ControlButton) view).getProperties().isHideable) {
|
||||
((ControlButton) view).setVisibility(mControlVisible ? (((ControlButton) view).getProperties().hidden ? View.INVISIBLE : View.VISIBLE) : View.GONE);
|
||||
((ControlButton) view).setVisibility(mControlVisible ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setModifiable(boolean z) {
|
||||
mCanModify = z;
|
||||
mModifiable = z;
|
||||
for (int i = 0; i < getChildCount(); i++) {
|
||||
View v = getChildAt(i);
|
||||
if (v instanceof ControlButton) {
|
||||
|
|
@ -107,7 +116,7 @@ public class ControlLayout extends FrameLayout
|
|||
}
|
||||
}
|
||||
|
||||
private void setModified(boolean z) {
|
||||
protected void setModified(boolean z) {
|
||||
if (mActivity != null) mActivity.isModified = z;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import org.lwjgl.glfw.*;
|
|||
|
||||
public class CustomControls
|
||||
{
|
||||
public float scaledAt;
|
||||
public List<ControlData> mControlDataList;
|
||||
public CustomControls() {
|
||||
this(new ArrayList<ControlData>());
|
||||
|
|
@ -14,6 +15,7 @@ public class CustomControls
|
|||
|
||||
public CustomControls(List<ControlData> mControlDataList) {
|
||||
this.mControlDataList = mControlDataList;
|
||||
this.scaledAt = 100f;
|
||||
}
|
||||
|
||||
// Generate default control
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
package net.kdt.pojavlaunch.installers;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.zip.*;
|
||||
import net.kdt.pojavlaunch.*;
|
||||
|
||||
public class BaseInstaller {
|
||||
protected File mFile;
|
||||
protected ZipFile mJarFile;
|
||||
|
||||
public void setInput(File file) throws IOException {
|
||||
mFile = file;
|
||||
mJarFile = new ZipFile(file);
|
||||
}
|
||||
|
||||
public void install(JavaGUILauncherActivity ctx) throws IOException {}
|
||||
|
||||
public void from(BaseInstaller base) {
|
||||
mFile = base.mFile;
|
||||
mJarFile = base.mJarFile;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package net.kdt.pojavlaunch.installers;
|
||||
|
||||
import android.content.*;
|
||||
import java.io.*;
|
||||
import java.util.jar.*;
|
||||
import net.kdt.pojavlaunch.*;
|
||||
import java.nio.charset.*;
|
||||
import net.kdt.pojavlaunch.value.*;
|
||||
import org.apache.commons.io.*;
|
||||
import com.google.gson.*;
|
||||
import java.util.zip.*;
|
||||
|
||||
public class FabricInstaller extends BaseInstaller {
|
||||
public FabricInstaller(BaseInstaller i) {
|
||||
from(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void install(JavaGUILauncherActivity ctx) throws IOException {
|
||||
// Unused ZipFile
|
||||
mJarFile.close();
|
||||
|
||||
String mcversion = ctx.dialogInput("Fabric installer", R.string.main_version);
|
||||
|
||||
ctx.appendlnToLog("Launching JVM");
|
||||
ctx.launchJavaRuntime(null,
|
||||
"-jar " + mFile.getAbsolutePath() + " client -dir . -mcversion " + mcversion);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package net.kdt.pojavlaunch.installers;
|
||||
|
||||
import java.io.*;
|
||||
import com.google.gson.*;
|
||||
import net.kdt.pojavlaunch.value.*;
|
||||
|
||||
public class InstallerDetector
|
||||
{
|
||||
public static boolean isFabric(BaseInstaller installer) {
|
||||
return installer.mJarFile.getEntry("net/fabricmc/installer/Main.class") != null;
|
||||
}
|
||||
|
||||
// Forge Legacy: for 1.12.1 and below
|
||||
public static boolean isForgeLegacy(BaseInstaller installer) throws IOException, JsonSyntaxException {
|
||||
ForgeInstallProfile profile = LegacyForgeInstaller.readInstallProfile(installer);
|
||||
return profile != null && profile.versionInfo != null;
|
||||
}
|
||||
|
||||
// Forge New: for 1.12.2 and above
|
||||
public static boolean isForgeNew(BaseInstaller installer) throws IOException, JsonSyntaxException {
|
||||
ForgeInstallProfile profile = LegacyForgeInstaller.readInstallProfile(installer);
|
||||
return profile != null && profile.version != null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
package net.kdt.pojavlaunch.installers;
|
||||
import android.content.*;
|
||||
import java.io.*;
|
||||
import java.util.jar.*;
|
||||
import net.kdt.pojavlaunch.*;
|
||||
import java.nio.charset.*;
|
||||
import net.kdt.pojavlaunch.value.*;
|
||||
import org.apache.commons.io.*;
|
||||
import com.google.gson.*;
|
||||
import java.util.zip.*;
|
||||
|
||||
public class LegacyForgeInstaller extends BaseInstaller {
|
||||
public LegacyForgeInstaller(BaseInstaller i) {
|
||||
from(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void install(JavaGUILauncherActivity ctx) throws IOException {
|
||||
String target;
|
||||
|
||||
ctx.appendlnToLog("Reading install_profile.json");
|
||||
ForgeInstallProfile profile = readInstallProfile(this);
|
||||
|
||||
// Write the json file
|
||||
File versionFile = new File(Tools.versnDir, profile.install.target);
|
||||
versionFile.mkdir();
|
||||
target = versionFile.getAbsolutePath() + "/" + profile.install.target + ".json";
|
||||
ctx.appendlnToLog("Writing " + target);
|
||||
Tools.write(
|
||||
target,
|
||||
Tools.GLOBAL_GSON.toJson(profile.versionInfo)
|
||||
);
|
||||
|
||||
// Extract Forge universal
|
||||
String[] libInfos = profile.install.path.split(":");
|
||||
File libraryFile = new File(Tools.libraries, Tools.artifactToPath(libInfos[0], libInfos[1], libInfos[2]));
|
||||
libraryFile.getParentFile().mkdirs();
|
||||
target = libraryFile.getAbsolutePath().replace("-universal", "");
|
||||
ctx.appendlnToLog("Writing " + target);
|
||||
FileOutputStream out = new FileOutputStream(target);
|
||||
IOUtils.copy(mJarFile.getInputStream(mJarFile.getEntry(profile.install.filePath)), out);
|
||||
out.close();
|
||||
|
||||
mJarFile.close();
|
||||
}
|
||||
|
||||
public static ForgeInstallProfile readInstallProfile(BaseInstaller base) throws IOException, JsonSyntaxException {
|
||||
ZipEntry entry = base.mJarFile.getEntry("install_profile.json");
|
||||
return entry == null ? null : Tools.GLOBAL_GSON.fromJson(
|
||||
Tools.convertStream(
|
||||
base.mJarFile.getInputStream(entry),
|
||||
Charset.forName("UTF-8")
|
||||
),
|
||||
ForgeInstallProfile.class
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
package net.kdt.pojavlaunch.installers;
|
||||
|
||||
import android.content.*;
|
||||
import java.io.*;
|
||||
import java.util.jar.*;
|
||||
import net.kdt.pojavlaunch.*;
|
||||
import java.nio.charset.*;
|
||||
import net.kdt.pojavlaunch.value.*;
|
||||
import org.apache.commons.io.*;
|
||||
import com.google.gson.*;
|
||||
import java.util.zip.*;
|
||||
|
||||
public class NewForgeInstaller extends BaseInstaller {
|
||||
public NewForgeInstaller(BaseInstaller i) {
|
||||
from(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void install(JavaGUILauncherActivity ctx) throws IOException {
|
||||
String target;
|
||||
|
||||
ctx.appendlnToLog("Reading install_profile.json");
|
||||
ForgeInstallProfile profile = readInstallProfile(this);
|
||||
|
||||
// Write the json file
|
||||
File versionFile = new File(Tools.versnDir, profile.version);
|
||||
versionFile.mkdir();
|
||||
target = versionFile.getAbsolutePath() + "/" + profile.version + ".json";
|
||||
ctx.appendlnToLog("Writing " + target + " from " + profile.json);
|
||||
ZipEntry versionJson = mJarFile.getEntry(profile.json==null ? "version.json" : profile.json.substring(profile.json.indexOf("/")+1,profile.json.length()));
|
||||
Tools.write(
|
||||
target,
|
||||
Tools.convertStream(mJarFile.getInputStream(versionJson))
|
||||
);
|
||||
|
||||
// Forge 1.12.2+ installer does not include universal, so download
|
||||
// Users are already go throught Forge ads to download installer, so not again.
|
||||
String[] libInfos = profile.path.split(":");
|
||||
File libraryFile = new File(Tools.libraries, Tools.artifactToPath(libInfos[0], libInfos[1], libInfos[2]));
|
||||
libraryFile.getParentFile().mkdirs();
|
||||
target = libraryFile.getAbsolutePath();
|
||||
String downloadPath = "https://files.minecraftforge.net/maven/" + profile.path.replace(":", "/").replace("net.minecraftforge","net/minecraftforge") + "/forge-" + libInfos[2] + "-universal.jar";
|
||||
ctx.appendlnToLog("Downloading " + target);
|
||||
Tools.downloadFile(downloadPath, target);
|
||||
|
||||
mJarFile.close();
|
||||
}
|
||||
|
||||
public static ForgeInstallProfile readInstallProfile(BaseInstaller base) throws IOException, JsonSyntaxException {
|
||||
ZipEntry entry = base.mJarFile.getEntry("install_profile.json");
|
||||
return entry == null ? null : Tools.GLOBAL_GSON.fromJson(
|
||||
Tools.convertStream(
|
||||
base.mJarFile.getInputStream(entry)
|
||||
),
|
||||
ForgeInstallProfile.class
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -19,7 +19,12 @@ public class LauncherPreferenceFragment extends PreferenceFragmentCompat
|
|||
SeekBarPreference seek2 = (SeekBarPreference) findPreference("timeLongPressTrigger");
|
||||
seek2.setMin(100);
|
||||
seek2.setMax(1000);
|
||||
seek2.setValue(500);
|
||||
seek2.setValue(LauncherPreferences.PREF_LONGPRESS_TRIGGER);
|
||||
|
||||
SeekBarPreference seek3 = (SeekBarPreference) findPreference("buttonscale");
|
||||
seek3.setMin(20);
|
||||
seek3.setMax(500);
|
||||
seek3.setValue((int) LauncherPreferences.PREF_BUTTONSIZE);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ public class LauncherPreferences
|
|||
public static String PREF_LANGUAGE = "default";
|
||||
|
||||
public static void loadPreferences() {
|
||||
PREF_BUTTONSIZE = DEFAULT_PREF.getFloat("controlSize", 1f);
|
||||
PREF_BUTTONSIZE = DEFAULT_PREF.getInt("buttonscale", 100);
|
||||
PREF_FREEFORM = DEFAULT_PREF.getBoolean("freeform", false);
|
||||
PREF_VERTYPE_RELEASE = DEFAULT_PREF.getBoolean("vertype_release", true);
|
||||
PREF_VERTYPE_SNAPSHOT = DEFAULT_PREF.getBoolean("vertype_snapshot", false);
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ public class MinecraftDownloaderTask extends AsyncTask<String, String, Throwable
|
|||
jvmArgs.add("-Xms128M");
|
||||
jvmArgs.add("-Xmx1G");
|
||||
*/
|
||||
Intent mainIntent = new Intent(mActivity, CustomCtrlMainActivity.class /* MainActivity.class */);
|
||||
Intent mainIntent = new Intent(mActivity, MainActivity.class /* MainActivity.class */);
|
||||
// mainIntent.addFlags(Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT);
|
||||
mainIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
|
||||
mainIntent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
||||
|
|
|
|||
|
|
@ -194,10 +194,6 @@ public class JREUtils
|
|||
|
||||
// Fix white color on banner and sheep
|
||||
envMap.put("LIBGL_NORMALIZE", "1");
|
||||
|
||||
// those 2 down below make it more laggy also kinda usless as they dont fix the sheep collor \\
|
||||
// envMap.put("LIBGL_BATCH", "10");
|
||||
// envMap.put("LIBGL_USEVBO", "0");
|
||||
|
||||
envMap.put("MESA_GLSL_CACHE_DIR", ctx.getCacheDir().getAbsolutePath());
|
||||
envMap.put("LD_LIBRARY_PATH", LD_LIBRARY_PATH);
|
||||
|
|
|
|||
|
|
@ -19,11 +19,13 @@ public class LocaleUtils {
|
|||
LauncherPreferences.loadPreferences();
|
||||
}
|
||||
|
||||
Locale locale;
|
||||
if (LauncherPreferences.PREF_LANGUAGE.equals("default")) {
|
||||
return context;
|
||||
locale = DEFAULT_LOCALE;
|
||||
} else {
|
||||
locale = new Locale(LauncherPreferences.PREF_LANGUAGE);
|
||||
}
|
||||
|
||||
Locale locale = new Locale(LauncherPreferences.PREF_LANGUAGE);
|
||||
Locale.setDefault(locale);
|
||||
|
||||
Resources res = context.getResources();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
package net.kdt.pojavlaunch.value;
|
||||
|
||||
import net.kdt.pojavlaunch.*;
|
||||
|
||||
public class ForgeInstallProfile {
|
||||
// ----- < 1.12.2 Forge Install Profile -----
|
||||
public ForgeInstallProperties install;
|
||||
public JMinecraftVersionList.Version versionInfo;
|
||||
|
||||
public static class ForgeInstallProperties {
|
||||
public String profileName;
|
||||
public String target;
|
||||
public String path;
|
||||
public String version;
|
||||
public String filePath; // universal file .jar
|
||||
public String minecraft; // target Minecraft version
|
||||
}
|
||||
|
||||
// ----- 1.12.2+ Forge Install Profile -----
|
||||
public String version;
|
||||
public String json;
|
||||
public String path;
|
||||
public String minecraft; // target Minecraft version
|
||||
}
|
||||
|
|
@ -11,7 +11,6 @@ public class CallbackBridge {
|
|||
public static final int CLIPBOARD_COPY = 2000;
|
||||
public static final int CLIPBOARD_PASTE = 2001;
|
||||
|
||||
public static boolean isMinecraft1p12;
|
||||
public static volatile int windowWidth, windowHeight;
|
||||
public static int mouseX, mouseY;
|
||||
public static boolean mouseLeft;
|
||||
|
|
@ -32,7 +31,7 @@ public class CallbackBridge {
|
|||
private static boolean threadAttached;
|
||||
public static void sendCursorPos(int x, int y) {
|
||||
if (!threadAttached) {
|
||||
threadAttached = CallbackBridge.nativeAttachThreadToOther(true, isMinecraft1p12, BaseMainActivity.isInputStackCall);
|
||||
threadAttached = CallbackBridge.nativeAttachThreadToOther(true, BaseMainActivity.isInputStackCall);
|
||||
}
|
||||
|
||||
DEBUG_STRING.append("CursorPos=" + x + ", " + y + "\n");
|
||||
|
|
@ -46,12 +45,16 @@ public class CallbackBridge {
|
|||
sendMouseKeycode(-1, 0, false);
|
||||
}
|
||||
|
||||
public static void sendKeycode(int keycode, char keychar, int modifiers, boolean isDown) {
|
||||
public static void sendKeycode(int keycode, char keychar, int scancode, int modifiers, boolean isDown) {
|
||||
DEBUG_STRING.append("KeyCode=" + keycode + ", Char=" + keychar);
|
||||
// TODO CHECK: This may cause input issue, not receive input!
|
||||
if (!nativeSendCharMods((int) keychar, modifiers) || !nativeSendChar((int) keychar)) {
|
||||
nativeSendKey(keycode, 0 /* scancode */, isDown ? 1 : 0, modifiers);
|
||||
/*
|
||||
if (!nativeSendCharMods((int) keychar, modifiers) || !nativeSendChar(keychar)) {
|
||||
nativeSendKey(keycode, 0, isDown ? 1 : 0, modifiers);
|
||||
}
|
||||
*/
|
||||
|
||||
nativeSendKeycode(keycode, keychar, scancode, isDown ? 1 : 0, modifiers);
|
||||
|
||||
// sendData(JRE_TYPE_KEYCODE_CONTROL, keycode, Character.toString(keychar), Boolean.toString(isDown), modifiers);
|
||||
}
|
||||
|
|
@ -124,13 +127,15 @@ public class CallbackBridge {
|
|||
private static native void nativeSendData(boolean isAndroid, int type, String data);
|
||||
*/
|
||||
|
||||
public static native boolean nativeAttachThreadToOther(boolean isAndroid, boolean isMinecraft1p12, boolean isUsePushPoll);
|
||||
private static native boolean nativeSendChar(int codepoint);
|
||||
public static native boolean nativeAttachThreadToOther(boolean isAndroid, boolean isUsePushPoll);
|
||||
/*
|
||||
private static native boolean nativeSendChar(char codepoint);
|
||||
// GLFW: GLFWCharModsCallback deprecated, but is Minecraft still use?
|
||||
private static native boolean nativeSendCharMods(int codepoint, int mods);
|
||||
private static native boolean nativeSendCharMods(char codepoint, int mods);
|
||||
*/
|
||||
// private static native void nativeSendCursorEnter(int entered);
|
||||
private static native void nativeSendCursorPos(int x, int y);
|
||||
private static native void nativeSendKey(int key, int scancode, int action, int mods);
|
||||
private static native void nativeSendKeycode(int keycode, char keychar, int scancode, int action, int mods);
|
||||
private static native void nativeSendMouseButton(int button, int action, int mods);
|
||||
private static native void nativeSendScroll(double xoffset, double yoffset);
|
||||
private static native void nativeSendScreenSize(int width, int height);
|
||||
|
|
|
|||
133
app/src/main/java/org/lwjgl/glfw/CallbackBridge.java.z
Normal file
133
app/src/main/java/org/lwjgl/glfw/CallbackBridge.java.z
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
package org.lwjgl.glfw;
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
import android.widget.*;
|
||||
import net.kdt.pojavlaunch.*;
|
||||
import android.content.*;
|
||||
|
||||
public abstract class CallbackBridge {
|
||||
public static final int ANDROID_TYPE_GRAB_STATE = 0;
|
||||
|
||||
public static final int CLIPBOARD_COPY = 2000;
|
||||
public static final int CLIPBOARD_PASTE = 2001;
|
||||
|
||||
public static volatile int windowWidth, windowHeight;
|
||||
public static int mouseX, mouseY;
|
||||
public static boolean mouseLeft;
|
||||
public static StringBuilder DEBUG_STRING = new StringBuilder();
|
||||
|
||||
public static final CallbackBridge INSTANCE = new CallbackBridgeV3();
|
||||
|
||||
// volatile private static boolean isGrabbing = false;
|
||||
|
||||
public void putMouseEventWithCoords(int button, int x, int y /* , int dz, long nanos */) {
|
||||
putMouseEventWithCoords(button, 1, x, y);
|
||||
putMouseEventWithCoords(button, 0, x, y);
|
||||
}
|
||||
|
||||
public void putMouseEventWithCoords(int button, int state, int x, int y /* , int dz, long nanos */) {
|
||||
sendCursorPos(x, y);
|
||||
sendMouseKeycode(button, 0, state == 1);
|
||||
}
|
||||
|
||||
private static boolean threadAttached;
|
||||
public void sendCursorPos(int x, int y) {
|
||||
if (!threadAttached) {
|
||||
threadAttached = CallbackBridge.nativeAttachThreadToOther(true, BaseMainActivity.isInputStackCall);
|
||||
}
|
||||
|
||||
DEBUG_STRING.append("CursorPos=" + x + ", " + y + "\n");
|
||||
mouseX = x;
|
||||
mouseY = y;
|
||||
nativeSendCursorPos(x, y);
|
||||
}
|
||||
|
||||
public void sendPrepareGrabInitialPos() {
|
||||
DEBUG_STRING.append("Prepare set grab initial posititon");
|
||||
sendMouseKeycode(-1, 0, false);
|
||||
}
|
||||
|
||||
public void sendKeycode(int keycode, char keychar, int modifiers, boolean isDown) {
|
||||
DEBUG_STRING.append("KeyCode=" + keycode + ", Char=" + keychar);
|
||||
// TODO CHECK: This may cause input issue, not receive input!
|
||||
/*
|
||||
if (!nativeSendCharMods(keychar, modifiers) || !nativeSendChar(keychar)) {
|
||||
nativeSendKey(keycode, 0, isDown ? 1 : 0, modifiers);
|
||||
}
|
||||
*/
|
||||
|
||||
nativeSendKeycode(keycode, keychar, modifiers, isDown);
|
||||
|
||||
// sendData(JRE_TYPE_KEYCODE_CONTROL, keycode, Character.toString(keychar), Boolean.toString(isDown), modifiers);
|
||||
}
|
||||
|
||||
public void sendMouseKeycode(int button, int modifiers, boolean isDown) {
|
||||
DEBUG_STRING.append("MouseKey=" + button + ", down=" + isDown + "\n");
|
||||
// if (isGrabbing()) DEBUG_STRING.append("MouseGrabStrace: " + android.util.Log.getStackTraceString(new Throwable()) + "\n");
|
||||
nativeSendMouseButton(button, isDown ? 1 : 0, modifiers);
|
||||
}
|
||||
|
||||
public void sendMouseKeycode(int keycode) {
|
||||
sendMouseKeycode(keycode, 0, true);
|
||||
sendMouseKeycode(keycode, 0, false);
|
||||
}
|
||||
|
||||
public void sendScroll(double xoffset, double yoffset) {
|
||||
DEBUG_STRING.append("ScrollX=" + xoffset + ",ScrollY=" + yoffset);
|
||||
nativeSendScroll(xoffset, yoffset);
|
||||
}
|
||||
|
||||
public void sendUpdateWindowSize(int w, int h) {
|
||||
nativeSendScreenSize(w, h);
|
||||
}
|
||||
|
||||
public static boolean isGrabbing() {
|
||||
// return isGrabbing;
|
||||
return nativeIsGrabbing();
|
||||
}
|
||||
|
||||
// Called from JRE side
|
||||
public static String accessAndroidClipboard(int type, String copy) {
|
||||
switch (type) {
|
||||
case CLIPBOARD_COPY:
|
||||
BaseMainActivity.GLOBAL_CLIPBOARD.setPrimaryClip(ClipData.newPlainText("Copy", copy));
|
||||
return null;
|
||||
|
||||
case CLIPBOARD_PASTE:
|
||||
if (BaseMainActivity.GLOBAL_CLIPBOARD.hasPrimaryClip() && BaseMainActivity.GLOBAL_CLIPBOARD.getPrimaryClipDescription().hasMimeType(ClipDescription.MIMETYPE_TEXT_PLAIN)) {
|
||||
return BaseMainActivity.GLOBAL_CLIPBOARD.getPrimaryClip().getItemAt(0).getText().toString();
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
public void receiveCallback(int type, String data) {
|
||||
switch (type) {
|
||||
case ANDROID_TYPE_GRAB_STATE:
|
||||
// isGrabbing = Boolean.parseBoolean(data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public static native boolean nativeAttachThreadToOther(boolean isAndroid, boolean isUsePushPoll);
|
||||
public static native boolean nativeIsGrabbing();
|
||||
|
||||
protected abstract boolean nativeSendChar(char codepoint /* int codepoint */);
|
||||
// GLFW: GLFWCharModsCallback deprecated, but is Minecraft still use?
|
||||
protected abstract boolean nativeSendCharMods(char codepoint, int mods);
|
||||
// protected abstract void nativeSendCursorEnter(int entered);
|
||||
protected abstract void nativeSendCursorPos(int x, int y);
|
||||
protected abstract void nativeSendKey(int key, int scancode, int action, int mods);
|
||||
protected abstract void nativeSendMouseButton(int button, int action, int mods);
|
||||
protected abstract void nativeSendScroll(double xoffset, double yoffset);
|
||||
protected abstract void nativeSendScreenSize(int width, int height);
|
||||
|
||||
|
||||
|
||||
static {
|
||||
System.loadLibrary("pojavexec");
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue