Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Tungstend committed Jun 18, 2022
1 parent 8fcabab commit 309cd04
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 88 deletions.
2 changes: 1 addition & 1 deletion HMCLPE/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {
applicationId "com.tungsten.hmclpe"
minSdk 26
targetSdk 32
versionCode 8
versionCode 9
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
2 changes: 1 addition & 1 deletion HMCLPE/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 8,
"versionCode": 9,
"versionName": "1.0",
"outputFile": "HMCLPE-release.apk"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

import static android.content.Context.CLIPBOARD_SERVICE;

import android.app.AlertDialog;
import android.app.Dialog;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.util.Log;
import android.net.Uri;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
Expand All @@ -31,6 +33,7 @@ public class VerifyDialog extends Dialog implements View.OnClickListener {

private TextView textView;
private EditText editText;
private Button obtainPermission;
private Button cancel;
private Button copy;
private Button verify;
Expand All @@ -50,18 +53,32 @@ private void init() {

textView = findViewById(R.id.oaid_text);
editText = findViewById(R.id.edit_verify_code);
obtainPermission = findViewById(R.id.obtain_permission);
cancel = findViewById(R.id.cancel);
copy = findViewById(R.id.copy_oaid);
verify = findViewById(R.id.verify);

textView.setText(getContext().getString(R.string.dialog_verify_msg).replace("%s", code));
obtainPermission.setOnClickListener(this);
cancel.setOnClickListener(this);
copy.setOnClickListener(this);
verify.setOnClickListener(this);
}

@Override
public void onClick(View view) {
if (view == obtainPermission) {
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
builder.setTitle(getContext().getString(R.string.dialog_obtain_permission_title));
builder.setMessage(getContext().getString(R.string.dialog_obtain_permission_msg));
builder.setPositiveButton(getContext().getString(R.string.dialog_obtain_permission_positive), (dialogInterface, i) -> {
Uri uri = Uri.parse("https://afdian.net/@tungs");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
getContext().startActivity(intent);
});
builder.setNegativeButton(getContext().getString(R.string.dialog_obtain_permission_negative), (dialogInterface, i) -> {});
builder.create().show();
}
if (view == cancel) {
verifyInterface.onCancel();
dismiss();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ public class AboutUsUI extends BaseUI implements View.OnClickListener {
private ImageButton tungs;
private ImageButton mio;

private ImageButton cosine;
private ImageButton saltfish;
private ImageButton hmcl;
private ImageButton yushijinhun;
private ImageButton nide;
private ImageButton bangbang93;
private ImageButton mcbbs;
private ImageButton mcmod;
Expand All @@ -42,10 +41,9 @@ public void onCreate() {
tungs = activity.findViewById(R.id.tungs_link);
mio = activity.findViewById(R.id.mio_link);

cosine = activity.findViewById(R.id.cosine_link);
saltfish = activity.findViewById(R.id.saltfish_link);
hmcl = activity.findViewById(R.id.hmcl_link);
yushijinhun = activity.findViewById(R.id.yushijinhun_link);
nide = activity.findViewById(R.id.nide_link);
bangbang93 = activity.findViewById(R.id.bangbang93_link);
mcbbs = activity.findViewById(R.id.mcbbs_link);
mcmod = activity.findViewById(R.id.mcmod_link);
Expand All @@ -54,10 +52,9 @@ public void onCreate() {
tungs.setOnClickListener(this);
mio.setOnClickListener(this);

cosine.setOnClickListener(this);
saltfish.setOnClickListener(this);
hmcl.setOnClickListener(this);
yushijinhun.setOnClickListener(this);
nide.setOnClickListener(this);
bangbang93.setOnClickListener(this);
mcbbs.setOnClickListener(this);
mcmod.setOnClickListener(this);
Expand Down Expand Up @@ -97,18 +94,15 @@ public void onClick(View view) {
uri = Uri.parse("https://space.bilibili.com/35801833");
}

if (view == cosine) {
uri = Uri.parse("https://github.com/CosineMath");
}
if (view == saltfish) {
uri = Uri.parse("https://github.com/TSaltedfishKing");
}
if (view == hmcl) {
uri = Uri.parse("https://hmcl.huangyuhui.net/");
}
if (view == yushijinhun) {
uri = Uri.parse("https://yushi.moe/");
}
if (view == nide) {
uri = Uri.parse("http://login.nide8.com/");
}
if (view == bangbang93) {
uri = Uri.parse("https://bmclapidoc.bangbang93.com/");
}
Expand Down
Binary file added HMCLPE/src/main/res/drawable/ic_cosine.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed HMCLPE/src/main/res/drawable/ic_nide.jpg
Binary file not shown.
Binary file removed HMCLPE/src/main/res/drawable/ic_yushijinhun.jpg
Binary file not shown.
10 changes: 10 additions & 0 deletions HMCLPE/src/main/res/layout/dialog_verify.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@
android:layout_height="wrap_content"
android:orientation="horizontal">

<Button
android:layout_width="80dp"
android:layout_height="40dp"
android:gravity="center"
android:text="@string/dialog_verify_donate"
android:textSize="15sp"
android:textColor="@color/colorLinkBlue"
android:background="@drawable/launcher_button_parent"
android:id="@+id/obtain_permission"/>

<View
android:layout_width="0dp"
android:layout_height="0dp"
Expand Down
79 changes: 12 additions & 67 deletions HMCLPE/src/main/res/layout/ui_setting_about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:background="@drawable/ic_saltfish"
android:background="@drawable/ic_cosine"
android:layout_gravity="center"/>

<LinearLayout
Expand All @@ -235,15 +235,15 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:text="@string/ui_about_tsaltedfishking_main"
android:text="@string/ui_about_cosine_main"
android:textSize="14sp"
android:textColor="@color/colorPureBlack" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:text="@string/ui_about_tsaltedfishking_sub"
android:text="@string/ui_about_cosine_sub"
android:textSize="12sp" />

</LinearLayout>
Expand All @@ -254,7 +254,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/ic_baseline_jump_black"
android:id="@+id/saltfish_link"/>
android:id="@+id/cosine_link"/>

</LinearLayout>

Expand All @@ -275,62 +275,7 @@
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:background="@drawable/ic_craft_table"
android:layout_gravity="center"/>

<LinearLayout
android:layout_gravity="center"
android:layout_marginStart="15dp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:text="@string/ui_about_hmcl_main"
android:textSize="14sp"
android:textColor="@color/colorPureBlack" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:text="@string/ui_about_hmcl_sub"
android:textSize="12sp" />

</LinearLayout>

<ImageButton
android:layout_gravity="center"
android:layout_marginStart="15dp"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/ic_baseline_jump_black"
android:id="@+id/hmcl_link"/>

</LinearLayout>

<View
android:layout_width="match_parent"
android:layout_height="1px"
android:background="@color/colorDarkGray"/>

<LinearLayout
android:paddingTop="12dp"
android:paddingBottom="12dp"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">

<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:background="@drawable/ic_yushijinhun"
android:background="@drawable/ic_saltfish"
android:layout_gravity="center"/>

<LinearLayout
Expand All @@ -345,15 +290,15 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:text="@string/ui_about_yushijinhun_main"
android:text="@string/ui_about_tsaltedfishking_main"
android:textSize="14sp"
android:textColor="@color/colorPureBlack" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:text="@string/ui_about_yushijinhun_sub"
android:text="@string/ui_about_tsaltedfishking_sub"
android:textSize="12sp" />

</LinearLayout>
Expand All @@ -364,7 +309,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/ic_baseline_jump_black"
android:id="@+id/yushijinhun_link"/>
android:id="@+id/saltfish_link"/>

</LinearLayout>

Expand All @@ -385,7 +330,7 @@
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:background="@drawable/ic_nide"
android:background="@drawable/ic_craft_table"
android:layout_gravity="center"/>

<LinearLayout
Expand All @@ -400,15 +345,15 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:text="@string/ui_about_nide_main"
android:text="@string/ui_about_hmcl_main"
android:textSize="14sp"
android:textColor="@color/colorPureBlack" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:text="@string/ui_about_nide_sub"
android:text="@string/ui_about_hmcl_sub"
android:textSize="12sp" />

</LinearLayout>
Expand All @@ -419,7 +364,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/ic_baseline_jump_black"
android:id="@+id/nide_link"/>
android:id="@+id/hmcl_link"/>

</LinearLayout>

Expand Down
16 changes: 10 additions & 6 deletions HMCLPE/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,21 @@
<string name="dialog_unknown_error_positive">确定</string>

<string name="dialog_verify_title">开发版测试权限验证</string>
<string name="dialog_verify_msg">您的设备码为:\n%s\n请复制此设备码私聊开发者获取验证码。</string>
<string name="dialog_verify_code">验证码</string>
<string name="dialog_verify_msg">您的设备码为:\n%s\n请填写与此设备码匹配的授权验证码。</string>
<string name="dialog_verify_code">授权验证码</string>
<string name="dialog_verify_donate">获取权限</string>
<string name="dialog_verify_copy">复制设备码</string>
<string name="dialog_verify_copy_success">复制成功</string>
<string name="dialog_verify_verify">验证</string>
<string name="dialog_verify_verify_success">验证成功</string>
<string name="dialog_verify_verify_fail">验证失败</string>
<string name="dialog_verify_cancel">取消</string>

<string name="dialog_obtain_permission_title">提示</string>
<string name="dialog_obtain_permission_msg">你需要在爱发电赞助 10 元以获取开发版测试权限,赞助后你将收到内测群群号,请在爱发电私信我你的 QQ 号和设备码。</string>
<string name="dialog_obtain_permission_positive">前往</string>
<string name="dialog_obtain_permission_negative">取消</string>

<string name="import_control_label">导入控制布局方案</string>

<string name="storage_permissions_remind">请授予启动器读写权限,否则可能无法正常运行</string>
Expand Down Expand Up @@ -1006,14 +1012,12 @@
<string name="ui_about_shirosakimio_main" translatable="false">ShirosakiMio</string>
<string name="ui_about_shirosakimio_sub" translatable="false">B 站 ID:@ShirosakiMio</string>
<string name="ui_about_thank">鸣谢</string>
<string name="ui_about_cosine_main" translatable="false">CosineMath</string>
<string name="ui_about_cosine_sub">提供大量技术支持</string>
<string name="ui_about_tsaltedfishking_main" translatable="false">TSaltedfishKing</string>
<string name="ui_about_tsaltedfishking_sub">提供 HMCL-PE 官网模板</string>
<string name="ui_about_hmcl_main">HMCL 开发团队及所有贡献者</string>
<string name="ui_about_hmcl_sub">本项目大量借鉴 HMCL</string>
<string name="ui_about_yushijinhun_main" translatable="false">yushijinhun</string>
<string name="ui_about_yushijinhun_sub">authlib-injector 相关支持</string>
<string name="ui_about_nide_main">统一通行证开发团队</string>
<string name="ui_about_nide_sub">nide8auth 相关支持</string>
<string name="ui_about_bangbang93_main" translatable="false">bangbang93</string>
<string name="ui_about_bangbang93_sub">提供 BMCLAPI 下载源,请赞助支持 BMCLAPI!</string>
<string name="ui_about_mcbbs_main">MCBBS 我的世界中文论坛</string>
Expand Down

0 comments on commit 309cd04

Please sign in to comment.