-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from little-game-and-simple-software/sketchware…
…_project Sketchware project
- Loading branch information
Showing
190 changed files
with
68,910 additions
and
280 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
app/build/bin/injected/gen/com/my/newproject/BuildConfig.java
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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 was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,209 @@ | ||
package com.my.newproject; | ||
|
||
import android.app.*; | ||
import android.os.*; | ||
import android.view.*; | ||
import android.view.View.*; | ||
import android.widget.*; | ||
import android.content.*; | ||
import android.graphics.*; | ||
import android.media.*; | ||
import android.net.*; | ||
import android.text.*; | ||
import android.util.*; | ||
import android.webkit.*; | ||
import android.animation.*; | ||
import android.view.animation.*; | ||
import java.util.*; | ||
import java.text.*; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.support.v7.widget.Toolbar; | ||
import android.widget.LinearLayout; | ||
import android.widget.TextView; | ||
import android.webkit.WebView; | ||
import android.webkit.WebSettings; | ||
import android.widget.Button; | ||
import android.content.Intent; | ||
import android.net.Uri; | ||
import android.media.MediaPlayer; | ||
import android.view.View; | ||
import android.webkit.WebViewClient; | ||
import android.content.ClipData; | ||
import android.content.ClipboardManager; | ||
|
||
public class AboutActivity extends AppCompatActivity { | ||
|
||
|
||
private Toolbar _toolbar; | ||
|
||
private LinearLayout linear1; | ||
private TextView textview1; | ||
private TextView connect; | ||
private TextView textview2; | ||
private LinearLayout linear2; | ||
private WebView webview1; | ||
private Button button1; | ||
private Button button2; | ||
private Button button3; | ||
|
||
private Intent i = new Intent(); | ||
private MediaPlayer bgm; | ||
@Override | ||
protected void onCreate(Bundle _savedInstanceState) { | ||
super.onCreate(_savedInstanceState); | ||
setContentView(R.layout.about); | ||
initialize(_savedInstanceState); | ||
initializeLogic(); | ||
} | ||
|
||
private void initialize(Bundle _savedInstanceState) { | ||
|
||
_toolbar = (Toolbar) findViewById(R.id._toolbar); | ||
setSupportActionBar(_toolbar); | ||
getSupportActionBar().setDisplayHomeAsUpEnabled(true); | ||
getSupportActionBar().setHomeButtonEnabled(true); | ||
_toolbar.setNavigationOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View _v) { | ||
onBackPressed(); | ||
} | ||
}); | ||
linear1 = (LinearLayout) findViewById(R.id.linear1); | ||
textview1 = (TextView) findViewById(R.id.textview1); | ||
connect = (TextView) findViewById(R.id.connect); | ||
textview2 = (TextView) findViewById(R.id.textview2); | ||
linear2 = (LinearLayout) findViewById(R.id.linear2); | ||
webview1 = (WebView) findViewById(R.id.webview1); | ||
webview1.getSettings().setJavaScriptEnabled(true); | ||
webview1.getSettings().setSupportZoom(true); | ||
button1 = (Button) findViewById(R.id.button1); | ||
button2 = (Button) findViewById(R.id.button2); | ||
button3 = (Button) findViewById(R.id.button3); | ||
|
||
connect.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View _view) { | ||
((ClipboardManager) getSystemService(getApplicationContext().CLIPBOARD_SERVICE)).setPrimaryClip(ClipData.newPlainText("clipboard", textview1.getText().toString())); | ||
SketchwareUtil.showMessage(getApplicationContext(), "已复制信息到粘贴板"); | ||
} | ||
}); | ||
|
||
webview1.setWebViewClient(new WebViewClient() { | ||
@Override | ||
public void onPageStarted(WebView _param1, String _param2, Bitmap _param3) { | ||
final String _url = _param2; | ||
SketchwareUtil.showMessage(getApplicationContext(), "启动😃"); | ||
super.onPageStarted(_param1, _param2, _param3); | ||
} | ||
|
||
@Override | ||
public void onPageFinished(WebView _param1, String _param2) { | ||
final String _url = _param2; | ||
SketchwareUtil.showMessage(getApplicationContext(), "完成😜"); | ||
super.onPageFinished(_param1, _param2); | ||
} | ||
}); | ||
|
||
button1.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View _view) { | ||
webview1.loadUrl("https://space.bilibili.com/26680057?share_medium=android&share_source=copy_link&bbid=AWIANlRjVWBWMFNnGykbKRstTywdf00sSTUBinfoc&ts=1593620681111"); | ||
} | ||
}); | ||
|
||
button2.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View _view) { | ||
webview1.loadUrl("https://github.com/2439905184"); | ||
} | ||
}); | ||
|
||
button3.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View _view) { | ||
webview1.loadUrl("https://github.com/orgs/little-game-and-simple-software/dashboard"); | ||
} | ||
}); | ||
} | ||
private void initializeLogic() { | ||
webview1.loadUrl("https://github.com/2439905184"); | ||
} | ||
|
||
@Override | ||
protected void onActivityResult(int _requestCode, int _resultCode, Intent _data) { | ||
super.onActivityResult(_requestCode, _resultCode, _data); | ||
|
||
switch (_requestCode) { | ||
|
||
default: | ||
break; | ||
} | ||
} | ||
|
||
@Override | ||
public void onStart() { | ||
super.onStart(); | ||
bgm = MediaPlayer.create(getApplicationContext(), R.raw.bgm_true); | ||
bgm.setLooping(true); | ||
bgm.start(); | ||
} | ||
|
||
@Override | ||
public void onBackPressed() { | ||
bgm.setLooping(false); | ||
bgm.reset(); | ||
bgm.pause(); | ||
bgm.release(); | ||
} | ||
@Deprecated | ||
public void showMessage(String _s) { | ||
Toast.makeText(getApplicationContext(), _s, Toast.LENGTH_SHORT).show(); | ||
} | ||
|
||
@Deprecated | ||
public int getLocationX(View _v) { | ||
int _location[] = new int[2]; | ||
_v.getLocationInWindow(_location); | ||
return _location[0]; | ||
} | ||
|
||
@Deprecated | ||
public int getLocationY(View _v) { | ||
int _location[] = new int[2]; | ||
_v.getLocationInWindow(_location); | ||
return _location[1]; | ||
} | ||
|
||
@Deprecated | ||
public int getRandom(int _min, int _max) { | ||
Random random = new Random(); | ||
return random.nextInt(_max - _min + 1) + _min; | ||
} | ||
|
||
@Deprecated | ||
public ArrayList<Double> getCheckedItemPositionsToArray(ListView _list) { | ||
ArrayList<Double> _result = new ArrayList<Double>(); | ||
SparseBooleanArray _arr = _list.getCheckedItemPositions(); | ||
for (int _iIdx = 0; _iIdx < _arr.size(); _iIdx++) { | ||
if (_arr.valueAt(_iIdx)) | ||
_result.add((double)_arr.keyAt(_iIdx)); | ||
} | ||
return _result; | ||
} | ||
|
||
@Deprecated | ||
public float getDip(int _input){ | ||
return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, _input, getResources().getDisplayMetrics()); | ||
} | ||
|
||
@Deprecated | ||
public int getDisplayWidthPixels(){ | ||
return getResources().getDisplayMetrics().widthPixels; | ||
} | ||
|
||
@Deprecated | ||
public int getDisplayHeightPixels(){ | ||
return getResources().getDisplayMetrics().heightPixels; | ||
} | ||
|
||
} |
Oops, something went wrong.