Added navigation view
This commit is contained in:
parent
cd425eb8a5
commit
31dd65440f
@ -41,7 +41,8 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".activity.MainActivity"
|
android:name=".activity.MainActivity"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:launchMode="singleTask">
|
android:launchMode="singleTask"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN"/>
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ import android.util.Log;
|
|||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
import android.webkit.WebView;
|
import android.webkit.WebView;
|
||||||
import android.webkit.WebViewClient;
|
import android.webkit.WebViewClient;
|
||||||
import org.itxtech.daedalus.BuildConfig;
|
import org.itxtech.daedalus.BuildConfig;
|
||||||
@ -28,6 +29,7 @@ import java.util.Locale;
|
|||||||
* the Free Software Foundation, version 3.
|
* the Free Software Foundation, version 3.
|
||||||
*/
|
*/
|
||||||
public class AboutActivity extends AppCompatActivity {
|
public class AboutActivity extends AppCompatActivity {
|
||||||
|
private WebView mWebView = null;
|
||||||
|
|
||||||
@SuppressLint({"JavascriptInterface", "SetJavaScriptEnabled", "addJavascriptInterface"})
|
@SuppressLint({"JavascriptInterface", "SetJavaScriptEnabled", "addJavascriptInterface"})
|
||||||
@Override
|
@Override
|
||||||
@ -35,13 +37,14 @@ public class AboutActivity extends AppCompatActivity {
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_about);
|
setContentView(R.layout.activity_about);
|
||||||
|
|
||||||
WebView view = (WebView) findViewById(R.id.webView_about);
|
mWebView = new WebView(this.getApplicationContext());
|
||||||
|
((ViewGroup) findViewById(R.id.activity_about)).addView(mWebView);
|
||||||
|
|
||||||
view.getSettings().setJavaScriptEnabled(true);
|
mWebView.getSettings().setJavaScriptEnabled(true);
|
||||||
view.setBackgroundColor(0);
|
mWebView.setBackgroundColor(0);
|
||||||
view.addJavascriptInterface(this, "JavascriptInterface");
|
mWebView.addJavascriptInterface(this, "JavascriptInterface");
|
||||||
|
|
||||||
view.setOnLongClickListener(new View.OnLongClickListener() {
|
mWebView.setOnLongClickListener(new View.OnLongClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onLongClick(View view) {
|
public boolean onLongClick(View view) {
|
||||||
return true;
|
return true;
|
||||||
@ -49,17 +52,17 @@ public class AboutActivity extends AppCompatActivity {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (Locale.getDefault().getLanguage().equals("zh")) {
|
if (Locale.getDefault().getLanguage().equals("zh")) {
|
||||||
view.loadUrl("file:///android_asset/about_html/index_zh.html");
|
mWebView.loadUrl("file:///android_asset/about_html/index_zh.html");
|
||||||
} else {
|
} else {
|
||||||
view.loadUrl("file:///android_asset/about_html/index.html");
|
mWebView.loadUrl("file:///android_asset/about_html/index.html");
|
||||||
}
|
}
|
||||||
|
|
||||||
view.setWebViewClient(new WebViewClient() {
|
mWebView.setWebViewClient(new WebViewClient() {
|
||||||
@Override
|
@Override
|
||||||
public void onPageFinished(WebView view, String url) {
|
public void onPageFinished(WebView view, String url) {
|
||||||
super.onPageFinished(view, url);
|
super.onPageFinished(view, url);
|
||||||
try {
|
try {
|
||||||
view.loadUrl("javascript:changeVersionInfo('" + getPackageManager().getPackageInfo(getPackageName(), 0).versionName + "', '" + BuildConfig.BUILD_TIME + "', '" + BuildConfig.GIT_COMMIT + "')");
|
mWebView.loadUrl("javascript:changeVersionInfo('" + getPackageManager().getPackageInfo(getPackageName(), 0).versionName + "', '" + BuildConfig.BUILD_TIME + "', '" + BuildConfig.GIT_COMMIT + "')");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e("DAboutActivity", e.toString());
|
Log.e("DAboutActivity", e.toString());
|
||||||
}
|
}
|
||||||
@ -67,6 +70,23 @@ public class AboutActivity extends AppCompatActivity {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
|
||||||
|
if (mWebView != null) {
|
||||||
|
Log.d("DAboutActivity", "onDestroy");
|
||||||
|
|
||||||
|
mWebView.removeAllViews();
|
||||||
|
mWebView.setWebViewClient(null);
|
||||||
|
((ViewGroup) mWebView.getParent()).removeView(mWebView);
|
||||||
|
mWebView.setTag(null);
|
||||||
|
mWebView.clearHistory();
|
||||||
|
mWebView.destroy();
|
||||||
|
mWebView = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
// Inflate the menu; this adds items to the action bar if it is present.
|
// Inflate the menu; this adds items to the action bar if it is present.
|
||||||
|
@ -6,12 +6,19 @@ import android.content.Intent;
|
|||||||
import android.net.VpnService;
|
import android.net.VpnService;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.design.widget.FloatingActionButton;
|
import android.support.design.widget.FloatingActionButton;
|
||||||
|
import android.support.design.widget.NavigationView;
|
||||||
|
import android.support.v4.view.GravityCompat;
|
||||||
|
import android.support.v4.widget.DrawerLayout;
|
||||||
|
import android.support.v7.app.ActionBarDrawerToggle;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.support.v7.widget.Toolbar;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import org.itxtech.daedalus.BuildConfig;
|
||||||
import org.itxtech.daedalus.Daedalus;
|
import org.itxtech.daedalus.Daedalus;
|
||||||
import org.itxtech.daedalus.R;
|
import org.itxtech.daedalus.R;
|
||||||
import org.itxtech.daedalus.service.DaedalusVpnService;
|
import org.itxtech.daedalus.service.DaedalusVpnService;
|
||||||
@ -29,7 +36,7 @@ import java.util.List;
|
|||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, version 3.
|
* the Free Software Foundation, version 3.
|
||||||
*/
|
*/
|
||||||
public class MainActivity extends AppCompatActivity {
|
public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener {
|
||||||
public static final String LAUNCH_ACTION = "org.itxtech.daedalus.activity.MainActivity.LAUNCH_ACTION";
|
public static final String LAUNCH_ACTION = "org.itxtech.daedalus.activity.MainActivity.LAUNCH_ACTION";
|
||||||
public static final int LAUNCH_ACTION_NONE = 0;
|
public static final int LAUNCH_ACTION_NONE = 0;
|
||||||
public static final int LAUNCH_ACTION_ACTIVATE = 1;
|
public static final int LAUNCH_ACTION_ACTIVATE = 1;
|
||||||
@ -48,18 +55,26 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
instance = this;
|
instance = this;
|
||||||
|
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
/*Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
setSupportActionBar(toolbar);*/
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||||
fab.setOnClickListener(new View.OnClickListener() {
|
fab.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
Intent intent = new Intent(v.getContext(), ServerTestActivity.class);
|
startActivity(new Intent(v.getContext(), ServerTestActivity.class));
|
||||||
startActivity(intent);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.main_drawer_layout);
|
||||||
|
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
|
||||||
|
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
|
||||||
|
drawer.addDrawerListener(toggle);
|
||||||
|
toggle.syncState();
|
||||||
|
|
||||||
|
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
|
||||||
|
navigationView.setNavigationItemSelectedListener(this);
|
||||||
|
|
||||||
final Button but = (Button) findViewById(R.id.button_activate);
|
final Button but = (Button) findViewById(R.id.button_activate);
|
||||||
if (isServiceActivated()) {
|
if (isServiceActivated()) {
|
||||||
but.setText(R.string.button_text_deactivate);
|
but.setText(R.string.button_text_deactivate);
|
||||||
@ -77,6 +92,9 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
((TextView) navigationView.getHeaderView(0).findViewById(R.id.textView_nav_version)).setText(getString(R.string.nav_version) + " " + BuildConfig.VERSION_NAME);
|
||||||
|
((TextView) navigationView.getHeaderView(0).findViewById(R.id.textView_nav_git_commit)).setText(getString(R.string.nav_git_commit) + " " + BuildConfig.GIT_COMMIT);
|
||||||
|
|
||||||
updateUserInterface(getIntent());
|
updateUserInterface(getIntent());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,13 +116,13 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
Log.d("MainActivity", "Updating user interface");
|
Log.d("MainActivity", "Updating user interface");
|
||||||
int launchAction = intent.getIntExtra(LAUNCH_ACTION, LAUNCH_ACTION_NONE);
|
int launchAction = intent.getIntExtra(LAUNCH_ACTION, LAUNCH_ACTION_NONE);
|
||||||
if (launchAction == LAUNCH_ACTION_ACTIVATE) {
|
if (launchAction == LAUNCH_ACTION_ACTIVATE) {
|
||||||
Daedalus.updateShortcut(this);
|
Daedalus.updateShortcut(this.getApplicationContext());
|
||||||
activateService();
|
activateService();
|
||||||
} else if (launchAction == LAUNCH_ACTION_DEACTIVATE) {
|
} else if (launchAction == LAUNCH_ACTION_DEACTIVATE) {
|
||||||
deactivateService();
|
deactivateService();
|
||||||
} else {
|
} else {
|
||||||
updateUserInterface();
|
updateUserInterface();
|
||||||
Daedalus.updateShortcut(this);
|
Daedalus.updateShortcut(this.getApplicationContext());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -215,4 +233,24 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onNavigationItemSelected(MenuItem item) {
|
||||||
|
// Handle navigation view item clicks here.
|
||||||
|
int id = item.getItemId();
|
||||||
|
|
||||||
|
if (id == R.id.action_settings) {
|
||||||
|
startActivity(new Intent(this, SettingsActivity.class));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (id == R.id.action_about) {
|
||||||
|
startActivity(new Intent(this, AboutActivity.class));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.main_drawer_layout);
|
||||||
|
drawer.closeDrawer(GravityCompat.START);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -123,7 +123,7 @@ public class DaedalusVpnService extends VpnService implements Runnable {
|
|||||||
this.running = true;
|
this.running = true;
|
||||||
this.mThread.start();
|
this.mThread.start();
|
||||||
}
|
}
|
||||||
Daedalus.updateShortcut(this);
|
Daedalus.updateShortcut(this.getApplicationContext());
|
||||||
return START_STICKY;
|
return START_STICKY;
|
||||||
case ACTION_DEACTIVATE:
|
case ACTION_DEACTIVATE:
|
||||||
stopThread();
|
stopThread();
|
||||||
@ -171,7 +171,7 @@ public class DaedalusVpnService extends VpnService implements Runnable {
|
|||||||
if (shouldRefresh && MainActivity.getInstance() != null && MainActivity.getInstance().isAppOnForeground()) {
|
if (shouldRefresh && MainActivity.getInstance() != null && MainActivity.getInstance().isAppOnForeground()) {
|
||||||
startActivity(new Intent(this, MainActivity.class).putExtra(MainActivity.LAUNCH_ACTION, MainActivity.LAUNCH_ACTION_NONE));
|
startActivity(new Intent(this, MainActivity.class).putExtra(MainActivity.LAUNCH_ACTION, MainActivity.LAUNCH_ACTION_NONE));
|
||||||
} else if (shouldRefresh) {
|
} else if (shouldRefresh) {
|
||||||
Daedalus.updateShortcut(this);
|
Daedalus.updateShortcut(this.getApplicationContext());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
9
app/src/main/res/drawable/side_nav_bar.xml
Normal file
9
app/src/main/res/drawable/side_nav_bar.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<gradient
|
||||||
|
android:startColor="#81C784"
|
||||||
|
android:centerColor="#4CAF50"
|
||||||
|
android:endColor="#2E7D32"
|
||||||
|
android:type="linear"
|
||||||
|
android:angle="135"/>
|
||||||
|
</shape>
|
@ -8,19 +8,11 @@
|
|||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/activity_about"
|
android:id="@+id/activity_about"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||||
android:paddingTop="@dimen/activity_vertical_margin"
|
android:paddingTop="@dimen/activity_vertical_margin"
|
||||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||||
tools:context="org.itxtech.daedalus.activity.AboutActivity">
|
tools:context="org.itxtech.daedalus.activity.AboutActivity">
|
||||||
|
|
||||||
<WebView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/webView_about"
|
|
||||||
android:overScrollMode="never"
|
|
||||||
android:scrollbars="none"
|
|
||||||
android:layout_alignParentStart="true" android:layout_alignParentTop="true"/>
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
@ -1,20 +1,26 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<android.support.design.widget.CoordinatorLayout
|
<android.support.v4.widget.DrawerLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:fitsSystemWindows="true"
|
android:fitsSystemWindows="true"
|
||||||
tools:context="org.itxtech.daedalus.activity.MainActivity">
|
android:id="@+id/main_drawer_layout"
|
||||||
|
tools:openDrawer="start">
|
||||||
|
|
||||||
<android.support.design.widget.FloatingActionButton
|
<include
|
||||||
android:id="@+id/fab"
|
layout="@layout/app_bar_main"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"/>
|
||||||
|
|
||||||
|
<android.support.design.widget.NavigationView
|
||||||
|
android:id="@+id/nav_view"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="bottom|end"
|
android:layout_gravity="start"
|
||||||
android:layout_margin="@dimen/fab_margin"
|
android:fitsSystemWindows="true"
|
||||||
app:srcCompat="@mipmap/ic_verified_user_grey600_36dp"/>
|
app:headerLayout="@layout/nav_header_main"
|
||||||
<include layout="@layout/content_main"/>
|
app:menu="@menu/activity_main_drawer"/>
|
||||||
|
|
||||||
</android.support.design.widget.CoordinatorLayout>
|
</android.support.v4.widget.DrawerLayout>
|
||||||
|
34
app/src/main/res/layout/app_bar_main.xml
Normal file
34
app/src/main/res/layout/app_bar_main.xml
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<android.support.design.widget.CoordinatorLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:fitsSystemWindows="true"
|
||||||
|
tools:context="org.itxtech.daedalus.activity.MainActivity">
|
||||||
|
|
||||||
|
<android.support.design.widget.AppBarLayout
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:theme="@style/AppTheme.AppBarOverlay">
|
||||||
|
|
||||||
|
<android.support.v7.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
android:background="?attr/colorPrimary"
|
||||||
|
app:popupTheme="@style/AppTheme.PopupOverlay"/>
|
||||||
|
|
||||||
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
|
<android.support.design.widget.FloatingActionButton
|
||||||
|
android:id="@+id/fab"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="bottom|end"
|
||||||
|
android:layout_margin="@dimen/fab_margin"
|
||||||
|
app:srcCompat="@mipmap/ic_verified_user_grey600_36dp"/>
|
||||||
|
<include layout="@layout/content_main"/>
|
||||||
|
|
||||||
|
</android.support.design.widget.CoordinatorLayout>
|
40
app/src/main/res/layout/nav_header_main.xml
Normal file
40
app/src/main/res/layout/nav_header_main.xml
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/nav_header_height"
|
||||||
|
android:background="@drawable/side_nav_bar"
|
||||||
|
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||||
|
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||||
|
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||||
|
android:paddingTop="@dimen/activity_vertical_margin"
|
||||||
|
android:theme="@style/ThemeOverlay.AppCompat.Dark"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:gravity="bottom">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="@dimen/nav_header_vertical_spacing"
|
||||||
|
app:srcCompat="@mipmap/ic_launcher"
|
||||||
|
android:id="@+id/imageView"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="@dimen/nav_header_vertical_spacing"
|
||||||
|
android:text="@string/app_name"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Body1"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/textView_nav_version"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/textView_nav_git_commit"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
20
app/src/main/res/menu/activity_main_drawer.xml
Normal file
20
app/src/main/res/menu/activity_main_drawer.xml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<group android:checkableBehavior="single"
|
||||||
|
android:id="@+id/nav_group_main">
|
||||||
|
<item android:id="@+id/nav_home"
|
||||||
|
android:title="@string/action_home"
|
||||||
|
android:checked="true"
|
||||||
|
android:icon="@mipmap/ic_home_grey600_36dp"/>
|
||||||
|
</group>
|
||||||
|
|
||||||
|
<group android:id="@+id/nav_group_more">
|
||||||
|
<item android:id="@+id/action_settings"
|
||||||
|
android:title="@string/action_settings"
|
||||||
|
android:icon="@mipmap/ic_settings_grey600_36dp"/>
|
||||||
|
<item android:id="@+id/action_about"
|
||||||
|
android:title="@string/action_about"
|
||||||
|
android:icon="@mipmap/ic_info_grey600_36dp"/>
|
||||||
|
</group>
|
||||||
|
</menu>
|
@ -38,4 +38,9 @@
|
|||||||
<string name="settings_issue_tracker">提交反馈</string>
|
<string name="settings_issue_tracker">提交反馈</string>
|
||||||
<string name="settings_issue_summary">前往 GitHub 提交问题反馈。</string>
|
<string name="settings_issue_summary">前往 GitHub 提交问题反馈。</string>
|
||||||
<string name="settings_dns_test_servers">DNS 测试服务器</string>
|
<string name="settings_dns_test_servers">DNS 测试服务器</string>
|
||||||
|
<string name="navigation_drawer_close">关闭导航栏</string>
|
||||||
|
<string name="navigation_drawer_open">开启导航栏</string>
|
||||||
|
<string name="action_home">主页</string>
|
||||||
|
<string name="nav_version">版本:</string>
|
||||||
|
<string name="nav_git_commit">Git commit:</string>
|
||||||
</resources>
|
</resources>
|
@ -3,4 +3,7 @@
|
|||||||
<dimen name="activity_horizontal_margin">16dp</dimen>
|
<dimen name="activity_horizontal_margin">16dp</dimen>
|
||||||
<dimen name="activity_vertical_margin">16dp</dimen>
|
<dimen name="activity_vertical_margin">16dp</dimen>
|
||||||
<dimen name="fab_margin">16dp</dimen>
|
<dimen name="fab_margin">16dp</dimen>
|
||||||
|
<!-- Default screen margins, per the Android Design guidelines. -->
|
||||||
|
<dimen name="nav_header_vertical_spacing">16dp</dimen>
|
||||||
|
<dimen name="nav_header_height">180dp</dimen>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -38,4 +38,9 @@
|
|||||||
<string name="settings_issue_tracker">Issue tracker</string>
|
<string name="settings_issue_tracker">Issue tracker</string>
|
||||||
<string name="settings_issue_summary">Submit an issue in GitHub Issues page.</string>
|
<string name="settings_issue_summary">Submit an issue in GitHub Issues page.</string>
|
||||||
<string name="settings_dns_test_servers">DNS test servers</string>
|
<string name="settings_dns_test_servers">DNS test servers</string>
|
||||||
|
<string name="navigation_drawer_open">Open navigation drawer</string>
|
||||||
|
<string name="navigation_drawer_close">Close navigation drawer</string>
|
||||||
|
<string name="action_home">Home</string>
|
||||||
|
<string name="nav_version">Version:</string>
|
||||||
|
<string name="nav_git_commit">Git commit:</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
|
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<shortcut
|
<shortcut
|
||||||
android:enabled="true"
|
android:enabled="true"
|
||||||
android:icon="@mipmap/ic_settings_applications_grey600_36dp"
|
android:icon="@mipmap/ic_settings_grey600_36dp"
|
||||||
android:shortcutDisabledMessage="@string/action_settings"
|
android:shortcutDisabledMessage="@string/action_settings"
|
||||||
android:shortcutId="settings"
|
android:shortcutId="settings"
|
||||||
android:shortcutLongLabel="@string/action_settings"
|
android:shortcutLongLabel="@string/action_settings"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user