Updated README

This commit is contained in:
PeratX 2017-06-13 22:08:00 +08:00
parent 14e6797d79
commit ffae7c9646
4 changed files with 17 additions and 11 deletions

View File

@ -12,6 +12,11 @@ __[Releases](https://github.com/iTXTech/Daedalus/releases)__
src='https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png'
height="80">](https://play.google.com/store/apps/details?id=org.itxtech.daedalus)
Manual
-------------
[Wiki](https://github.com/iTXTech/Daedalus/wiki)
Introduction
-------------
This application can create a VPN tunnel to modify the DNS settings on Android.<br>

View File

@ -50,7 +50,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
public static final String LAUNCH_FRAGMENT = "org.itxtech.daedalus.activity.MainActivity.LAUNCH_FRAGMENT";
public static final int FRAGMENT_NONE = -1;
public static final int FRAGMENT_MAIN = 0;
public static final int FRAGMENT_HOME = 0;
public static final int FRAGMENT_DNS_TEST = 1;
public static final int FRAGMENT_SETTINGS = 2;
public static final int FRAGMENT_ABOUT = 3;
@ -111,8 +111,8 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.main_drawer_layout);
if (drawer.isDrawerOpen(GravityCompat.START)) {
drawer.closeDrawer(GravityCompat.START);
} else if (!(currentFragment instanceof MainFragment)) {
switchFragment(new MainFragment());
} else if (!(currentFragment instanceof HomeFragment)) {
switchFragment(new HomeFragment());
} else {
super.onBackPressed();
}
@ -187,7 +187,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
}
private void updateMainButton(int id) {
if (currentFragment instanceof MainFragment) {
if (currentFragment instanceof HomeFragment) {
Button button = (Button) currentFragment.getView().findViewById(R.id.button_activate);
button.setText(id);
}
@ -216,8 +216,8 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
case FRAGMENT_DNS_TEST:
switchFragment(new DNSTestFragment());
break;
case FRAGMENT_MAIN:
switchFragment(new MainFragment());
case FRAGMENT_HOME:
switchFragment(new HomeFragment());
break;
case FRAGMENT_RULES:
switchFragment(new RulesFragment());
@ -230,7 +230,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
break;
}
if (currentFragment == null) {
switchFragment(new MainFragment());
switchFragment(new HomeFragment());
}
}
@ -253,7 +253,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/iTXTech/Daedalus")));
break;
case R.id.nav_home:
switchFragment(new MainFragment());
switchFragment(new HomeFragment());
break;
case R.id.nav_rules:
switchFragment(new RulesFragment());

View File

@ -22,7 +22,7 @@ import org.itxtech.daedalus.activity.MainActivity;
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*/
public class MainFragment extends ToolbarFragment {
public class HomeFragment extends ToolbarFragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
@ -33,7 +33,8 @@ public class MainFragment extends ToolbarFragment {
@Override
public void onClick(View v) {
if (Daedalus.getInstance().isServiceActivated()) {
Daedalus.getInstance().deactivateService();
startActivity(new Intent(getActivity(), MainActivity.class)
.putExtra(MainActivity.LAUNCH_ACTION, MainActivity.LAUNCH_ACTION_DEACTIVATE));
} else {
startActivity(new Intent(getActivity(), MainActivity.class)
.putExtra(MainActivity.LAUNCH_ACTION, MainActivity.LAUNCH_ACTION_ACTIVATE));

View File

@ -11,7 +11,7 @@
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="org.itxtech.daedalus.fragment.MainFragment">
tools:context="org.itxtech.daedalus.fragment.HomeFragment">
<ImageView
android:contentDescription="icon"
android:id="@+id/imageView_icon"