mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-15 23:59:21 -04:00
Un-hardcode strings resources
This commit is contained in:
parent
f48a05e3b5
commit
a6df620b0f
@ -80,7 +80,7 @@ public class ImportControlActivity extends Activity {
|
|||||||
else runOnUiThread(() -> {
|
else runOnUiThread(() -> {
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
ImportControlActivity.this,
|
ImportControlActivity.this,
|
||||||
"Invalid or corrupted file",
|
getText(R.string.import_control_invalid_file),
|
||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
finishAndRemoveTask();
|
finishAndRemoveTask();
|
||||||
});
|
});
|
||||||
@ -95,17 +95,16 @@ public class ImportControlActivity extends Activity {
|
|||||||
String fileName = trimFileName(mEditText.getText().toString());
|
String fileName = trimFileName(mEditText.getText().toString());
|
||||||
//Step 1 check for suffixes.
|
//Step 1 check for suffixes.
|
||||||
if(!isFileNameValid(fileName)){
|
if(!isFileNameValid(fileName)){
|
||||||
Toast.makeText(this, "Invalid name or file already exists", Toast.LENGTH_SHORT).show();
|
Toast.makeText(this, getText(R.string.import_control_invalid_name), Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(!mIsFileVerified){
|
if(!mIsFileVerified){
|
||||||
Toast.makeText(this, "The file is being verified, please wait and retry", Toast.LENGTH_LONG).show();
|
Toast.makeText(this, getText(R.string.import_control_verifying_file), Toast.LENGTH_LONG).show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Toast.makeText(getApplicationContext(), "Starting importation", Toast.LENGTH_SHORT).show();
|
|
||||||
|
|
||||||
new File(Tools.CTRLMAP_PATH + "/TMP_IMPORT_FILE.json").renameTo(new File(Tools.CTRLMAP_PATH + "/" + fileName + ".json"));
|
new File(Tools.CTRLMAP_PATH + "/TMP_IMPORT_FILE.json").renameTo(new File(Tools.CTRLMAP_PATH + "/" + fileName + ".json"));
|
||||||
|
Toast.makeText(getApplicationContext(), getText(R.string.import_control_done), Toast.LENGTH_SHORT).show();
|
||||||
finishAndRemoveTask();
|
finishAndRemoveTask();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
android:background="@drawable/mine_button_background"
|
android:background="@drawable/mine_button_background"
|
||||||
android:onClick="startImport"
|
android:onClick="startImport"
|
||||||
|
|
||||||
android:text="IMPORT"
|
android:text="@string/import_control_import_button"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="@+id/editText_import_control_file_name"
|
app:layout_constraintEnd_toEndOf="@+id/editText_import_control_file_name"
|
||||||
|
@ -160,6 +160,13 @@
|
|||||||
<string name="control_customkey">Send custom keycode</string>
|
<string name="control_customkey">Send custom keycode</string>
|
||||||
<string name="control_scaleup">Scale up</string>
|
<string name="control_scaleup">Scale up</string>
|
||||||
<string name="control_scaledown">Scale down</string>
|
<string name="control_scaledown">Scale down</string>
|
||||||
|
|
||||||
|
<!-- ImportControlActivity Strings -->
|
||||||
|
<string name="import_control_invalid_file">Invalid or corrupted file</string>
|
||||||
|
<string name="import_control_import_button">import controls</string>
|
||||||
|
<string name="import_control_verifying_file">File is being verified, please wait and try again…</string>
|
||||||
|
<string name="import_control_invalid_name">Invalid name or file already exists</string>
|
||||||
|
<string name="import_control_done">Importation done</string>
|
||||||
<!--
|
<!--
|
||||||
<string name="control_more3"></string>
|
<string name="control_more3"></string>
|
||||||
<string name="control_more4"></string>
|
<string name="control_more4"></string>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user