diff --git a/app/src/main/java/org/itxtech/daedalus/fragment/DnsTestFragment.java b/app/src/main/java/org/itxtech/daedalus/fragment/DnsTestFragment.java index 419f674..7bb46bc 100644 --- a/app/src/main/java/org/itxtech/daedalus/fragment/DnsTestFragment.java +++ b/app/src/main/java/org/itxtech/daedalus/fragment/DnsTestFragment.java @@ -4,7 +4,6 @@ import android.content.Context; import android.os.Bundle; import android.os.Handler; import android.os.Message; -import android.support.design.widget.Snackbar; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -174,9 +173,9 @@ public class DnsTestFragment extends ToolbarFragment { startTestBut.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - Snackbar.make(v, R.string.notice_start_test, Snackbar.LENGTH_SHORT) - .setAction("Action", null).show(); - startTestBut.setVisibility(View.INVISIBLE); + /*Snackbar.make(v, R.string.notice_start_test, Snackbar.LENGTH_SHORT) + .setAction("Action", null).show();*/ + startTestBut.setEnabled(false); InputMethodManager imm = (InputMethodManager) Daedalus.getInstance().getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(v.getWindowToken(), 0); @@ -249,7 +248,7 @@ public class DnsTestFragment extends ToolbarFragment { textViewTestInfo.setText((String) msg.obj); break; case MSG_TEST_DONE: - startTestBtn.setVisibility(View.VISIBLE); + startTestBtn.setEnabled(true); stopThread(); break; } diff --git a/app/src/main/java/org/itxtech/daedalus/fragment/GlobalConfigFragment.java b/app/src/main/java/org/itxtech/daedalus/fragment/GlobalConfigFragment.java index e6ed943..5de8079 100644 --- a/app/src/main/java/org/itxtech/daedalus/fragment/GlobalConfigFragment.java +++ b/app/src/main/java/org/itxtech/daedalus/fragment/GlobalConfigFragment.java @@ -43,8 +43,8 @@ public class GlobalConfigFragment extends PreferenceFragment { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { preference.setSummary(DNSServerHelper.getDescription((String) newValue, Daedalus.getInstance())); - Snackbar.make(getView(), R.string.notice_need_restart, Snackbar.LENGTH_LONG) - .setAction("Action", null).show(); + /*Snackbar.make(getView(), R.string.notice_need_restart, Snackbar.LENGTH_LONG) + .setAction("Action", null).show();*/ return true; } }); @@ -57,8 +57,8 @@ public class GlobalConfigFragment extends PreferenceFragment { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { preference.setSummary(DNSServerHelper.getDescription((String) newValue, Daedalus.getInstance())); - Snackbar.make(getView(), R.string.notice_need_restart, Snackbar.LENGTH_LONG) - .setAction("Action", null).show(); + /*Snackbar.make(getView(), R.string.notice_need_restart, Snackbar.LENGTH_LONG) + .setAction("Action", null).show();*/ return true; } }); diff --git a/app/src/main/java/org/itxtech/daedalus/fragment/RulesFragment.java b/app/src/main/java/org/itxtech/daedalus/fragment/RulesFragment.java index 9cfc42d..27320e0 100644 --- a/app/src/main/java/org/itxtech/daedalus/fragment/RulesFragment.java +++ b/app/src/main/java/org/itxtech/daedalus/fragment/RulesFragment.java @@ -62,8 +62,8 @@ public class RulesFragment extends ToolbarFragment implements Toolbar.OnMenuItem if (viewHolder instanceof RulesFragment.ViewHolder) { Rule rule = Rule.getRuleById(((ViewHolder) viewHolder).getId()); if (rule != null && rule.isServiceAndUsing()) { - Snackbar.make(getView(), R.string.notice_after_stop, Snackbar.LENGTH_LONG) - .setAction("Action", null).show(); + /*Snackbar.make(getView(), R.string.notice_after_stop, Snackbar.LENGTH_LONG) + .setAction("Action", null).show();*/ return 0; } } @@ -229,10 +229,10 @@ public class RulesFragment extends ToolbarFragment implements Toolbar.OnMenuItem rule.setUsing(!v.isSelected()); v.setSelected(!v.isSelected()); } - } else { + }/* else { Snackbar.make(view, R.string.notice_after_stop, Snackbar.LENGTH_LONG) .setAction("Action", null).show(); - } + }*/ } @Override @@ -243,10 +243,10 @@ public class RulesFragment extends ToolbarFragment implements Toolbar.OnMenuItem .putExtra(ConfigActivity.LAUNCH_ACTION_ID, Integer.parseInt(id)) .putExtra(ConfigActivity.LAUNCH_ACTION_FRAGMENT, ConfigActivity.LAUNCH_FRAGMENT_RULE) .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)); - } else { + }/* else { Snackbar.make(view, R.string.notice_after_stop, Snackbar.LENGTH_LONG) .setAction("Action", null).show(); - } + }*/ return true; } }