forked from qiusunshine/hikerView
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
613817d
commit e78ceb3
Showing
70 changed files
with
10,849 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,13 +8,15 @@ | |
|
||
3、Adblock Plus广告拦截订阅 | ||
|
||
4、播放器 | ||
4、视频播放器 | ||
|
||
5、Dlan投屏 | ||
|
||
6、网页投屏 | ||
|
||
7、多线程文件下载 | ||
7、多线程文件下载(支持m3u8合并为mp4) | ||
|
||
8、高亮代码编辑器 | ||
|
||
... | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
apply plugin: 'com.android.library' | ||
|
||
android { | ||
compileSdkVersion 28 | ||
|
||
|
||
|
||
defaultConfig { | ||
minSdkVersion 15 | ||
targetSdkVersion 28 | ||
versionCode 1 | ||
versionName "1.0" | ||
|
||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | ||
|
||
} | ||
dataBinding { | ||
enabled = true | ||
} | ||
|
||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
// javaCompileOptions { | ||
// annotationProcessorOptions { | ||
// includeCompileClasspath = true | ||
// } | ||
// } | ||
|
||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_8 | ||
targetCompatibility JavaVersion.VERSION_1_8 | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation project(":code-editor") | ||
implementation 'androidx.appcompat:appcompat:1.3.0-alpha01' | ||
implementation "androidx.legacy:legacy-preference-v14:1.0.0" | ||
implementation('androidx.core:core:1.3.0') | ||
api 'androidx.legacy:legacy-support-v4:1.0.0' | ||
implementation 'androidx.legacy:legacy-support-core-ui:1.0.0' | ||
implementation 'androidx.recyclerview:recyclerview:1.1.0' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.hiker.editor" /> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
//AlertDialog.Builder Template | ||
|
||
var AlertDialog = android.app.AlertDialog; | ||
var ScrollView = android.widget.ScrollView; | ||
var LinearLayout = android.widget.LinearLayout; | ||
var TextView = android.widget.TextView; | ||
var Color = android.graphics.Color; | ||
var EditText = android.widget.EditText; | ||
var ViewGroup = android.view.ViewGroup; | ||
var DialogInterface = android.content.DialogInterface; | ||
|
||
var alert = new AlertDialog.Builder(ctx); | ||
alert.setTitle("Hello Sun"); | ||
|
||
var scroll = new ScrollView(ctx); | ||
var layout = new LinearLayout(ctx); | ||
layout.setOrientation(1); | ||
|
||
var note = new TextView(ctx); | ||
note.setText("It is now daytime :D"); | ||
note.setTextColor(Color.WHITE); | ||
note.setTextSize(20); | ||
|
||
var sethealth = new EditText(ctx); | ||
sethealth.setHint("Set Health"); | ||
|
||
var params = new ViewGroup.LayoutParams(-2, -2); | ||
|
||
layout.addView(note, params); | ||
layout.addView(sethealth, params); | ||
|
||
alert.setView(layout); | ||
|
||
alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() { | ||
onClick: function(view) { | ||
Player.setHealth(sethealth.getText().toString()); | ||
} | ||
}); | ||
|
||
alert.setNegativeButton("Ok (Don't set health)", new DialogInterface.OnClickListener() { | ||
onClick: function(view) { | ||
//nothing | ||
} | ||
}); | ||
|
||
alert.setNeutralButton("Set time to night", new DialogInterface.OnClickListener() { | ||
onClick: function(view) { | ||
Level.setTime(13500); | ||
} | ||
}); | ||
|
||
var dialog = alert.create(); | ||
dialog.show(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
//Custom UI Setup: | ||
|
||
var GUI; | ||
var ctx = com.mojang.minecraftpe.MainActivity.currentMainActivity.get(); | ||
|
||
var Runnable = java.lang.Runnable; | ||
var LinearLayout = android.widget.LinearLayout; | ||
var Button = android.widget.Button; | ||
var View = android.view.View; | ||
var PopupWindow = android.widget.PopupWindow; | ||
var RelativeLayout = android.widget.RelativeLayout; | ||
var ColorDrawable = android.graphics.drawable.ColorDrawable; | ||
var Color = android.graphics.Color; | ||
var Gravity = android.view.Gravity; | ||
|
||
function newLevel() { | ||
ctx.runOnUiThread(new Runnable({ run: function(){ | ||
try { | ||
var layout = new LinearLayout(ctx); | ||
layout.setOrientation(1); | ||
|
||
var button = new Button(ctx); | ||
button.setText("Button"); | ||
button.setOnClickListener(new View.OnClickListener({ | ||
onClick: function(view) { | ||
//Your Code; | ||
} | ||
})); | ||
layout.addView(button); | ||
|
||
GUI = new PopupWindow(layout, RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT); | ||
GUI.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); | ||
GUI.showAtLocation(ctx.getWindow().getDecorView(), Gravity.RIGHT | Gravity.TOP, 0, 0); | ||
} catch (err) { | ||
print("An error occured: " + err); | ||
} | ||
}})); | ||
} | ||
|
||
function leaveGame() { | ||
ctx.runOnUiThread(new Runnable({ run: function(){ | ||
if(GUI != null) { | ||
GUI.dismiss(); | ||
GUI = null; | ||
} | ||
}})); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
//Standard Custom UI Template: | ||
|
||
var Button = android.widget.Button; | ||
var View = android.view.View; | ||
|
||
var button = new Button(ctx); | ||
button.setText("Button"); | ||
button.setOnClickListener(new View.OnClickListener({ | ||
onClick: function(view){ | ||
//Your Code | ||
} | ||
})); | ||
layout.addView(button); |
22 changes: 22 additions & 0 deletions
22
editor/src/main/assets/templates/ButtonWithTouchListener.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
//Custom UI with OnTouchListener Template: | ||
|
||
var Button = android.widget.Button; | ||
var View = android.view.View; | ||
|
||
var active = false; | ||
var button = new Button(ctx); | ||
button.setText("Button"); | ||
button.setOnTouchListener(new View.OnTouchListener({ | ||
onClick: function(v, event){ | ||
switch(event.getAction()) { | ||
case 0: | ||
active = true; | ||
break; | ||
case 1: | ||
active = false; | ||
break; | ||
} | ||
return true; | ||
} | ||
})); | ||
layout.addView(button); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//CheckBox Template: | ||
|
||
var CheckBox = android.widget.CheckBox; | ||
var View = android.view.View; | ||
|
||
var checked = false; | ||
var button = new CheckBox(ctx); | ||
button.setText("Button"); | ||
button.setChecked(checked); | ||
button.setOnClickListener(new View.OnClickListener({ | ||
onClick: function(view){ | ||
if(!checked) { | ||
checked = true; | ||
} else { | ||
checked = false; | ||
} | ||
} | ||
})); | ||
layout.addView(button); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//ImageView Template: | ||
|
||
var BitmapFactory = android.graphics.BitmapFactory; | ||
var BitmapDrawable = android.graphics.drawable.BitmapDrawable; | ||
var ImageView = android.widget.ImageView; | ||
|
||
var directory = new BitmapFactory.decodeFile("Your Directory"); | ||
var img = new BitmapDrawable(directory); | ||
var image = new ImageView(ctx); | ||
image.setImageBitmap(img); | ||
|
||
//If you want this image to do something, put your OnClickListener here | ||
//If you don't want this image to do anything, do this: | ||
yourPopupWindowVariable.setTouchable(false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
//Custom UI + Menu Setup: | ||
|
||
var GUI; | ||
var menu; | ||
var exitUI; | ||
|
||
var ctx = com.mojang.minecraftpe.MainActivity.currentMainActivity.get(); | ||
var Runnable = java.lang.Runnable; | ||
var LinearLayout = android.widget.LinearLayout; | ||
var Button = android.widget.Button; | ||
var View = android.view.View; | ||
var PopupWindow = android.widget.PopupWindow; | ||
var RelativeLayout = android.widget.RelativeLayout; | ||
var ColorDrawable = android.graphics.drawable.ColorDrawable; | ||
var Color = android.graphics.Color; | ||
var Gravity = android.view.Gravity; | ||
var ScrollView = android.widget.ScrollView; | ||
|
||
function dip2px(dips) { | ||
return Math.ceil(dips * ctx.getResources().getDisplayMetrics().density); | ||
} | ||
|
||
function newLevel() { | ||
ctx.runOnUiThread(new Runnable({ run: function(){ | ||
try { | ||
var layout = new LinearLayout(ctx); | ||
layout.setOrientation(1); | ||
|
||
var menuBtn = new Button(ctx); | ||
menuBtn.setText("Menu"); | ||
menuBtn.setOnClickListener(new View.OnClickListener({ | ||
onClick: function(view){ | ||
mainMenu(); | ||
} | ||
})); | ||
layout.addView(menuBtn); | ||
|
||
GUI = new PopupWindow(layout, RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT); | ||
GUI.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); | ||
GUI.showAtLocation(ctx.getWindow().getDecorView(), Gravity.RIGHT | Gravity.BOTTOM, 0, 0); | ||
} catch (err) { | ||
print("An error occured: " + err); | ||
} | ||
}})); | ||
} | ||
|
||
function mainMenu() { | ||
ctx.runOnUiThread(new Runnable({ run: function(){ | ||
try { | ||
var menuLayout = new LinearLayout(ctx); | ||
var menuScroll = new ScrollView(ctx); | ||
var menuLayout1 = new LinearLayout(ctx); | ||
menuLayout.setOrientation(1); | ||
menuLayout1.setOrientation(1); | ||
|
||
menuScroll.addView(menuLayout); | ||
menuLayout1.addView(menuScroll); | ||
|
||
var button = new Button(ctx); | ||
button.setText("Button"); | ||
button.setOnClickListener(new View.OnClickListener({ | ||
onClick: function(view){ | ||
//Your Code | ||
} | ||
})); | ||
menuLayout.addView(button); | ||
|
||
//Add more buttons in this section | ||
|
||
menu = new PopupWindow(menuLayout1, ctx.getWindowManager().getDefaultDisplay().getWidth()/2, ctx.getWindowManager().getDefaultDisplay().getHeight()); | ||
menu.setBackgroundDrawable(new ColorDrawable(Color.BLACK)); | ||
menu.showAtLocation(ctx.getWindow().getDecorView(), Gravity.RIGHT | Gravity.TOP, 0, 0); | ||
} catch (error) { | ||
print("An error occured: " + error); | ||
} | ||
}})); | ||
} | ||
|
||
function exit() { | ||
ctx.runOnUiThread(new Runnable({ run: function(){ | ||
try { | ||
var xLayout = new LinearLayout(ctx); | ||
|
||
var xButton = new Button(ctx); | ||
xButton.setText("x"); | ||
xButton.setTextColor(Color.WHITE); | ||
xButton.setOnClickListener(new View.OnClickListener({ | ||
onClick: function(view){ | ||
exitUI.dismiss(); | ||
menu.dismiss(); | ||
} | ||
})); | ||
xLayout.addView(xButton); | ||
|
||
exitUI = new PopupWindow(xLayout, dip2px(40), dip2px(40)); | ||
exitUI.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); | ||
exitUI.showAtLocation(ctx.getWindow().getDecorView(), Gravity.RIGHT | Gravity.TOP, 0, 0); | ||
} catch (exception) { | ||
print(exception); | ||
} | ||
}})); | ||
} | ||
|
||
function leaveGame() { | ||
ctx.runOnUiThread(new Runnable({ run: function(){ | ||
if(GUI != null) { | ||
GUI.dismiss(); | ||
GUI = null; | ||
} | ||
if(menu != null) { | ||
menu.dismiss(); | ||
menu = null; | ||
} | ||
if(exitUI != null) { | ||
exitUI.dismiss(); | ||
exitUI = null; | ||
} | ||
}})); | ||
} |
Oops, something went wrong.