Skip to content

Commit

Permalink
Commit before release
Browse files Browse the repository at this point in the history
  • Loading branch information
kenvix committed Mar 3, 2019
1 parent e8d62c5 commit dceec1d
Show file tree
Hide file tree
Showing 19 changed files with 40 additions and 22 deletions.
7 changes: 0 additions & 7 deletions .idea/dictionaries/Kenvix.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import java.util.ArrayList;
import java.util.List;

public class QuickCommandModel extends BaseModel {
public final class QuickCommandModel extends BaseModel {
public static final String FieldCid = "cid";
public static final String FieldName = "name";
public static final String FieldValue = "value";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import com.kenvix.rconmanager.rcon.meta.RconServer;

public class ServerModel extends BaseModel {
public final class ServerModel extends BaseModel {
public static final String FieldSid = "sid";
public static final String FieldName = "name";
public static final String FieldHost = "host";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.kenvix.rconmanager.ui.addserver;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.Intent;
import android.database.Cursor;
import android.support.v7.widget.Toolbar;
Expand Down Expand Up @@ -70,9 +71,9 @@ protected void onInitialize() {
addServerEditMode.setVisibility(View.VISIBLE);
addServerEditModeTargetId.setText("#" + String.valueOf(editTargetId));

try(Cursor currentData = serverModel.getBySid(editTargetId)) {
try (Cursor currentData = serverModel.getBySid(editTargetId)) {

if(currentData.getCount() <= 0)
if (currentData.getCount() <= 0)
throw new IllegalArgumentException(getString(R.string.error_invalid_sid) + editTargetId);

addServerPort.setText(currentData.getString(currentData.getColumnIndexOrThrow(ServerModel.FieldPort)));
Expand Down Expand Up @@ -110,14 +111,14 @@ private boolean checkForm() {
}

private void onServerFormTest(View view) {
if(!checkForm())
if (!checkForm())
return;


}

private void onServerFormSubmit(View view) {
if(!checkForm())
if (!checkForm())
return;

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,4 +407,23 @@ public List<QuickCommand> getQuickCommands() {

return quickCommands;
}

public void makeBackConfirm() {

AlertDialog.Builder builder = new AlertDialog.Builder(this)
.setMessage(getString(R.string.prompt_confirm_disconnect))
.setNegativeButton(getString(R.string.action_exit), (dialog, which) -> exit())
.setOnCancelListener(dialog -> exit())
.setPositiveButton(getString(R.string.action_run_in_background), (dialog, which) -> MainActivity.startActivity(this));

builder.show();
}

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if(keyCode == KeyEvent.KEYCODE_BACK){
makeBackConfirm();
}
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ public void reloadQuickCommandRecyclerView() {

public static void startActivity(Activity activity) {
Intent intent = new Intent(activity, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
activity.startActivity(intent);
}
}
Binary file modified app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-hdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-mdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions app/src/main/res/values-en/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,7 @@
<string name="title_add_quick_command">Add or modify quick command</string>
<string name="title_quick_command">Quick commands</string>
<string name="quick_command_value">Command value</string>
<string name="prompt_confirm_disconnect">Disconnect and exit or run in background?</string>
<string name="action_disconnect">Disconnect and exit</string>
<string name="action_run_in_background">"Background "</string>
</resources>
3 changes: 3 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,7 @@
<string name="action_close">关闭</string>
<string name="title_add_quick_command">添加或修改快捷命令</string>
<string name="title_quick_command">快捷命令列表</string>
<string name="prompt_confirm_disconnect">退出并结束会话 / 在后台运行?</string>
<string name="action_disconnect">退出并结束会话</string>
<string name="action_run_in_background">后台运行</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,17 @@ private void processFormNotEmpty(Element targetClass, List<Element> annotatedEle
.beginControlFlow("try")
.addStatement("int number = Integer.parseInt($N.getText().toString())", fieldVarName));

String lessConditionStatement = null;
String lessConditionStatement = null;

if(formNumberLess != null) {
lessConditionStatement = "number >= " + formNumberLess.value();
} else if(formNumberLessOrEqual != null) {
lessConditionStatement = "number > " + formNumberLessOrEqual.value();
}
if(formNumberLess != null) {
lessConditionStatement = "number >= " + formNumberLess.value();
} else if(formNumberLessOrEqual != null) {
lessConditionStatement = "number > " + formNumberLessOrEqual.value();
}

String moreConditionStatement = null;
String moreConditionStatement = null;

if(formNumberMore != null) {
if(formNumberMore != null) {
moreConditionStatement = "number <= " + formNumberMore.value();
} else if(formNumberMoreOrEqual != null) {
moreConditionStatement = "number < " + formNumberMoreOrEqual.value();
Expand Down

0 comments on commit dceec1d

Please sign in to comment.