Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
E
echo-adr-Deprecated
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
echo
echo-adr-Deprecated
Commits
abef905b
Commit
abef905b
authored
Jul 19, 2020
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
settings demo
parent
8ec9bb6f
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
158 additions
and
39 deletions
+158
-39
build.gradle
app/build.gradle
+3
-2
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+17
-15
HttpProxyService.java
app/src/main/java/com/virjar/echo/adr/HttpProxyService.java
+2
-1
MainActivity.java
app/src/main/java/com/virjar/echo/adr/MainActivity.java
+2
-1
LoginActivity.java
app/src/main/java/com/virjar/echo/adr/ui/LoginActivity.java
+21
-1
SettingsActivity.java
...rc/main/java/com/virjar/echo/adr/ui/SettingsActivity.java
+33
-0
activity_login.xml
app/src/main/res/layout/activity_login.xml
+3
-12
settings_activity.xml
app/src/main/res/layout/settings_activity.xml
+9
-0
arrays.xml
app/src/main/res/values/arrays.xml
+12
-0
colors.xml
app/src/main/res/values/colors.xml
+3
-5
strings.xml
app/src/main/res/values/strings.xml
+16
-0
root_preferences.xml
app/src/main/res/xml/root_preferences.xml
+35
-0
gradle.properties
gradle.properties
+2
-2
No files found.
app/build.gradle
View file @
abef905b
...
...
@@ -43,9 +43,9 @@ dependencies {
implementation
fileTree
(
dir:
'libs'
,
include:
[
'*.jar'
])
implementation
'com.android.support:appcompat-v7:2
7.1.1
'
implementation
'com.android.support:appcompat-v7:2
8.0.0
'
implementation
'com.android.support.constraint:constraint-layout:1.1.1'
implementation
'com.android.support:design:2
7.1.1
'
implementation
'com.android.support:design:2
8.0.0
'
//compile 'com.android.support:support-v4:24.2.0'
api
project
(
':echo-lib'
)
...
...
@@ -53,5 +53,6 @@ dependencies {
//引入netty之后,class直接就爆炸了。考虑实现API精简
implementation
'com.android.support:multidex:1.0.3'
implementation
'androidx.preference:preference:1.1.0'
annotationProcessor
'org.projectlombok:lombok:1.18.2'
}
app/src/main/AndroidManifest.xml
View file @
abef905b
...
...
@@ -2,6 +2,12 @@
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
package=
"com.virjar.echo.adr"
>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.WRITE_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.FOREGROUND_SERVICE"
/>
<uses-permission
android:name=
"android.permission.SYSTEM_ALERT_WINDOW"
/>
<uses-permission
android:name=
"android.permission.RECEIVE_BOOT_COMPLETED"
/>
<application
android:allowBackup=
"true"
...
...
@@ -10,13 +16,16 @@
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
android:theme=
"@style/AppTheme"
>
<activity
android:name=
".ui.SettingsActivity"
android:label=
"@string/title_activity_settings"
/>
<activity
android:name=
".MainActivity"
/>
<activity
android:name=
".ui.LoginActivity
"
<activity
android:name=
".ui.LoginActivity"
android:configChanges=
"orientation|screenSize
"
android:theme=
"@style/Theme.AppCompat.NoActionBar"
android:windowSoftInputMode=
"stateHidden|adjustPan"
android:configChanges=
"orientation|screenSize"
>
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
...
...
@@ -25,7 +34,7 @@
</activity>
<receiver
android:name=
"
com.virjar.echo.adr
.StartOnBootBroadcastReceiver"
android:name=
".StartOnBootBroadcastReceiver"
android:enabled=
"true"
android:exported=
"true"
>
<intent-filter
android:priority=
"1000"
>
...
...
@@ -45,27 +54,20 @@
<data
android:scheme=
"package"
/>
</intent-filter>
</receiver>
<!--开机自启服务-->
</receiver>
<!-- 开机自启服务 -->
<service
android:name=
"
com.virjar.echo.adr
.HttpProxyService"
android:name=
".HttpProxyService"
android:enabled=
"true"
android:exported=
"true"
tools:ignore=
"ExportedService"
>
<intent-filter
android:priority=
"1000"
>
<action
android:name=
"com.virjar.g4proxy.service"
/>
<category
android:name=
"android.intent.category.DEFAULT"
/>
</intent-filter>
</service>
</application>
<uses-permission
android:name=
"android.permission.RECEIVE_BOOT_COMPLETED"
/>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.WRITE_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.FOREGROUND_SERVICE"
/>
<uses-permission
android:name=
"android.permission.SYSTEM_ALERT_WINDOW"
/>
</manifest>
\ No newline at end of file
app/src/main/java/com/virjar/echo/adr/HttpProxyService.java
View file @
abef905b
...
...
@@ -10,9 +10,10 @@ import android.graphics.BitmapFactory;
import
android.graphics.Color
;
import
android.os.Build
;
import
android.os.IBinder
;
import
android.support.annotation.Nullable
;
import
androidx.annotation.Nullable
;
import
com.virjar.echo.nat.client.EchoClient
;
import
com.virjar.echo.nat.log.EchoLogger
;
...
...
app/src/main/java/com/virjar/echo/adr/MainActivity.java
View file @
abef905b
...
...
@@ -2,7 +2,8 @@ package com.virjar.echo.adr;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.support.v7.app.AppCompatActivity
;
import
androidx.appcompat.app.AppCompatActivity
;
public
class
MainActivity
extends
AppCompatActivity
{
...
...
app/src/main/java/com/virjar/echo/adr/ui/LoginActivity.java
View file @
abef905b
package
com
.
virjar
.
echo
.
adr
.
ui
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.
support.v7.app.AppCompatActivity
;
import
android.
view.View
;
import
android.view.Window
;
import
android.view.WindowManager
;
import
android.widget.Button
;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
androidx.appcompat.app.AppCompatActivity
;
import
com.virjar.echo.adr.R
;
public
class
LoginActivity
extends
AppCompatActivity
{
...
...
@@ -18,11 +22,26 @@ public class LoginActivity extends AppCompatActivity {
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
requestWindowFeature
(
Window
.
FEATURE_NO_TITLE
);
getWindow
().
setFlags
(
WindowManager
.
LayoutParams
.
FLAG_FULLSCREEN
,
WindowManager
.
LayoutParams
.
FLAG_FULLSCREEN
);
setContentView
(
R
.
layout
.
activity_login
);
imageView
=
findViewById
(
R
.
id
.
imageView
);
textView
=
findViewById
(
R
.
id
.
textView
);
setupAnimation
();
Button
btnSetting
=
findViewById
(
R
.
id
.
btn_setting
);
btnSetting
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
getWindow
().
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_FULLSCREEN
);
startActivity
(
new
Intent
(
LoginActivity
.
this
,
SettingsActivity
.
class
));
}
});
}
private
void
setupAnimation
()
{
imageView
.
setOnTouchListener
(
new
OnSwipeTouchListener
(
getApplicationContext
())
{
public
void
onSwipeTop
()
{
}
...
...
@@ -56,4 +75,5 @@ public class LoginActivity extends AppCompatActivity {
});
}
}
app/src/main/java/com/virjar/echo/adr/ui/SettingsActivity.java
0 → 100644
View file @
abef905b
package
com
.
virjar
.
echo
.
adr
.
ui
;
import
android.os.Bundle
;
import
androidx.appcompat.app.ActionBar
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.preference.PreferenceFragmentCompat
;
import
com.virjar.echo.adr.R
;
public
class
SettingsActivity
extends
AppCompatActivity
{
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
settings_activity
);
getSupportFragmentManager
()
.
beginTransaction
()
.
replace
(
R
.
id
.
settings
,
new
SettingsFragment
())
.
commit
();
ActionBar
actionBar
=
getSupportActionBar
();
if
(
actionBar
!=
null
)
{
actionBar
.
setDisplayHomeAsUpEnabled
(
true
);
}
}
public
static
class
SettingsFragment
extends
PreferenceFragmentCompat
{
@Override
public
void
onCreatePreferences
(
Bundle
savedInstanceState
,
String
rootKey
)
{
setPreferencesFromResource
(
R
.
xml
.
root_preferences
,
rootKey
);
}
}
}
\ No newline at end of file
app/src/main/res/layout/activity_login.xml
View file @
abef905b
...
...
@@ -94,11 +94,7 @@
android:paddingRight=
"32dp"
>
<android.support.design.widget.TextInputLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:textColorHint=
"#96ffffff"
android:theme=
"@style/EditScreenTextInputLayoutStyle"
>
<EditText
android:layout_width=
"match_parent"
...
...
@@ -111,13 +107,7 @@
android:maxLines=
"1"
android:textColor=
"@android:color/white"
android:textSize=
"16sp"
/>
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:textColorHint=
"#96ffffff"
android:theme=
"@style/EditScreenTextInputLayoutStyle"
>
<EditText
android:layout_width=
"match_parent"
...
...
@@ -130,7 +120,7 @@
android:maxLines=
"1"
android:textColor=
"@android:color/white"
android:textSize=
"16sp"
/>
</android.support.design.widget.TextInputLayout>
<LinearLayout
android:layout_width=
"match_parent"
...
...
@@ -153,6 +143,7 @@
android:textSize=
"16dp"
/>
<Button
android:id=
"@+id/btn_setting"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"16dp"
...
...
app/src/main/res/layout/settings_activity.xml
0 → 100644
View file @
abef905b
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<FrameLayout
android:id=
"@+id/settings"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/values/arrays.xml
0 → 100644
View file @
abef905b
<resources>
<!-- Reply Preference -->
<string-array
name=
"reply_entries"
>
<item>
Reply
</item>
<item>
Reply to all
</item>
</string-array>
<string-array
name=
"reply_values"
>
<item>
reply
</item>
<item>
reply_all
</item>
</string-array>
</resources>
\ No newline at end of file
app/src/main/res/values/colors.xml
View file @
abef905b
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color
name=
"colorPrimary"
>
#FFFFFF
</color>
<color
name=
"colorPrimaryDark"
>
#FFFFFF
</color>
<color
name=
"colorAccent"
>
#FFFFFF
</color>
<color
name=
"colorPrimary"
>
#2196f3
</color>
<color
name=
"colorPrimaryDark"
>
#1976d2
</color>
<color
name=
"colorAccent"
>
#FF9800
</color>
<color
name=
"textInputLayout"
>
#96ffffff
</color>
</resources>
app/src/main/res/values/strings.xml
View file @
abef905b
<resources>
<string
name=
"app_name"
>
EchoProxy
</string>
<string
name=
"title_activity_settings"
>
SettingsActivity
</string>
<!-- Preference Titles -->
<string
name=
"messages_header"
>
Messages
</string>
<string
name=
"sync_header"
>
Sync
</string>
<!-- Messages Preferences -->
<string
name=
"signature_title"
>
Your signature
</string>
<string
name=
"reply_title"
>
Default reply action
</string>
<!-- Sync Preferences -->
<string
name=
"sync_title"
>
Sync email periodically
</string>
<string
name=
"attachment_title"
>
Download incoming attachments
</string>
<string
name=
"attachment_summary_on"
>
Automatically download attachments for incoming emails
</string>
<string
name=
"attachment_summary_off"
>
Only download attachments when manually requested
</string>
</resources>
app/src/main/res/xml/root_preferences.xml
0 → 100644
View file @
abef905b
<PreferenceScreen
xmlns:app=
"http://schemas.android.com/apk/res-auto"
>
<PreferenceCategory
app:title=
"@string/messages_header"
>
<EditTextPreference
app:key=
"signature"
app:title=
"@string/signature_title"
app:useSimpleSummaryProvider=
"true"
/>
<ListPreference
app:defaultValue=
"reply"
app:entries=
"@array/reply_entries"
app:entryValues=
"@array/reply_values"
app:key=
"reply"
app:title=
"@string/reply_title"
app:useSimpleSummaryProvider=
"true"
/>
</PreferenceCategory>
<PreferenceCategory
app:title=
"@string/sync_header"
>
<SwitchPreferenceCompat
app:key=
"sync"
app:title=
"@string/sync_title"
/>
<SwitchPreferenceCompat
app:dependency=
"sync"
app:key=
"attachment"
app:summaryOff=
"@string/attachment_summary_off"
app:summaryOn=
"@string/attachment_summary_on"
app:title=
"@string/attachment_title"
/>
</PreferenceCategory>
</PreferenceScreen>
\ No newline at end of file
gradle.properties
View file @
abef905b
...
...
@@ -14,7 +14,7 @@ org.gradle.jvmargs=-Xmx1536m
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX
=
fals
e
android.useAndroidX
=
tru
e
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier
=
fals
e
android.enableJetifier
=
tru
e
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment