add feedback & about
This commit is contained in:
19 files changed
+157
-14
No files matched your search
@@ -10,14 +10,14 @@
|
||||
android:name=".MainApplication"
|
||||
android:allowBackup="false"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:label="@string/launch_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
tools:ignore="GoogleAppIndexingWarning">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:label="@string/app_name"
|
||||
android:label="@string/launch_name"
|
||||
android:screenOrientation="portrait"
|
||||
android:launchMode="singleTask">
|
||||
<intent-filter>
|
||||
@@ -79,6 +79,10 @@
|
||||
android:label="@string/clash_logs"
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity android:name=".FeedbackActivity"
|
||||
android:label="@string/clash_feedback"
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait" />
|
||||
<service
|
||||
android:name=".ClashStartService"
|
||||
android:exported="false" />
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.github.kr328.clash
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.preference.PreferenceFragmentCompat
|
||||
import kotlinx.android.synthetic.main.activity_feedback.*
|
||||
import kotlinx.android.synthetic.main.activity_main.*
|
||||
|
||||
class FeedbackActivity : BaseActivity() {
|
||||
class Fragment : PreferenceFragmentCompat() {
|
||||
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||
setPreferencesFromResource(R.xml.feedback, rootKey)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_feedback)
|
||||
|
||||
setSupportActionBar(activity_feedback_toolbar)
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.github.kr328.clash
|
||||
|
||||
import android.app.Activity
|
||||
import android.app.AlertDialog
|
||||
import android.app.Dialog
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.VpnService
|
||||
@@ -49,6 +51,14 @@ class MainActivity : BaseActivity() {
|
||||
startActivity(Intent(this, LogActivity::class.java))
|
||||
}
|
||||
|
||||
activity_main_clash_feedback.setOnClickListener {
|
||||
startActivity(Intent(this, FeedbackActivity::class.java))
|
||||
}
|
||||
|
||||
activity_main_clash_about.setOnClickListener {
|
||||
showAboutDialog()
|
||||
}
|
||||
|
||||
activity_main_clash_status_icon.setImageResource(R.drawable.ic_clash_stopped)
|
||||
activity_main_clash_status_title.text = getString(R.string.clash_status_stopped)
|
||||
activity_main_clash_status_summary.text = getString(R.string.clash_status_click_to_start)
|
||||
@@ -186,4 +196,8 @@ class MainActivity : BaseActivity() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun showAboutDialog() {
|
||||
AlertDialog.Builder(this).setView(R.layout.dialog_about).show()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical" android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/activity_feedback_toolbar"
|
||||
android:elevation="4dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp" />
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/activity_feedback_content"
|
||||
android:name="com.github.kr328.clash.FeedbackActivity$Fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
</LinearLayout>
|
||||
@@ -25,7 +25,7 @@
|
||||
android:id="@+id/activity_import_file_save"
|
||||
android:padding="10dp"
|
||||
android:src="@drawable/ic_save"
|
||||
android:contentDescription="@string/app_name"
|
||||
android:contentDescription="@string/launch_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
android:id="@+id/activity_import_url_save"
|
||||
android:padding="10dp"
|
||||
android:src="@drawable/ic_save"
|
||||
android:contentDescription="@string/app_name"
|
||||
android:contentDescription="@string/launch_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:contentDescription="@string/app_name" />
|
||||
android:contentDescription="@string/launch_name" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<ImageView
|
||||
android:id="@+id/adapter_form_text_icon"
|
||||
android:src="@drawable/ic_about"
|
||||
android:contentDescription="@string/app_name"
|
||||
android:contentDescription="@string/launch_name"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp" />
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
android:padding="2dp"
|
||||
android:layout_marginStart="2dp"
|
||||
android:textColor="@color/colorAccent"
|
||||
android:text="@string/app_name"
|
||||
android:text="@string/launch_name"
|
||||
android:id="@+id/adapter_proxy_header_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
<?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"
|
||||
android:padding="20dp">
|
||||
<ImageView
|
||||
android:id="@android:id/icon"
|
||||
android:src="@drawable/ic_logo"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:contentDescription="@string/launch_name" />
|
||||
<TextView
|
||||
android:id="@android:id/title"
|
||||
android:layout_marginStart="10dp"
|
||||
android:text="@string/application_name"
|
||||
android:textColor="@color/colorAccent"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toEndOf="@android:id/icon" />
|
||||
<TextView
|
||||
android:layout_alignStart="@android:id/title"
|
||||
android:layout_below="@android:id/title"
|
||||
android:text="@string/about_power_by_clash"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
</RelativeLayout>
|
||||
@@ -11,6 +11,6 @@
|
||||
android:inputType="text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:hint="@string/app_name" />
|
||||
android:hint="@string/launch_name" />
|
||||
|
||||
</FrameLayout>
|
||||
@@ -15,7 +15,7 @@
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:contentDescription="@string/app_name" />
|
||||
android:contentDescription="@string/launch_name" />
|
||||
|
||||
<TextView
|
||||
android:textColor="@android:color/black"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:contentDescription="@string/app_name" />
|
||||
android:contentDescription="@string/launch_name" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<resources>
|
||||
<string name="app_name">Clash</string>
|
||||
<string name="launch_name">Clash</string>
|
||||
<string name="application_name">Clash for Android</string>
|
||||
|
||||
<string name="clash_status_stopped">Stopped</string>
|
||||
<string name="clash_status_click_to_start">Click here to start</string>
|
||||
@@ -90,4 +91,19 @@
|
||||
<string name="clash_start_service_notification">Starting Clash</string>
|
||||
|
||||
<string name="not_implemented">Not Implemented</string>
|
||||
|
||||
<string name="feedback_source">Source & Issues</string>
|
||||
<string name="feedback_upstream">Upstream</string>
|
||||
<string name="feedback_github_repo">Github</string>
|
||||
|
||||
<string name="feedback_group">Groups</string>
|
||||
<string name="feedback_telegram_channel">Telegram Channel</string>
|
||||
<string name="feedback_telegram_group">Telegram Group</string>
|
||||
|
||||
<string name="feedback_upstream_url" translatable="false">https://github.com/Dreamacro/clash</string>
|
||||
<string name="feedback_github_repo_url" translatable="false">https://github.com/Kr328/ClashForAndroid</string>
|
||||
<string name="feedback_telegram_group_url" translatable="false">https://t.me/clash_for_android</string>
|
||||
<string name="feedback_telegram_channel_url" translatable="false">https://t.me/clash_for_android_channel</string>
|
||||
|
||||
<string name="about_power_by_clash">Power by Clash</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<PreferenceCategory android:title="@string/feedback_source">
|
||||
<Preference android:title="@string/feedback_upstream"
|
||||
android:summary="@string/feedback_upstream_url">
|
||||
<intent android:action="android.intent.action.VIEW"
|
||||
android:data="@string/feedback_upstream_url" />
|
||||
</Preference>
|
||||
<Preference android:title="@string/feedback_github_repo"
|
||||
android:summary="@string/feedback_github_repo_url">
|
||||
<intent android:action="android.intent.action.VIEW"
|
||||
android:data="@string/feedback_github_repo_url" />
|
||||
</Preference>
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory android:title="@string/feedback_group">
|
||||
<Preference android:title="@string/feedback_telegram_channel"
|
||||
android:summary="@string/feedback_telegram_channel_url">
|
||||
<intent android:action="android.intent.action.VIEW" android:data="@string/feedback_telegram_channel_url" />
|
||||
</Preference>
|
||||
<Preference android:title="@string/feedback_telegram_group" android:summary="@string/feedback_telegram_group_url">
|
||||
<intent android:action="android.intent.action.VIEW" android:data="@string/feedback_telegram_group_url" />
|
||||
</Preference>
|
||||
</PreferenceCategory>
|
||||
</PreferenceScreen>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<PreferenceCategory android:title="@string/feedback_source">
|
||||
<Preference android:title="@string/feedback_upstream"
|
||||
android:summary="@string/feedback_upstream_url">
|
||||
<intent android:action="android.intent.action.VIEW"
|
||||
android:data="@string/feedback_upstream_url" />
|
||||
</Preference>
|
||||
<Preference android:title="@string/feedback_github_repo"
|
||||
android:summary="@string/feedback_github_repo_url">
|
||||
<intent android:action="android.intent.action.VIEW"
|
||||
android:data="@string/feedback_github_repo_url" />
|
||||
</Preference>
|
||||
</PreferenceCategory>
|
||||
</PreferenceScreen>
|
||||
@@ -1,3 +1,3 @@
|
||||
<resources>
|
||||
<string name="app_name">core</string>
|
||||
<string name="launch_name">core</string>
|
||||
</resources>
|
||||
@@ -5,7 +5,7 @@
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:text="@string/app_name"
|
||||
android:text="@string/launch_name"
|
||||
android:id="@+id/clash_notification_title"
|
||||
android:textAppearance="@style/TextAppearance.Compat.Notification.Title"
|
||||
android:textColor="@android:color/black"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<resources>
|
||||
<string name="app_name">Clash</string>
|
||||
<string name="launch_name">Clash</string>
|
||||
|
||||
<string name="clash_service_status_channel">Clash Status</string>
|
||||
<string name="clash_service_running">Running</string>
|
||||
|
||||
Reference in new issue
Block a user