Skip to content

Commit

Permalink
about page add author information.
Browse files Browse the repository at this point in the history
  • Loading branch information
arnozhang committed Dec 6, 2016
1 parent 156c19c commit 64200fe
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
package com.jungle.apps.photos.module.misc;

import android.os.Bundle;
import android.view.View;
import com.jungle.apps.photos.R;
import com.jungle.apps.photos.base.app.PhotoBaseActivity;
import com.jungle.base.utils.MiscUtils;

public class AboutActivity extends PhotoBaseActivity {

Expand All @@ -29,5 +31,11 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

setContentView(R.layout.activity_about);
findViewById(R.id.author_zone).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
MiscUtils.openUrlByBrowser(getContext(), getString(R.string.arnozhang_github));
}
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="#0068cc" android:state_pressed="true"/>
<item android:color="#0079dd"/>
</selector>
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,40 @@
android:gravity="center">

<ImageView
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/app_icon"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginBottom="150dp"
android:text="@string/app_name"
android:textSize="18sp"/>
android:textSize="24sp"/>

<LinearLayout
android:id="@+id/author_zone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="120dp"
android:gravity="center"
android:orientation="vertical">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/arnozhang"
android:textSize="20sp"
android:textColor="@color/author_color"
android:duplicateParentState="true"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="@string/arnozhang_github"
android:textSize="16sp"
android:textColor="@color/author_color"
android:duplicateParentState="true"/>
</LinearLayout>
</LinearLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,6 @@
<string name="download_failed">下载失败</string>
<string name="about_item_text">关于</string>
<string name="network_invalid_tips">连接超时,请检查你的网络设置。</string>
<string name="arnozhang_github">https://github.com/arnozhang</string>
<string name="arnozhang">Arno Zhang丶</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import android.util.Patterns;
import android.view.View;
import android.view.WindowManager;
import android.webkit.URLUtil;
import com.jungle.base.R;
import com.jungle.base.app.AppCore;
import com.jungle.base.app.BaseActivity;
Expand Down Expand Up @@ -245,7 +246,7 @@ public static boolean openUrlByBrowser(Context context, String url) {

final String HTTP_TAG = "http://";
url = url.trim();
if (url.indexOf(HTTP_TAG) != 0) {
if (!URLUtil.isNetworkUrl(url)) {
url = HTTP_TAG + url;
}

Expand Down

0 comments on commit 64200fe

Please sign in to comment.