Skip to content

Commit 0361454

Browse files
author
tiann
committed
improved translation
1 parent 8d7f217 commit 0361454

File tree

4 files changed

+87
-69
lines changed

4 files changed

+87
-69
lines changed

VirtualApp/app/src/main/java/io/virtualapp/home/NewHomeActivity.java

+3-5
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
import io.virtualapp.abs.ui.VUiKit;
5151
import io.virtualapp.settings.SettingsActivity;
5252
import io.virtualapp.update.VAVersionService;
53+
import io.virtualapp.utils.Misc;
5354

5455
import static io.virtualapp.XApp.XPOSED_INSTALLER_PACKAGE;
5556

@@ -266,7 +267,7 @@ protected int dp2px(float dp) {
266267
}
267268

268269
private void alertForExp() {
269-
final String shown = "_exp_has_alert2";
270+
final String shown = "_exp_has_alert3";
270271
boolean aBoolean = PreferenceManager.getDefaultSharedPreferences(this).getBoolean(shown, false);
271272
if (aBoolean) {
272273
return;
@@ -302,14 +303,11 @@ private void alertForExp() {
302303
t.setData(Uri.parse("https://www.coolapk.com/apk/me.weishu.exp"));
303304
startActivity(t);
304305
}).setNegativeButton(R.string.about_donate_title, (dialog, which) -> {
305-
Intent t = new Intent(Intent.ACTION_VIEW);
306-
t.setData(Uri.parse("https://vxposed.com/donate.html"));
307-
startActivity(t);
306+
Misc.showDonate(NewHomeActivity.this);
308307
})
309308
.create();
310309
try {
311310
alertDialog.show();
312-
313311
} catch (Throwable ignored) {
314312
}
315313
}, 2000);

VirtualApp/app/src/main/java/io/virtualapp/settings/SettingsActivity.java

+2-61
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
import android.app.Activity;
44
import android.app.ProgressDialog;
5-
import android.content.ClipData;
6-
import android.content.ClipboardManager;
75
import android.content.ComponentName;
86
import android.content.Intent;
97
import android.content.pm.PackageManager;
@@ -13,7 +11,6 @@
1311
import android.preference.PreferenceFragment;
1412
import android.preference.PreferenceScreen;
1513
import android.preference.SwitchPreference;
16-
import android.support.v7.app.AlertDialog;
1714
import android.widget.Toast;
1815

1916
import com.android.launcher3.LauncherFiles;
@@ -27,7 +24,7 @@
2724
import io.virtualapp.R;
2825
import io.virtualapp.gms.FakeGms;
2926
import io.virtualapp.home.ListAppActivity;
30-
import moe.feng.alipay.zerosdk.AlipayZeroSdk;
27+
import io.virtualapp.utils.Misc;
3128

3229
/**
3330
* Settings activity for Launcher. Currently implements the following setting: Allow rotation
@@ -150,63 +147,7 @@ public void onCreate(Bundle savedInstanceState) {
150147
});
151148

152149
donate.setOnPreferenceClickListener(preference -> {
153-
AlertDialog alertDialog = new AlertDialog.Builder(getActivity(), R.style.Theme_AppCompat_DayNight_Dialog_Alert)
154-
.setTitle(R.string.donate_dialog_title)
155-
.setMessage(R.string.donate_dialog_content)
156-
.setPositiveButton(R.string.donate_dialog_yes, (dialog, which) -> {
157-
// show chooser dialog
158-
159-
final String alipay = getResources().getString(R.string.donate_alipay);
160-
final String[] items = {alipay, "Paypal", "Bitcoin"};
161-
162-
AlertDialog chooseDialog = new AlertDialog.Builder(getActivity(), R.style.Theme_AppCompat_DayNight_Dialog_Alert)
163-
.setTitle(R.string.donate_choose_title)
164-
.setItems(items, (dialog1, which1) -> {
165-
dialog1.dismiss();
166-
if (which1 == 0) {
167-
if (!AlipayZeroSdk.hasInstalledAlipayClient(getActivity())) {
168-
Toast.makeText(getActivity(), R.string.prompt_alipay_not_found, Toast.LENGTH_SHORT).show();
169-
return;
170-
}
171-
AlipayZeroSdk.startAlipayClient(getActivity(), "FKX016770URBZGZSR37U37");
172-
} else if (which1 == 1) {
173-
try {
174-
Intent t = new Intent(Intent.ACTION_VIEW);
175-
t.setData(Uri.parse("https://paypal.me/virtualxposed"));
176-
startActivity(t);
177-
} catch (Throwable ignored) {
178-
ignored.printStackTrace();
179-
}
180-
} else if (which1 == 2) {
181-
final String address = "39Wst8oL74pRP2vKPkPihH6RFQF4hWoBqU";
182-
183-
try {
184-
ClipboardManager clipboardManager = (ClipboardManager) getActivity().getSystemService(CLIPBOARD_SERVICE);
185-
if (clipboardManager != null) {
186-
clipboardManager.setPrimaryClip(ClipData.newPlainText(null, address));
187-
}
188-
Toast.makeText(getActivity(), getResources().getString(R.string.donate_bitconins_tips), Toast.LENGTH_SHORT).show();
189-
} catch (Throwable ignored) {
190-
ignored.printStackTrace();
191-
}
192-
}
193-
})
194-
.create();
195-
chooseDialog.show();
196-
})
197-
.setNegativeButton(R.string.donate_dialog_no, ((dialog, which) -> {
198-
Intent intent = new Intent();
199-
intent.setAction(Intent.ACTION_VIEW);
200-
intent.addCategory(Intent.CATEGORY_BROWSABLE);
201-
intent.setData(Uri.parse("https://github.com/android-hacker/VirtualXposed"));
202-
startActivity(intent);
203-
}))
204-
.create();
205-
try {
206-
alertDialog.show();
207-
} catch (Throwable ignored) {
208-
// BadTokenException.
209-
}
150+
Misc.showDonate(getActivity());
210151
return false;
211152
});
212153
about.setOnPreferenceClickListener(preference -> {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
package io.virtualapp.utils;
2+
3+
import android.app.Activity;
4+
import android.content.ClipData;
5+
import android.content.ClipboardManager;
6+
import android.content.Context;
7+
import android.content.Intent;
8+
import android.net.Uri;
9+
import android.support.v7.app.AlertDialog;
10+
import android.widget.Toast;
11+
12+
import io.virtualapp.R;
13+
import moe.feng.alipay.zerosdk.AlipayZeroSdk;
14+
15+
/**
16+
* @author weishu
17+
* @date 2018/10/29.
18+
*/
19+
public class Misc {
20+
public static void showDonate(Activity context) {
21+
AlertDialog alertDialog = new AlertDialog.Builder(context, R.style.Theme_AppCompat_DayNight_Dialog_Alert)
22+
.setTitle(R.string.donate_dialog_title)
23+
.setMessage(R.string.donate_dialog_content)
24+
.setPositiveButton(R.string.donate_dialog_yes, (dialog, which) -> {
25+
// show chooser dialog
26+
27+
final String alipay = context.getResources().getString(R.string.donate_alipay);
28+
final String[] items = {alipay, "Paypal", "Bitcoin"};
29+
30+
AlertDialog chooseDialog = new AlertDialog.Builder(context, R.style.Theme_AppCompat_DayNight_Dialog_Alert)
31+
.setTitle(R.string.donate_choose_title)
32+
.setItems(items, (dialog1, which1) -> {
33+
dialog1.dismiss();
34+
if (which1 == 0) {
35+
if (!AlipayZeroSdk.hasInstalledAlipayClient(context)) {
36+
Toast.makeText(context, R.string.prompt_alipay_not_found, Toast.LENGTH_SHORT).show();
37+
return;
38+
}
39+
AlipayZeroSdk.startAlipayClient(context, "FKX016770URBZGZSR37U37");
40+
} else if (which1 == 1) {
41+
try {
42+
Intent t = new Intent(Intent.ACTION_VIEW);
43+
t.setData(Uri.parse("https://paypal.me/virtualxposed"));
44+
context.startActivity(t);
45+
} catch (Throwable ignored) {
46+
ignored.printStackTrace();
47+
}
48+
} else if (which1 == 2) {
49+
final String address = "39Wst8oL74pRP2vKPkPihH6RFQF4hWoBqU";
50+
51+
try {
52+
ClipboardManager clipboardManager = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
53+
if (clipboardManager != null) {
54+
clipboardManager.setPrimaryClip(ClipData.newPlainText(null, address));
55+
}
56+
Toast.makeText(context, context.getResources().getString(R.string.donate_bitconins_tips), Toast.LENGTH_SHORT).show();
57+
} catch (Throwable ignored) {
58+
ignored.printStackTrace();
59+
}
60+
}
61+
})
62+
.create();
63+
chooseDialog.show();
64+
})
65+
.setNegativeButton(R.string.donate_dialog_no, ((dialog, which) -> {
66+
Intent intent = new Intent();
67+
intent.setAction(Intent.ACTION_VIEW);
68+
intent.addCategory(Intent.CATEGORY_BROWSABLE);
69+
intent.setData(Uri.parse("https://github.com/android-hacker/VirtualXposed"));
70+
context.startActivity(intent);
71+
}))
72+
.create();
73+
try {
74+
alertDialog.show();
75+
} catch (Throwable ignored) {
76+
// BadTokenException.
77+
}
78+
}
79+
}

VirtualApp/app/src/main/res/values/strings.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,11 @@
166166
<string name="install_file_manager_tips">File Manager is supported by Amaze File Manager, download(about 3M) and install it now?</string>
167167
<string name="settings_permission_manage_text">Permission Manager</string>
168168
<string name="install_permission_manager_tips">Permission Manager is implemented by XPrivacyLua, download(about 1.7M) and install it now?</string>
169-
<string name="exp_tips">很久之前跟大家透露了 EXposed 的相关信息,经过一段时间的反馈和调整,已经到达一个小的里程碑。可能还有很多小伙伴不知道,今天就给大家介绍一下。\n\n
169+
<string name="exp_tips">reached a milestone. Many users may don\'t know it, let me introduce you today. \n\n
170170

171-
跟我之前创造的 VirtualXposed 一样,EXposed 也是一个免Root使用Xposed 模块的App;他俩各有千秋,EXposed 由于直接运行在原生系统,不论是性能还是稳定性都会好很多;而VirtualXposed 基于VA,天生支持多开。EXposed 才诞生一个月,其稳定性已经超越发展将近一年的 VirtualXposed\n\n
171+
Like the VirtualXposed I created earlier, EXposed is also an app that makes you use Xposed module without root, unlock the bootloader. they both have their own advantages, and EXposed will be much better in terms of performance and stability due to running directly in the native system; while VirtualXposed is based on VitualApp, which is more natural. . EXposed was born a month, and its stability has surpassed the development of VirtualXposed for nearly a year. \n\n
172172

173-
目前 EXposed 已经上架应用商店,并且改名为 太极,大家可以在安装尝试一下。</string>
173+
Currently, EXposed has been put on the app store and renamed to Tai Chi. You can try it out.</string>
174174
<string name="advance_settings_enable_launcher_summary">When enabled, You can set VirtualXposed be the Launcher of system</string>
175175
<string name="advance_settings_enable_launcher">Enable Launcher</string>
176176
<string name="exp_introduce_title">An easy way to use Xposed</string>

0 commit comments

Comments
 (0)