Skip to content

Commit

Permalink
New percent layout
Browse files Browse the repository at this point in the history
  • Loading branch information
PeratX committed Apr 8, 2017
1 parent d14f69a commit f8b82fd
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 12 deletions.
1 change: 1 addition & 0 deletions app/src/main/java/org/itxtech/daedalus/AboutActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ protected void onCreate(Bundle savedInstanceState) {
WebView view = (WebView) findViewById(R.id.webView_about);

view.getSettings().setJavaScriptEnabled(true);
view.setBackgroundColor(0);
view.addJavascriptInterface(this, "JavascriptInterface");

view.setOnLongClickListener(new View.OnLongClickListener() {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<WebView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:id="@+id/webView_about"
android:overScrollMode="never"
android:scrollbars="none"
Expand Down
31 changes: 22 additions & 9 deletions app/src/main/res/layout/content_main.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
<android.support.percent.PercentRelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
Expand All @@ -15,26 +15,39 @@
tools:context="org.itxtech.daedalus.MainActivity">
<ImageView
android:contentDescription="icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content" app:srcCompat="@mipmap/ic_launcher"
android:id="@+id/imageView"
android:id="@+id/imageView_icon"
android:layout_width="0dp"
android:layout_height="0dp"
android:clickable="false"
android:minHeight="120dp" android:minWidth="150dp"
app:srcCompat="@mipmap/ic_launcher"
app:layout_widthPercent="40%"
app:layout_heightPercent="20%"
app:layout_marginTopPercent="5%"
android:layout_alignParentTop="true" android:layout_centerHorizontal="true"/>
<TextView
android:text="@string/app_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="30sp"
app:layout_marginTopPercent="5%"
android:layout_below="@id/imageView_icon"
android:textAppearance="@android:style/TextAppearance.Material" android:fontFamily="sans-serif"
android:layout_centerHorizontal="true" android:id="@+id/textView_app_name"/>
<TextView
android:text="@string/notice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView_notice"
app:layout_marginTopPercent="5%"
android:textAppearance="@android:style/TextAppearance.Material" android:fontFamily="sans-serif"
android:layout_marginTop="46dp"
android:layout_below="@+id/imageView" android:layout_centerHorizontal="true"/>
android:layout_below="@+id/textView_app_name" android:layout_centerHorizontal="true"/>
<Button
android:text="@string/activate"
android:textSize="15sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/button_activate"
android:layout_marginTop="60dp"
app:layout_marginTopPercent="10%"
android:layout_alignTop="@+id/textView_notice" android:layout_centerHorizontal="true"/>
</RelativeLayout>

</android.support.percent.PercentRelativeLayout>
2 changes: 1 addition & 1 deletion app/src/main/res/values-zh/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<resources>
<string name="app_name">Daedalus</string>
<string name="action_settings">设置</string>
<string name="notice">Daedalus: 方便易用的基于 CuteDNS 的科学上网工具。</string>
<string name="notice">方便易用的基于 CuteDNS 的科学上网工具。</string>
<string name="activate">启用</string>
<string name="deactivate">停用</string>
<string name="action_about">关于</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<resources>
<string name="app_name">Daedalus</string>
<string name="action_settings">Settings</string>
<string name="notice">Daedalus: The CuteDNS implementation on Android.</string>
<string name="notice">The CuteDNS implementation on Android.</string>
<string name="activate">Activate</string>
<string name="deactivate">Deactivate</string>
<string name="action_about">About</string>
Expand Down

0 comments on commit f8b82fd

Please sign in to comment.