Removed some unnecessary notifications

This commit is contained in:
PeratX 2017-06-08 20:28:33 +08:00
parent 9b7bd3687d
commit 2a04f3a29b
3 changed files with 14 additions and 15 deletions

View File

@ -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;
}

View File

@ -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;
}
});

View File

@ -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;
}
}