Added project home action

This commit is contained in:
PeratX 2017-04-06 00:18:38 +08:00
parent 763f97eaea
commit 1c50011d34
5 changed files with 19 additions and 13 deletions

View File

@ -5,6 +5,7 @@ import android.app.NotificationManager;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.net.VpnService;
import android.os.Bundle;
import android.preference.PreferenceManager;
@ -145,19 +146,19 @@ public class MainActivity extends AppCompatActivity {
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
Intent intent = new Intent();
intent.setClass(this, SettingsActivity.class);
startActivity(intent);
startActivity(new Intent(this, SettingsActivity.class));
return true;
}
if (id == R.id.action_about) {
Intent intent = new Intent();
intent.setClass(this, AboutActivity.class);
startActivity(intent);
startActivity(new Intent(this, AboutActivity.class));
return true;
}
if (id == R.id.action_project_home) {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/iTXTech/Daedalus")));
}
return super.onOptionsItemSelected(item);
}
}

View File

@ -67,8 +67,8 @@ public class ServerTestActivity extends AppCompatActivity {
private String testServer(DNSClient client, String dnsServer, String testUrl, String testText) {
Log.d("Dvpn", "Testing DNS " + dnsServer);
testText += getResources().getString(R.string.test_server_address) + testUrl + "\n"
+ getResources().getString(R.string.test_dns_server) + dnsServer;
testText += getResources().getString(R.string.test_server_address) + " " + testUrl + "\n"
+ getResources().getString(R.string.test_dns_server) + " " + dnsServer;
mHandler.obtainMessage(MSG_DISPLAY_STATUS, testText).sendToTarget();
@ -87,9 +87,9 @@ public class ServerTestActivity extends AppCompatActivity {
Set<A> answers = responseMessage.getAnswersFor(question);
for (A a : answers) {
InetAddress inetAddress = a.getInetAddress();
testText += "\n" + getResources().getString(R.string.test_resolved_address) + inetAddress.getHostAddress();
testText += "\n" + getResources().getString(R.string.test_resolved_address) + " " + inetAddress.getHostAddress();
}
testText += "\n" + getResources().getString(R.string.test_time_used) + String.valueOf(endTime - startTime) + " ms\n\n";
testText += "\n" + getResources().getString(R.string.test_time_used) + " " + String.valueOf(endTime - startTime) + " ms\n\n";
} catch (Exception e) {
testText += "\n" + getResources().getString(R.string.test_failed) + "\n\n";

View File

@ -4,10 +4,13 @@
tools:context="org.itxtech.daedalus.MainActivity">
<item android:id="@+id/action_settings"
android:title="@string/action_settings"
android:orderInCategory="100"
/>
android:orderInCategory="100"/>
<item android:id="@+id/action_about"
android:title="@string/action_about"
android:orderInCategory="100"
app:showAsAction="never"/>
<item android:id="@+id/action_project_home"
android:title="@string/action_project_home"
android:orderInCategory="100"
app:showAsAction="never"/>
</menu>

View File

@ -8,7 +8,7 @@
<string name="action_about">关于</string>
<string name="notification_activated">点击回到 Daedalus</string>
<string name="settings_system">系统设置</string>
<string name="settings_boot">开机自动启</string>
<string name="settings_boot">开机自动启</string>
<string name="about">作者iTX Technologies\n网站https://itxtech.org\n\nDaedalus 是一个运行在 Android 上的 DNS 代理程序。\n它基于
CuteDNS(http://www.cutedns.cn) 的 DNS 服务器。\n\n你可以通过此程序通过 https 协议直连Google, Google Play, Twitter, Facebook, Gmail, Youtube,
Google Drive, Tumblr, Mega, Dropbox, Apkpure, ccFox.info, ProjectH, Battle.NET, WordPress, Microsoft Live,
@ -30,4 +30,5 @@
<string name="test_dns_server">DNS 服务器:</string>
<string name="test_resolved_address">解析的地址:</string>
<string name="test_failed">查询失败。超时或未知的主机。</string>
<string name="action_project_home">项目主页</string>
</resources>

View File

@ -31,4 +31,5 @@
<string name="test_dns_server">DNS server:</string>
<string name="test_resolved_address">Resolved address:</string>
<string name="test_failed">Query failed. Timeout or unknown hostname.</string>
<string name="action_project_home">Project home</string>
</resources>