Commit 96799136 authored by Max Lv's avatar Max Lv

rework layout

parent f2d129ab
......@@ -37,7 +37,12 @@
<activity
android:name=".AppManager"
android:theme="@style/Theme.GAEProxy"
android:label="@string/app_name"/>
android:label="@string/app_name">
<intent-filter>
<action android:name="com.github.shadowsocks.AppManager" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<service
android:name=".ShadowsocksService"
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.shadowsocks</groupId>
......@@ -35,6 +35,13 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.actionbarsherlock</groupId>
<artifactId>actionbarsherlock</artifactId>
<version>4.3.0</version>
<type>apklib</type>
</dependency>
<dependency>
<groupId>com.google.android.analytics</groupId>
<artifactId>analytics</artifactId>
......@@ -47,6 +54,20 @@
<version>1.5</version>
</dependency>
<dependency>
<groupId>net.saik0.android.unifiedpreference</groupId>
<artifactId>unifiedpreference</artifactId>
<version>0.0.2</version>
<type>apklib</type>
</dependency>
<dependency>
<groupId>org.jraf</groupId>
<artifactId>android-switch-backport</artifactId>
<version>1.0</version>
<type>apklib</type>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:layout_width="fill_parent"
android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:duplicateParentState="false">
<TextView android:text="@string/proxyed_help"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:textSize="16sp" android:padding="3px" />
<ListView android:layout_width="fill_parent"
android:layout_height="wrap_content" android:id="@+id/applistview"></ListView>
android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:duplicateParentState="false">
<TextView android:text="@string/proxied_help"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:textSize="16sp" android:padding="3dp"/>
<ListView android:layout_width="fill_parent"
android:layout_height="wrap_content" android:id="@+id/applistview"/>
</LinearLayout>
\ No newline at end of file
......@@ -13,6 +13,5 @@
<CheckBox android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/itemcheck"></CheckBox>
</TableRow>
</TableLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<org.jraf.android.backport.switchwidget.Switch
android:id="@+id/switchButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"/>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!--
Zirco Browser for Android
Copyright (C) 2010 - 2011 J. Devauchelle and contributors.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 3 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-->
<resources>
<!-- Variation on the Light theme that turns off the title -->
<style name="Theme.GAEProxy" parent="android:Theme.Holo.Light"/>
</resources>
\ No newline at end of file
......@@ -29,7 +29,7 @@
</array>
<!-- feature category -->
<string name="fearute_cat">Feature Settings</string>
<string name="feature_cat">Feature Settings</string>
<string name="http_proxy">HTTP Proxy</string>
<string name="http_proxy_summary">Local HTTP Proxy</string>
<string name="dns_proxy">DNS Proxy</string>
......@@ -40,10 +40,10 @@
<string name="auto_set_proxy">Global Proxy</string>
<string name="auto_set_proxy_summary">Set up system wide proxy
</string>
<string name="proxyed_apps">Individual Proxy</string>
<string name="proxyed_apps_summary">Set individual proxy for apps
<string name="proxied_apps">Individual Proxy</string>
<string name="proxied_apps_summary">Set individual proxy for apps
</string>
<string name="proxyed_help">Select apps to use with Shadowsocks:</string>
<string name="proxied_help">Select apps to use with Shadowsocks:</string>
<string name="bypass_apps">Bypass Mode</string>
<string name="bypass_apps_summary">Enable this option to bypass selected apps</string>
<string name="auto_connect">Auto Connect</string>
......
......@@ -17,6 +17,9 @@
<resources>
<!-- Variation on the Light theme that turns off the title -->
<style name="Theme.GAEProxy" parent="android:Theme.Light"/>
<style name="Theme.GAEProxy" parent="@style/Theme.Sherlock.Light">
<item name="switchStyle">@style/Widget.Holo.Light.CompoundButton.Switch</item>
</style>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<CheckBoxPreference
android:defaultValue="false"
android:key="isHTTPProxy"
android:summary="@string/http_proxy_summary"
android:title="@string/http_proxy">
</CheckBoxPreference>
<CheckBoxPreference
android:defaultValue="true"
android:key="isDNSProxy"
android:summary="@string/dns_proxy_summary"
android:title="@string/dns_proxy">
</CheckBoxPreference>
<CheckBoxPreference
android:defaultValue="true"
android:key="isGFWList"
android:summary="@string/auto_set_gfwlist_summary"
android:title="@string/auto_set_gfwlist">
</CheckBoxPreference>
<CheckBoxPreference
android:defaultValue="true"
android:key="isGlobalProxy"
android:disableDependentsState="true"
android:summary="@string/auto_set_proxy_summary"
android:title="@string/auto_set_proxy">
</CheckBoxPreference>
<CheckBoxPreference
android:defaultValue="false"
android:dependency="isGlobalProxy"
android:key="isBypassApps"
android:summary="@string/bypass_apps_summary"
android:title="@string/bypass_apps">
</CheckBoxPreference>
<Preference
android:key="proxyedApps"
android:dependency="isGlobalProxy"
android:summary="@string/proxied_apps_summary"
android:title="@string/proxied_apps">
<intent android:action="com.github.shadowsocks.AppManager"/>
</Preference>
<CheckBoxPreference
android:key="isAutoConnect"
android:summary="@string/auto_connect_summary"
android:title="@string/auto_connect">
</CheckBoxPreference>
</PreferenceScreen>
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<com.github.shadowsocks.preferences.SummaryEditTextPreference
android:defaultValue="198.199.101.152"
android:key="proxy"
android:summary="@string/proxy_summary"
android:title="@string/proxy">
</com.github.shadowsocks.preferences.SummaryEditTextPreference>
<com.github.shadowsocks.preferences.SummaryEditTextPreference
android:defaultValue="443"
android:key="remotePort"
android:summary="@string/remote_port_summary"
android:title="@string/remote_port">
</com.github.shadowsocks.preferences.SummaryEditTextPreference>
<com.github.shadowsocks.preferences.SummaryEditTextPreference
android:defaultValue="1080"
android:key="port"
android:summary="@string/port_summary"
android:title="@string/port">
</com.github.shadowsocks.preferences.SummaryEditTextPreference>
<com.github.shadowsocks.preferences.SummaryEditTextPreference
android:defaultValue="u1rRWTssNv0p"
android:key="sitekey"
android:summary="@string/sitekey_summary"
android:title="@string/sitekey">
</com.github.shadowsocks.preferences.SummaryEditTextPreference>
<ListPreference
android:defaultValue="rc4"
android:key="encMethod"
android:entries="@array/enc_method_entry"
android:entryValues="@array/enc_method_value"
android:title="@string/enc_method">
</ListPreference>
</PreferenceScreen>
<?xml version="1.0" encoding="utf-8"?>
<preference-headers xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:unified="http://schemas.android.com/apk/res-auto">
<header
unified:fragment="com.github.shadowsocks.Shadowsocks$ProxyFragment"
unified:title="@string/proxy_cat"
unified:preferenceRes="@xml/pref_proxy"/>
<header
unified:fragment="com.github.shadowsocks.Shadowsocks$FeatureFragment"
unified:title="@string/feature_cat"
unified:preferenceRes="@xml/pref_feature"/>
</preference-headers>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory android:title="@string/function_cat">
<CheckBoxPreference
android:key="isRunning"
android:disableDependentsState="true"
android:summary="@string/service_summary"
android:title="@string/service_controller">
</CheckBoxPreference>
</PreferenceCategory>
<PreferenceCategory android:title="@string/proxy_cat">
<EditTextPreference
android:dependency="isRunning"
android:defaultValue="198.199.101.152"
android:key="proxy"
android:summary="@string/proxy_summary"
android:title="@string/proxy">
</EditTextPreference>
<EditTextPreference
android:dependency="isRunning"
android:defaultValue="443"
android:key="remotePort"
android:summary="@string/remote_port_summary"
android:title="@string/remote_port">
</EditTextPreference>
<EditTextPreference
android:dependency="isRunning"
android:defaultValue="1080"
android:key="port"
android:summary="@string/port_summary"
android:title="@string/port">
</EditTextPreference>
<EditTextPreference
android:dependency="isRunning"
android:defaultValue="u1rRWTssNv0p"
android:key="sitekey"
android:summary="@string/sitekey_summary"
android:title="@string/sitekey">
</EditTextPreference>
<ListPreference
android:dependency="isRunning"
android:defaultValue="rc4"
android:key="encMethod"
android:entries="@array/enc_method_entry"
android:entryValues="@array/enc_method_value"
android:title="@string/enc_method">
</ListPreference>
</PreferenceCategory>
<PreferenceCategory android:title="@string/fearute_cat">
<CheckBoxPreference
android:dependency="isRunning"
android:defaultValue="false"
android:key="isHTTPProxy"
android:summary="@string/http_proxy_summary"
android:title="@string/http_proxy">
</CheckBoxPreference>
<CheckBoxPreference
android:dependency="isRunning"
android:defaultValue="true"
android:key="isDNSProxy"
android:summary="@string/dns_proxy_summary"
android:title="@string/dns_proxy">
</CheckBoxPreference>
<CheckBoxPreference
android:dependency="isRunning"
android:defaultValue="true"
android:key="isGFWList"
android:summary="@string/auto_set_gfwlist_summary"
android:title="@string/auto_set_gfwlist">
</CheckBoxPreference>
<CheckBoxPreference
android:dependency="isRunning"
android:defaultValue="true"
android:key="isGlobalProxy"
android:summary="@string/auto_set_proxy_summary"
android:title="@string/auto_set_proxy">
</CheckBoxPreference>
<CheckBoxPreference
android:dependency="isRunning"
android:defaultValue="false"
android:key="isBypassApps"
android:summary="@string/bypass_apps_summary"
android:title="@string/bypass_apps">
</CheckBoxPreference>
<Preference
android:dependency="isRunning"
android:key="proxyedApps"
android:summary="@string/proxyed_apps_summary"
android:title="@string/proxyed_apps">
</Preference>
<CheckBoxPreference
android:dependency="isRunning"
android:key="isAutoConnect"
android:summary="@string/auto_connect_summary"
android:title="@string/auto_connect">
</CheckBoxPreference>
</PreferenceCategory>
</PreferenceScreen>
This diff is collapsed.
package com.github.shadowsocks.preferences;
import android.content.Context;
import android.preference.EditTextPreference;
import android.util.AttributeSet;
import com.github.shadowsocks.R;
public class SummaryEditTextPreference extends EditTextPreference {
private CharSequence mDefaultSummary;
public SummaryEditTextPreference(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
mDefaultSummary = getSummary();
}
public SummaryEditTextPreference(Context context, AttributeSet attrs) {
super(context, attrs);
mDefaultSummary = getSummary();
}
public SummaryEditTextPreference(Context context) {
super(context);
}
@Override
public void onDialogClosed(boolean positiveResult) {
super.onDialogClosed(positiveResult);
if (positiveResult) {
String value = getEditText().getText().toString();
if (value.isEmpty()) {
setSummary(mDefaultSummary);
} else {
setSummary(value);
}
}
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment